Преглед изворни кода

删除微信支付和医院床位模块

zsf пре 1 година
родитељ
комит
5c33ec39f2
61 измењених фајлова са 10 додато и 2836 уклоњено
  1. 0 30
      src/main/java/com/rf/psychological/hospital/bed/dao/model/BedEntity.java
  2. 0 7
      src/main/java/com/rf/psychological/hospital/bed/dao/repository/BedRepository.java
  3. 0 2
      src/main/java/com/rf/psychological/hospital/bed/package-info.java
  4. 0 60
      src/main/java/com/rf/psychological/hospital/bed/rest/BedController.java
  5. 0 12
      src/main/java/com/rf/psychological/hospital/bed/service/BedService.java
  6. 0 62
      src/main/java/com/rf/psychological/hospital/bed/service/impl/BedServiceImpl.java
  7. 0 15
      src/main/java/com/rf/psychological/hospital/device/ecg/EcgController.java
  8. 0 22
      src/main/java/com/rf/psychological/hospital/device/ecg/dao/model/EcgEntity.java
  9. 0 7
      src/main/java/com/rf/psychological/hospital/device/ecg/dao/repository/EcgRepository.java
  10. 0 4
      src/main/java/com/rf/psychological/hospital/device/ecg/service/EcgService.java
  11. 0 13
      src/main/java/com/rf/psychological/hospital/device/ecg/service/impl/EcgServiceImpl.java
  12. 0 2
      src/main/java/com/rf/psychological/hospital/device/package-info.java
  13. 0 22
      src/main/java/com/rf/psychological/hospital/device/pulse/dao/model/PulseEntity.java
  14. 0 12
      src/main/java/com/rf/psychological/hospital/device/pulse/dao/repository/PulseRepository.java
  15. 0 15
      src/main/java/com/rf/psychological/hospital/device/pulse/rest/PulseController.java
  16. 0 4
      src/main/java/com/rf/psychological/hospital/device/pulse/service/PulseService.java
  17. 0 13
      src/main/java/com/rf/psychological/hospital/device/pulse/service/impl/PulseServiceImpl.java
  18. 0 44
      src/main/java/com/rf/psychological/hospital/patient/dao/model/PatientEntity.java
  19. 0 7
      src/main/java/com/rf/psychological/hospital/patient/dao/repository/PatientRepository.java
  20. 0 2
      src/main/java/com/rf/psychological/hospital/patient/package-info.java
  21. 0 61
      src/main/java/com/rf/psychological/hospital/patient/rest/PatientController.java
  22. 0 12
      src/main/java/com/rf/psychological/hospital/patient/service/PatientService.java
  23. 0 68
      src/main/java/com/rf/psychological/hospital/patient/service/impl/PatientServiceImpl.java
  24. 0 37
      src/main/java/com/rf/psychological/hospital/section/dao/model/SectionEntity.java
  25. 0 8
      src/main/java/com/rf/psychological/hospital/section/dao/repository/SectionRepository.java
  26. 0 2
      src/main/java/com/rf/psychological/hospital/section/package-info.java
  27. 0 60
      src/main/java/com/rf/psychological/hospital/section/rest/SectionController.java
  28. 0 12
      src/main/java/com/rf/psychological/hospital/section/service/SectionService.java
  29. 0 59
      src/main/java/com/rf/psychological/hospital/section/service/impl/SectionServiceImpl.java
  30. 0 43
      src/main/java/com/rf/psychological/hospital/ward/dao/model/WardEntity.java
  31. 0 7
      src/main/java/com/rf/psychological/hospital/ward/dao/repository/WardRepository.java
  32. 0 2
      src/main/java/com/rf/psychological/hospital/ward/package-info.java
  33. 0 58
      src/main/java/com/rf/psychological/hospital/ward/rest/WardController.java
  34. 0 12
      src/main/java/com/rf/psychological/hospital/ward/service/WardService.java
  35. 0 66
      src/main/java/com/rf/psychological/hospital/ward/service/impl/WardServiceImpl.java
  36. 0 2
      src/main/java/com/rf/psychological/hospital/worker/package-info.java
  37. 8 25
      src/main/java/com/rf/psychological/rest/ServerController.java
  38. 0 125
      src/main/java/com/rf/psychological/wxpay/config/WxPayConfig.java
  39. 0 79
      src/main/java/com/rf/psychological/wxpay/controller/OrderInfoController.java
  40. 0 63
      src/main/java/com/rf/psychological/wxpay/controller/PromotionInfoController.java
  41. 0 185
      src/main/java/com/rf/psychological/wxpay/controller/WxPayController.java
  42. 0 62
      src/main/java/com/rf/psychological/wxpay/model/OrderInfo.java
  43. 0 50
      src/main/java/com/rf/psychological/wxpay/model/PaymentInfo.java
  44. 0 57
      src/main/java/com/rf/psychological/wxpay/model/PromotionInfo.java
  45. 0 68
      src/main/java/com/rf/psychological/wxpay/repository/OrderInfoRepository.java
  46. 0 12
      src/main/java/com/rf/psychological/wxpay/repository/PaymentInfoRepository.java
  47. 0 14
      src/main/java/com/rf/psychological/wxpay/repository/PromotionInfoRepository.java
  48. 0 94
      src/main/java/com/rf/psychological/wxpay/service/OrderInfoService.java
  49. 0 15
      src/main/java/com/rf/psychological/wxpay/service/PaymentInfoService.java
  50. 0 24
      src/main/java/com/rf/psychological/wxpay/service/PromotionInfoService.java
  51. 0 61
      src/main/java/com/rf/psychological/wxpay/service/WxPayService.java
  52. 0 230
      src/main/java/com/rf/psychological/wxpay/service/impl/OrderInfoServiceImpl.java
  53. 0 64
      src/main/java/com/rf/psychological/wxpay/service/impl/PaymentInfoServiceImpl.java
  54. 0 39
      src/main/java/com/rf/psychological/wxpay/service/impl/PromotionInfoServiceImpl.java
  55. 0 430
      src/main/java/com/rf/psychological/wxpay/service/impl/WxPayServiceImpl.java
  56. 0 29
      src/main/java/com/rf/psychological/wxpay/task/WxTask.java
  57. 0 41
      src/main/java/com/rf/psychological/wxpay/utils/HttpUtils.java
  58. 0 44
      src/main/java/com/rf/psychological/wxpay/utils/OrderNoUtils.java
  59. 0 116
      src/main/java/com/rf/psychological/wxpay/utils/WechatPay2ValidatorForRequest.java
  60. 0 28
      src/main/resources/apiclient_key.pem
  61. 2 17
      src/main/resources/config/application-test.yml

+ 0 - 30
src/main/java/com/rf/psychological/hospital/bed/dao/model/BedEntity.java

@@ -1,30 +0,0 @@
-package com.rf.psychological.hospital.bed.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Author:zzf
- * @Date:2023/5/8:17:48
- * @Description:
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_bed_info")
-@org.hibernate.annotations.Table(appliesTo = "t_bed_info", comment = "脉搏设备信息")
-public class BedEntity extends BaseEntity {
-    @Column(name = "bed_no",columnDefinition = "int not null comment '病床编号'")
-    private Integer bedNo;
-
-    @Column(name = "status",columnDefinition = "varchar(2) not null default '0' comment '0:未入住;1:已入住'")
-    private String status;
-
-}

+ 0 - 7
src/main/java/com/rf/psychological/hospital/bed/dao/repository/BedRepository.java

@@ -1,7 +0,0 @@
-package com.rf.psychological.hospital.bed.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.bed.dao.model.BedEntity;
-
-public interface BedRepository extends BaseRepository<BedEntity,String> {
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/bed/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.bed;
-//病床

+ 0 - 60
src/main/java/com/rf/psychological/hospital/bed/rest/BedController.java

@@ -1,60 +0,0 @@
-package com.rf.psychological.hospital.bed.rest;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.hospital.bed.dao.model.BedEntity;
-import com.rf.psychological.hospital.bed.service.BedService;
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-import com.rf.psychological.hospital.patient.service.PatientService;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.utils.Result;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @Author:zzf
- * @Date:2023/5/8:17:49
- * @Description:床位
- */
-@RestController
-@Slf4j
-@RequestMapping("/bed")
-public class BedController extends BaseController {
-
-
-    @Autowired
-    private BedService service;
-
-    @SafetyProcess
-    @OperationLogAnnotation
-    @ApiOperation(value = "保存病例信息",notes = "bedNo:病床编号;status:状态,0未入住;1已入住")
-    @PostMapping("/save")
-    public Result save(@RequestBody String json) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        BedEntity bedEntity = JSONObject.parseObject(data,BedEntity.class);
-        this.service.save(bedEntity);
-        return success();
-    }
-
-    @SafetyProcess
-    @DeleteMapping("/delete/{id}")
-    @ApiOperation("删除")
-    @OperationLogAnnotation
-    public Result delete(@PathVariable String id){
-        this.service.deletedById(id);
-        return success();
-    }
-
-    @SafetyProcess
-    @PostMapping("/find")
-    @ApiOperation(value = "查询",notes = "id:主键,bedNo:编号,status:状态;pageNum:可为空,默认1 ;pageSize:可为空,默认10")
-    public Result find(@RequestBody String json ) throws Exception {
-        Page<BedEntity> bedEntityPage = this.service.find(json);
-        return success(bedEntityPage);
-    }
-}

+ 0 - 12
src/main/java/com/rf/psychological/hospital/bed/service/BedService.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.hospital.bed.service;
-
-import com.rf.psychological.hospital.bed.dao.model.BedEntity;
-import org.springframework.data.domain.Page;
-
-public interface BedService {
-    void save(BedEntity bedEntity);
-
-    void deletedById(String id);
-
-    Page<BedEntity> find(String json) throws Exception;
-}

+ 0 - 62
src/main/java/com/rf/psychological/hospital/bed/service/impl/BedServiceImpl.java

@@ -1,62 +0,0 @@
-package com.rf.psychological.hospital.bed.service.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.hospital.bed.dao.model.BedEntity;
-import com.rf.psychological.hospital.bed.dao.repository.BedRepository;
-import com.rf.psychological.hospital.bed.service.BedService;
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-import com.rf.psychological.hospital.patient.dao.repository.PatientRepository;
-import com.rf.psychological.security.AesEncryptUtils;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.criteria.Predicate;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author:zzf
- * @Date:2023/5/8:17:52
- * @Description:
- */
-@Service
-public class BedServiceImpl implements BedService {
-    @Autowired
-    private BedRepository repository;
-    @Override
-    public void save(BedEntity bedEntity) {
-        this.repository.save(bedEntity);
-    }
-
-    @Override
-    public void deletedById(String id) {
-        this.repository.deleteById(id);
-    }
-
-    @Override
-    public Page<BedEntity> find(String json) throws Exception {
-        JSONObject jsonObject = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data")));
-        Specification<PatientEntity> specification = (root, query, criteriaBuilder) -> {
-            List<Predicate> predicateList = new ArrayList<>();
-            if(jsonObject.containsKey("id") && StringUtils.isNotEmpty(jsonObject.getString("id"))){
-                predicateList.add(criteriaBuilder.equal(root.get("id"),jsonObject.getString("id")));
-            }
-            //id:主键,bedNo:编号
-            if(jsonObject.containsKey("bedNo") && jsonObject.getInteger("bedNo") != null){
-                predicateList.add(criteriaBuilder.equal(root.get("bedNo"),jsonObject.getString("bedNo")));
-            }
-            if(jsonObject.containsKey("status") && StringUtils.isNotEmpty(jsonObject.getString("status"))){
-                predicateList.add(criteriaBuilder.equal(root.get("status"),jsonObject.getString("status")));
-            }
-            query.where(criteriaBuilder.and(predicateList.toArray(new Predicate[0])));
-            return query.getRestriction();
-        };
-        int pageNum = (jsonObject.containsKey("pageNum") && jsonObject.getInteger("pageNum") >0)?jsonObject.getIntValue("pageNum"): 1;
-        int pageSize = (jsonObject.containsKey("pageSize") && jsonObject.getInteger("pageSize") >0)?jsonObject.getIntValue("pageSize"): 10;
-        return this.repository.findAll(specification, PageRequest.of(pageNum-1,pageSize));
-    }
-}

+ 0 - 15
src/main/java/com/rf/psychological/hospital/device/ecg/EcgController.java

@@ -1,15 +0,0 @@
-package com.rf.psychological.hospital.device.ecg;
-
-import com.rf.psychological.base.rest.BaseController;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @Author:zzf
- * @Date:2023/7/4:17:18
- * @Description: 机构<-->Ecg
- */
-@RestController
-@RequestMapping("/ecg")
-public class EcgController extends BaseController {
-}

+ 0 - 22
src/main/java/com/rf/psychological/hospital/device/ecg/dao/model/EcgEntity.java

@@ -1,22 +0,0 @@
-package com.rf.psychological.hospital.device.ecg.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Author:zzf
- * @Date:2023/5/9:09:25
- * @Description:
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Table(name = "t_ecg_info")
-@org.hibernate.annotations.Table(appliesTo = "t_ecg_info", comment = "心电设备信息")
-public class EcgEntity extends BaseEntity {
-}

+ 0 - 7
src/main/java/com/rf/psychological/hospital/device/ecg/dao/repository/EcgRepository.java

@@ -1,7 +0,0 @@
-package com.rf.psychological.hospital.device.ecg.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.device.ecg.dao.model.EcgEntity;
-
-public interface EcgRepository extends BaseRepository<EcgEntity,String> {
-}

+ 0 - 4
src/main/java/com/rf/psychological/hospital/device/ecg/service/EcgService.java

@@ -1,4 +0,0 @@
-package com.rf.psychological.hospital.device.ecg.service;
-
-public interface EcgService {
-}

+ 0 - 13
src/main/java/com/rf/psychological/hospital/device/ecg/service/impl/EcgServiceImpl.java

@@ -1,13 +0,0 @@
-package com.rf.psychological.hospital.device.ecg.service.impl;
-
-import com.rf.psychological.hospital.device.ecg.service.EcgService;
-import org.springframework.stereotype.Service;
-
-/**
- * @Author:zzf
- * @Date:2023/7/4:17:17
- * @Description:
- */
-@Service
-public class EcgServiceImpl implements EcgService {
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/device/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.device;
-//设备信息   ecg  pulse

+ 0 - 22
src/main/java/com/rf/psychological/hospital/device/pulse/dao/model/PulseEntity.java

@@ -1,22 +0,0 @@
-package com.rf.psychological.hospital.device.pulse.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Author:zzf
- * @Date:2023/5/9:09:20
- * @Description:
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Table(name = "t_pulse_info")
-@org.hibernate.annotations.Table(appliesTo = "t_pulse_info", comment = "脉搏设备信息")
-public class PulseEntity extends BaseEntity {
-}

+ 0 - 12
src/main/java/com/rf/psychological/hospital/device/pulse/dao/repository/PulseRepository.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.hospital.device.pulse.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.device.pulse.dao.model.PulseEntity;
-
-/**
- * @Author:zzf
- * @Date:2023/5/9:09:20
- * @Description:
- */
-public interface PulseRepository extends BaseRepository<PulseEntity,String> {
-}

+ 0 - 15
src/main/java/com/rf/psychological/hospital/device/pulse/rest/PulseController.java

@@ -1,15 +0,0 @@
-package com.rf.psychological.hospital.device.pulse.rest;
-
-import com.rf.psychological.base.rest.BaseController;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @Author:zzf
- * @Date:2023/5/9:09:22
- * @Description:机构<-->Pulse
- */
-@RestController
-@RequestMapping("/pulse")
-public class PulseController extends BaseController {
-}

+ 0 - 4
src/main/java/com/rf/psychological/hospital/device/pulse/service/PulseService.java

@@ -1,4 +0,0 @@
-package com.rf.psychological.hospital.device.pulse.service;
-
-public interface PulseService {
-}

+ 0 - 13
src/main/java/com/rf/psychological/hospital/device/pulse/service/impl/PulseServiceImpl.java

@@ -1,13 +0,0 @@
-package com.rf.psychological.hospital.device.pulse.service.impl;
-
-import com.rf.psychological.hospital.device.pulse.service.PulseService;
-import org.springframework.stereotype.Service;
-
-/**
- * @Author:zzf
- * @Date:2023/5/9:09:24
- * @Description:
- */
-@Service
-public class PulseServiceImpl implements PulseService {
-}

+ 0 - 44
src/main/java/com/rf/psychological/hospital/patient/dao/model/PatientEntity.java

@@ -1,44 +0,0 @@
-package com.rf.psychological.hospital.patient.dao.model;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Table;
-import java.util.Date;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:17:35
- * @Description: 病例表
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_patient_info")
-@org.hibernate.annotations.Table(appliesTo = "t_patient_info", comment = "病例基础信息")
-public class PatientEntity extends BaseEntity {
-    @Column(name = "patient_no",columnDefinition = "varchar(20) not null comment '编号'")
-    private String patientNo;
-    @Column(name = "patient_name",columnDefinition = "varchar(50) not null comment '名称'")
-    private String patientName;
-    @Column(name = "gender",columnDefinition = "int not null default '1' comment '性别:0女 1男'")
-    private Integer gender;
-    @Column(name = "born_date",columnDefinition = "varchar(20) comment '出生日期'")
-    private String bornDate;
-    @Column(name = "phone",columnDefinition = "varchar(11) comment '联系方式'")
-    private String phone;
-    @Column(name = "cert_number",columnDefinition = "varchar(18) comment '身份证号'")
-    private String certNumber;
-    @Column(name = "create_time",columnDefinition = "varchar(20) comment '创建时间:yyyy-MM-dd HH:mm:ss'")
-    private String createTime;
-    @Column(name = "discharge_time",columnDefinition = "varchar(20) comment '出院时间:yyyy-MM-dd HH:mm:ss'")
-    private String dischargeTime;
-
-}

+ 0 - 7
src/main/java/com/rf/psychological/hospital/patient/dao/repository/PatientRepository.java

@@ -1,7 +0,0 @@
-package com.rf.psychological.hospital.patient.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-
-public interface PatientRepository extends BaseRepository<PatientEntity,String> {
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/patient/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.patient;
-//患者

+ 0 - 61
src/main/java/com/rf/psychological/hospital/patient/rest/PatientController.java

@@ -1,61 +0,0 @@
-package com.rf.psychological.hospital.patient.rest;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-import com.rf.psychological.hospital.patient.service.PatientService;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import com.rf.psychological.hospital.section.service.SectionService;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.utils.Result;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @Author:zzf
- * @Date:2023/5/8:15:45
- * @Description:病例
- */
-@RestController
-@RequestMapping("/patient")
-@Slf4j
-public class PatientController extends BaseController {
-
-
-    @Autowired
-    private PatientService service;
-
-    @SafetyProcess
-    @OperationLogAnnotation
-    @ApiOperation(value = "保存病例信息",notes = "patientNo:编号,新增为空,patientName:名称,gender:性别 0女 1男,bornDate:出生日期,phone:联系方式,certNumber:身份证号,createTime:创建日期,dischargeTime:离院日期")
-    @PostMapping("/save")
-    public Result save(@RequestBody String json) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        PatientEntity patientEntity = JSONObject.parseObject(data,PatientEntity.class);
-        this.service.save(patientEntity);
-        return success();
-    }
-
-    @SafetyProcess
-    @DeleteMapping("/delete/{id}")
-    @ApiOperation("删除")
-    @OperationLogAnnotation
-    public Result delete(@PathVariable String id){
-        this.service.deletedById(id);
-        return success();
-    }
-
-    @SafetyProcess
-    @PostMapping("/find")
-    @ApiOperation(value = "查询",notes = "id:主键,patientNo:编号,certNumber:身份证号;patientName:名称 可为空;phone:联系方式;pageNum:可为空,默认1 ;pageSize:可为空,默认10")
-    public Result find(@RequestBody String json ) throws Exception {
-        Page<PatientEntity> patientEntityPage = this.service.find(json);
-        return success(patientEntityPage);
-    }
-
-}

+ 0 - 12
src/main/java/com/rf/psychological/hospital/patient/service/PatientService.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.hospital.patient.service;
-
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-import org.springframework.data.domain.Page;
-
-public interface PatientService {
-    void save(PatientEntity patientEntity);
-
-    void deletedById(String id);
-
-    Page<PatientEntity> find(String json) throws Exception;
-}

+ 0 - 68
src/main/java/com/rf/psychological/hospital/patient/service/impl/PatientServiceImpl.java

@@ -1,68 +0,0 @@
-package com.rf.psychological.hospital.patient.service.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.hospital.patient.dao.model.PatientEntity;
-import com.rf.psychological.hospital.patient.dao.repository.PatientRepository;
-import com.rf.psychological.hospital.patient.service.PatientService;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import com.rf.psychological.hospital.section.dao.repository.SectionRepository;
-import com.rf.psychological.security.AesEncryptUtils;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.criteria.Predicate;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author:zzf
- * @Date:2023/5/8:15:47
- * @Description:
- */
-@Service
-public class PatientServiceImpl implements PatientService {
-    @Autowired
-    private PatientRepository patientRepository;
-    @Override
-    public void save(PatientEntity patientEntity) {
-        this.patientRepository.save(patientEntity);
-    }
-
-    @Override
-    public void deletedById(String id) {
-        this.patientRepository.deleteById(id);
-    }
-
-    @Override
-    public Page<PatientEntity> find(String json) throws Exception {
-        JSONObject jsonObject = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data")));
-        Specification<PatientEntity> specification = (root, query, criteriaBuilder) -> {
-            List<Predicate> predicateList = new ArrayList<>();
-            if(jsonObject.containsKey("id") && StringUtils.isNotEmpty(jsonObject.getString("id"))){
-                predicateList.add(criteriaBuilder.equal(root.get("id"),jsonObject.getString("id")));
-            }
-            //id:主键,patientNo:编号,certNumber:身份证号;patientName:名称 可为空;phone:联系方式;pageNum:可为空,默认1 ;pageSize:可为空,默认10
-            if(jsonObject.containsKey("patientNo") && StringUtils.isNotEmpty(jsonObject.getString("patientNo"))){
-                predicateList.add(criteriaBuilder.equal(root.get("patientNo"),jsonObject.getString("patientNo")));
-            }
-            if(jsonObject.containsKey("certNumber") && StringUtils.isNotEmpty(jsonObject.getString("certNumber"))){
-                predicateList.add(criteriaBuilder.equal(root.get("certNumber"),jsonObject.getString("certNumber")));
-            }
-            if(jsonObject.containsKey("patientName") && StringUtils.isNotEmpty(jsonObject.getString("patientName"))){
-                predicateList.add(criteriaBuilder.equal(root.get("patientName"),jsonObject.getString("patientName")));
-            }
-            if(jsonObject.containsKey("phone") && StringUtils.isNotEmpty(jsonObject.getString("phone"))){
-                predicateList.add(criteriaBuilder.equal(root.get("phone"),jsonObject.getString("phone")));
-            }
-            query.where(criteriaBuilder.and(predicateList.toArray(new Predicate[0])));
-            return query.getRestriction();
-        };
-        int pageNum = (jsonObject.containsKey("pageNum") && jsonObject.getInteger("pageNum") >0)?jsonObject.getIntValue("pageNum"): 1;
-        int pageSize = (jsonObject.containsKey("pageSize") && jsonObject.getInteger("pageSize") >0)?jsonObject.getIntValue("pageSize"): 10;
-        return this.patientRepository.findAll(specification, PageRequest.of(pageNum-1,pageSize));
-    }
-}

+ 0 - 37
src/main/java/com/rf/psychological/hospital/section/dao/model/SectionEntity.java

@@ -1,37 +0,0 @@
-package com.rf.psychological.hospital.section.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:16:15
- * @Description:
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_section_info")
-@org.hibernate.annotations.Table(appliesTo = "t_section_info", comment = "科室信息表")
-public class SectionEntity extends BaseEntity {
-
-    @Column(name = "section_name",columnDefinition = "varchar(20) not null comment '科室名称'")
-    private String sectionName;
-
-    @Column(name = "department_id",columnDefinition = "varchar(32) comment '部门编号'")
-    private String departmentId;
-
-    @Column(name = "introduce",columnDefinition = "varchar(200) comment '科室介绍'")
-    private String introduce ;
-
-    @Column(name = "external",columnDefinition = "varchar(100) comment '扩展字段'")
-    private String external;
-
-}

+ 0 - 8
src/main/java/com/rf/psychological/hospital/section/dao/repository/SectionRepository.java

@@ -1,8 +0,0 @@
-package com.rf.psychological.hospital.section.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-
-public interface SectionRepository extends BaseRepository<SectionEntity,String> {
-
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/section/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.section;
-//科室

+ 0 - 60
src/main/java/com/rf/psychological/hospital/section/rest/SectionController.java

@@ -1,60 +0,0 @@
-package com.rf.psychological.hospital.section.rest;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import com.rf.psychological.hospital.section.service.SectionService;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.utils.Result;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:15:57
- * @Description: 科室
- */
-@RestController
-@Slf4j
-@RequestMapping("/section")
-public class SectionController extends BaseController {
-
-
-    @Autowired
-    private SectionService service;
-
-    @SafetyProcess
-    @OperationLogAnnotation
-    @ApiOperation(value = "保存科室信息",notes = "sectionName:科室名称;departmentId:部门编号;introduce:科室介绍")
-    @PostMapping("/save")
-    public Result save(@RequestBody String json) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        SectionEntity sectionEntity = JSONObject.parseObject(data,SectionEntity.class);
-        this.service.save(sectionEntity);
-        return success();
-    }
-
-    @SafetyProcess
-    @DeleteMapping("/delete/{id}")
-    @ApiOperation("删除")
-    @OperationLogAnnotation
-    public Result delete(@PathVariable String id){
-        this.service.deletedById(id);
-        return success();
-    }
-
-    @SafetyProcess
-    @PostMapping("/find")
-    @ApiOperation(value = "查询",notes = "id:主键,可为空;sectionName:名称 可为空;departmentId:部门编号,可为空;pageNum:可为空,默认1 ;pageSize:可为空,默认10")
-    public Result find(@RequestBody String json ) throws Exception {
-        Page<SectionEntity> sectionEntityPage = this.service.find(json);
-        return success(sectionEntityPage);
-    }
-
-
-}

+ 0 - 12
src/main/java/com/rf/psychological/hospital/section/service/SectionService.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.hospital.section.service;
-
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import org.springframework.data.domain.Page;
-
-public interface SectionService {
-    void save(SectionEntity sectionEntity);
-
-    void deletedById(String id);
-
-    Page<SectionEntity> find(String json) throws Exception;
-}

+ 0 - 59
src/main/java/com/rf/psychological/hospital/section/service/impl/SectionServiceImpl.java

@@ -1,59 +0,0 @@
-package com.rf.psychological.hospital.section.service.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import com.rf.psychological.hospital.section.dao.repository.SectionRepository;
-import com.rf.psychological.hospital.section.service.SectionService;
-import com.rf.psychological.security.AesEncryptUtils;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.criteria.Predicate;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:15:54
- * @Description:
- */
-@Service
-public class SectionServiceImpl implements SectionService {
-    @Autowired
-    private SectionRepository sectionRepository;
-    @Override
-    public void save(SectionEntity sectionEntity) {
-        this.sectionRepository.save(sectionEntity);
-    }
-
-    @Override
-    public void deletedById(String id) {
-        this.sectionRepository.deleteById(id);
-    }
-
-    @Override
-    public Page<SectionEntity> find(String json) throws Exception {
-        JSONObject jsonObject = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data")));
-        Specification<SectionEntity> specification = (root, query, criteriaBuilder) -> {
-            List<Predicate> predicateList = new ArrayList<>();
-            if(jsonObject.containsKey("id") && StringUtils.isNotEmpty(jsonObject.getString("id"))){
-                predicateList.add(criteriaBuilder.equal(root.get("id"),jsonObject.getString("id")));
-            }
-            if(jsonObject.containsKey("sectionName") && StringUtils.isNotEmpty(jsonObject.getString("sectionName"))){
-                predicateList.add(criteriaBuilder.equal(root.get("sectionName"),jsonObject.getString("sectionName")));
-            }
-            if(jsonObject.containsKey("departmentId") && StringUtils.isNotEmpty(jsonObject.getString("departmentId"))){
-                predicateList.add(criteriaBuilder.equal(root.get("departmentId"),jsonObject.getString("departmentId")));
-            }
-            query.where(criteriaBuilder.and(predicateList.toArray(new Predicate[0])));
-            return query.getRestriction();
-        };
-        int pageNum = (jsonObject.containsKey("pageNum") && jsonObject.getInteger("pageNum") >0)?jsonObject.getIntValue("pageNum"): 1;
-        int pageSize = (jsonObject.containsKey("pageSize") && jsonObject.getInteger("pageSize") >0)?jsonObject.getIntValue("pageSize"): 10;
-        return this.sectionRepository.findAll(specification, PageRequest.of(pageNum-1,pageSize));
-    }
-}

+ 0 - 43
src/main/java/com/rf/psychological/hospital/ward/dao/model/WardEntity.java

@@ -1,43 +0,0 @@
-package com.rf.psychological.hospital.ward.dao.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:17:06
- * @Description:病房
- */
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Table(name = "t_ward_info")
-@org.hibernate.annotations.Table(appliesTo = "t_ward_info", comment = "病房信息表")
-public class WardEntity extends BaseEntity {
-
-    //病房编号
-    @Column(name = "ward_no",columnDefinition = "int not null comment '病房编号'")
-    private Integer wardNo;
-    //对应科室id
-    @Column(name = "section_id",columnDefinition = "varchar(32) not null comment '科室编号' ")
-    private Integer sectionId;
-
-    //房间状态 1可入住,表示未住满 0不可入住
-    @Column(name = "ward_status",columnDefinition = "varchar(2) not null default '1' comment '病房状态:1可入住 0不可入住'")
-    private String wardStatus;
-
-    @Column(name = "bed_num",columnDefinition = "int not null default '3' comment '病床数,默认3'")
-    private Integer bedNum;
-
-    //已住患者人数
-    @Column(name = "patient_num",columnDefinition = "int not null default '0' comment '已入住患者数,默认0'")
-    private Integer patientNum;
-
-}

+ 0 - 7
src/main/java/com/rf/psychological/hospital/ward/dao/repository/WardRepository.java

@@ -1,7 +0,0 @@
-package com.rf.psychological.hospital.ward.dao.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.hospital.ward.dao.model.WardEntity;
-
-public interface WardRepository extends BaseRepository<WardEntity,String> {
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/ward/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.ward;
-//病房

+ 0 - 58
src/main/java/com/rf/psychological/hospital/ward/rest/WardController.java

@@ -1,58 +0,0 @@
-package com.rf.psychological.hospital.ward.rest;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.hospital.ward.dao.model.WardEntity;
-import com.rf.psychological.hospital.ward.service.WardService;
-import com.rf.psychological.opLog.annotation.OperationLogAnnotation;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.utils.Result;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:17:20
- * @Description:病房
- */
-@RestController
-@Slf4j
-@RequestMapping("/ward")
-public class WardController extends BaseController {
-
-    @Autowired
-    private WardService service;
-
-    @SafetyProcess
-    @OperationLogAnnotation
-    @ApiOperation(value = "保存科室信息",notes = "sectionName:科室名称;departmentId:部门编号;introduce:科室介绍")
-    @PostMapping("/save")
-    public Result save(@RequestBody String json) throws Exception {
-        String data = AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"));
-        WardEntity wardEntity = JSONObject.parseObject(data,WardEntity.class);
-        this.service.save(wardEntity);
-        return success();
-    }
-
-    @SafetyProcess
-    @DeleteMapping("/delete/{id}")
-    @ApiOperation("删除")
-    @OperationLogAnnotation
-    public Result delete(@PathVariable String id){
-        this.service.deletedById(id);
-        return success();
-    }
-
-    @SafetyProcess
-    @PostMapping("/find")
-    @ApiOperation(value = "查询",notes = "id:主键,可为空;sectionId:科室编号 可为空;wardNo:病房编号,可为空;wardStatus:状态:可为空,1可入住 0不可入住;pageNum:可为空,默认1 ;pageSize:可为空,默认10")
-    public Result find(@RequestBody String json ) throws Exception {
-        Page<WardEntity> sectionEntityPage = this.service.find(json);
-        return success(sectionEntityPage);
-    }
-
-}

+ 0 - 12
src/main/java/com/rf/psychological/hospital/ward/service/WardService.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.hospital.ward.service;
-
-import com.rf.psychological.hospital.ward.dao.model.WardEntity;
-import org.springframework.data.domain.Page;
-
-public interface WardService {
-    void save(WardEntity wardEntity);
-
-    void deletedById(String id);
-
-    Page<WardEntity> find(String json) throws Exception;
-}

+ 0 - 66
src/main/java/com/rf/psychological/hospital/ward/service/impl/WardServiceImpl.java

@@ -1,66 +0,0 @@
-package com.rf.psychological.hospital.ward.service.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.rf.psychological.hospital.section.dao.model.SectionEntity;
-import com.rf.psychological.hospital.ward.dao.model.WardEntity;
-import com.rf.psychological.hospital.ward.dao.repository.WardRepository;
-import com.rf.psychological.hospital.ward.service.WardService;
-import com.rf.psychological.security.AesEncryptUtils;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.criteria.Predicate;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author:zzf
- * @Date:2023/5/6:17:19
- * @Description:
- */
-@Service
-public class WardServiceImpl implements WardService {
-
-    @Autowired
-    private WardRepository repository;
-
-    @Override
-    public void save(WardEntity wardEntity) {
-        this.repository.save(wardEntity);
-    }
-
-    @Override
-    public void deletedById(String id) {
-        this.repository.deleteById(id);
-    }
-
-    @Override
-    public Page<WardEntity> find(String json) throws Exception {
-
-        JSONObject jsonObject = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data")));
-        Specification<WardEntity> specification = (root, query, criteriaBuilder) -> {
-            List<Predicate> predicateList = new ArrayList<>();
-            if(jsonObject.containsKey("id") && StringUtils.isNotEmpty(jsonObject.getString("id"))){
-                predicateList.add(criteriaBuilder.equal(root.get("id"),jsonObject.getString("id")));
-            }
-            if(jsonObject.containsKey("sectionId") && StringUtils.isNotEmpty(jsonObject.getString("sectionId"))){
-                predicateList.add(criteriaBuilder.equal(root.get("sectionId"),jsonObject.getString("sectionId")));
-            }
-            if(jsonObject.containsKey("wardStatus") && StringUtils.isNotEmpty(jsonObject.getString("wardStatus"))){
-                predicateList.add(criteriaBuilder.equal(root.get("wardStatus"),jsonObject.getString("wardStatus")));
-            }
-            if(jsonObject.containsKey("wardNo")){
-                predicateList.add(criteriaBuilder.equal(root.get("wardNo"),jsonObject.getIntValue("wardNo")));
-            }
-            query.where(criteriaBuilder.and(predicateList.toArray(new Predicate[0])));
-            return query.getRestriction();
-        };
-        int pageNum = (jsonObject.containsKey("pageNum") && jsonObject.getInteger("pageNum") >0)?jsonObject.getIntValue("pageNum"): 1;
-        int pageSize = (jsonObject.containsKey("pageSize") && jsonObject.getInteger("pageSize") >0)?jsonObject.getIntValue("pageSize"): 10;
-        return this.repository.findAll(specification, PageRequest.of(pageNum-1,pageSize));
-    }
-}

+ 0 - 2
src/main/java/com/rf/psychological/hospital/worker/package-info.java

@@ -1,2 +0,0 @@
-package com.rf.psychological.hospital.worker;
-//工作人员

+ 8 - 25
src/main/java/com/rf/psychological/rest/ServerController.java

@@ -7,7 +7,9 @@ import com.rf.psychological.dao.dto.InstitutionAuthConTaskDto;
 import com.rf.psychological.dao.dto.InstitutionAuthSubjectNameDto;
 import com.rf.psychological.dao.dto.SubjectEntityDto;
 import com.rf.psychological.dao.dto.UserRecordsDto;
-import com.rf.psychological.dao.model.*;
+import com.rf.psychological.dao.model.AnswerEntity;
+import com.rf.psychological.dao.model.CategorySubjectEntity;
+import com.rf.psychological.dao.model.CognitiveTaskEntity;
 import com.rf.psychological.enums.UserRole;
 import com.rf.psychological.file.excel.ExcelClass;
 import com.rf.psychological.group.dao.model.GroupAuthEntity;
@@ -17,7 +19,10 @@ import com.rf.psychological.group.service.GroupInfoService;
 import com.rf.psychological.institution.model.InstitutionAuthEntity;
 import com.rf.psychological.institution.service.InstitutionAuthService;
 import com.rf.psychological.plan.service.TestPlanContendService;
-import com.rf.psychological.scale.dao.model.*;
+import com.rf.psychological.scale.dao.model.ScaleEntity;
+import com.rf.psychological.scale.dao.model.ScaleMarksEntity;
+import com.rf.psychological.scale.dao.model.SubjectEntity;
+import com.rf.psychological.scale.dao.model.UserRecordEntity;
 import com.rf.psychological.scale.service.*;
 import com.rf.psychological.security.SafetyProcess;
 import com.rf.psychological.socket.MyClient;
@@ -25,8 +30,6 @@ import com.rf.psychological.user.dao.model.UserEntity;
 import com.rf.psychological.user.service.UserRepeatNameNumService;
 import com.rf.psychological.user.service.UserService;
 import com.rf.psychological.utils.*;
-import com.rf.psychological.wxpay.service.OrderInfoService;
-import com.rf.psychological.wxpay.service.impl.OrderInfoServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -41,15 +44,12 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Profile;
 import org.springframework.data.domain.Page;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.*;
@@ -114,15 +114,6 @@ public class ServerController extends BaseController {
     @Autowired
     private GroupInfoService groupInfoService;
 
-    @Autowired
-    private UserRecordPhyService userRecordPhyService;
-
-    @Autowired(required = false)
-    private OrderInfoService orderInfoService;
-
-    @Value("${spring.profiles.active}")
-    private String profileValue;
-
     @SafetyProcess
     @GetMapping("server")
     public Result scanServer() {
@@ -739,15 +730,7 @@ public class ServerController extends BaseController {
     @GetMapping("/getRecordById")
     @ApiOperation(value = "根据id查询测试详细信息")
     public Result getRecordById(String id) {
-        //公网版先检验是否为支付订单
-        if (profileValue != null ){
-            if (Constant.PROFILE_PUBLIC.equals(profileValue) ){
-               //OrderInfoService service = new OrderInfoServiceImpl();
-               if (!orderInfoService.checkPayOrder(id)){
-                   return fail("未支付");
-               }
-            }
-        }
+
         //获取测试记录信息
         UserRecordEntity userRecordEntity = this.userRecordService.getUserRecordById(id);
         //获取测试人员信息

+ 0 - 125
src/main/java/com/rf/psychological/wxpay/config/WxPayConfig.java

@@ -1,125 +0,0 @@
-package com.rf.psychological.wxpay.config;
-
-import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
-import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
-import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
-import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Credentials;
-import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Validator;
-import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
-import com.wechat.pay.contrib.apache.httpclient.exception.HttpCodeException;
-import com.wechat.pay.contrib.apache.httpclient.exception.NotFoundException;
-import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.security.GeneralSecurityException;
-import java.security.PrivateKey;
-
-/**
- * @Description:读取微信支付配置文件
- * @Author: zsf
- * @Date: 2022/6/21
- */
-@Configuration
-//@PropertySource("classpath:config/wxpay.properties")
-@ConfigurationProperties(prefix = "wx.pay")
-//@Profile(value = "!lan")
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-@Data
-@Slf4j
-public class WxPayConfig {
-    //商户号
-    private String mchId;
-
-    //商户api证书序列号
-    private String mchSerialNo;
-
-    //商户私钥文件
-    private String privateKeyPath;
-
-    //API秘钥
-    private String apiV3Key;
-
-    //APPID
-    private String appId;
-
-    //微信服务器地址
-    private String domain;
-
-    //接受结果回调地址
-    private String notifyDomain;
-
-    /**
-     * 获取商户的私钥文件
-     * @param fileName
-     * @return
-     */
-    private PrivateKey getPrivateKey(String fileName){
-        try {
-            String path =  this.getClass().getClassLoader().getResource(fileName).getPath();
-            InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName);
-            log.info(path);
-            return PemUtil.loadPrivateKey(is);//new ByteArrayInputStream(fileName.getBytes("utf-8"))
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new RuntimeException("私钥文件不存在",e);
-        }
-    }
-
-    /**
-     * 获取签名验证器
-     * @return
-     */
-    @Bean
-    Verifier getVerifier() throws NotFoundException, GeneralSecurityException, IOException, HttpCodeException {
-        try {
-            log.info("获取证书管理器实例");
-            // 获取证书管理器实例
-            CertificatesManager   certificatesManager = CertificatesManager.getInstance();
-           // log.info("向证书管理器增加需要自动更新平台证书的商户信息");
-            // 向证书管理器增加需要自动更新平台证书的商户信息
-            //获取商户私钥
-            PrivateKey privateKey = getPrivateKey(privateKeyPath);
-            //log.info("获取商户私钥");
-            //私钥签名对象
-            PrivateKeySigner privateKeySigner = new PrivateKeySigner(mchSerialNo, privateKey);
-            //log.info("私钥签名对象");
-            //身份认证对象
-            WechatPay2Credentials wechatPay2Credentials = new WechatPay2Credentials(mchId, privateKeySigner);
-            //log.info("身份认证对象");
-            certificatesManager.putMerchant(mchId,wechatPay2Credentials, apiV3Key.getBytes(StandardCharsets.UTF_8));
-            //log.info("从证书管理器中获取verifier");
-            // 从证书管理器中获取verifier
-            Verifier verifier = certificatesManager.getVerifier(mchId);
-            return  verifier;
-        }catch (Exception e){
-            e.printStackTrace();
-            return null;
-        }
-
-    }
-
-    /**
-     * 获取http请求对象
-     * @param verifier
-     * @return
-     */
-    @Bean(name = "wxPayClient")
-    public CloseableHttpClient getWxPayClient(Verifier verifier){
-        WechatPayHttpClientBuilder builder = WechatPayHttpClientBuilder.create()
-                .withMerchant(mchId, mchSerialNo, getPrivateKey(privateKeyPath))
-                .withValidator(new WechatPay2Validator(verifier));
-        // 通过WechatPayHttpClientBuilder构造的HttpClient,会自动的处理签名和验签,并进行证书自动更新
-        CloseableHttpClient httpClient = builder.build();
-        return  httpClient;
-    }
-}

+ 0 - 79
src/main/java/com/rf/psychological/wxpay/controller/OrderInfoController.java

@@ -1,79 +0,0 @@
-package com.rf.psychological.wxpay.controller;
-
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.enums.OrderStatus;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.utils.Result;
-import com.rf.psychological.wxpay.model.OrderInfo;
-import com.rf.psychological.wxpay.service.OrderInfoService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Profile;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @Description:商品订单管理
- * @Author: zsf
- * @Date: 2022/6/22
- */
-@RestController
-@RequestMapping("/api/orderInfo")
-@Api(tags = "商品订单管理")
-@Slf4j
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-public class OrderInfoController extends BaseController {
-
-    @Autowired
-    private OrderInfoService orderInfoService;
-
-    @GetMapping("/findOrderInfoList")
-    @ApiOperation("查询订单")
-
-    public Result findOrderInfoList(int pageNum,int pageSize,String productId,String userId,String orderStatus){
-        try {
-            Page<OrderInfo> infoPage = orderInfoService.findOrderInfoList(pageNum,pageSize,productId,userId,orderStatus);
-            return success(infoPage);
-        }catch (Exception e){
-            e.printStackTrace();
-            return fail("查询失败");
-        }
-    }
-
-    /**
-     * 查询本地订单状态
-     * @param orderNo
-     * @return
-     */
-    @SafetyProcess
-    @ApiOperation("查询本地订单状态")
-    @GetMapping("/queryOrderStatus/{orderNo}")
-    public Result queryOrderStatus(@PathVariable String orderNo){
-
-        OrderInfo info = orderInfoService.getOrderStatus(orderNo);
-        if (info == null ){
-            return success(null,"请确认订单编号,查询为空");
-        }
-        String orderStatus = info.getOrderStatus();
-        if(OrderStatus.SUCCESS.getType().equals(orderStatus)){
-            return success(0,"支付成功"); //支付成功
-        }
-
-        return success(101,"支付中......");
-    }
-
-    @SafetyProcess
-    @ApiOperation("查询用户结果支付情况")
-    @GetMapping("/queryOrderByResultIdAndUserId/{productId}/{userId}/{resultId}")
-    public Result queryOrderByResultIdAndUserIdAndProId(@PathVariable("productId") String productId ,
-                                                        @PathVariable("userId") String userId,
-                                                        @PathVariable("resultId") String resultId ){
-        return success(orderInfoService.queryOrderByResultIdAndUserIdAndProId(productId,userId,resultId));
-    }
-}

+ 0 - 63
src/main/java/com/rf/psychological/wxpay/controller/PromotionInfoController.java

@@ -1,63 +0,0 @@
-package com.rf.psychological.wxpay.controller;
-
-import cn.hutool.core.date.DateUtil;
-import com.rf.psychological.dao.model.CognitiveTaskEntity;
-import com.rf.psychological.scale.dao.repository.CognitiveTaskRepository;
-import com.rf.psychological.scale.service.CognitiveTaskService;
-import com.rf.psychological.security.SafetyProcess;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.utils.Result;
-import com.rf.psychological.wxpay.model.PromotionInfo;
-import com.rf.psychological.wxpay.service.PromotionInfoService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * @Description:量表收费管理
- * @Author: zsf
- * @Date: 2022/6/29
- */
-@RestController
-@RequestMapping("/api/promotionInfo")
-@Api(tags = "量表收费管理")
-@Slf4j
-public class PromotionInfoController extends BaseController {
-    @Autowired
-    private PromotionInfoService infoService;
-
-    @Autowired
-    private CognitiveTaskRepository repository;
-
-    @SafetyProcess
-    @GetMapping("/queryPromotionBySubjectId/{subjectId}")
-    @ApiOperation(value = "根据量表id获取到收费价格")
-    public Result queryPromotionBySubjectId(@PathVariable String subjectId){
-        try {
-            PromotionInfo info =  infoService.findInfoBySubjectId(subjectId);
-            return success(info);
-        }catch (Exception e ){
-            e.printStackTrace();
-            return fail();
-        }
-    }
-    @GetMapping("/save")
-    public Result saveTask(){
-        List<CognitiveTaskEntity> list =  repository.findAll();
-        for (CognitiveTaskEntity taskEntity : list){
-            PromotionInfo promotionInfo = new PromotionInfo();
-            promotionInfo.setCreateTime(DateUtil.now());
-            promotionInfo.setUpdateTime(DateUtil.now());
-            promotionInfo.setName(taskEntity.getName());
-            promotionInfo.setPrice(0.01);
-            promotionInfo.setType("1");
-            promotionInfo.setSubjectId(taskEntity.getId());
-            infoService.saveOrUpdateInfo(promotionInfo);
-        }
-        return success();
-    }
-}

+ 0 - 185
src/main/java/com/rf/psychological/wxpay/controller/WxPayController.java

@@ -1,185 +0,0 @@
-package com.rf.psychological.wxpay.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
-import com.rf.psychological.security.AesEncryptUtils;
-import com.rf.psychological.security.SafetyProcess;
-import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
-import com.rf.psychological.base.rest.BaseController;
-import com.rf.psychological.wxpay.utils.HttpUtils;
-import com.rf.psychological.utils.Result;
-import com.rf.psychological.wxpay.service.WxPayService;
-import com.rf.psychological.wxpay.utils.WechatPay2ValidatorForRequest;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @Description:微信支付接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-@CrossOrigin //跨域
-@RestController
-@RequestMapping("/api/wx-pay")
-@Api(tags = "网站微信支付APIv3")
-@Slf4j
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-public class WxPayController  extends BaseController {
-
-    @Autowired
-    private WxPayService wxPayService;
-
-    @Autowired
-    private Verifier verifier;
-
-
-    /**
-     * 调用统一下单API,生成支付二维码
-     * @return
-     */
-    @SafetyProcess
-    @ApiOperation(value = "调用统一下单API,生成支付二维码",notes = "json字符串形式传参(加密)," +
-            "data参数中包括(必传):productId:量表id,userId:用户id,resultId:测试结果id,description:订单描述信息," +
-            "total:订单总金额,单位为分")
-    @PostMapping("/native")
-    public Result nativePay(@RequestBody String paramJson){
-        try {
-            log.info(paramJson);
-            String paramData = AesEncryptUtils.decrypt(JSONObject.parseObject(paramJson).getString("data"));
-            log.info(paramData);
-            if (StringUtils.isEmpty(paramData)){
-                return fail(null,"参数不能为空");
-            }
-            Map<String,Object> map = wxPayService.nativePay(JSON.parseObject(paramData));
-            return success(map);
-        }catch (Exception e){
-            e.printStackTrace();
-            return fail("二维码生成失败");
-        }
-    }
-
-    /**
-     * h5下单API,生成支付二维码
-     * @return
-     */
-    @SafetyProcess
-    @ApiOperation(value = "h5下单API,生成支付二维码",notes = "json字符串形式传参(加密)," +
-            "data参数中包括(必传):productId:量表id,userId:用户id,resultId:测试结果id,description:订单描述信息," +
-            "payerClientIp:用户的客户端IP,支持IPv4和IPv6两种格式的IP地址,sceneType:场景类型ios、Android," +
-            "total:订单总金额,单位为分")
-    @PostMapping("/h5Pay")
-    public Result h5Pay(@RequestBody String paramJson) throws Exception {
-        try {
-            String paramData = AesEncryptUtils.decrypt(JSONObject.parseObject(paramJson).getString("data"));
-            if (StringUtils.isEmpty(paramData)){
-                return fail(null,"参数不能为空");
-            }
-            //获取必要参数
-            JSONObject paramObject = JSONObject.parseObject(paramData);
-            Map result = wxPayService.h5Pay(paramObject);
-            return success(result);
-        }catch (Exception e){
-            e.printStackTrace();
-            return fail("h5_url生成失败");
-        }
-    }
-
-
-    /**
-     * 支付通知 微信支付通过支付通知接口将用户支付成功消息通知给商户
-     * @param request
-     * @param response
-     * @return
-     */
-    @ApiOperation("支付通知")
-    @PostMapping("/native/notify")
-    public String nativeNotify(HttpServletRequest request, HttpServletResponse response){
-        Gson gson = new Gson();
-        Map<String,Object> map = new HashMap<>();
-        //处理通知参数
-        try {
-            String body = HttpUtils.readData( request);
-            Map<String,Object> bodyMap = gson.fromJson(body, HashMap.class);
-            String requestId = (String)bodyMap.get("id");
-            log.info("支付通知的id ===> {}", requestId);
-            log.info("支付通知的完整数据 ===> {}", body);
-
-            //签名的验证
-            WechatPay2ValidatorForRequest wechatPay2ValidatorForRequest
-                    = new WechatPay2ValidatorForRequest(verifier, requestId, body);
-            if(!wechatPay2ValidatorForRequest.validate(request)){
-
-                log.error("通知验签失败");
-                //失败应答
-                response.setStatus(500);
-                map.put("code", "ERROR");
-                map.put("message", "通知验签失败");
-                return gson.toJson(map);
-            }
-            log.info("通知验签成功");
-            //处理订单
-            wxPayService.processOrder(bodyMap);
-
-            //成功应答
-            response.setStatus(200);
-            map.put("code", "SUCCESS");
-            map.put("message", "成功");
-            return gson.toJson(map);
-        }catch (Exception e){
-            e.printStackTrace();
-            //失败应答
-            response.setStatus(500);
-            map.put("code", "ERROR");
-            map.put("message", "失败");
-            return gson.toJson(map);
-        }
-    }
-
-
-    /**
-     * 用户取消订单
-     * @param orderNo
-     * @return
-     * @throws Exception
-     */
-    @ApiOperation("用户取消订单-PC")
-    @GetMapping("/cancel/{orderNo}")
-    public Result cancel(@PathVariable String orderNo) throws Exception {
-        log.info("取消订单");
-        wxPayService.cancelOrder(orderNo);
-        return success(null,"订单已取消");
-    }
-
-
-    @SafetyProcess
-    @ApiOperation("查询订单")
-    @GetMapping("/queryOrder/{orderNo}")
-    public Result queryOrder(@PathVariable String orderNo) throws Exception {
-        log.info("查询订单订单");
-        return success( wxPayService.queryOrder(orderNo));
-    }
-
-    @ApiOperation("交易账单--暂未开发")
-    @GetMapping("/queryTradeBill/{billDate}/{type}")
-    public Result queryTradeBill(@PathVariable String billDate, @PathVariable String type){
-        return success();
-    }
-
-    @GetMapping("/refund/{orderNo}")
-    public Result refund(@PathVariable String orderNo) throws IOException {
-        wxPayService.refund(orderNo);
-        return success();
-    }
-}

+ 0 - 62
src/main/java/com/rf/psychological/wxpay/model/OrderInfo.java

@@ -1,62 +0,0 @@
-package com.rf.psychological.wxpay.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.*;
-import org.hibernate.annotations.DynamicUpdate;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-/**
- * @Description:订单信息
- * @Author: zsf
- * @Date: 2022/6/21
- */
-@Entity
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper=false)
-@Table(name = "t_order_info")
-@org.hibernate.annotations.Table(appliesTo = "t_order_info", comment = "订单信息表")
-@DynamicUpdate(value = true)
-public class OrderInfo extends BaseEntity {
-
-    @Column(name = "title", columnDefinition = "varchar(100) comment '订单标题'")
-    private String title;//订单标题
-
-    @Column(name = "order_no", columnDefinition = "varchar(50) comment '商户订单编号'")
-    private String orderNo;//商户订单编号
-
-    @Column(name = "user_id", columnDefinition = "varchar(36) comment '用户id'")
-    private String userId;//用户id
-
-    @Column(name = "product_id", columnDefinition = "varchar(36) comment '量表产品id'")
-    private String productId;//量表id
-
-    @Column(name = "result_id", columnDefinition = "varchar(36) comment '报告结果id'")
-    private String resultId;//报告结果id
-
-    @Column(name = "total_fee", columnDefinition = "int(11) comment '订单金额(分)'")
-    private Integer totalFee;//订单金额(分)
-
-    @Column(name = "code_url", columnDefinition = "varchar(50) comment '订单二维码连接'")
-    private String codeUrl;//订单二维码连接
-
-    @Column(name = "order_status", columnDefinition = "varchar(20) comment '订单状态'")
-    private String orderStatus;//订单状态
-
-    @Column(name = "trade_type", columnDefinition = "varchar(20) comment '交易类型'")
-    private String tradeType;//交易类型
-
-    @Column(name = "create_time", columnDefinition = "varchar(20) comment '创建时间'")
-    private String createTime;//创建时间
-
-    @Column(name = "update_time", columnDefinition = "varchar(20) comment '更新时间'")
-    private String updateTime;//更新时间
-
-    @Transient
-    private String desc;
-}

+ 0 - 50
src/main/java/com/rf/psychological/wxpay/model/PaymentInfo.java

@@ -1,50 +0,0 @@
-package com.rf.psychological.wxpay.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import org.hibernate.annotations.DynamicUpdate;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-
-/**
- * @Description:支付日志
- * @Author: zsf
- * @Date: 2022/6/22
- */
-@Entity
-@Data
-@EqualsAndHashCode(callSuper=false)
-@NoArgsConstructor
-@Table(name = "t_payment_info")
-@org.hibernate.annotations.Table(appliesTo = "t_payment_info", comment = "支付日志信息表")
-@DynamicUpdate
-public class PaymentInfo extends BaseEntity {
-
-    @Column(name = "order_no", columnDefinition = "varchar(50) comment '商品订单编号'")
-    private String orderNo;//商品订单编号
-
-    @Column(name = "transaction_id", columnDefinition = "varchar(50) comment '支付系统交易编号'")
-    private String transactionId;//支付系统交易编号
-
-    @Column(name = "payment_type", columnDefinition = "varchar(20) comment '支付类型'")
-    private String paymentType;//支付类型
-
-    @Column(name = "trade_type", columnDefinition = "varchar(20) comment '交易类型'")
-    private String tradeType;//交易类型
-
-    @Column(name = "trade_state", columnDefinition = "varchar(20) comment '交易状态'")
-    private String tradeState;//交易状态
-
-    @Column(name = "payer_total", columnDefinition = "int(11) comment '支付金额'")
-    private Integer payerTotal;//支付金额(分)
-
-    @Column(name = "content", columnDefinition = "varchar(500) comment '通知参数'")
-    private String content;//通知参数
-
-    @Column(name = "create_time", columnDefinition = "varchar(20) comment '创建时间'")
-    private String createTime;//创建时间
-}

+ 0 - 57
src/main/java/com/rf/psychological/wxpay/model/PromotionInfo.java

@@ -1,57 +0,0 @@
-package com.rf.psychological.wxpay.model;
-
-import com.rf.psychological.base.model.BaseEntity;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import org.hibernate.annotations.DynamicUpdate;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import java.sql.Date;
-
-/**
- * @Description:量表和认知任务促销价格表
- * @Author: zsf
- * @Date: 2022/6/29
- */
-@Entity
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper=false)
-@Table(name = "t_promotion_info")
-@org.hibernate.annotations.Table(appliesTo = "t_promotion_info", comment = "量表和认知任务促销价格表")
-@DynamicUpdate(value = true)
-public class PromotionInfo extends BaseEntity {
-
-    @Column(name = "subject_id", columnDefinition = "varchar(36) comment '量表/认知任务id'")
-    private  String subjectId;//量表/认知任务id
-    @Column(name = "name", columnDefinition = "varchar(255) comment '量表/认知任务名称'")
-    private  String name;//量表/认知任务名称
-
-    @Column(name = "price", columnDefinition = "DECIMAL(20,2) comment '价格'")
-    private  double price;//价格
-
-    @Column(name = "promotion_end_time", columnDefinition = "DATETIME(6) comment '促销结束时间'")
-    private Date promotionEndTime;//促销结束时间
-
-    @Column(name = "promotion_price", columnDefinition = "DECIMAL(20,2) comment '促销价格'")
-    private  double promotionPrice;//促销价格
-
-    @Column(name = "promotionStartTime", columnDefinition = "DATETIME(6) comment '促销开始时间'")
-    private  Date promotion_start_time;//促销开始时间
-
-    @Column(name = "promotionType", columnDefinition = "varchar(10) comment '促销类型:0->没有促销使用原价;1->使用促销价;2->限时购'")
-    private  String promotion_type;//促销类型:0->没有促销使用原价;1->使用促销价;2->限时购
-
-    @Column(name = "type", columnDefinition = "varchar(10) comment '类型:0-量表;1-认知任务'")
-    private  String type;//量表类型
-
-    @Column(name = "create_time", columnDefinition = "varchar(20) comment '创建时间'")
-    private String createTime;
-    @Column(name = "update_time", columnDefinition = "varchar(20) comment '更新时间'")
-    private String updateTime;
-}

+ 0 - 68
src/main/java/com/rf/psychological/wxpay/repository/OrderInfoRepository.java

@@ -1,68 +0,0 @@
-package com.rf.psychological.wxpay.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.wxpay.model.OrderInfo;
-
-import java.util.List;
-
-/**
- * @Description:订单信息接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-public interface OrderInfoRepository extends BaseRepository<OrderInfo, String> {
-
-
-    OrderInfo getNoPayOrderInfoByProductIdAndUserId(String productId,String userId);
-
-    /**
-     * 查询该商品该用户下未支付的订单
-     * @param productId
-     * @param userId
-     * @param orderStatus
-     * @return
-     */
-    OrderInfo findByProductIdAndUserIdAndOrderStatus(String productId,String userId,String orderStatus);
-
-    /**
-     * 获取到该量表下该用户的未支付状态订单
-     * @param productId 量表id
-     * @param userId 用户id
-     * @param resultId 结果id
-     * @param orderStatus 状态
-     * @return
-     */
-    OrderInfo findByProductIdAndUserIdAndResultIdAndOrderStatus(String productId,String userId,String resultId,String orderStatus);
-
-    /**
-     * 根据状态查询
-     * @param orderStatus
-     * @return
-     */
-    List<OrderInfo> findByOrderStatus(String orderStatus);
-
-
-    /**
-     * 根据订单编号获取订单
-     * @param orderNo 订单编号
-     * @return
-     */
-    OrderInfo findByOrderNo(String orderNo);
-
-
-    /**
-     * 查询订单
-     * @param productId
-     * @param userId
-     * @param resultId
-     * @return
-     */
-    OrderInfo findByProductIdAndUserIdAndResultId(String productId,String userId,String resultId);
-
-
-
-    OrderInfo findByResultIdAndOrderStatus(String resultId,String status);
-
-
-
-}

+ 0 - 12
src/main/java/com/rf/psychological/wxpay/repository/PaymentInfoRepository.java

@@ -1,12 +0,0 @@
-package com.rf.psychological.wxpay.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.wxpay.model.PaymentInfo;
-
-/**
- * @Description:支付记录
- * @Author: zsf
- * @Date: 2022/6/22
- */
-public interface PaymentInfoRepository extends BaseRepository<PaymentInfo,String> {
-}

+ 0 - 14
src/main/java/com/rf/psychological/wxpay/repository/PromotionInfoRepository.java

@@ -1,14 +0,0 @@
-package com.rf.psychological.wxpay.repository;
-
-import com.rf.psychological.base.repository.BaseRepository;
-import com.rf.psychological.wxpay.model.PromotionInfo;
-
-/**
- * @Description:量表收费接口
- * @Author: zsf
- * @Date: 2022/6/29
- */
-public interface PromotionInfoRepository extends BaseRepository<PromotionInfo,String> {
-
-    PromotionInfo findBySubjectId(String subId);
-}

+ 0 - 94
src/main/java/com/rf/psychological/wxpay/service/OrderInfoService.java

@@ -1,94 +0,0 @@
-package com.rf.psychological.wxpay.service;
-
-import com.rf.psychological.enums.OrderStatus;
-import com.rf.psychological.enums.wxpay.WxTradeType;
-import com.rf.psychological.wxpay.model.OrderInfo;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-
-/**
- * @Description:订单信息接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-public interface OrderInfoService {
-
-    /**
-     * 创建订单
-     * @param productId 量表产品id
-     * @param userId  用户id
-     * @param resultId 结果id
-     * @return
-     */
-    public OrderInfo createOrderByProductId(String productId, String userId, String resultId,Integer price ,WxTradeType type) throws Exception;
-
-    /**
-     * 保存二维码连接
-     * @param info
-     */
-    void saveCodeUrl(OrderInfo info);
-
-    /**
-     * 查询订单列表
-     * @param pageNum 页码
-     * @param pageSize 数量
-     * @param productId 产品id
-     * @param userId 用户id
-     * @param orderStatus 订单状态
-     * @return
-     */
-    Page<OrderInfo> findOrderInfoList(int pageNum, int pageSize,String productId,String userId,String orderStatus);
-
-    /**
-     * 根据编号获取订单状态
-     * @param orderNo 订单号
-     * @return
-     */
-    OrderInfo  getOrderStatus(String orderNo);
-
-    /**
-     * 查询订单是否支付成功
-     * @param proId 量表id
-     * @param userId 用户id
-     * @param resultId 报告id
-     * @return
-     */
-    OrderInfo queryOrderByResultIdAndUserIdAndProId(String proId,String userId,String resultId);
-
-    /**
-     * 关闭订单
-     * @param orderNo 订单编号
-     */
-    void cancelOrder(String orderNo);
-
-
-    /**
-     * 更新订单状态
-     * @param info 订单
-     * @param success 状态值
-     */
-    void updateOrderStatus(OrderInfo info, OrderStatus success);
-
-    /**
-     * 更新订单状态
-     * @param orderNo 订单
-     * @param status 状态值
-     */
-    void updateOrderStatus(String orderNo, OrderStatus status);
-
-    /**
-     * 根据订单状态查询所有订单
-     * @param status
-     * @return
-     */
-    List<OrderInfo>  queryOrderInfoList(OrderStatus status);
-
-
-    /**
-     * 判断是否支付
-     * @param resultId
-     * @return
-     */
-    boolean checkPayOrder(String resultId);
-}

+ 0 - 15
src/main/java/com/rf/psychological/wxpay/service/PaymentInfoService.java

@@ -1,15 +0,0 @@
-package com.rf.psychological.wxpay.service;
-
-/**
- * @Description:支付日志接口
- * @Author: zsf
- * @Date: 2022/6/22
- */
-public interface PaymentInfoService {
-
-    /**
-     * 日志记录
-     * @param plainText 内容
-     */
-    void createPaymentInfo(String plainText);
-}

+ 0 - 24
src/main/java/com/rf/psychological/wxpay/service/PromotionInfoService.java

@@ -1,24 +0,0 @@
-package com.rf.psychological.wxpay.service;
-
-import com.rf.psychological.wxpay.model.PromotionInfo;
-
-/**
- * @Description:量表价格接口
- * @Author: zsf
- * @Date: 2022/6/29
- */
-public interface PromotionInfoService {
-
-    /**
-     * 获取到量表收费信息
-     * @param id 量表id
-     * @return
-     */
-    public PromotionInfo findInfoBySubjectId(String id);
-
-    /**
-     * 新增或保存收费信息
-     * @param info 收费表单
-     */
-    public void saveOrUpdateInfo(PromotionInfo info);
-}

+ 0 - 61
src/main/java/com/rf/psychological/wxpay/service/WxPayService.java

@@ -1,61 +0,0 @@
-package com.rf.psychological.wxpay.service;
-
-import com.alibaba.fastjson.JSONObject;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.Map;
-
-/**
- * @Description:微信支付接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-public interface WxPayService {
-
-
-    /**
-     * 调用native支付接口
-     * @param paramJson
-     * @return
-     * @throws Exception
-     */
-    public Map<String,Object> nativePay(JSONObject paramJson) throws Exception;
-
-
-
-    /**
-     * 处理订单
-     * @param bodyMap 密文数据
-     * @throws GeneralSecurityException
-     */
-    void processOrder(Map<String, Object> bodyMap) throws GeneralSecurityException;
-
-    /**
-     * 取消订单
-     * @param orderNo 订单号
-     */
-    void cancelOrder(String orderNo) throws Exception;
-
-    /**
-     * 查询订单
-     * @param orderNo
-     * @return
-     */
-    Map queryOrder(String orderNo) throws IOException;
-
-    /**
-     * 定时检查未支付订单
-     */
-    void checkOrderStatus() throws Exception;
-
-    /**
-     * h5下单
-     * @param paramData
-     * @return
-     */
-    Map<String,Object> h5Pay(JSONObject paramData) throws Exception;
-
-
-    Map refund(String orderNo) throws IOException;
-}

+ 0 - 230
src/main/java/com/rf/psychological/wxpay/service/impl/OrderInfoServiceImpl.java

@@ -1,230 +0,0 @@
-package com.rf.psychological.wxpay.service.impl;
-
-import com.rf.psychological.enums.OrderStatus;
-import com.rf.psychological.enums.wxpay.WxTradeType;
-import com.rf.psychological.scale.dao.model.SubjectEntity;
-import com.rf.psychological.scale.service.SubjectService;
-import com.rf.psychological.utils.DateUtil;
-import com.rf.psychological.wxpay.model.OrderInfo;
-import com.rf.psychological.wxpay.repository.OrderInfoRepository;
-import com.rf.psychological.wxpay.service.OrderInfoService;
-import com.rf.psychological.wxpay.service.WxPayService;
-import com.rf.psychological.wxpay.utils.OrderNoUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import javax.persistence.criteria.Predicate;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * @Description:订单信息接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-@Service
-@Slf4j
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-public class OrderInfoServiceImpl implements OrderInfoService {
-
-    @Autowired
-    private OrderInfoRepository orderInfoRepository;
-
-    @Autowired
-    private SubjectService subjectService;
-
-    @Autowired
-    private WxPayService wxPayService;
-    /**
-     * 创建订单
-     * @param productId 产品id
-     * @return
-     */
-    @Override
-    public OrderInfo createOrderByProductId(String productId, String userId, String resultId,Integer total, WxTradeType type) throws Exception {
-        //根据产品id获取到和当前人id查询是否存在未支付订单
-        OrderInfo orderInfo = orderInfoRepository.findByProductIdAndUserIdAndResultIdAndOrderStatus(productId,userId,resultId,OrderStatus.NOTPAY.getType());
-        //如果存在,判断生成类型
-        if (orderInfo != null){
-            if (type.getType().equals(orderInfo.getTradeType())){
-                return orderInfo;
-            }else {
-                //取消订单,生成新的订单
-                wxPayService.cancelOrder(orderInfo.getOrderNo());
-                this.cancelOrder(orderInfo.getOrderNo());
-                orderInfo =  saveOrder(productId,userId,resultId,total,type);
-            }
-        }else {
-            orderInfo =  saveOrder(productId,userId,resultId,total,type);
-        }
-        return orderInfo;
-    }
-
-    private OrderInfo saveOrder(String productId, String userId, String resultId, Integer total, WxTradeType type) {
-        //TODO 获取产品信息,产品名称 价格
-        Optional<SubjectEntity> subject = subjectService.findById(productId);
-        //生成订单
-        OrderInfo orderInfo = new OrderInfo();
-        orderInfo.setTitle(subject.get().getName());
-        orderInfo.setOrderNo(OrderNoUtils.getOrderNo());
-        orderInfo.setProductId(productId);
-        orderInfo.setUserId(userId);
-        orderInfo.setTotalFee(total);
-        orderInfo.setOrderStatus(OrderStatus.NOTPAY.getType());
-        orderInfo.setCreateTime(DateUtil.getNowTime());
-        orderInfo.setUpdateTime(DateUtil.getNowTime());
-        orderInfo.setResultId(resultId);
-        orderInfo.setTradeType(type.getType());
-        orderInfo.setDesc(subject.get().getName());
-        orderInfoRepository.save(orderInfo);
-        return orderInfo;
-    }
-
-    /**
-     * 保存二维码地址
-     * @param info
-     */
-    @Override
-    public void saveCodeUrl(OrderInfo info) {
-        info.setUpdateTime(DateUtil.getNowTime());
-        orderInfoRepository.save(info);
-    }
-
-    /**
-     * 查询订单列表
-     * @param pageNum 页码
-     * @param pageSize 数量
-     * @param productId 产品id
-     * @param userId 用户id
-     * @param orderStatus 订单状态
-     * @return
-     */
-    @Override
-    public Page<OrderInfo> findOrderInfoList(int pageNum, int pageSize, String productId, String userId, String orderStatus) {
-        if (pageNum <=0){pageNum=0;}else {pageNum = pageNum-1;}
-        Specification specification = (Specification<OrderInfo>) (root,query,criteriaBuilder)->{
-            List<Predicate> list =new ArrayList<>();
-            if (!StringUtils.isEmpty(productId)){
-                list.add(criteriaBuilder.equal(root.get("productId"),productId));
-            }
-            if (!StringUtils.isEmpty(userId)){
-                list.add(criteriaBuilder.equal(root.get("userId"),userId));
-            }
-            if (!StringUtils.isEmpty(orderStatus)){
-                list.add(criteriaBuilder.equal(root.get("orderStatus"),orderStatus));
-            }
-            query.where(criteriaBuilder.and(list.toArray(new Predicate[list.size()])));
-            query.orderBy(criteriaBuilder.asc(root.get("createTime")));
-            return query.getRestriction();
-        };
-        Page<OrderInfo> orderInfos = orderInfoRepository.findAll(specification, PageRequest.of(pageNum,pageSize));
-        return orderInfos;
-    }
-
-    /**
-     * 获取订单状态
-     * @param orderNo 订单号
-     * @return
-     */
-    @Override
-    public OrderInfo  getOrderStatus(String orderNo) {
-        OrderInfo info = orderInfoRepository.findByOrderNo(orderNo);
-        return info;
-    }
-
-    /**
-     * 查询订单是否支付成功
-     * @param proId 量表id
-     * @param userId 用户id
-     * @param resultId 报告id
-     * @return
-     */
-    @Override
-    public OrderInfo queryOrderByResultIdAndUserIdAndProId(String proId, String userId, String resultId) {
-        try {
-            OrderInfo info = orderInfoRepository.findByProductIdAndUserIdAndResultIdAndOrderStatus(proId,userId,resultId,OrderStatus.SUCCESS.getType());
-            return info;
-        }catch (Exception e){
-            e.printStackTrace();
-            return null;
-        }
-
-    }
-
-    /**
-     * 关闭订单
-     * @param orderNo 订单编号
-     */
-    @Override
-    public void cancelOrder(String orderNo) {
-        this.updateOrderStatus(orderNo,OrderStatus.CANCEL);
-    }
-
-
-    /**
-     * 更新状态
-     * @param info 订单
-     * @param success 状态值
-     */
-    @Override
-    public void updateOrderStatus(OrderInfo info, OrderStatus success) {
-        info.setOrderStatus(success.getType());
-        info.setUpdateTime(DateUtil.getNowTime());
-        orderInfoRepository.save(info);
-    }
-
-    /**
-     * 更新状态
-     * @param orderNo 订单
-     * @param success 状态值
-     */
-    @Override
-    public void updateOrderStatus(String orderNo, OrderStatus success) {
-        OrderInfo info = this.orderInfoRepository.findByOrderNo(orderNo);
-        info.setOrderStatus(success.getType());
-        info.setUpdateTime(DateUtil.getNowTime());
-        orderInfoRepository.save(info);
-    }
-
-    /**
-     * 查询该状态下的所有订单
-     * @param status 订单状态
-     * @return
-     */
-    @Override
-    //@Cacheable(value = "order",key = "#status.getType()")
-    public List<OrderInfo>  queryOrderInfoList(OrderStatus status){
-        return orderInfoRepository.findByOrderStatus(status.getType());
-    }
-
-    /**
-     * 校验是否支付
-     * @param resultId 记录id
-     * @return
-     */
-    @Override
-    public boolean checkPayOrder(String resultId) {
-        try {
-            OrderInfo orderInfo = orderInfoRepository.findByResultIdAndOrderStatus(resultId,OrderStatus.SUCCESS.getType());
-            if ( orderInfo == null){
-                return false;
-            }
-            return true;
-        }catch (Exception e){
-            e.printStackTrace();
-            return false;
-        }
-
-    }
-
-
-}

+ 0 - 64
src/main/java/com/rf/psychological/wxpay/service/impl/PaymentInfoServiceImpl.java

@@ -1,64 +0,0 @@
-package com.rf.psychological.wxpay.service.impl;
-
-import cn.hutool.core.date.DateUtil;
-import com.google.gson.Gson;
-import com.rf.psychological.enums.PayType;
-import com.rf.psychological.wxpay.model.PaymentInfo;
-import com.rf.psychological.wxpay.repository.PaymentInfoRepository;
-import com.rf.psychological.wxpay.service.PaymentInfoService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @Description:支付记录接口
- * @Author: zsf
- * @Date: 2022/6/22
- */
-@Service
-@Slf4j
-public class PaymentInfoServiceImpl implements PaymentInfoService {
-
-
-    @Autowired
-    private PaymentInfoRepository paymentInfoRepository;
-
-    /**
-     * 创建支付记录
-     * @param plainText 内容
-     */
-    @Override
-    public void createPaymentInfo(String plainText) {
-        log.info("记录支付日志");
-
-        Gson gson = new Gson();
-        HashMap plainTextMap = gson.fromJson(plainText, HashMap.class);
-
-        //订单号
-        String orderNo = (String)plainTextMap.get("out_trade_no");
-        //业务编号
-        String transactionId = (String)plainTextMap.get("transaction_id");
-        //支付类型
-        String tradeType = (String)plainTextMap.get("trade_type");
-        //交易状态
-        String tradeState = (String)plainTextMap.get("trade_state");
-        //用户实际支付金额
-        Map<String, Object> amount = (Map)plainTextMap.get("amount");
-        Integer payerTotal = ((Double) amount.get("payer_total")).intValue();
-
-        PaymentInfo paymentInfo = new PaymentInfo();
-        paymentInfo.setOrderNo(orderNo);
-        paymentInfo.setPaymentType(PayType.WXPAY.getType());
-        paymentInfo.setTransactionId(transactionId);
-        paymentInfo.setTradeType(tradeType);
-        paymentInfo.setTradeState(tradeState);
-        paymentInfo.setPayerTotal(payerTotal);
-        paymentInfo.setContent(plainText);
-        paymentInfo.setCreateTime(DateUtil.now());
-        paymentInfoRepository.save(paymentInfo);
-    }
-
-}

+ 0 - 39
src/main/java/com/rf/psychological/wxpay/service/impl/PromotionInfoServiceImpl.java

@@ -1,39 +0,0 @@
-package com.rf.psychological.wxpay.service.impl;
-
-import com.rf.psychological.wxpay.repository.PromotionInfoRepository;
-import com.rf.psychological.wxpay.model.PromotionInfo;
-import com.rf.psychological.wxpay.service.PromotionInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @Description:量表价格接口
- * @Author: zsf
- * @Date: 2022/6/29
- */
-@Service
-public class PromotionInfoServiceImpl implements PromotionInfoService {
-
-
-    @Autowired
-    private PromotionInfoRepository promotionInfoRepository;
-
-    /**
-     * 查询收费信息
-     * @param id 量表id
-     * @return
-     */
-    @Override
-    public PromotionInfo findInfoBySubjectId(String id) {
-        return promotionInfoRepository.findBySubjectId(id);
-    }
-
-    /**
-     * 保存或更新收费表单
-     * @param info 收费表单
-     */
-    @Override
-    public void saveOrUpdateInfo(PromotionInfo info) {
-        promotionInfoRepository.save(info);
-    }
-}

+ 0 - 430
src/main/java/com/rf/psychological/wxpay/service/impl/WxPayServiceImpl.java

@@ -1,430 +0,0 @@
-package com.rf.psychological.wxpay.service.impl;
-
-import cn.hutool.core.date.DateTime;
-import cn.hutool.core.date.DateUnit;
-import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.google.gson.Gson;
-import com.rf.psychological.dao.model.CognitiveTaskEntity;
-import com.rf.psychological.scale.dao.model.SubjectEntity;
-import com.rf.psychological.scale.service.CognitiveTaskService;
-import com.rf.psychological.scale.service.SubjectService;
-import com.rf.psychological.wxpay.config.WxPayConfig;
-import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
-import com.rf.psychological.enums.OrderStatus;
-import com.rf.psychological.enums.wxpay.WxApiType;
-import com.rf.psychological.enums.wxpay.WxNotifyType;
-import com.rf.psychological.enums.wxpay.WxTradeState;
-import com.rf.psychological.enums.wxpay.WxTradeType;
-import com.rf.psychological.wxpay.model.OrderInfo;
-import com.rf.psychological.wxpay.service.OrderInfoService;
-import com.rf.psychological.wxpay.service.PaymentInfoService;
-import com.rf.psychological.wxpay.service.WxPayService;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.util.EntityUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-
-import javax.annotation.Resource;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
-import java.security.GeneralSecurityException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * @Description:微信支付接口
- * @Author: zsf
- * @Date: 2022/6/21
- */
-@Service
-@Slf4j
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-public class WxPayServiceImpl implements WxPayService {
-
-    private final ReentrantLock lock =  new ReentrantLock();
-    @Resource
-    private WxPayConfig wxPayConfig;
-
-    @Resource
-    private CloseableHttpClient wxPayClient;
-
-    @Autowired
-    private OrderInfoService orderInfoService;
-
-    @Autowired
-    private PaymentInfoService paymentInfoService;
-
-    @Autowired
-    private SubjectService subjectService;
-
-    @Autowired
-    private CognitiveTaskService cognitiveTaskService;
-
-    /**
-     * 调用native支付接口
-     * @param jsonObject
-     * @return code_url和订单号
-     * @throws Exception
-     */
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public Map<String, Object> nativePay(JSONObject jsonObject) throws Exception {
-        log.info("生成订单");
-        Map map = pay(jsonObject,WxTradeType.NATIVE,WxApiType.NATIVE_PAY);
-        return map;
-    }
-
-    /**
-     * 处理订单
-     * @param bodyMap 密文数据
-     * @throws GeneralSecurityException
-     */
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public void processOrder(Map<String, Object> bodyMap) throws GeneralSecurityException {
-        log.info("处理订单");
-        //解密报文
-        String plainText = decryptFromResource(bodyMap);
-        //将明文转换成map
-        Gson gson = new Gson();
-        HashMap plainTextMap = gson.fromJson(plainText, HashMap.class);
-        String orderNo = (String)plainTextMap.get("out_trade_no");
-        /*在对业务数据进行状态检查和处理之前,
-        要采用数据锁进行并发控制,
-        以避免函数重入造成的数据混乱*/
-        //尝试获取锁:
-        // 成功获取则立即返回true,获取失败则立即返回false。不必一直等待锁的释放
-        if(lock.tryLock()){
-            try {
-                //处理重复的通知
-                //接口调用的幂等性:无论接口被调用多少次,产生的结果是一致的。
-                OrderInfo info = orderInfoService.getOrderStatus(orderNo);
-                String orderStatus = info !=null?info.getOrderStatus():null;
-                if(!OrderStatus.NOTPAY.getType().equals(orderStatus)){
-                    return;
-                }
-                //更新订单状态
-                orderInfoService.updateOrderStatus(info, OrderStatus.SUCCESS);
-                //记录支付日志
-                paymentInfoService.createPaymentInfo(plainText);
-            } finally {
-                //要主动释放锁
-                lock.unlock();
-            }
-        }
-    }
-
-    /**
-     * 取消订单
-     * @param orderNo 订单号
-     */
-    @Override
-    public void cancelOrder(String orderNo) throws Exception {
-        //调用微信支付的关单接口
-        this.closeOrder(orderNo);
-        //更新商户端的订单状态
-        orderInfoService.cancelOrder(orderNo);
-    }
-
-    /**
-     * 查询订单
-     * @param orderNo
-     * @return
-     */
-    @Override
-    public Map queryOrder(String orderNo) throws IOException {
-        //拼接url
-        String url = String.format(WxApiType.ORDER_QUERY_BY_NO.getType(),orderNo);
-        url = wxPayConfig.getDomain().concat(url).concat("?mchid=").concat(wxPayConfig.getMchId());
-        HttpGet httpGet = new HttpGet(url);
-        httpGet.setHeader("Accept", "application/json");
-        CloseableHttpResponse response = wxPayClient.execute(httpGet);
-        try {
-            Map resultMap = new HashMap();
-            int statusCode = response.getStatusLine().getStatusCode();//响应状态码
-            String body = EntityUtils.toString(response.getEntity());
-            resultMap.put("body",body);
-            resultMap.put("statusCode",statusCode);
-            //log.info(orderNo+"-----url------"+body);
-            if (statusCode == 200) { //处理成功
-               // log.info("成功200");
-            } else if (statusCode == 204) { //处理成功,无返回Body
-                //log.info("成功204");
-            } else {
-                log.info("查询失败,响应码 = " + statusCode);
-                throw new IOException("request failed");
-            }
-            return resultMap;
-        }finally {
-            response.close();
-        }
-    }
-
-    @Override
-    public void checkOrderStatus() throws Exception {
-        DateTime nowDate = DateUtil.date();
-        //获取未支付订单
-        List<OrderInfo> infos = orderInfoService.queryOrderInfoList(OrderStatus.NOTPAY);
-        for (OrderInfo info : infos){
-            String orderNo = info.getOrderNo();
-            //log.warn("根据订单号核实订单状态 ===> {}", orderNo);
-            //调用微信支付查单接口
-            Map queryResult = this.queryOrder(orderNo);
-            String result = queryResult.get("body").toString();
-            Gson gson = new Gson();
-            Map<String, String> resultMap = gson.fromJson(result, HashMap.class);
-            //获取微信支付端的订单状态
-            String tradeState = resultMap.get("trade_state");
-            //判断订单状态
-            if(WxTradeState.SUCCESS.getType().equals(tradeState)){
-               // log.warn("核实订单已支付 ===> {}", orderNo);
-                //如果确认订单已支付则更新本地订单状态
-                orderInfoService.updateOrderStatus(orderNo,OrderStatus.SUCCESS);
-                //记录支付日志
-                paymentInfoService.createPaymentInfo(result);
-            }
-            //判断url是否有效 两小时内有效
-            String orderType = info.getTradeType();
-            long betweenHour = DateUtil.between(nowDate,DateUtil.parseDateTime(info.getUpdateTime()), DateUnit.HOUR);
-            long betweenMinute = DateUtil.between(nowDate,DateUtil.parseDateTime(info.getUpdateTime()), DateUnit.MINUTE);
-            //log.info(betweenHour+"-------------------"+nowDate+"------------"+info.getUpdateTime());
-            if(WxTradeState.NOTPAY.getType().equals(tradeState)
-                    &&( (betweenHour >= 2 && WxTradeType.NATIVE.getType().equals(orderType))||(betweenMinute >= 5 && WxTradeType.MWEB.getType().equals(orderType)))){
-                //log.warn("核实订单未支付 ===> {}", orderNo);
-                //如果订单未支付,则调用关单接口
-                this.closeOrder(orderNo);
-                //更新本地订单状态
-                orderInfoService.updateOrderStatus(orderNo, OrderStatus.CLOSED);
-            }
-        }
-    }
-
-    @Override
-    public Map<String,Object> h5Pay(JSONObject paramData) throws Exception {
-        log.info("h5生成订单");
-        //生成订单
-        Map<String,Object> map = pay(paramData,WxTradeType.MWEB,WxApiType.H5_PAY);
-        return map;
-    }
-
-    @Override
-    public Map refund(String orderNo) throws IOException {
-        HttpPost httpPost = new HttpPost(wxPayConfig.getDomain().concat(WxApiType.DOMESTIC_REFUNDS.getType()));
-        Gson gson = new Gson();
-        Map paramsMap = new HashMap();
-        paramsMap.put("out_trade_no","ORDER_20220627180617553");
-        paramsMap.put("out_refund_no","REFUND_20220627180617553");
-        Map amountMap = new HashMap();
-        amountMap.put("refund", 1);
-        amountMap.put("total", 1);
-        amountMap.put("currency", "CNY");
-        paramsMap.put("amount", amountMap);
-
-
-        //将body转化为json字符串
-        String jsonParams = gson.toJson(paramsMap);
-        log.info("请求参数-------"+jsonParams);
-        StringEntity entity = new StringEntity(jsonParams,"utf-8");
-        entity.setContentType("application/json");
-        httpPost.setEntity(entity);
-        httpPost.setHeader("Accept","application/json");
-        //完成签名并执行请求
-        CloseableHttpResponse response = wxPayClient.execute(httpPost);
-        String bodyAsString = EntityUtils.toString(response.getEntity());//获取响应体
-        int statusCode = response.getStatusLine().getStatusCode();//获取状态码
-        if (statusCode == 200){//成功
-            log.info("成功,返回结果 = "+bodyAsString);
-        }else if (statusCode == 204){//成功 无返回body
-            log.info("成功");
-        }else {
-            log.info("下单失败,响应码 = " + statusCode+ ",返回结果 = " + bodyAsString);
-            throw new IOException("request failed"+bodyAsString);
-        }
-        return null;
-    }
-
-
-    @Transactional(rollbackFor = Exception.class)
-    Map<String, Object> pay(JSONObject paramData, WxTradeType type,WxApiType apiType) throws Exception {
-        String productId = paramData.getString("productId");
-        String userId = paramData.getString("userId");
-        String resultId = paramData.getString("resultId");
-        String description = paramData.getString("description");
-        String price = paramData.getString("total");
-        Integer money=new BigDecimal(String.valueOf(price)).movePointRight(2).intValue();
-        OrderInfo orderInfo = orderInfoService.createOrderByProductId(productId,userId,resultId,money,type);
-        //判断支付码连接是否存在
-        String codeUrl =orderInfo.getCodeUrl();
-        log.info("生成订单----------------------"+StringUtils.hasLength(codeUrl));
-        if (StringUtils.hasLength(codeUrl) ){
-            Map<String,Object> map = new HashMap<>();
-            map.put("codeUrl",codeUrl);
-            map.put("orderNo",orderInfo.getOrderNo());
-            return map;
-        }
-        //调用统一下单API
-        HttpPost httpPost = new HttpPost(wxPayConfig.getDomain().concat(apiType.getType()));
-        //构建必要参数
-        Gson gson = new Gson();
-        Map paramsMap = new HashMap();
-        paramsMap.put("appid",wxPayConfig.getAppId());
-        paramsMap.put("mchid",wxPayConfig.getMchId());
-        paramsMap.put("description",description);
-        paramsMap.put("out_trade_no",orderInfo.getOrderNo());
-        paramsMap.put("notify_url",wxPayConfig.getNotifyDomain().concat(WxNotifyType.NATIVE_NOTIFY.getType()));
-        Map amountMap = new HashMap();
-        amountMap.put("total", orderInfo.getTotalFee());
-        amountMap.put("currency", "CNY");
-        paramsMap.put("amount", amountMap);
-
-        if (WxTradeType.MWEB == type){//h5必填参数
-            String payerClientIp = paramData.getString("payerClientIp");
-            String h5Type = paramData.getString("sceneType");
-            Map sceneMap = new HashMap();
-            sceneMap.put("payer_client_ip",payerClientIp);
-            Map infoMap = new HashMap();
-            infoMap.put("type",h5Type);
-            sceneMap.put("h5_info",infoMap);
-            paramsMap.put("scene_info",sceneMap);
-        }
-        //将body转化为json字符串
-        String jsonParams = gson.toJson(paramsMap);
-        log.info("请求参数-------"+jsonParams);
-        StringEntity entity = new StringEntity(jsonParams,"utf-8");
-        entity.setContentType("application/json");
-        httpPost.setEntity(entity);
-        httpPost.setHeader("Accept","application/json");
-        //完成签名并执行请求
-        CloseableHttpResponse response = wxPayClient.execute(httpPost);
-        //获取响应
-        try {
-            String bodyAsString = EntityUtils.toString(response.getEntity());//获取响应体q
-            int statusCode = response.getStatusLine().getStatusCode();//获取状态码
-            if (statusCode == 200){//成功
-                log.info("成功,返回结果 = "+bodyAsString);
-            }else if (statusCode == 204){//成功 无返回body
-                log.info("成功");
-            }else {
-                log.info("下单失败,响应码 = " + statusCode+ ",返回结果 = " + bodyAsString);
-                throw new IOException("request failed"+bodyAsString);
-            }
-            //响应结果
-            HashMap<String,String> resultMap = gson.fromJson(bodyAsString,HashMap.class);
-            //获取到二维码连接
-            if (WxTradeType.NATIVE == type){
-                codeUrl = resultMap.get("code_url");
-            }else if (WxTradeType.MWEB==type){
-                codeUrl = resultMap.get("h5_url");
-            }
-            orderInfo.setCodeUrl(codeUrl);
-            orderInfoService.saveCodeUrl(orderInfo);
-            //返回二维码
-            Map<String, Object> map = new HashMap<>();
-            map.put("codeUrl", codeUrl);
-            map.put("orderNo", orderInfo.getOrderNo());
-
-            //量表测试次数
-            Optional<SubjectEntity> optional = this.subjectService.findById(productId);
-            if(optional.isPresent()){
-                map.put("testNum",optional.get().getTestNum());
-            }else{
-                Optional<CognitiveTaskEntity> optional1 = cognitiveTaskService.getAllById(productId);
-                if(optional1.isPresent()){
-                     map.put("testNum", optional1.get().getTestNum());
-                }else{
-                    map.put("testNum","0");
-                    log.error("生成支付二维码量表或认知任务已删除:id="+productId);
-                }
-            }
-//            optional.ifPresent(subjectEntity -> map.put("testNum", subjectEntity.getTestNum()));
-            return map;
-        }finally {
-            response.close();
-        }
-    }
-
-    /**
-     * 关闭订单
-     * @param orderNo
-     */
-    private void closeOrder(String orderNo) throws Exception {
-        log.info("关单接口的调用,订单号 ===> {}", orderNo);
-
-        //创建远程请求对象
-        String url = String.format(WxApiType.CLOSE_ORDER_BY_NO.getType(), orderNo);
-        url = wxPayConfig.getDomain().concat(url);
-        HttpPost httpPost = new HttpPost(url);
-
-        //组装json请求体
-        Gson gson = new Gson();
-        Map<String, String> paramsMap = new HashMap<>();
-        paramsMap.put("mchid", wxPayConfig.getMchId());
-        String jsonParams = gson.toJson(paramsMap);
-        log.info("请求参数 ===> {}", jsonParams);
-
-        //将请求参数设置到请求对象中
-        StringEntity entity = new StringEntity(jsonParams,"utf-8");
-        entity.setContentType("application/json");
-        httpPost.setEntity(entity);
-        httpPost.setHeader("Accept", "application/json");
-
-        //完成签名并执行请求
-        CloseableHttpResponse response = wxPayClient.execute(httpPost);
-
-        try {
-            int statusCode = response.getStatusLine().getStatusCode();//响应状态码
-            if (statusCode == 200) { //处理成功
-                log.info("成功200");
-            } else if (statusCode == 204) { //处理成功,无返回Body
-                log.info("成功204");
-            } else {
-                log.info("取消订单失败,响应码 = " + statusCode);
-                throw new IOException("request failed");
-            }
-
-        } finally {
-            response.close();
-        }
-    }
-
-    /**
-     * 解密数据
-     * @param bodyMap
-     * @return
-     */
-    private String decryptFromResource(Map<String, Object> bodyMap) throws GeneralSecurityException {
-        log.info("密文解密");
-
-        //通知数据
-        Map<String, String> resourceMap = (Map) bodyMap.get("resource");
-        //数据密文
-        String ciphertext = resourceMap.get("ciphertext");
-        //随机串
-        String nonce = resourceMap.get("nonce");
-        //附加数据
-        String associatedData = resourceMap.get("associated_data");
-
-        log.info("密文 ===> {}", ciphertext);
-        AesUtil aesUtil = new AesUtil(wxPayConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
-        String plainText = aesUtil.decryptToString(associatedData.getBytes(StandardCharsets.UTF_8),
-                nonce.getBytes(StandardCharsets.UTF_8),
-                ciphertext);
-
-        log.info("明文 ===> {}", plainText);
-
-        return plainText;
-    }
-}

+ 0 - 29
src/main/java/com/rf/psychological/wxpay/task/WxTask.java

@@ -1,29 +0,0 @@
-package com.rf.psychological.wxpay.task;
-
-import com.rf.psychological.wxpay.service.WxPayService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-
-/**
- * @Description:微信定时器
- * @Author: zsf
- * @Date: 2022/6/23
- */
-
-@Slf4j
-@Component
-@ConditionalOnProperty(prefix="wx.pay",name = "is_lan", havingValue = "false")
-public class WxTask {
-
-    @Autowired
-    private WxPayService wxPayService;
-
-    @Scheduled(cron = "0/30 * * * * ?")
-    public void taskQueryOrder() throws Exception {
-        wxPayService.checkOrderStatus();
-    }
-}

+ 0 - 41
src/main/java/com/rf/psychological/wxpay/utils/HttpUtils.java

@@ -1,41 +0,0 @@
-package com.rf.psychological.wxpay.utils;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.IOException;
-/**
- * @Description:微信支付http工具
- * @Author: zsf
- * @Date: 2022/6/21
- */
-public class HttpUtils {
-    /**
-     * 将通知参数转化为字符串
-     * @param request
-     * @return
-     */
-    public static String readData(HttpServletRequest request) {
-        BufferedReader br = null;
-        try {
-            StringBuilder result = new StringBuilder();
-            br = request.getReader();
-            for (String line; (line = br.readLine()) != null; ) {
-                if (result.length() > 0) {
-                    result.append("\n");
-                }
-                result.append(line);
-            }
-            return result.toString();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        } finally {
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-}

+ 0 - 44
src/main/java/com/rf/psychological/wxpay/utils/OrderNoUtils.java

@@ -1,44 +0,0 @@
-package com.rf.psychological.wxpay.utils;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Random;
-
-/**
- * @Description:订单号工具类
- * @Author: zsf
- * @Date: 2022/6/21
- */
-public class OrderNoUtils {
-
-    /**
-     * 获取订单编号
-     * @return
-     */
-    public static String getOrderNo() {
-        return "ORDER_" + getNo();
-    }
-
-    /**
-     * 获取退款单编号
-     * @return
-     */
-    public static String getRefundNo() {
-        return "REFUND_" + getNo();
-    }
-
-    /**
-     * 获取编号
-     * @return
-     */
-    public static String getNo() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-        String newDate = sdf.format(new Date());
-        String result = "";
-        Random random = new Random();
-        for (int i = 0; i < 3; i++) {
-            result += random.nextInt(10);
-        }
-        return newDate + result;
-    }
-}

+ 0 - 116
src/main/java/com/rf/psychological/wxpay/utils/WechatPay2ValidatorForRequest.java

@@ -1,116 +0,0 @@
-package com.rf.psychological.wxpay.utils;
-
-import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpServletRequest;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.time.DateTimeException;
-import java.time.Duration;
-import java.time.Instant;
-
-import static com.wechat.pay.contrib.apache.httpclient.constant.WechatPayHttpHeaders.*;
-
-/**
- * @Description:验签工作
- * @Author: zsf
- * @Date: 2022/6/22
- */
-public class WechatPay2ValidatorForRequest {
-
-
-    protected static final Logger log = LoggerFactory.getLogger(WechatPay2ValidatorForRequest.class);
-    /**
-     * 应答超时时间,单位为分钟
-     */
-    protected static final long RESPONSE_EXPIRED_MINUTES = 5;
-    protected final Verifier verifier;
-    protected final String requestId;
-    protected final String body;
-
-
-    public WechatPay2ValidatorForRequest(Verifier verifier, String requestId, String body) {
-        this.verifier = verifier;
-        this.requestId = requestId;
-        this.body = body;
-    }
-
-    protected static IllegalArgumentException parameterError(String message, Object... args) {
-        message = String.format(message, args);
-        return new IllegalArgumentException("parameter error: " + message);
-    }
-
-    protected static IllegalArgumentException verifyFail(String message, Object... args) {
-        message = String.format(message, args);
-        return new IllegalArgumentException("signature verify fail: " + message);
-    }
-
-    public final boolean validate(HttpServletRequest request) throws IOException {
-        try {
-            //处理请求参数
-            validateParameters(request);
-
-            //构造验签名串
-            String message = buildMessage(request);
-
-            String serial = request.getHeader(WECHAT_PAY_SERIAL);
-            String signature = request.getHeader(WECHAT_PAY_SIGNATURE);
-
-            //验签
-            if (!verifier.verify(serial, message.getBytes(StandardCharsets.UTF_8), signature)) {
-                throw verifyFail("serial=[%s] message=[%s] sign=[%s], request-id=[%s]",
-                        serial, message, signature, requestId);
-            }
-        } catch (IllegalArgumentException e) {
-            log.warn(e.getMessage());
-            return false;
-        }
-
-        return true;
-    }
-
-    protected final void validateParameters(HttpServletRequest request) {
-
-        // NOTE: ensure HEADER_WECHAT_PAY_TIMESTAMP at last
-        String[] headers = {WECHAT_PAY_SERIAL, WECHAT_PAY_SIGNATURE, WECHAT_PAY_NONCE, WECHAT_PAY_TIMESTAMP};
-
-        String header = null;
-        for (String headerName : headers) {
-            header = request.getHeader(headerName);
-            if (header == null) {
-                throw parameterError("empty [%s], request-id=[%s]", headerName, requestId);
-            }
-        }
-
-        //判断请求是否过期
-        String timestampStr = header;
-        try {
-            Instant responseTime = Instant.ofEpochSecond(Long.parseLong(timestampStr));
-            // 拒绝过期请求
-            if (Duration.between(responseTime, Instant.now()).abs().toMinutes() >= RESPONSE_EXPIRED_MINUTES) {
-                throw parameterError("timestamp=[%s] expires, request-id=[%s]", timestampStr, requestId);
-            }
-        } catch (DateTimeException | NumberFormatException e) {
-            throw parameterError("invalid timestamp=[%s], request-id=[%s]", timestampStr, requestId);
-        }
-    }
-
-    protected final String buildMessage(HttpServletRequest request) throws IOException {
-        String timestamp = request.getHeader(WECHAT_PAY_TIMESTAMP);
-        String nonce = request.getHeader(WECHAT_PAY_NONCE);
-        return timestamp + "\n"
-                + nonce + "\n"
-                + body + "\n";
-    }
-
-    protected final String getResponseBody(CloseableHttpResponse response) throws IOException {
-        HttpEntity entity = response.getEntity();
-        return (entity != null && entity.isRepeatable()) ? EntityUtils.toString(entity) : "";
-    }
-}

+ 0 - 28
src/main/resources/apiclient_key.pem

@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC6U1RL+Msu0oUi
-lIH5as0MAtb9wUtbgZI4Lqa4p5XwsAUFXcCJob5RnZEStHH2TK4W0VEENp0psp8F
-FntmIJsyMAODu4Wt97OZ29mn9/qVYnPC4QGVfor5t9oPo5UtMa/KLqCMZbMhC0kT
-iq2q7uvmR6D9mV3VmOqi7KKeX65aYgo1VPH5EjzO4okpk3yes1KkDGQfYubPoZot
-v//7Ca07ZnFX8/NKY3a8d/VTIuUW1DzPMwplt6H/oN5+H04xfLxe5MZvq+YEPx2U
-zHMO1of1WWPUAotbgMO4CwqbVHoX+9H4LlTP3hhxtORO3p0qE4txXMBvrHWuqf3h
-rZnA5pPrAgMBAAECggEASpIRGbq/7sRYfkd7YUwqNlVon/RdaYkI8S1SknKX4tU/
-nS8xYKP4HIf4SMkpFw8HWaB6UTpeWhLf69RcnLoOAt8OeQly7fZFzh0cFkp74o+d
-jvAohyE3E8xOHJY2nPjWxw80OBx3vZDbtVN6QAARL3+ZYgWgdV0XAw+74bCfghIt
-3kDX+85Fgp4TE0B23hrVeuwUVZQgA2UmfqejYj0+58rHkDetONLB7S4ylN7qtH5K
-hnRs1z2mrGM0U31dHlQqCzqTd/dNIvHmp9OTF5pkLvXKGVQLtQzWsyH+8uJhdleU
-z7KOkDTK/4oZX6I//s4akBTP+me6uXqm0WuEikRRGQKBgQDih/n3ET/jOoUgyVAu
-1hDBC70J+5SC/Ky6ZWIMqXu036af7tMeOO/ldgtwOOHrQ3JMGQsoIgm0TjzIvrr6
-AYt00rJM7RRAJzi5oNqYxvAMiVu/ic5sFqj8jPa4Kbb6HLbgLj4jsbE6i9Wc7t1y
-NJYk4leA4Q0muGgCzfDHutQjrwKBgQDSkGjT1sSkvmzy7bFKTbVXdLWHbjQiVn41
-+hCIQqAGbCZEaj0S8WExBU1+nwHNZLE7XCXXURNJ9KPNYPmQ4452tH2uCz89NlSQ
-Tk1k7q/+OXZp7DsorUMGgJ7i+855IfBSeHTji9PXlHElS4gHKHTi2lYSYoTT6cfR
-wHNbGREWhQKBgBNcLafI6J3h5XjM27Z1Aw+MkkZlIuci8xwnB/8vCOyHZLUscwyV
-LyN8ODQKGHzD0ePhDAwNBKlNOnKpok81jJaaXzSl2mI1N+rdbXE7J07a+mVfQK4K
-Lb0PyxIoNoQfqh10tkjUqeHoC4STAYf+KIrUcUgJc9dIUVNUCGz5caHvAoGAendd
-UOBX7M2Ihl4ywFmkACK0Nfmlvtb5fyFbHjVJ55JdS2tS7EKR2bYQ1XVb0f8fibvV
-kn7oLhpobtpZLKj9QhNGCcUm2c5QrsGsB+k/WShIs+Ceo9Dp681BHBmChDd2FDFV
-Isc/xeHjUOK2Uht4qDx+1SCRysLs4hUBwtk4dBUCgYEAgULAZGfnWBjI4nQP0RYK
-Wpn7nDZ1G1eeh2lBx9/3YRe7w5jpB2gR0fh2S5beCzoQqQuSiDHRBWdyLtn1sZa+
-1lexq67VV2TOrUT/rCaU/31odKbSWtDJIkpw5Sp+36sp29eoKsus4mhBY/JDNcUg
-PIfpyiV3t4CNpA2wo7GoFYs=
------END PRIVATE KEY-----

+ 2 - 17
src/main/resources/config/application-test.yml

@@ -1,4 +1,4 @@
-# 机构版44测试服务器
+# 44测试服务器
 server:
   port: 8090
   address: 0.0.0.0
@@ -70,22 +70,7 @@ spring:
         max-idle: 8
         max-active: 8
         min-idle: 0
-#微信支付
-wx.pay:
-  # 商户号
-  mch-id: 1627594233
-  #商户api证书序列号
-  mch-serial-no: 25BB4D9C58F3D9FFCBC0F882B57F7E842CBE5A23
-  # 商户私钥文件
-  private-key-path: apiclient_key.pem
-  # API秘钥
-  api-v3-key: MentalHealth20191025JuemingTest1
-  # APPID
-  app-id: wxfee6e2d1588e3f7f
-  # 微信服务器地址
-  domain: https://api.mch.weixin.qq.com
-  # 接受结果回调地址
-  #notify-domain: http://49.232.26.44:8090
+
 
   is_lan: true
 #swagger 显示隐藏配置