Forráskód Böngészése

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

liubing 4 éve
szülő
commit
98980f2c9f
29 módosított fájl, 366 hozzáadás és 272 törlés
  1. 1 0
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  2. 13 3
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  4. 20 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 17 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  6. 48 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  7. 71 0
      business/base-service/src/main/java/com/yihu/jw/utils/FileUtil.java
  8. 1 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  9. 5 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/AccountDO.java
  10. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/ActiveRecordDO.java
  11. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/TaskPatientDetailDO.java
  12. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java
  13. 17 0
      common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java
  14. 12 0
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  15. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  16. 10 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java
  17. 6 0
      svr/svr-door-serivce/sql/初始sql.sql
  18. 13 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java
  19. 21 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  20. 33 14
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/HospitalService.java
  21. 14 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  22. 0 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  23. 28 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  24. 1 5
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  25. 2 24
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/AccountService.java
  26. 2 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActiveRecordService.java
  27. 14 186
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java
  28. 5 7
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java
  29. 3 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -576,6 +576,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                wlyyChargeDictDO.setCreateTime(new Date());
                wlyyChargeDictDO.setReqFee(chargeFee);
                wlyyChargeDictDO.setChargeType(fee+"");
                wlyyChargeDictDO.setDeptTypeCode("6");
                wlyyChargeDictDO.setChargeName(doctorName+"创建的号别");
                wlyyChargeDictDO = wlyyChargeDictDao.save(wlyyChargeDictDO);
                return  wlyyChargeDictDO.getChargeType();

+ 13 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -91,6 +91,18 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        String birth = "";
        String yktFamilyId = "";
        int sex=3;
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        if (list!=null&&list.size()>0){
            if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
                return  mixEnvelop;
            }
        }else {
            basePatientDO.setMobile(phoneNum);
        }
        //获取his家属数据
        JSONArray jsonArray = new JSONArray();
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
@ -264,9 +276,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        result.setPatient(patientId);
        result.setCardNo(idCard);
        result.setCardType(cardType);
        //保存到base_patient表中
        //basePatientDO.setMobile(phoneNum);
        //保存到base_patient表
        basePatientDO.setName(familyName);
        basePatientDO.setIdcard(idCard);
        basePatientDO.setRegister("0");

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -15,7 +15,7 @@ import java.util.List;
 */
public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatientDO, String>, JpaSpecificationExecutor<WlyyOutpatientDO> {
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.outpatientType <> '3' and a.status in(0,1)")
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.outpatientType <> '3' and a.outpatientType <> '4' and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientList(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and  a.outpatientType = '3' and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientAndDoctorList(String patient);

+ 20 - 6
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1952,12 +1952,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        //下载银医通
        net.sf.json.JSONObject object1 = entranceService.qutpatientBalance(outpatientDO.getCardNo(), demoFlag);
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        if (doctorDO == null) {
            throw new RuntimeException("未找到医生信息");
        }
        logger.info("下载银医通");
        String chargeType = null;
        if (StringUtils.isNoneBlank(outpatientDO.getChargeType())){
            if (outpatientDO.getChargeType().equalsIgnoreCase("33")){
                chargeType = outpatientDO.getChargeType();
            }
        String chargeType = "";
        if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwfzChargeType();
        }else if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpfzChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getJyzxChargeType();
        }else if ("2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
            chargeType = doctorDO.getXtfzChargeType();
        }else {
            chargeType = doctorDO.getChargeType();
        }
        net.sf.json.JSONObject rs = entranceService.BS10111(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), chargeType, outpatientDO.getWinNo(), demoFlag);
        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
@ -10135,7 +10149,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        BaseDoctorDO doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
        outpatientDO.setMjz("mz");
        outpatientDO.setStatus("1");
        outpatientDO.setStatus("3");
        outpatientDO.setCreateTime(new Date());
        outpatientDO.setIdcard(patientDO.getIdcard());
        outpatientDO.setCreateTime(new Date());

+ 17 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java

@ -123,7 +123,23 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                courierflag="Y";
            }
        }
        JSONObject res =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType(),courierflag);
        String chargeType = "";
        if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwfzChargeType();
        }else if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpfzChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getJyzxChargeType();
        }else if ("2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
            chargeType = doctorDO.getXtfzChargeType();
        }else {
            chargeType = doctorDO.getChargeType();
        }
        JSONObject res =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType,courierflag);
        JSONObject result = new JSONObject();
        logger.info("挂号结果 res: " + res.toString());
        String rsCode = "";

+ 48 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -47,6 +47,10 @@ import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.FileUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
@ -121,6 +125,9 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Value("${demo.flag}")
@ -913,4 +920,45 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    public String saveVideoFile(String vip){
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("YXAPPKEY");
        WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("YXAPPSECRET");
        if (sysDictDO==null){
            return  "找不到对应的key";
        }
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://vcloud.163.com/app/vod/video/get";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
        httpPost.put("Nonce", nonce);
        httpPost.put("CurTime", curTime);
        httpPost.put("CheckSum", checkSum);
        httpPost.put("Content-Type", "application/json");
        JSONObject object = new JSONObject();
        object.put("vid",vip);
        logger.info("入参"+object.toJSONString());
        String response = httpClientUtil.postBodyHead(url,object,httpPost);
        logger.info("返回日志"+response);
        if(StringUtils.isNoneBlank(response)){
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                JSONObject object1 = jsonObject.getJSONObject("ret");
                String vedioUrl =object1.getString("origUrl");
                String vedioName = object1.getString("videoName");
                String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
                logger.info("filePath:"+filePath);
                logger.info("vedioUrl"+vedioUrl);
                FileUtil.saveUrlAs(vedioUrl,filePath,"GET",vedioName);
            }
        }
        return null;
    }
}

+ 71 - 0
business/base-service/src/main/java/com/yihu/jw/utils/FileUtil.java

@ -3,7 +3,10 @@ package com.yihu.jw.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.MappedByteBuffer;
import java.security.AccessController;
import java.security.PrivilegedAction;
@ -44,4 +47,72 @@ public class FileUtil {
            e.printStackTrace();
        }
    }
    /**
     * @从制定URL下载文件并保存到指定目录
     * @param filePath 文件将要保存的目录
     * @param method 请求方法,包括POST和GET
     * @param url 请求的路径
     * @return
     */
    public static File saveUrlAs(String url, String filePath, String method,String fileName){
        //System.out.println("fileName---->"+filePath);
        //创建不同的文件夹目录
        File file=new File(filePath);
        //判断文件夹是否存在
        if (!file.exists())
        {
            //如果文件夹不存在,则创建新的的文件夹
            file.mkdirs();
        }
        FileOutputStream fileOut = null;
        HttpURLConnection conn = null;
        InputStream inputStream = null;
        try
        {
            // 建立链接
            URL httpUrl=new URL(url);
            conn=(HttpURLConnection) httpUrl.openConnection();
            //以Post方式提交表单,默认get方式
            conn.setRequestMethod(method);
            conn.setDoInput(true);
            conn.setDoOutput(true);
            // post方式不能使用缓存
            conn.setUseCaches(false);
            //连接指定的资源
            conn.connect();
            //获取网络输入流
            inputStream=conn.getInputStream();
            BufferedInputStream bis = new BufferedInputStream(inputStream);
            //判断文件的保存路径后面是否以/结尾
            if (!filePath.endsWith("/")) {
                filePath += "/";
            }
            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
            fileOut = new FileOutputStream(filePath+fileName);
            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
            byte[] buf = new byte[4096];
            int length = bis.read(buf);
            //保存文件
            while(length != -1)
            {
                bos.write(buf, 0, length);
                length = bis.read(buf);
            }
            bos.close();
            bis.close();
            conn.disconnect();
        } catch (Exception e)
        {
            e.printStackTrace();
            System.out.println("抛出异常!!");
        }
        return file;
    }
}

+ 1 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -3111,7 +3111,7 @@ public class ImService {
			participants.put(patientCode,0);
			BasePatientDO basePatientDO = basePatientDao.findById(patientCode);
			String patientSex = "";
			if(1 == basePatientDO.getSex()){
			if(basePatientDO.getSex()!=null&&1 == basePatientDO.getSex()){
				patientSex= "男";
			}else{
				patientSex= "女";

+ 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;
    }

+ 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为前移或后延的天数
     */

+ 12 - 0
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -240,6 +240,18 @@ public class HttpClientUtil {
        String ret = restTemplate.postForObject(url, formEntity, String.class);
        return ret;
    }
    public static String postBodyHead(String url, com.alibaba.fastjson.JSONObject params, Map<String, Object> headerMap) {
        RestTemplate restTemplate = new RestTemplate();
        HttpHeaders headers = new HttpHeaders();
        for(String str:headerMap.keySet()){
            headers.add(str,headerMap.get(str).toString());
        }
        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
        String ret = restTemplate.postForObject(url, formEntity, String.class);
        return ret;
    }
    
    public  void putBody(String url, com.alibaba.fastjson.JSONObject params) {
        RestTemplate restTemplate = new RestTemplate();

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1703,7 +1703,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }else {
            try {
                Map<String,Object> rs = registerService.registerPatient(mobile,pw);
                Map<String,Object> rs = registerService.registerPatient(mobile,pw,name,idcard);
                String code = rs.get("code").toString();
                if(!"1".equals(code)){
                    ObjEnvelop objEnvelop = new ObjEnvelop();

+ 10 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java

@ -120,7 +120,7 @@ public class RegisterService {
        rs.put("mes","保存用户信息失败");
        return rs;
    }
    public Map<String,Object> registerPatient(String mobile,String pw)throws Exception{
    public Map<String,Object> registerPatient(String mobile,String pw,String name,String idcard)throws Exception{
        Map<String,Object> rs = new HashedMap();
        try{
@ -140,6 +140,12 @@ public class RegisterService {
            patient.setLocked(0);
            patient.setCreateTime(new Date());
            patient.setUpdateTime(new Date());
            if(StringUtils.isNoneBlank(name)){
                patient.setName(name);
            }
            if (StringUtils.isNoneBlank(idcard)){
                patient.setIdcard(idcard);
            }
            BasePatientDO temp = basePatientDao.save(patient);
            PatientMedicareCardDO medicareCardDO = new PatientMedicareCardDO();
@ -155,6 +161,9 @@ public class RegisterService {
            wlyyPatientFamilyMemberDO.setFamilyMember(patient.getId());
            wlyyPatientFamilyMemberDO.setFamilyRelation("7");
            wlyyPatientFamilyMemberDO.setFamilyRelationName("本人");
            if (StringUtils.isNoneBlank(idcard)){
                wlyyPatientFamilyMemberDO.setCardNo(idcard);
            }
            familyMemberDao.save(wlyyPatientFamilyMemberDO);
            /*if (org.apache.commons.lang3.StringUtils.isNoneBlank(wxId)&&wxId.equalsIgnoreCase("xm_ykyy_wx")){
                ykyyService.registerYkt(temp.getId(),pw,captcha);

+ 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;
    }

+ 14 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -2,6 +2,7 @@ package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.service.YkyyPrescriptionService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetCommonService;
@ -15,8 +16,10 @@ import com.yihu.jw.repository.job.QuartzJobConfigDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.*;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.AutoTimeOutRemind;
import com.yihu.jw.util.OverdueJob;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.util.TimeoutOverDueJob;
import com.yihu.jw.web.BaseController;
import com.yihu.jw.wechat.service.WxTemplateService;
import io.swagger.annotations.Api;
@ -71,6 +74,8 @@ public class JobController extends BaseController {
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    @Autowired
@ -709,4 +714,11 @@ public class JobController extends BaseController {
        return success(prescriptionStatusUpdateService.finishOldConsult(consult));
    }
    @RequestMapping(value = "saveVideoFile", method = RequestMethod.GET)
    @ApiOperation("下载云信录制是哦")
    public String saveVideoFile(String vip){
        return success(ykyyPrescriptionService.saveVideoFile(vip));
    }
}

+ 0 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -357,7 +357,6 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                if (null != jsonObject.get("id")) {
                    id = jsonObject.get("id").toString();
                }
                ;
                mixEnvelop = wlyyFamilyMemberService.addFamily(id, patientId, familyName, dictId, cardType, idCard, username, false,medicareType,medicare,clinicId);
            } else {
                mixEnvelop.setStatus(408);

+ 28 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -6,6 +6,7 @@ import com.yihu.jw.area.service.BaseCityService;
import com.yihu.jw.area.service.BaseCommitteeService;
import com.yihu.jw.area.service.BaseProvinceService;
import com.yihu.jw.area.service.BaseTownService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelReader;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
@ -46,6 +47,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
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.web.bind.annotation.*;
@ -54,6 +57,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -65,7 +69,7 @@ import java.util.Map;
@RequestMapping(value = BaseHospitalRequestMapping.Prescription.PREFIX)
@Api(value = "在线复诊", description = "在线复诊接口", tags = {"在线复诊接口"})
public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    
    private static final Logger logger = LoggerFactory.getLogger(PrescriptionEndpoint.class);
    @Autowired
    private PrescriptionService prescriptionService;
    
@ -89,6 +93,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    
    @Autowired
    private BusinessOrderService businessOrderService;
@ -119,6 +125,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private TnPrescriptionService tnPrescriptionService;
    @Value("${qywx.id}")
    private String qywxId;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -128,6 +136,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @Value("${pay.flag}")
    private boolean payFlag;
    @Value("${wlyy.url}")
    private String wlyyUrl;
    @Value("${qywx.url}")
    private String qywxUrl;
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientList)
    @ApiOperation(value = " 查询某个时间段的患者门诊就诊记录")
@ -402,6 +415,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            objEnvelop.setStatus(300);
            return objEnvelop;
        }else {
            BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
            //发送系统消息
            SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
            //发送IM消息
@ -411,6 +425,18 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
                hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
            }
            if(!"zsyy".equals(qywxId) && !"xm_xzzx_wx".equals(qywxId)){
                //发送厦门i健康智能推送
                try{
                    if (doctorDO!=null&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        String wxurl = wlyyUrl+"/im/common/message/sendDoctorTemplateByDoctorIdcard?sessionId=1_1&sessionType=1&from=1&content=1&businessType=1&doctor_idcard="+doctorDO.getIdcard()+"&patientName="+URLEncoder.encode(wlyyOutpatientDO.getPatientName())+"&url=1";
                        logger.info("发送厦门i健康智能推送url:"+wxurl);
                        wlyyBusinessService.sendDoctorTemplateByDoctorIdcard(wxurl);
                    }
                }catch (Exception e){
                    logger.info("发送厦门i健康智能失败"+e.toString());
                }
            }
            return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
        }
@ -452,7 +478,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
            return success(xzzxEntranceService.selectDrugDict(pyKey));
        }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
            return success(tnPrescriptionService.getDrugDictionary(drugNo,pyKey,null,null,null));
            return success(tnPrescriptionService.getDrugDictionary(drugNo,pyKey,null,groupNo,null));
        }else {
            return ListEnvelop.getError("尚未开发!");
        }

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

@ -5,7 +5,6 @@ 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;
@ -17,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> {
@ -206,7 +202,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName(ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(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);