Browse Source

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

 Conflicts:
	svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
Shi Kejing 4 years ago
parent
commit
c3fe57650f
57 changed files with 807 additions and 351 deletions
  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. 60 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  8. 71 0
      business/base-service/src/main/java/com/yihu/jw/utils/FileUtil.java
  9. 2 0
      business/base-service/src/mqConfig/esbmq-config.xml
  10. 1 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  11. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java
  12. 5 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/AccountDO.java
  13. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/ActiveRecordDO.java
  14. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/TaskPatientDetailDO.java
  15. 65 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceDO.java
  16. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductExtendInfoDO.java
  17. 4 1
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/PatientHospitalRecordDO.java
  18. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java
  19. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  20. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java
  21. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
  22. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanLogDO.java
  23. 4 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java
  24. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java
  25. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java
  26. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/util/AesEncryptUtils.java
  27. 89 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java
  28. 17 0
      common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java
  29. 12 0
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  30. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  31. 10 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java
  32. 6 0
      svr/svr-door-serivce/sql/初始sql.sql
  33. 13 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java
  34. 21 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  35. 33 14
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/HospitalService.java
  36. 8 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  37. 2 0
      svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml
  38. 14 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  39. 0 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  40. 28 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  41. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java
  42. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java
  43. 39 61
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  44. 11 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java
  45. 6 6
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  46. 2 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/gateway/GcClientDetailsService.java
  47. 9 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java
  48. 13 10
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java
  49. 31 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceAuditService.java
  50. 24 2
      svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java
  51. 17 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java
  52. 2 24
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/AccountService.java
  53. 2 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActiveRecordService.java
  54. 14 186
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java
  55. 5 7
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java
  56. 3 2
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java
  57. 12 0
      svr/svr-wlyy-specialist/src/main/resources/application.yml

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

+ 60 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -1053,6 +1053,44 @@ public class EntranceService {
                if (StringUtils.isNotBlank(vo.getFixationfluid())) {
                    sbs.append(" fixationfluid=\"" + vo.getFixationfluid() + "\"");
                }
                /**
                 * 补充患者信息
                 * social_no 身份证、tell_phone 手机号、address1联系地址、address2、address3、address4、address5 area区、target职称类别
                 */
                if (StringUtils.isNotBlank(vo.getSocialNo())) {
                    sbs.append(" social_no=\"" + vo.getSocialNo() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getTellPhone())) {
                    sbs.append(" tell_phone=\"" + vo.getTellPhone() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getAddress1())) {
                    sbs.append(" address1=\"" + vo.getAddress1() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getAddress2())) {
                    sbs.append(" address2=\"" + vo.getAddress2() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getAddress3())) {
                    sbs.append(" address3=\"" + vo.getAddress3() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getAddress4())) {
                    sbs.append(" address4=\"" + vo.getAddress4() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getAddress5())) {
                    sbs.append(" address5=\"" + vo.getAddress5() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getArea())) {
                    sbs.append(" area=\"" + vo.getArea() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getTarget())) {
                    sbs.append(" target=\"" + vo.getTarget() + "\"");
                }
                logger.info("判断自取或者快递标识"+vo.getSelfDelivered());
                if (StringUtils.isNotBlank(vo.getSelfDelivered())){
                    sbs.append(" self_delivered=\"" + vo.getSelfDelivered() + "\"");
@ -1813,6 +1851,28 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    public JSONArray MS02019(boolean demoFlag) throws Exception {
        String fid = "MS02019";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg/>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 同步医生到本地库,获取到医生的时候需要调用BS55010 查询医生的诊查费
     *

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

+ 2 - 0
business/base-service/src/mqConfig/esbmq-config.xml

@ -88,6 +88,8 @@
				<MS02016_1>EwellQ.S60.MS02016.GET</MS02016_1>
				<MS02017_0>EwellQ.S60.MS02017.PUT</MS02017_0>
				<MS02017_1>EwellQ.S60.MS02017.GET</MS02017_1>
				<MS02019_1>EwellQ.S60.MS02019.GET</MS02019_1>
				<MS02019_0>EwellQ.S60.MS02019.PUT</MS02019_0>
				<!--检查检验end-->
				<!-- 预约挂号start-->

+ 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= "女";

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

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

+ 65 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceDO.java

@ -1,8 +1,12 @@
package com.yihu.jw.entity.iot.device;
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;
@ -14,7 +18,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "iot_device")
public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Serializable {
public class IotDeviceDO extends UuidIdentityEntity implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
@ -90,6 +94,12 @@ public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Seria
    private String categoryName;//设备类型名称
    @Column(name = "inventory_log_id")
    private String inventoryLogId;//出入库记录id
    private Date createTime;
    private String createUser;
    private String createUserName;
    private Date updateTime;
    private String updateUser;
    private String updateUserName;
    public enum DeviceStatus {
        normal("正常", "1"),
@ -356,4 +366,58 @@ public class IotDeviceDO extends UuidIdentityEntityWithOperator implements Seria
    public void setIsGrant(Integer isGrant) {
        this.isGrant = isGrant;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductExtendInfoDO.java

@ -45,7 +45,6 @@ public class IotProductExtendInfoDO extends UuidIdentityEntityWithOperator imple
    private String companyName;//生产企业名称
    @Column(name = "ratify_date")
    private Date ratifyDate;//批准日期
    @Column(name = "agency_name")
    private String agencyName;//代理人
    public String getSaasId() {
        return saasId;
@ -143,6 +142,7 @@ public class IotProductExtendInfoDO extends UuidIdentityEntityWithOperator imple
        this.ratifyDate = ratifyDate;
    }
    @Column(name = "agency_name")
    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAgencyName() {
        return agencyName;

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

+ 89 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java

@ -128,6 +128,23 @@ public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    private String selfDelivered;//快递是否1是0否
    //患者信息
/*
    补充字段 social_no、tell_phone、address1、address2、address3、address4、address5 area、target
*/
    private String socialNo;
    private String tellPhone;
    private String address1;
    private String address2;
    private String address3;
    private String address4;
    private String address5;
    private String area;
    private String target;
@ -442,4 +459,76 @@ public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    public void setSelfDelivered(String selfDelivered) {
        this.selfDelivered = selfDelivered;
    }
    public String getSocialNo() {
        return socialNo;
    }
    public void setSocialNo(String socialNo) {
        this.socialNo = socialNo;
    }
    public String getTellPhone() {
        return tellPhone;
    }
    public void setTellPhone(String tellPhone) {
        this.tellPhone = tellPhone;
    }
    public String getAddress1() {
        return address1;
    }
    public void setAddress1(String address1) {
        this.address1 = address1;
    }
    public String getAddress2() {
        return address2;
    }
    public void setAddress2(String address2) {
        this.address2 = address2;
    }
    public String getAddress3() {
        return address3;
    }
    public void setAddress3(String address3) {
        this.address3 = address3;
    }
    public String getAddress4() {
        return address4;
    }
    public void setAddress4(String address4) {
        this.address4 = address4;
    }
    public String getAddress5() {
        return address5;
    }
    public void setAddress5(String address5) {
        this.address5 = address5;
    }
    public String getArea() {
        return area;
    }
    public void setArea(String area) {
        this.area = area;
    }
    public String getTarget() {
        return target;
    }
    public void setTarget(String target) {
        this.target = target;
    }
}

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

+ 8 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -377,6 +377,14 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(entranceService.MS02014(demoFlag));
    }
    @GetMapping(value = "/MS02019")
    @ApiOperation(value = "五级地址字典")
    public ListEnvelop MS02019() throws Exception{
        JSONArray  obj = entranceService.MS02019(demoFlag);
        return success(obj);
    }
    @PostMapping(value = "/ehospitalNotice")
    @ApiOperation(value = "互联网医院通知")
    public ObjEnvelop ehospitalNotice(

+ 2 - 0
svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml

@ -94,6 +94,8 @@
				<MS02016_1>EwellQ.S60.MS02016.GET</MS02016_1>
				<MS02017_0>EwellQ.S60.MS02017.PUT</MS02017_0>
				<MS02017_1>EwellQ.S60.MS02017.GET</MS02017_1>
				<MS02019_1>EwellQ.S60.MS02019.GET</MS02019_1>
				<MS02019_0>EwellQ.S60.MS02019.PUT</MS02019_0>
				<!--检查检验end-->
				<!-- 预约挂号start-->

+ 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 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -9,6 +9,7 @@ import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java

@ -5,6 +5,7 @@ import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.iot.service.product.IotProductBaseInfoService;
import com.yihu.jw.entity.iot.device.IotDeviceInventoryWarningDO;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceInventoryWarningVO;
import com.yihu.jw.restmodel.iot.product.IotMaintenanceUnitVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;

+ 39 - 61
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -30,6 +30,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import io.searchbox.client.JestResult;
import iot.device.LocationDataVO;
import okhttp3.OkHttpClient;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
@ -298,12 +299,15 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        String sql = "select t.code as \"code\",t.name as \"name\" from wlyy.wlyy_patient t where 1=1 ";
        String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
        if (StringUtils.isNotEmpty(idCard)){
            sql = sql +" and t.idcard = '"+idCard+"'";
            sql = sql +" and t.idcard = '"+AesEncryptUtils.encrypt(idCard)+"'";
        }if (StringUtils.isNotEmpty(snCode)){
            sqlEqt = sqlEqt +" and t.device_code = '"+snCode+"'";
        }
        System.out.println("查询患者name和code开始");
        List<Map<String,Object>> nameList = hibenateUtils.createSQLQuery(sql);
        for (Map<String,Object> tmp:nameList){
            tmp.put("name",AesEncryptUtils.decrypt(tmp.get("name").toString()));
        }
        System.out.println("查询患者name和code结束:"+nameList);
        System.out.println("查询设备名称开始");
        List<Map<String,Object>> deviceList = hibenateUtils.createSQLQuery(sqlEqt);
@ -329,7 +333,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                List<Map<String,Object>> nameList = new ArrayList<>();
                List<Map<String,Object>> deviceList = new ArrayList<>();
                if (StringUtils.isNotEmpty(idCard)){
                    sql = sql +" and t.idcard = '"+AesEncryptUtils.decrypt(idCard)+"'";
                    sql = sql +" and t.idcard = '"+AesEncryptUtils.encrypt(idCard)+"'";
                    nameList = jdbcTempalte.queryForList(sql);
                }if (StringUtils.isNoneBlank(snCoed)){
                    sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
@ -351,6 +355,34 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        return list;
    }
    public LocationDataVO addNameAndCodeToLocationVO(LocationDataVO locationDataVO){
        if(null!=locationDataVO){
                String sql = "select t.code as \"code\",t.name as \"name\" from wlyy.wlyy_patient t where 1=1 ";
                String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
                String idCard = locationDataVO.getIdCard();
                String snCoed = locationDataVO.getDeviceSn();
                List<Map<String,Object>> nameList = new ArrayList<>();
                List<Map<String,Object>> deviceList = new ArrayList<>();
                if (StringUtils.isNotEmpty(idCard)){
                    sql = sql +" and t.idcard = '"+ AesEncryptUtils.encrypt(idCard)+"'";
                    nameList = jdbcTempalte.queryForList(sql);
                }if (StringUtils.isNoneBlank(snCoed)){
                    sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
                    deviceList = jdbcTempalte.queryForList(sqlEqt);
                }
                if(nameList.size()>0){
                    String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
                    String name = null==nameList.get(0).get("name")?"": ConcealUtil.nameOrAddrConceal(AesEncryptUtils.decrypt(nameList.get(0).get("name").toString()));
                    locationDataVO.setCode(code);
                    locationDataVO.setName(name);
                }
                if (deviceList.size()>0){
                    String equipmentName = null==deviceList.get(0).get("device_name")?"":deviceList.get(0).get("device_name").toString();
                    locationDataVO.setEquimentName(equipmentName);
                }
            }
        return locationDataVO;
    }
    /**
     * 根据设备SN码查询设备地址
@ -470,15 +502,6 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
                "FROM `iot_patient_device` p, iot_device d LEFT JOIN iot_company c on d.manufacturer_id = c.id and c.status = 1 " +
                "where p.device_sn = '" + deviceSn + "' and p.del =  1 and p.device_id= d.id GROUP BY p.device_sn ";
        List<IotPatientDeviceVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
        list.forEach(one->{
            one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
            one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
            one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
            one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
            one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
            one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
        });
        return list;
    }
@ -521,29 +544,10 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        if (page != null && pageSize != null) {
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
            sql += "limit " +(page-1)* pageSize + "," +pageSize;
            List<IotPatientDeviceVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
            list.forEach(one->{
                one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
                one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
                one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            });
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Device.message_success_find, list,page, pageSize,count);
        }
        List<IotPatientDeviceVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
        list.forEach(one->{
            one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
            one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
            one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
            one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
            one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
            one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
        });
        return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_find, list);
    }
@ -591,13 +595,6 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
            sql += "limit " + (page - 1) * pageSize + "," + pageSize;
            List<IotPatientDeviceVO> deviceVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
            for (int i=0;i<deviceVOList.size();i++){
                deviceVOList.get(i).setPatientName(AesEncryptUtils.decrypt(deviceVOList.get(i).getPatientName()));
                deviceVOList.get(i).setIdcard(AesEncryptUtils.decrypt(deviceVOList.get(i).getIdcard()));
                deviceVOList.get(i).setMobile(AesEncryptUtils.decrypt(deviceVOList.get(i).getMobile()));
                deviceVOList.get(i).setCreateUserName(AesEncryptUtils.decrypt(deviceVOList.get(i).getCreateUserName()));
                deviceVOList.get(i).setUpdateUserName(AesEncryptUtils.decrypt(deviceVOList.get(i).getUpdateUserName()));
            }
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, deviceVOList, page, pageSize, count);
        } else {
            List<IotPatientDeviceVO> deviceVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
@ -615,8 +612,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            sql += "and d.device_sn like '%" + deviceSn + "%' ";
        }
        if(StringUtils.isNotBlank(patientName)){
            sql += "and AES_DECRYPT(from_base64(d.patient_name),'jkzl2021ZJXL*#%a') like '%" + patientName + "%' ";
            //AES_DECRYPT(from_base64(t.name),'jkzl2021ZJXL*#%a')
            sql += "and d.patient_name like '%" + patientName + "%' ";
        }
        if(StringUtils.isNotBlank(deviceName)){
            sql += "and d.device_name like '%" + deviceName + "%' ";
@ -628,37 +624,19 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            sql += "and d.hospital_name like '%" + hospitalName + "%' ";
        }
        //数据权限过滤
//        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
//        if(!orgList.contains(userAgent.commonHospital)){
//            sql += " and d.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
//        }
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql += " and d.hospital in ("+orgUserService.getUserOrg(orgList)+") ";
        }
        sql += "order by d.update_time desc ";
        //判断是否需要分页
        if (page != null && pageSize != null) {
            Long count = Long.valueOf(jdbcTempalte.queryForList(sql).size());
            sql += "limit " + (page - 1) * pageSize + "," + pageSize;
            List<IotPatientDeviceVO> deviceVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
            deviceVOList.forEach(one->{
                one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
                one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
                one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            });
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, deviceVOList, page, pageSize, count);
        } else {
            List<IotPatientDeviceVO> deviceVOList = jdbcTempalte.query(sql, new BeanPropertyRowMapper<>(IotPatientDeviceVO.class));
            deviceVOList.forEach(one->{
                one.setIdcard(AesEncryptUtils.decrypt(one.getIdcard()));
                one.setMobile(AesEncryptUtils.decrypt(one.getMobile()));
                one.setPatientName(AesEncryptUtils.decrypt(one.getPatientName()));
                one.setContactsName(AesEncryptUtils.decrypt(one.getContactsName()));
                one.setContactsMobile(AesEncryptUtils.decrypt(one.getContactsMobile()));
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            });
            return MixEnvelop.getSuccessList(IotRequestMapping.Common.message_success_find, deviceVOList);
        }
    }

+ 11 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

@ -4,6 +4,7 @@ import com.yihu.iot.dao.dict.IotHospitalDao;
import com.yihu.iot.service.common.OrgUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.dict.IotHospitalDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
@ -60,9 +61,19 @@ public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospita
            Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());
            sql += "limit " + (page-1)*pageSize + "," + pageSize;
            List<IotHospitalDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(IotHospitalDO.class));
            for (IotHospitalDO one:list){
                if (StringUtils.isNoneBlank(one.getPhone())){
                    one.setPhone(AesEncryptUtils.decrypt(one.getPhone()));
                }
            }
            return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, list, page, pageSize, count);
        }else {
            List<IotHospitalDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(IotHospitalDO.class));
            for (IotHospitalDO one:list){
                if (StringUtils.isNoneBlank(one.getPhone())){
                    one.setPhone(AesEncryptUtils.decrypt(one.getPhone()));
                }
            }
            return MixEnvelop.getSuccessList(IotRequestMapping.Company.message_success_find, list);
        }
    }

+ 6 - 6
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> {
@ -168,6 +165,9 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            params.put("city",city);
        }
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql.toString(),params);
       for (Map<String,Object> tmp:list){
           tmp.put("phone",AesEncryptUtils.decrypt(tmp.get("phone").toString()));
       }
       return list;
    }
@ -200,9 +200,9 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(5);
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName(ConcealUtil.nameOrAddrConceal(jsobj.get("name").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 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/gateway/GcClientDetailsService.java

@ -3,6 +3,7 @@ package com.yihu.iot.service.gateway;
import com.yihu.iot.dao.gateway.GcClientDetailsDao;
import com.yihu.jw.entity.iot.gateway.GcClientDetails;
import com.yihu.jw.entity.util.AesEncryptUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -29,7 +30,7 @@ public class GcClientDetailsService{
        gcClientDetails.setAppId(getUUID());
        gcClientDetails.setAppSecret(getUUID());
        gcClientDetails.setAppUri(appUri);
        gcClientDetails.setCreateUserName(createUserName);
        gcClientDetails.setCreateUserName(AesEncryptUtils.encrypt(createUserName));
        gcClientDetails.setCreatieUser(creatieUser);
        gcClientDetails.setCreatieTime(new Date());
        gcClientDetails.setDel(1);

+ 9 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/message/IotMessageService.java

@ -6,6 +6,7 @@ import com.yihu.iot.dao.message.IotMessageDao;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -53,7 +54,14 @@ public class IotMessageService  extends BaseJpaService<IotMessageDO, IotMessageD
        sql.append("  ORDER BY read_msg, create_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        List<IotMessageDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(IotMessageDO.class));
        for (IotMessageDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        long count = list.size();

+ 13 - 10
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -15,6 +15,7 @@ import com.yihu.iot.util.conceal.ConcealUtil;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.http.HttpClientUtil;
@ -104,7 +105,7 @@ public class MonitorPlatformService  {
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
@ -115,6 +116,7 @@ public class MonitorPlatformService  {
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
                    locationDataVOList.add(locationDataVO);
                });
//                JSONArray jsonArrayTemp = new JSONArray();
@ -130,8 +132,7 @@ public class MonitorPlatformService  {
//                jsonObject.put("size",size);
//                List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.getDetailModelList().addAll(locationDataVOList);
            }
            envelop.setTotalCount(total);
            return envelop;
@ -184,7 +185,7 @@ public class MonitorPlatformService  {
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
@ -195,11 +196,10 @@ public class MonitorPlatformService  {
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
                    locationDataVOList.add(locationDataVO);
                });
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.getDetailModelList().addAll(locationDataVOList);
//                for (String categoryCode:categoryCodes){
//                    JSONObject json = new JSONObject();
//                    JSONArray jsonArray = new JSONArray();
@ -864,7 +864,7 @@ public class MonitorPlatformService  {
            String sql = "SELECT d.device_sn,b.supplier_name supplierName,b.origin_place originPlace,e.product_img productImg" +
                    ",e.description  from iot_device d,iot_product_base_info b,iot_product_extend_info e" +
                    " WHERE d.device_sn = '"+deviceSn+"' and d.product_id = b.id and d.product_id = e.product_id";
            List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
            List<JSONObject> list = myJdbcTemplate.queryJson(sql,new Object[]{});
            if(list!=null&&list.size()>0){
                JSONObject js = list.get(0);
                tmp.put("supplierName",js.getString("supplierName"));
@ -1092,9 +1092,12 @@ public class MonitorPlatformService  {
        sql.append("from wlyy.wlyy_patient_device d,wlyy.wlyy_patient p  ");
        sql.append("WHERE d.`user` = p.`code` and d.del=0  ");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(name)){
            sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+name+"') ");
            sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+ AesEncryptUtils.encrypt(name)+"') ");
        }
        List<JSONObject> jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
        for (JSONObject obj:jsonArray){
            obj.put("name",AesEncryptUtils.decrypt(obj.getString("name")));
        }
        if(jsonArray.size()==0){
            sql= new StringBuffer(" select '5' as categoryCode, id,device_code as deviceSn,null as code,null as name,'健康小屋' as deviceName from xmiot.iot_equipmet_detail where device_code like '%"+name+"%'");
            jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
@ -1131,9 +1134,9 @@ public class MonitorPlatformService  {
                String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location where del=0 and  device_sn='"+deviceSn+"' limit 0,5 ";
                try {
                    List<Map<String,Object>> locationDataVOList = jdbcTemplate.queryForList(sqlLocation);
                    JSONObject location = JSONObject.parseObject(locationDataVOList.get(0).get("location").toString());
                    if(locationDataVOList.size()>0){
                        data.put("locationData",location);

+ 31 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceAuditService.java

@ -6,6 +6,7 @@ import com.yihu.iot.dao.platform.*;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.platform.*;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.platform.IotInterfaceAuditVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -129,6 +130,15 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
            IotCompanyDO company = iotCompanyDao.findOne(one.getCompanyId());
            one.setContactsName(company.getContactsName());
            one.setContactsMobile(company.getContactsMobile());
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        });
        //获取总数
@ -216,6 +226,15 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
            IotCompanyDO company = iotCompanyDao.findOne(one.getCompanyId());
            one.setContactsName(company.getContactsName());
            one.setContactsMobile(company.getContactsMobile());
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        });
        //获取总数
@ -236,6 +255,18 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
        sql.append("WHERE company_id = '").append(account.getId()).append("'");
        sql.append(" order by time desc  limit ").append((page-1)*size).append(",").append(size);
        List<IotInterfaceAuditDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotInterfaceAuditDO.class));
        for (IotInterfaceAuditDO one:list){
            if (StringUtils.isNotBlank(one.getName())){
                one.setName(AesEncryptUtils.decrypt(one.getName()));
            }
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        //获取总数
        long count = list.size();

+ 24 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java

@ -11,6 +11,7 @@ import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.company.IotCompanyAppVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -145,7 +146,15 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotShareInterfaceDO.class));
        List<IotShareInterfaceDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotShareInterfaceDO.class));
        for (IotShareInterfaceDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
@ -193,6 +202,14 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        sql.append(" order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyAppDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotCompanyAppDO.class));
        for (IotCompanyAppDO one:list){
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
        }
        ArrayList<IotCompanyAppVO> resultList = new ArrayList<>();
        
@ -234,7 +251,12 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        List<IotShareInterfaceDO> interfaceDOS = new ArrayList<>();
        list.forEach(one->{
            if (StringUtils.isNotBlank(one.getCreateUserName())){
                one.setCreateUserName(AesEncryptUtils.decrypt(one.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(one.getUpdateUserName())){
                one.setUpdateUserName(AesEncryptUtils.decrypt(one.getUpdateUserName()));
            }
            IotShareInterfaceDO shareInterfaceDO = iotShareInterfaceDao.findById(one.getShareInterfaceId());
            interfaceDOS.add(shareInterfaceDO);
        });

+ 17 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java

@ -3,6 +3,7 @@ package com.yihu.iot.service.workType;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.workType.IotWorkTypeDao;
import com.yihu.jw.entity.iot.workType.IotWorkTypeDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
@ -105,6 +106,14 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
        sql.append("order by w.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        for (IotWorkTypeDO tmp:list){
            if (StringUtils.isNotBlank(tmp.getCreateUserName())){
                tmp.setCreateUserName(AesEncryptUtils.decrypt(tmp.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(tmp.getUpdateUserName())){
                tmp.setUpdateUserName(AesEncryptUtils.decrypt(tmp.getUpdateUserName()));
            }
        }
        long count =list.size();
@ -136,6 +145,14 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        for (IotWorkTypeDO tmp:list){
            if (StringUtils.isNotBlank(tmp.getCreateUserName())){
                tmp.setCreateUserName(AesEncryptUtils.decrypt(tmp.getCreateUserName()));
            }
            if (StringUtils.isNotBlank(tmp.getUpdateUserName())){
                tmp.setUpdateUserName(AesEncryptUtils.decrypt(tmp.getUpdateUserName()));
            }
        }
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());

+ 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