Sfoglia il codice sorgente

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 4 anni fa
parent
commit
da8b861806
26 ha cambiato i file con 193 aggiunte e 254 eliminazioni
  1. 4 0
      common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java
  2. 5 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/AccountDO.java
  3. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/ActiveRecordDO.java
  4. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/TaskPatientDetailDO.java
  5. 4 1
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/PatientHospitalRecordDO.java
  6. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java
  7. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  8. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java
  9. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
  10. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanLogDO.java
  11. 4 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java
  12. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java
  13. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java
  14. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java
  15. 17 0
      common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java
  16. 6 0
      svr/svr-door-serivce/sql/初始sql.sql
  17. 13 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java
  18. 21 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  19. 33 14
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/HospitalService.java
  20. 2 5
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  21. 2 24
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/AccountService.java
  22. 2 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActiveRecordService.java
  23. 14 186
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java
  24. 5 7
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java
  25. 3 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java
  26. 12 0
      svr/svr-wlyy-specialist/src/main/resources/application.yml

+ 4 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java

@ -7,6 +7,7 @@ package com.yihu.jw.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
@ -14,6 +15,7 @@ import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.util.Date;
@ -73,6 +75,7 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
	}
	@Column(name = "create_user_name",updatable = false)
	@Convert(converter = StringFStringEncryptConverter.class)
	public String getCreateUserName() {
		return createUserName;
	}
@ -101,6 +104,7 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
	}
	@Column(name = "update_user_name")
	@Convert(converter = StringFStringEncryptConverter.class)
	public String getUpdateUserName() {
		return updateUserName;
	}

+ 5 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/AccountDO.java

@ -1,11 +1,9 @@
package com.yihu.jw.entity.health.bank;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@ -91,6 +89,7 @@ public class AccountDO extends UuidIdentityEntityWithOperator implements Seriali
        this.patientId = patientId;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAccountName() {
        return accountName;
    }
@ -124,6 +123,7 @@ public class AccountDO extends UuidIdentityEntityWithOperator implements Seriali
        this.usedTotal = usedTotal;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPassword() {
        return password;
    }
@ -132,6 +132,7 @@ public class AccountDO extends UuidIdentityEntityWithOperator implements Seriali
        this.password = password;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCardNumber() {
        return cardNumber;
    }

+ 3 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/ActiveRecordDO.java

@ -2,13 +2,11 @@ package com.yihu.jw.entity.health.bank;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@ -103,6 +101,7 @@ public class ActiveRecordDO extends UuidIdentityEntity implements Serializable {
        this.patientId = patientId;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;

+ 3 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/TaskPatientDetailDO.java

@ -1,11 +1,9 @@
package com.yihu.jw.entity.health.bank;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@ -121,6 +119,7 @@ public class TaskPatientDetailDO extends UuidIdentityEntityWithOperator implemen
        this.patientIdcard = patientIdcard;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientOpenid() {
        return patientOpenid;
    }

+ 4 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/PatientHospitalRecordDO.java

@ -1,8 +1,10 @@
package com.yihu.jw.entity.specialist;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -109,6 +111,7 @@ public class PatientHospitalRecordDO extends UuidIdentityEntityWithOperator impl
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -215,7 +218,7 @@ public class PatientHospitalRecordDO extends UuidIdentityEntityWithOperator impl
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java

@ -3,8 +3,10 @@ package com.yihu.jw.entity.specialist;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -27,6 +29,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
    private String doctor;//专科医生
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    private String doctorName;//专科医生姓名
    @Column(name = "patient")
@ -57,12 +60,14 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
    private String signDoctor;//签约医生
    @Column(name = "sign_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    private String signDoctorName;//签约医生
    @Column(name = "health_doctor")
    private String healthDoctor;//健康管理师
    @Column(name = "health_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    private String healthDoctorName;//健康管理师姓名
    @Column(name = "sign_year")
@ -138,6 +143,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -170,6 +176,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.signDoctor = signDoctor;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getSignDoctorName() {
        return signDoctorName;
    }
@ -186,6 +193,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.healthDoctor = healthDoctor;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getHealthDoctorName() {
        return healthDoctorName;
    }
@ -226,6 +234,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.healthAssistant = healthAssistant;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getHealthAssistantName() {
        return healthAssistantName;
    }
@ -323,6 +332,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -348,6 +358,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java

@ -1,8 +1,10 @@
package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -35,6 +37,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }

+ 5 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java

@ -2,10 +2,12 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -75,6 +77,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -115,6 +118,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.attendingDoctorCode = attendingDoctorCode;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAttendingDoctorName() {
        return attendingDoctorName;
    }
@ -171,6 +175,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }

+ 5 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java

@ -3,8 +3,10 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -115,6 +117,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
    }
    @Column(name = "name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getName() {
        return name;
    }
@ -238,6 +241,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -263,6 +267,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanLogDO.java

@ -2,7 +2,9 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -36,6 +38,7 @@ public class PatientRehabilitationPlanLogDO extends UuidIdentityEntity implement
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }

+ 4 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java

@ -2,8 +2,10 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -36,6 +38,7 @@ public class RehabilitationDetailAppointmentDO extends UuidIdentityEntity implem
    }
    @Column(name = "appointment_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAppointmentDoctorName() {
        return appointmentDoctorName;
    }
@ -81,6 +84,7 @@ public class RehabilitationDetailAppointmentDO extends UuidIdentityEntity implem
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }

+ 6 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -4,8 +4,10 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -152,6 +154,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -231,6 +234,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -256,6 +260,8 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 6 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java

@ -3,8 +3,10 @@ package com.yihu.jw.entity.specialist.rehabilitation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.util.StringFStringEncryptConverter;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@ -66,6 +68,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
    }
    @Column(name = "patient_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -84,6 +87,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -190,6 +194,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -215,6 +220,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java

@ -14,7 +14,7 @@ import javax.crypto.spec.SecretKeySpec;
 */
public class AesEncryptUtils {
    //可配置到Constant中,并读取配置文件注入,16位,自己定义
    private static final String KEY = "jkzl2021ZJXL*#%a";
    public static final String KEY = "jkzl2021ZJXL*#%a";
    //参数分别代表 算法名称/加密模式/数据填充方式
    private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding";

+ 17 - 0
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -445,6 +445,23 @@ public class DateUtil {
        }
    }
    /**
     * 得到一个时间延后或前移几天的时间,nowdate为时间,delay为前移或后延的天数
     */
    public static String getNextMin(String nowdate, int delay) {
        try {
            SimpleDateFormat format = new SimpleDateFormat(HH_MM);
            String mdate = "";
            Date d = strToDate(nowdate, HH_MM);
            long myTime = (d.getTime() / 1000) + delay * 60;
            d.setTime(myTime * 1000);
            mdate = format.format(d);
            return mdate;
        } catch (Exception e) {
            return "";
        }
    }
    /**
     * 得到一个时间延后或前移几天的时间,nowdate为时间,delay为前移或后延的天数
     */

+ 6 - 0
svr/svr-door-serivce/sql/初始sql.sql

@ -814,6 +814,12 @@ INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('42', NULL, 'FOLLOWUP_MANAGER_STATUS', '2', '1', '失管', '2', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('43', NULL, 'FOLLOWUP_MANAGER_STATUS', '2', '1', '拒管', '3', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('44', NULL, '350211A1002_org_work_time', 'startAm', '1', '08:00', '1', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('45', NULL, '350211A1002_org_work_time', 'stopAm', '2', '12:00', '2', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('46', NULL, '350211A1002_org_work_time', 'startPm', '3', '14:00', '3', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('47', NULL, '350211A1002_org_work_time', 'stopPm', '4', '20:00', '4', NULL);
CREATE TABLE `wlyy_followup_drugs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `followup_id` int(11) DEFAULT NULL COMMENT '随访ID',

+ 13 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -63,6 +63,19 @@ public class DoorOrderController extends BaseController {
    private JwDoorPrescriptionService jwDoorPrescriptionService;
    @PostMapping("/initDoorStatus")
    @ApiOperation(value = "获取医生分派订单开关状态")
    public String initDoorStatus() {
        try {
            doorOrderService.initDoorStatus();
            return success("成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败!" + e.getMessage());
        }
    }
    @GetMapping("/getDispatchOrderSwitch")
    @ApiOperation(value = "获取医生分派订单开关状态")
    public String getDispatchOrderSwitch(

+ 21 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -44,6 +44,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -1239,6 +1240,26 @@ public class DoorOrderService {
        doctorStatusDao.save(doctorSwitch);
    }
    public void initDoorStatus(){
        String sql = "SELECT * from base_doctor WHERE id not in ( " +
                "SELECT doctor from wlyy_door_doctor_status " +
                ")";
        List<BaseDoctorDO> doctorDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(BaseDoctorDO.class));
        List<WlyyDoorDoctorStatusDO> statusDOList = new ArrayList<>(doctorDOs.size());
        for (BaseDoctorDO baseDoctorDO:doctorDOs){
            WlyyDoorDoctorStatusDO doctorSwitch = new WlyyDoorDoctorStatusDO();
            doctorSwitch.setDoctor(baseDoctorDO.getId());
            doctorSwitch.setStatus(1);
            doctorSwitch.setCreateTime(new Date());
            doctorSwitch.setCreateUser("System");
            doctorSwitch.setCreateUserName("System");
            statusDOList.add(doctorSwitch);
        }
        doctorStatusDao.save(statusDOList);
    }
    /**
     * 更新调度员响应时间
     * @param orderId

+ 33 - 14
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/HospitalService.java

@ -1,12 +1,15 @@
package com.yihu.jw.door.service.common;
import com.yihu.jw.entity.base.system.SystemDictEntryDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -19,6 +22,8 @@ public class HospitalService {
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private WlyySystemDictService systemDictService;
    public List<Map<String, Object>> getDoctorsByhospitalNoPage(String hospital, String name, Integer type, Integer times) throws Exception {
/*        BaseOrgDO h = baseOrgDao.findByCode(hospital);
@ -68,17 +73,33 @@ public class HospitalService {
    public List<String> getWorkingTimeByPatient(String code) throws Exception {
        List<String> result = new ArrayList<>();
/*        BaseOrgDO h = baseOrgDao.findByCode(code);
        String startWorkingTimeAm = null ;
        String stopWorkingTimeAm = null ;
        String startWorkingTimePm = null ;
        String stopWorkingTimePm = null;
                List<SystemDictEntryDO> systemDictEntryDOList = systemDictService.getDictByDictName("350211A1002_org_work_time");
        for (SystemDictEntryDO dictEntryDO:systemDictEntryDOList){
            if("startAm".equals(dictEntryDO.getCode())){
                startWorkingTimeAm = dictEntryDO.getValue();
            }else  if("stopAm".equals(dictEntryDO.getCode())){
                stopWorkingTimeAm = dictEntryDO.getValue();
            }else  if("startPm".equals(dictEntryDO.getCode())){
                startWorkingTimePm = dictEntryDO.getValue();
            }else  if("stopPm".equals(dictEntryDO.getCode())){
                stopWorkingTimePm = dictEntryDO.getValue();
            }
        }
        long nd = 1000 * 24 * 60 * 60;
        long nh = 1000 * 60 * 60;
        long nm = 1000 * 60;
        int amCount = 0;
        //获取机构早上上班时间
        if(StringUtils.isNotBlank(h.getStartWorkingTimeAm()) && StringUtils.isNotBlank(h.getStopWorkingTimeAm())) {
            String startWorkTime = h.getStartWorkingTimeAm();
            String stopWokingTime = h.getStopWorkingTimeAm();
            Date startWokingTimeAm = DateUtil.strToDate(h.getStartWorkingTimeAm(), "HH:mm");
            Date stopWokingTimeAm = DateUtil.strToDate(h.getStopWorkingTimeAm(), "HH:mm");
        if(StringUtils.isNotBlank(startWorkingTimeAm) && StringUtils.isNotBlank(stopWorkingTimeAm)) {
            String startWorkTime = startWorkingTimeAm;
            String stopWokingTime = stopWorkingTimeAm;
            Date startWokingTimeAm = DateUtil.strToDate(startWorkingTimeAm, "HH:mm");
            Date stopWokingTimeAm = DateUtil.strToDate(stopWorkingTimeAm, "HH:mm");
            long diff = stopWokingTimeAm.getTime() - startWokingTimeAm.getTime();
            // 计算差多少分钟
@ -88,20 +109,18 @@ public class HospitalService {
                //判断是否是最后一段时间
                if(amCount - i > 1) {
                    result.add(startWorkTime + "-" + DateUtil.getNextMin(startWorkTime, 30));
//                    map.put(i, startWorkTime + "-" + DateUtil.getNextMin(startWorkTime, 30));
                    startWorkTime = DateUtil.getNextMin(startWorkTime, 30);
                }else {
                    result.add(startWorkTime + "-" + stopWokingTime);
//                            map.put(i, startWorkTime + "-" + stopWokingTime);
                }
            }
        }
        //获取机构下午上班时间
        if(StringUtils.isNotBlank(h.getStartWorkingTimePm()) && StringUtils.isNotBlank(h.getStopWorkingTimePm())) {
            String startWorkTime = h.getStartWorkingTimePm();
            String stopWokingTime = h.getStopWorkingTimePm();
            Date startWokingTimePm = DateUtil.strToDate(h.getStartWorkingTimePm(), "HH:mm");
            Date stopWokingTimePm = DateUtil.strToDate(h.getStopWorkingTimePm(), "HH:mm");
        if(StringUtils.isNotBlank(startWorkingTimePm) && StringUtils.isNotBlank(stopWorkingTimePm)) {
            String startWorkTime = startWorkingTimePm;
            String stopWokingTime = stopWorkingTimePm;
            Date startWokingTimePm = DateUtil.strToDate(startWorkingTimePm, "HH:mm");
            Date stopWokingTimePm = DateUtil.strToDate(stopWorkingTimePm, "HH:mm");
            long diff = stopWokingTimePm.getTime() - startWokingTimePm.getTime();
            // 计算差多少分钟
@ -116,7 +135,7 @@ public class HospitalService {
                    result.add(startWorkTime + "-" + stopWokingTime);
                }
            }
        }*/
        }
        return result;
    }

+ 2 - 5
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -5,8 +5,8 @@ import com.yihu.iot.dao.equipment.IotEquipmentDetailDao;
import com.yihu.iot.util.conceal.ConcealUtil;
import com.yihu.iot.util.excel.EntityUtils;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.datainput.Data;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import iot.device.LocationDataVO;
@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.sql.*;
import java.util.*;
import java.util.Date;
@Service
public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, IotEquipmentDetailDao> {
@ -202,7 +199,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName(ConcealUtil.nameOrAddrConceal(jsobj.get("name").toString()));
            locationDataVO.setCode(null);
            locationDataVO.setEquimentName((String) jsobj.get("equimentName"));
            locationDataVO.setEquimentName(AesEncryptUtils.decrypt(jsobj.get("equimentName").toString()));
            result.add(locationDataVO);
        }
        return result;

+ 2 - 24
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/AccountService.java

@ -9,6 +9,7 @@ import com.yihu.jw.entity.health.bank.AccountDO;
import com.yihu.jw.entity.health.bank.TaskDO;
import com.yihu.jw.entity.health.bank.TaskPatientDetailDO;
import com.yihu.jw.entity.health.bank.TaskRuleDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.DateUtils;
@ -315,32 +316,9 @@ public class AccountService extends BaseJpaService<AccountDO,AccountDao> {
        }
        buffer.append(") ");
       /* StringBuffer buffer1 = new StringBuffer();//设备类型
        buffer1.append("(");
        if (deviceTypes == null || deviceTypes.size() == 0){
            buffer1.append("''");
        }else {
            for (int i=0;i<deviceTypes.size();i++){
                buffer1.append("'"+deviceTypes.get(i)+"'").append(",");
            }
            buffer1.deleteCharAt(buffer1.length()-1);
        }
        buffer1.append(")");
        String sql1 = null ;
        if (bindStatus == -1){
            sql1 = "( SELECT btpd.patient_id AS patient_id FROM " +
                    "  wlyy_health_bank_task_patient_detail btpd " +
                    " LEFT JOIN wlyy_health_bank_task bt ON bt.id = btpd.task_id WHERE " +
                    " bt.task_code NOT IN "+buffer1+" and "+buffer+")";
        }else if (bindStatus == 1){
            sql1 = "( SELECT btpd.patient_id AS patient_id FROM " +
                    "  wlyy_health_bank_task_patient_detail btpd " +
                    " LEFT JOIN wlyy_health_bank_task bt ON bt.id = btpd.task_id WHERE " +
                    " bt.task_code IN "+buffer1 +" and "+buffer+")";
        }*/
        String sql =
                "SELECT ba1.patient_id AS patient_id," +
                        "ba1.account_name AS account_name," +
                        "AES_DECRYPT(from_base64(ba1.account_name,"+ AesEncryptUtils.KEY+") AS account_name," +
                        "ba1.hospital AS hospital," +
                        "ba1.total AS total," +
                        "ba1.create_time AS create_time," +

+ 2 - 2
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActiveRecordService.java

@ -8,6 +8,7 @@ import com.yihu.jw.dao.TaskDao;
import com.yihu.jw.entity.health.bank.ActiveRecordDO;
import com.yihu.jw.entity.health.bank.ActivityDO;
import com.yihu.jw.entity.health.bank.TaskDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@ -65,10 +66,9 @@ public class ActiveRecordService extends BaseJpaService<ActiveRecordDO, ActiveRe
        Map<String,Object> result = jdbcTemplate.queryForMap(sql);
        activeRecordDO.setPatientId(patientId);
        if(result!=null){
            activeRecordDO.setPatientName(result.get("name")+"");
            activeRecordDO.setPatientName(AesEncryptUtils.decrypt(result.get("name")+""));
        }
        String sql2 = "select f.* from wlyy.wlyy_sign_family f where f.patient='"+patientId+"' and f.status=1 and f.expenses_status=1";
//        Map<String,Object> result2 = jdbcTemplate.queryForMap(sql2);
        List<Map<String, Object>> result2 = jdbcTemplate.queryForList(sql2);
        if(result2!=null&&result2.size()>0){
            activeRecordDO.setTeamId(result2.get(0).get("admin_team_code")!=null?(Integer)result2.get(0).get("admin_team_code"):null);;

+ 14 - 186
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java

@ -5,11 +5,9 @@ package com.yihu.jw.service;/**
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Joiner;
import com.netflix.discovery.util.StringUtil;
import com.yihu.jw.dao.*;
import com.yihu.jw.entity.health.bank.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.DateUtils;
@ -22,7 +20,6 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.RollbackException;
import javax.transaction.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -276,8 +273,11 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
            }
            activityDO1.setTotal(count);
            String taskSql1 = "select * from wlyy_health_bank_task_patient_detail btpd where activity_id = '"+activityDO1.getId()
                    +"' and (patient_idcard = '"+activityDO.getPatientIdcard()+"' OR union_id = '"+activityDO.getUnionId()+"')";
                    +"' and (patient_idcard = '"+ AesEncryptUtils.encrypt(activityDO.getPatientIdcard())+"' OR union_id = '"+activityDO.getUnionId()+"')";
            List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(taskSql1,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
            for (TaskPatientDetailDO taskPatientDetailDO : taskPatientDetailDOS){
                taskPatientDetailDO.setPatientIdcard(AesEncryptUtils.decrypt(taskPatientDetailDO.getPatientIdcard()));
            }
            activityDO1.setTaskPatientDetailDOS(taskPatientDetailDOS);
            String tasksql = "select * from wlyy_health_bank_task where transaction_id = '"+activityDO1.getId()+"'";
            List<TaskDO> taskDOList = jdbcTemplate.query(tasksql,new BeanPropertyRowMapper(TaskDO.class));
@ -407,7 +407,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                " SELECT task_id FROM " +
                "wlyy_health_bank_task_patient_detail" +
                " WHERE " +
                " patient_idcard = '"+activityDO.getPatientIdcard()+"' "+ condition+")" +
                " patient_idcard = '"+ AesEncryptUtils.encrypt(activityDO.getPatientIdcard()) +"' "+ condition+")" +
                " ) AND del_flag =1 " +condition1+" order by create_time DESC "+
                " LIMIT "+(page-1)*size +","+size;
        List<ActivityDO> activityDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ActivityDO.class));
@ -423,7 +423,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                    " wlyy_health_bank_task_patient_detail " +
                    "GROUP BY patient_openid,patient_idcard,union_id)btpd1 " +
                    "WHERE " +
                    " btpd1.activity_id = '"+activityDO1.getId() +"' AND patient_openid = '"+activityDO.getOpenId()+ "' AND patient_idcard = '"+activityDO.getPatientIdcard()+"' "+condition;
                    " btpd1.activity_id = '"+activityDO1.getId() +"' AND patient_openid = '"+activityDO.getOpenId()+ "' AND patient_idcard = '"+AesEncryptUtils.encrypt(activityDO.getPatientIdcard())+"' "+condition;
            List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(activitySql);
            Long count = 0L;
            if(rstotal!=null&&rstotal.size()>0){
@ -478,7 +478,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                " SELECT task_id FROM " +
                "wlyy_health_bank_task_patient_detail" +
                " WHERE " +
                " patient_openid = '"+activityDO.getOpenId()+ "' AND patient_idcard = '"+activityDO.getPatientIdcard()+"'"+condition+ ")" +
                " patient_openid = '"+activityDO.getOpenId()+ "' AND patient_idcard = '"+AesEncryptUtils.encrypt(activityDO.getPatientIdcard())+"'"+condition+ ")" +
                " ) "+condition1;
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlcount);
        Long count = 0L;
@ -733,7 +733,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                "ORDER BY " +
                " btpd.couponTotal DESC,btpd.create_time ASC LIMIT " + (page-1)*size+","+size;
        List<TaskPatientDetailDO> patientDetailDOS1 = jdbcTemplate.query(sqlCoupon,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
        long count2 = 1l;
        long count2 = 1L;
        int i=0;
        for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS1){
            String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
@ -751,26 +751,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
            taskPatientDetailDO.setExchangeGoodsDO(exchangeGoodsDOS);
            taskPatientDetailDO.setTimeSeparated(timeSeparated);
        }
        //活动总积分排名
        /*String rankingSql1 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(total) AS sum , " +
                " patient_id, " +
                " activity_id, " +
                " create_time "+
                " FROM " +
                " wlyy_health_bank_task_patient_detail htpd " +
                " where htpd.activity_id ='"+activityId+"' AND htpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE " +
                " btpd1.sum >= (SELECT SUM(s.total) as total " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"') " +
                " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal1 = jdbcTemplate.queryForList(rankingSql1);
        Long count = 0L;
        if(rstotal1!=null&&rstotal1.size()>0){
            count = (Long) rstotal1.get(0).get("total");
        }*/
        Long countTotal = 0L;
        if ((count-2)>=0){
            countTotal = (count-2);
@ -801,28 +782,6 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
            total1 = Integer.parseInt( rstotal10.get(0).get("total").toString());
        }
        //总活动劵的排名
        /*String rankingSql2 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(coupon_total) AS sum , " +
                " patient_id, " +
                " activity_id," +
                " create_time " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail htpd WHERE htpd.activity_id ='"+activityId+"' AND htpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE " +
                "   btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')"+
                " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')";
        List<Map<String,Object>> rstotal2 = jdbcTemplate.queryForList(rankingSql2);
        Long count2 = 0L;
        if(rstotal2!=null&&rstotal2.size()>0){
            count2 = (Long) rstotal2.get(0).get("total");
        }*/
        Long countTotal1 = 0L;
        if ((count2-2)>=0){
            countTotal1=(count2-2);
@ -930,7 +889,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                "ORDER BY " +
                " btpd.couponTotal DESC )btpd1 WHERE  btpd1.patientId IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.street = '"+street+"') ORDER BY btpd1.create_time ";
        List<TaskPatientDetailDO> patientDetailDOS4 = jdbcTemplate.query(rankingSql5,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
        long count5 = 1l;
        long count5 = 1L;
        for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS4){
            String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
            String goodsSql = "select * from wlyy_health_bank_exchange_goods where patient_id ='"+taskPatientDetailDO.getPatientId()+"' " +
@ -955,7 +914,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                "ORDER BY " +
                " btpd.couponTotal DESC )btpd1 WHERE  btpd1.patientId IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.town = '"+town+"') ORDER BY btpd1.create_time ";
        List<TaskPatientDetailDO> patientDetailDOS5 = jdbcTemplate.query(rankingSql6,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
        long count6 = 1l;
        long count6 = 1L;
        for (TaskPatientDetailDO taskPatientDetailDO:patientDetailDOS5){
            String timeSeparated = DateUtils.getDatePoor(new Date(),taskPatientDetailDO.getUpdateTime());
            String goodsSql = "select * from wlyy_health_bank_exchange_goods where patient_id ='"+taskPatientDetailDO.getPatientId()+"' " +
@ -991,85 +950,6 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
            count11 =  new Double((Double) maps1.get(0).get("rank")).longValue();
        }
        //街道排名
       /* String rankingSql3 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(btpd.coupon_total) AS sum , " +
                " btpd.patient_id, " +
                " btpd.activity_id," +
                " create_time " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE  btpd1.patient_id IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.street = '"+street+"') AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')"+
                " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal3 = jdbcTemplate.queryForList(rankingSql3);
        Long count3 = 0L;
        if(rstotal3!=null&&rstotal3.size()>0){
            count3 = (Long) rstotal3.get(0).get("total");
        }*/
        //区排名
       /* String rankingSql4 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(btpd.coupon_total) AS sum , " +
                " btpd.patient_id, " +
                " btpd.activity_id," +
                " create_time  " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE  btpd1.patient_id IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.town = '"+town+"') AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')"+
                " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal4 = jdbcTemplate.queryForList(rankingSql4);
        Long count4 = 0L;
        if(rstotal4!=null&&rstotal4.size()>0){
            count4= (Long) rstotal4.get(0).get("total");
        }*/
        //积分
        //街道排名
        /*String rankingSql5 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(btpd.total) AS sum , " +
                " btpd.patient_id, " +
                " btpd.activity_id," +
                " create_time  " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE  btpd1.patient_id IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.street = '"+street+"') AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')"+
                " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal5 = jdbcTemplate.queryForList(rankingSql5);
        Long count5 = 0L;
        if(rstotal5!=null&&rstotal5.size()>0){
            count5 = (Long) rstotal5.get(0).get("total");
        }
        //区排名
        String rankingSql6 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(btpd.total) AS sum , " +
                " btpd.patient_id, " +
                " btpd.activity_id," +
                " create_time " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail btpd WHERE btpd.activity_id ='"+activityId+"' AND btpd.patient_id !='"+patient+
                "' GROUP BY patient_id )btpd1 " +
                "WHERE " +
                " btpd1.activity_id = '"+activityDO.getId()+"' and  btpd1.patient_id IN(SELECT p.code FROM wlyy.wlyy_patient p WHERE p.town = '"+town+"') AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')"
                + " AND btpd1.create_time >=(SELECT s.create_time " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal6 = jdbcTemplate.queryForList(rankingSql6);
        Long count6 = 0L;
        if(rstotal6!=null&&rstotal6.size()>0){
            count6= (Long) rstotal6.get(0).get("total");
        }
*/
        //活动劵团队排名
        String rankingSql7 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(btpd.coupon_total) AS sum , " +
@ -1110,56 +990,6 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
            count8 = (Long) rstotal8.get(0).get("total");
        }
      /*  //活动劵
        String rankingSql4 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(coupon_total) AS sum , " +
                " patient_id, " +
                " activity_id " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail " +
                "GROUP BY patient_id )btpd1 " +
                "WHERE " +
                " btpd1.activity_id = '"+activityDO.getId()+"'"+buffer+" AND btpd1.sum >= (SELECT SUM(s.coupon_total) as couponTotal " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal4 = jdbcTemplate.queryForList(rankingSql4);
        Long count4 = 0L;
        if(rstotal4!=null&&rstotal4.size()>0){
            count4= (Long) rstotal4.get(0).get("total");
        }
        //积分
        String rankingSql5 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(total) AS sum , " +
                " patient_id, " +
                " activity_id " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail " +
                "GROUP BY patient_id )btpd1 " +
                "WHERE " +
                " btpd1.activity_id = '"+activityDO.getId()+"'"+buffer+" AND btpd1.sum >= (SELECT SUM(s.total) as total " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal5 = jdbcTemplate.queryForList(rankingSql5);
        Long count5 = 0L;
        if(rstotal5!=null&&rstotal5.size()>0){
            count5 = (Long) rstotal5.get(0).get("total");
        }
        String rankingSql6 = "SELECT count(1)+1 AS total FROM (SELECT " +
                " SUM(total) AS sum , " +
                " patient_id, " +
                " activity_id " +
                "FROM " +
                " wlyy_health_bank_task_patient_detail " +
                "GROUP BY patient_id )btpd1 " +
                "WHERE " +
                " btpd1.activity_id = '"+activityDO.getId()+"'"+buffer+" AND btpd1.sum >= (SELECT SUM(s.total) as total " +
                "FROM  wlyy_health_bank_task_patient_detail s WHERE s.patient_id ='"+patient+"' AND  s.activity_id='"+activityId+"')" ;
        List<Map<String,Object>> rstotal6 = jdbcTemplate.queryForList(rankingSql6);
        Long count6 = 0L;
        if(rstotal6!=null&&rstotal6.size()>0){
            count6= (Long) rstotal6.get(0).get("total");
        }*/
        ActivityRuleDO activityRuleDO = activityRuleDao.selectByActivityId(activityId);
        JSONObject object = JSONObject.parseObject(activityRuleDO.getValue1());
        Integer type = object.getInteger("type");
@ -1236,8 +1066,6 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
        stringBuffer.append(" order by create_time desc");
        String sql = "SELECT * FROM wlyy_health_bank.wlyy_health_bank_activity  WHERE 1=1 AND del_flag=1 "+stringBuffer.toString()+" LIMIT "+(page-1)*size+","+size;
        List<ActivityDO> activityDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ActivityDO.class));
        String sqlcount = "SELECT COUNT(1)  AS total  FROM wlyy_health_bank.wlyy_health_bank_activity  WHERE 1=1 AND del_flag=1 "+stringBuffer.toString();
@ -1292,7 +1120,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
     */
    public MixEnvelop<ActivityDO,ActivityDO> selectByUnionId(String unionId,String patient,String idCard,Integer page,Integer size){
        String sql ="select hba.* from wlyy_health_bank_activity hba right join wlyy_health_bank_task_patient_detail htpd on htpd.activity_id=hba.id " +
                "AND htpd.union_id='"+unionId+"' AND  htpd.patient_id ='"+patient+"' and htpd.patient_idcard ='"+idCard+"' " +
                "AND htpd.union_id='"+unionId+"' AND  htpd.patient_id ='"+patient+"' and htpd.patient_idcard ='"+ AesEncryptUtils.encrypt(idCard)+"' " +
                "where hba.del_flag=1 and hba.type='竞走' order by hba.create_time desc LIMIT " + (page-1)*size+","+size;
        List<ActivityDO> activityDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ActivityDO.class));
        for (ActivityDO activityDO:activityDOList){
@ -1361,7 +1189,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
     */
    public List<ActivityDO> selectNowByUnionId(String unionId,String patient,String idCard){
        String sql ="select hba.* from wlyy_health_bank_activity hba right join wlyy_health_bank_task_patient_detail htpd on htpd.activity_id=hba.id " +
                "AND htpd.union_id='"+unionId+"' AND  htpd.patient_id ='"+patient+"' and htpd.patient_idcard ='"+idCard+"' " +
                "AND htpd.union_id='"+unionId+"' AND  htpd.patient_id ='"+patient+"' and htpd.patient_idcard ='"+AesEncryptUtils.encrypt(idCard) +"' " +
                "where hba.del_flag=1 and hba.type='竞走' order by hba.create_time desc " ;
        List<ActivityDO> activityDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ActivityDO.class));
        List<ActivityDO> activityDOS = new ArrayList<>();

+ 5 - 7
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.*;
import com.yihu.jw.entity.health.bank.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.DateUtils;
@ -14,18 +15,15 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.print.DocFlavor;
import javax.transaction.Transactional;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@ -278,7 +276,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
        buffer.append(") ");
        String sql =
                "SELECT ba1.patient_id AS patient_id," +
                        "ba1.account_name AS account_name," +
                        "AES_DECRYPT(from_base64(ba1.account_name,"+ AesEncryptUtils.KEY+") AS account_name," +
                        "ba1.hospital AS hospital," +
                        "ba1.total AS total," +
                        "ba1.create_time AS create_time," +
@ -750,7 +748,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                    }
            }
            String sql1 = "select * from wlyy_health_bank_task_patient_detail where task_id = '"+taskDO1.getId()+"' " +
                    "AND patient_idcard = '"+idCard+"' AND patient_openid = '"+openId+"' AND union_id = '"+unionId+"'";
                    "AND patient_idcard = '"+AesEncryptUtils.encrypt(idCard)+"' AND patient_openid = '"+openId+"' AND union_id = '"+unionId+"'";
            List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
            TaskPatientDetailDO taskPatientDetailDO1 = new TaskPatientDetailDO();
            if (taskPatientDetailDOS.isEmpty() && taskPatientDetailDOS.size() == 0){
@ -916,7 +914,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                    creditsDetailDO.setAccountId(accountDOS.get(0).getId());
                }
                String sql1 = "select *  from wlyy_health_bank_task_patient_detail where "+
                        " patient_idcard = '"+creditsDetailDO.getIdCard()+"' AND union_id = '"+creditsDetailDO.getUnionId()+"' AND task_id = '"+creditsDetailDO.getTransactionId()+"'";
                        " patient_idcard = '"+AesEncryptUtils.encrypt(creditsDetailDO.getIdCard())+"' AND union_id = '"+creditsDetailDO.getUnionId()+"' AND task_id = '"+creditsDetailDO.getTransactionId()+"'";
                List<TaskPatientDetailDO> taskPatientDetailDOList = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
                if(taskPatientDetailDOList == null || taskPatientDetailDOList.size()==0){
                    throw new Exception("该居民参与活动查不到!");
@ -1806,7 +1804,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql1);
                String idcard = null;
                if (maps!=null&&maps.size()!=0){
                    idcard = maps.get(0).get("idcard").toString();
                    idcard = AesEncryptUtils.decrypt(maps.get(0).get("idcard").toString());
                    accountDO.setIdCard(idcard);
                }
                TaskDO taskDO = taskDao.selectById("5e5d857d684d77f201684d7f58b3000a132");

+ 3 - 2
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java

@ -7,6 +7,7 @@ import com.yihu.jw.dao.ActivityDao;
import com.yihu.jw.dao.TaskDao;
import com.yihu.jw.dao.TaskPatientDetailDao;
import com.yihu.jw.entity.health.bank.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.bank.HealthBankMapping;
import com.yihu.jw.util.ISqlUtils;
@ -150,7 +151,7 @@ public class TaskPatientDtailService extends BaseJpaService<TaskPatientDetailDO,
        logger.info("openId:"+openId+"idCard:"+idCard+"unionId:"+unionId+"taskCode:"+taskCode);
        String sql ="select * from wlyy_health_bank_task_patient_detail where " +
                " (patient_idcard = '"+idCard+"' OR union_id ='"+unionId+"') AND task_id IN " +
                " (patient_idcard = '"+ AesEncryptUtils.encrypt(idCard)+"' OR union_id ='"+unionId+"') AND task_id IN " +
                "(select id from wlyy_health_bank_task where task_code = '"+taskCode+"' )";
        List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
        logger.info("参与信息:"+taskPatientDetailDOS);
@ -166,7 +167,7 @@ public class TaskPatientDtailService extends BaseJpaService<TaskPatientDetailDO,
        logger.info("openId:"+openId+"idCard:"+idCard+"unionId:"+unionId+"taskCode:"+taskId);
        String sql ="select * from wlyy_health_bank_task_patient_detail where " +
                " (patient_idcard = '"+idCard+"' OR union_id ='"+unionId+"') AND task_id = '"+taskId+"'" ;
                " (patient_idcard = '"+AesEncryptUtils.encrypt(idCard)+"' OR union_id ='"+unionId+"') AND task_id = '"+taskId+"'" ;
        List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(TaskPatientDetailDO.class));
        logger.info("参与信息:"+taskPatientDetailDOS);
        return taskPatientDetailDOS.get(0);

+ 12 - 0
svr/svr-wlyy-specialist/src/main/resources/application.yml

@ -104,6 +104,8 @@ im:
  #im_list_get: http://192.168.131.24:3000/
  data_base_name: ichat
encrypt:
  key: jkzl2021ZJXL*#%a
---
spring:
  profiles: jwtest
@ -140,6 +142,8 @@ im:
  im_list_get: http://172.26.0.118:3000/
  data_base_name: im_new
encrypt:
  key: jkzl2021ZJXL*#%a
---
spring:
  profiles: iotyanshi
@ -176,6 +180,8 @@ im:
  im_list_get: http://172.26.0.191:3000/
  data_base_name: im_new
encrypt:
  key: jkzl2021ZJXL*#%a
---
spring:
  profiles: jwdevtest
@ -211,6 +217,9 @@ wechat:
im:
  im_list_get: http://172.26.0.118:3000/
  data_base_name: im_new
encrypt:
  key: jkzl2021ZJXL*#%a
---
spring:
  profiles: prod
@ -246,3 +255,6 @@ wechat:
im:
  im_list_get: http://27.155.101.77:3000/
  data_base_name: im
encrypt:
  key: jkzl2021ZJXL*#%a