Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 8 năm trước cách đây
mục cha
commit
28f53e5b57
33 tập tin đã thay đổi với 1594 bổ sung139 xóa
  1. 21 7
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java
  2. 160 24
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java
  3. 14 16
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  4. 8 3
      patient-co-service/wlyy_service/src/main/resources/application.yml
  5. 35 4
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/controller/SignController.java
  6. 6 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyDao.java
  7. 15 12
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/LogService.java
  8. 43 3
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignZYService.java
  9. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  10. 106 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/HealthProblemDict.java
  11. 60 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/HpIcd10Relation.java
  12. 114 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/Icd10Dict.java
  13. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java
  14. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java
  15. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java
  16. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/service/SignFamilyService.java
  17. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisMsgPubSubListener.java
  18. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamDao.java
  19. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageDao.java
  20. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/service/SignFamilyServiceDao.java
  21. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/service/SignFamilyServiceItemDao.java
  22. 11 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  23. 224 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  24. 140 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignFamilyServiceService.java
  25. 157 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/Icd10DictServcie.java
  26. 30 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/KeyValueModel.java
  27. 50 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  28. 77 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/icd/Icd10Controller.java
  29. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java
  30. 88 18
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  31. 157 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignFamilyServiceNoFilterController.java
  32. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTagUtil.java
  33. 30 25
      patient-co/patient-co-wlyy/src/main/resources/application.yml

+ 21 - 7
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -43,7 +43,7 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "prePayCompletion",method = RequestMethod.POST)
	@ApiOperation("接收预结算完成消息")
	public Result prePayCompletion(@ApiParam(name="data",value="json串",defaultValue = "{}")
	public Result prePayCompletion(@ApiParam(name="data",value="json串",defaultValue = "{\"CODE\":1,\"RECIPE_NO\":\"0\",\"ORDER_NO\":\"DB0537136\"}")
								   @RequestParam(value = "data",required = true) String data){
		try {
@ -103,7 +103,7 @@ public class PrescriptionController extends BaseController{
	@ApiOperation("字典获取接口")
	public Result getDictForI(@ApiParam(name="dictName",value="字典名称",defaultValue = "IV_PHYSIC_DICT")
							  @RequestParam(value = "dictName",required = true) String dictName,
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3501111")
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3502050200")
							  @RequestParam(value = "hospital",required = true) String hospital)
	{
		try {
@ -142,11 +142,11 @@ public class PrescriptionController extends BaseController{
	public Result getLastRecipe(@ApiParam(name="cardNo",value="病人卡号",defaultValue = "")
								@RequestParam(value = "cardNo",required = true) String cardNo,
								@ApiParam(name="recipeNo",value="第一次获取上一方时传入0,第二次获取上一方时传入第一次返回的医嘱号,以此类推",defaultValue = "")
								@RequestParam(value = "recipeNo",required = true) String recipeNo,
								@RequestParam(value = "recipeNo",required = false) String recipeNo,
								@ApiParam(name="applyTimeFrom",value="开始时间",defaultValue = "")
								@RequestParam(value = "applyTimeFrom",required = true) String applyTimeFrom,
								@RequestParam(value = "applyTimeFrom",required = false) String applyTimeFrom,
								@ApiParam(name="applyTimeEnd",value="结束时间",defaultValue = "")
								@RequestParam(value = "applyTimeEnd",required = true) String applyTimeEnd)
								@RequestParam(value = "applyTimeEnd",required = false) String applyTimeEnd)
	{
		try {
@ -174,7 +174,7 @@ public class PrescriptionController extends BaseController{
		}
	}
	@RequestMapping(value = "getDispUnSettleFeeList",method = RequestMethod.POST)
	@RequestMapping(value = "getDispUnSettleFeeInfoList",method = RequestMethod.POST)
	@ApiOperation("查询处方结算结果列表")
	public Result getDispUnSettleFeeList(@ApiParam(name="cardNo",value="病人卡号",defaultValue = "")
										 @RequestParam(value = "cardNo",required = true) String cardNo,
@ -182,7 +182,7 @@ public class PrescriptionController extends BaseController{
										 @RequestParam(value = "visitNo",required = true) String visitNo)
	{
		try {
			String re = prescriptionService.getDispUnSettleFeeList(cardNo,null,null);
			String re = prescriptionService.getDispUnSettleFeeInfoList(cardNo,visitNo);
			return Result.success("查询处方结算结果列表!",re);
		} catch (Exception ex) {
@ -239,6 +239,20 @@ public class PrescriptionController extends BaseController{
		}
	}
	@RequestMapping(value = "IsApplied",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("判断是否有实名证书")
	public Result isApplied(@ApiParam(name="strUserIdcardNum",value="用户身份证号") @RequestParam String strUserIdcardNum)
	{
		try {
			String re = caService.isApplied(strUserIdcardNum);
			return Result.success("判断是否有实名证书成功!",re);
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
		}
	}
	@RequestMapping(value = "GetRealNameSoftCertExpiredDatetime",method = RequestMethod.POST)
	@ResponseBody

+ 160 - 24
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.service.prescription;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.SystemConfig;
import com.yihu.wlyy.service.common.util.MD5Util;
import com.yihu.wlyy.service.common.util.StringUtil;
import com.yihu.wlyy.service.common.util.WebserviceUtil;
import com.yihu.wlyy.service.service.LogService;
@ -19,6 +20,7 @@ import java.util.Map;
@Service
public class PrescriptionCAService {
    private String IS_APPLIED="XMCAF_SOFT_judgeRealNameSoftCertIsApplied"; //判断实名软证书是否已申请
    private String REQUEST_SIGN = "XMCAF_SOFT_requestRealNameSoftCertAndSign";//请求实名软证书并进行数字签名
    private String EXPIRED_DATETIME = "XMCAF_SOFT_getRealNameSoftCertExpiredDatetime"; //获取实名软证书的过期时间
    private String MODIFY_PASSWD = "XMCAF_SOFT_ModifyRealNameSoftCertCalledPasswd"; //修改实名软证书调用保护口令
@ -26,12 +28,106 @@ public class PrescriptionCAService {
    private String caUrl = SystemConfig.getInstance().getCAUrl();
    private String caNamespace = SystemConfig.getInstance().getCANamespace();
    private String unifiedCallInterface = "XMCA6_UnifiedCallInterface";
    @Autowired
    private LogService logService;
    @Autowired
    private ObjectMapper objectMapper;
    private String getHeaderXml(String api)
    {
        return "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
            "<root>\n" +
            "   <serverName>"+api+"</serverName>\n" +
            "   <format>xml</format>\n" +
            "   <callOperator></callOperator>\n" +
            "   <certificate></certificate>\n" +
            "   <srcIP>10.95.22.10</srcIP >\n" +
            "   <srcUserMac>60-D8-19-57-66-E3</srcUserMac>\n" +
            "   <srcSystemCode>1</srcSystemCode>\n" +
            "   <srcSystemName>厦门i健康</srcSystemName>\n" +
            "   <srcBusinessNodeCode>node01</srcBusinessNodeCode>\n" +
            "   <srcBusinessNodeName>审核</srcBusinessNodeName>\n" +
            "   <srcOperatorAccount>Zhuangsd</srcOperatorAccount>\n" +
            "   <srcBusinessStreamNO>11111</srcBusinessStreamNO>\n" +
            "   <srcDataExtProperty></srcDataExtProperty>\n" +
            "</root>";
    }
    /**
     * CA认证服务二次封装
     */
    private String postCAServer(String urlString,String namespace,String api, Map<String,String> params) throws Exception
    {
        String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                         "<root>\n";
        if(params!=null && params.size()>0)
        {
            for(String key : params.keySet())
            {
                msgBody += "    <"+key+">"+params.get(key)+"</"+key+">\n";
            }
        }
        msgBody += "</root>";
        String msgHeader = getHeaderXml(api);
        Map<String,String> p = new HashMap<>();
        p.put("msgHeader",msgHeader);
        p.put("msgBody",msgBody);
        return WebserviceUtil.post(urlString,namespace,unifiedCallInterface,p);
    }
    /**
     * 判断是否有实名证书
     **/
    public String isApplied(String strUserIdcardNum)  throws Exception
    {
        Boolean isSuccess = true;
        String re = "";
        String body = "";
        String error = "";
        String action = IS_APPLIED;
        try {
            Map<String,String> params = new HashMap<>();
            params.put("strUserIdcardNum",strUserIdcardNum);
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(caUrl, caNamespace, action, params);
            if(StringUtil.isEmpty(re))
            {
                throw new Exception("返回为空!");
            }
            else{
                if(re.startsWith("error"))
                {
                    throw new Exception(re);
                }
            }
        }
        catch (Exception ex)
        {
            isSuccess = false;
            ex.printStackTrace();
            error = ex.getMessage();
        }
        //保存http日志
        logService.saveHttpLog(isSuccess,action,"判断是否有实名证书","POST",null,body,re,error,logService.caType);
        if(!StringUtil.isEmpty(error))
        {
            throw new Exception(error);
        }
        return re;
    }
    /**
     * 请求实名软证书并进行数字签名
     **/
@ -51,7 +147,7 @@ public class PrescriptionCAService {
            body = objectMapper.writeValueAsString(params);
            re = WebserviceUtil.post(caUrl,caNamespace,action, params);
            re = postCAServer(caUrl,caNamespace,action, params);
            if(StringUtil.isEmpty(re))
            {
@ -99,7 +195,7 @@ public class PrescriptionCAService {
            params.put("strUserIdcardNum",strUserIdcardNum);
            body = objectMapper.writeValueAsString(params);
            re = WebserviceUtil.post(caUrl,caNamespace,action, params);
            re = postCAServer(caUrl, caNamespace, action, params);
            if(StringUtil.isEmpty(re))
            {
@ -146,7 +242,7 @@ public class PrescriptionCAService {
            params.put("strNewCalledPasswd",strNewCalledPasswd);
            body = objectMapper.writeValueAsString(params);
            re = WebserviceUtil.post(caUrl,caNamespace,action, params);
            re = postCAServer(caUrl, caNamespace, action, params);
            if(StringUtil.isEmpty(re))
            {
@ -177,7 +273,6 @@ public class PrescriptionCAService {
        return re;
    }
    /**
     * 验证签名(带多服务器负载均衡)
     **/
@ -195,7 +290,7 @@ public class PrescriptionCAService {
            params.put("strOriginalData",strOriginalData);
            body = objectMapper.writeValueAsString(params);
            re = WebserviceUtil.post(caUrl,caNamespace,action, params);
            re = postCAServer(caUrl,caNamespace,action, params);
            if(StringUtil.isEmpty(re))
            {
@ -226,34 +321,75 @@ public class PrescriptionCAService {
        return re;
    }
    /*public static void main(String args[]) {
    public static void main(String args[]) {
        try {
            String caUrl = SystemConfig.getInstance().getCAUrl();
            String caNamespace = SystemConfig.getInstance().getCANamespace();
            /*//获取实名软证书的过期时间
            String api = "XMCAF_SOFT_getRealNameSoftCertExpiredDatetime";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "</root>";*/
            /*//判断实名软证书是否已申请
            String api = "XMCAF_SOFT_judgeRealNameSoftCertIsApplied";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "</root>";*/
            //修改实名软证书调用保护口令
            String api = "XMCAF_SOFT_ModifyRealNameSoftCertCalledPasswd";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "    <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "   <strOldCalledPasswd>12345678</strOldCalledPasswd>\n" +
                    "   <strNewCalledPasswd>11111111</strNewCalledPasswd>\n" +
                    "</root>";
            //请求实名软证书并进行数字签名
            /*String orgData = "测试数据";
            String api = "XMCAF_SOFT_requestRealNameSoftCertAndSign";
            String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n"+
                    "   <strUserIdcardNum>123456</strUserIdcardNum>\n" +
                    "   <strRealNameSoftCertCalledPasswd>11111111</strRealNameSoftCertCalledPasswd>\n" +
                    "   <strOriginalData>"+ MD5Util.GetMD5Code(orgData)+"</strOriginalData>\n" +
                    "</root>";*/
            String msgHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                    "<root>\n" +
                    "   <serverName>"+api+"</serverName>\n" +
                    "   <format>xml</format>\n" +
                    "   <callOperator></callOperator>\n" +
                    "   <certificate></certificate>\n" +
                    "   <srcIP>10.95.22.10</srcIP >\n" +
                    "   <srcUserMac>60-D8-19-57-66-E3</srcUserMac>\n" +
                    "   <srcSystemCode>1</srcSystemCode>\n" +
                    "   <srcSystemName>厦门i健康</srcSystemName>\n" +
                    "   <srcBusinessNodeCode>node01</srcBusinessNodeCode>\n" +
                    "   <srcBusinessNodeName>审核</srcBusinessNodeName>\n" +
                    "   <srcOperatorAccount>Zhuangsd</srcOperatorAccount>\n" +
                    "   <srcBusinessStreamNO>11111</srcBusinessStreamNO>\n" +
                    "   <srcDataExtProperty></srcDataExtProperty>\n" +
                    "</root>";
            Map<String, String> params = new HashMap<>();
            params.put("strUserIdcardNum", "123456");
            params.put("strRealNameSoftCertCalledPasswd","11111111");
            params.put("strOriginalData","测试");
            params.put("srcBusinessStreamNO", "1");
            System.out.print("请求实名软证书并进行数字签名:" + WebserviceUtil.post(caUrl, caNamespace, "XMCAF_SOFT_requestRealNameSoftCertAndSign", params) + "\r\n");
*//*
            Map<String, String> params2 = new HashMap<>();
            params2.put("strUserIdcardNum", "123456");
            System.out.print("获取实名软证书的过期时间:" + WebserviceUtil.post(caUrl, caNamespace, "XMCAF_SOFT_getRealNameSoftCertExpiredDatetime", params2) + "\r\n");
*//*
            *//*Map<String, String> params3 = new HashMap<>();
            params3.put("strSignData", "123456");
            params3.put("strCertData", "123456");
            params3.put("strOriginalData", "123456");
            System.out.print("验证签名:"+WebserviceUtil.post(caUrl, caNamespace, "XMCA3_JMSVR_verifySignOnMultiServer", params3)+"\r\n");
*//*
            params.put("msgBody", msgBody);
            params.put("msgHeader", msgHeader);
            System.out.print(WebserviceUtil.post(caUrl, caNamespace, "XMCA6_UnifiedCallInterface", params) + "\r\n");
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }*/
    }
}

+ 14 - 16
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -19,6 +19,7 @@ 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.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -59,7 +60,9 @@ public class PrescriptionService extends ZysoftBaseService{
    @Autowired
    private HospitalDao hospitalDao;
    private String channelTopic = "redisPrescription";
    @Value("${redisChannel.prescription}")
    private String channelTopic;
//    private String channelTopic = "redisPrescription";
    /**
     * 新增续方日志
@ -357,15 +360,12 @@ public class PrescriptionService extends ZysoftBaseService{
     */
    public String getLastRecipe(String cardNo,String recipeNo,String applyTimeFrom,String applyTimeEnd)  throws Exception
    {
        String hospital = null;
        String licence = null;
        Patient patient = patientDao.findBySsc(cardNo);
        SignFamily signFamily = signFamilyDao.findByPatient(patient.getCode());
        //
        String[] hospitalMapping = getHospitalMapping(signFamily.getHospital()); //获取机构映射
        hospital = hospitalMapping[0];
        licence = hospitalMapping[1];
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
@ -441,24 +441,21 @@ public class PrescriptionService extends ZysoftBaseService{
        String response = postSecond("saveRecipe","挂号开处方接口",null,json,header,false,2);
        return null;
        return response;
    }
    /**
     * 7.5 查询处方结算结果列表
     * @param cardNo
     * @param hospital
     * @param licence
     * @param cardNo 病人卡号
     * @param visitNo 挂号号
     * @return
     * @throws Exception
     */
    public String getDispUnSettleFeeList(String cardNo, String hospital, String licence)  throws Exception
    public String getDispUnSettleFeeInfoList(String cardNo, String visitNo)  throws Exception
    {
        if(hospital==null){
            String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
            hospital = hospitalMapping[0];
            licence = hospitalMapping[1];
        }
        String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
@ -466,6 +463,7 @@ public class PrescriptionService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("cardNo",cardNo);
        params.put("visitNo",visitNo);
        String response = postSecond("getDispUnSettleFeeList","查询处方结算结果列表",params,null,header,false,2);

+ 8 - 3
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -48,6 +48,13 @@ spring:
        hibernate:
          dialect: org.hibernate.dialect.MySQL5Dialect
zysoftApi:
  internet: internet/CallEhrInterface
  base: base/CallEhrInterface
redisChannel:
    prescription: redisPrescription
---
spring:
  profiles: dev
@ -63,7 +70,6 @@ spring:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
    channelTopic : redisAddPrescription
---
spring:
@ -80,7 +86,7 @@ spring:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
    channelTopic : redisAddPrescription
---
spring:
  profiles: production
@ -96,4 +102,3 @@ spring:
    host: 120.41.253.95 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
    channelTopic : redisAddPrescription

+ 35 - 4
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/controller/SignController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.sign.controller;
import com.yihu.wlyy.sign.common.model.Result;
import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.service.LogService;
import com.yihu.wlyy.sign.service.SignZYService;
import com.zoe.phip.ssp.sdk.ApiException;
import io.swagger.annotations.Api;
@ -26,6 +27,9 @@ public class SignController {
	@Autowired
	private SignZYService signZYService;
	@Autowired
	private LogService logService;
	/******************************* 签约接口 ********************************************************/
	@RequestMapping(value = "CheckSignFamily",method = RequestMethod.POST)
@ -136,7 +140,9 @@ public class SignController {
			@RequestParam(value="end_time",required = true) String endTime){
		try {
			signZYService.loadSignFamilyBatch(startTime,endTime);
			signZYService.loadNewSignFamilyBatch(startTime,endTime);
			signZYService.loadNewSignFamilyBatch(startTime, endTime);
			logService.saveSignFamilyLog("0",true,"更新所有机构签约 startTime:"+startTime +" endTime:"+endTime,"");
			return Result.success("更新所有机构签约成功!");
		} catch (Exception ex) {
			if(ex instanceof ApiException)
@ -163,6 +169,7 @@ public class SignController {
		try {
			String re = signZYService.loadOrgSignFamily(startTime,endTime,hospital);
			logService.saveSignFamilyLog("0",true,"更新所有机构"+hospital+"签约 startTime:"+startTime +" endTime:"+endTime,re);
			return Result.success(re);
		} catch (Exception ex) {
			if(ex instanceof ApiException)
@ -308,10 +315,16 @@ public class SignController {
	@RequestMapping(value = "clearExpensesStatus",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("清洗扣费状态【临时】")
	public Result clearExpensesStatus(@RequestParam Integer page) {
	public Result clearExpensesStatus(@RequestParam Integer page,@RequestParam Integer size) {
		try {
			signZYService.clearExpensesStatus(page);
			int min = page*10;
			int max = (page+1)*10;
			for(int i=max-1;i>=min;i--)
			{
				System.out.print("start clearExpensesStatus ,page:"+i+" size:"+size);
				signZYService.clearExpensesStatus(i, size);
				logService.saveSignFamilyLog("0", true, "清洗扣费状态,page:"+i+" size:"+size, "");
			}
			return Result.success("清洗扣费状态完成!");
		} catch (Exception ex) {
			if(ex instanceof ApiException)
@ -326,5 +339,23 @@ public class SignController {
	}
	@RequestMapping(value = "clearReCharge",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("重采退费【临时】")
	public Result clearReCharge() {
		try {
			signZYService.clearReCharge();
			return Result.success("重采退费完成!");
		} catch (Exception ex) {
			if(ex instanceof ApiException)
			{
				ApiException apiEx = (ApiException) ex;
				return Result.error(apiEx.errorCode(),ex.getMessage());
			}
			else{
				return Result.error(ex.getMessage());
			}
		}
	}
}

+ 6 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyDao.java

@ -74,4 +74,10 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	 */
	@Query("select a from SignFamily a where a.status>0 and a.expensesStatus='0' and a.signYear='2017'")
	List<SignFamily> findNoExpenses(Pageable pageable);
	/**
	 * 【临时】退费
	 */
	@Query("select a from SignFamily a where a.status>0 and a.expensesStatus='3' and a.signYear='2017'")
	List<SignFamily> findReCharge();
}

+ 15 - 12
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/LogService.java

@ -96,19 +96,22 @@ public class LogService {
    {
        try
        {
            SignFamilyLog obj = new SignFamilyLog();
            obj.setAction(action);
            obj.setContent(content);
            obj.setCreateTime(new Date());
            obj.setError(msg);
            if (!isSuccess) {
                obj.setStatus("0");
            } else {
                obj.setStatus("1");
            //成功日志是否保存
            Boolean saveSuccessLog = systemDictService.getSaveSuccessLog();
            if(!isSuccess || saveSuccessLog || action.equals("0")) {
                SignFamilyLog obj = new SignFamilyLog();
                obj.setAction(action);
                obj.setContent(content);
                obj.setCreateTime(new Date());
                obj.setError(msg);
                if(!isSuccess) {
                    obj.setStatus("0");
                }
                else {
                    obj.setStatus("1");
                }
                signFamilyLogDao.save(obj);
            }
            signFamilyLogDao.save(obj);
        }
        catch (Exception ex)
        {

+ 43 - 3
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignZYService.java

@ -1804,10 +1804,10 @@ public class SignZYService {
    /**
     * 清洗扣费状态【临时】
     */
    public void clearExpensesStatus(int page) throws Exception
    public void clearExpensesStatus(int page,int size) throws Exception
    {
        Sort sort = new Sort(Sort.Direction.DESC, "signSource");
        PageRequest pageRequest = new PageRequest(page, 10000,sort);
        PageRequest pageRequest = new PageRequest(page, size,sort);
        //获取未扣费签约
        List<SignFamily> list = signFamilyDao.findNoExpenses(pageRequest);
        if(list!=null && list.size()>0)
@ -1816,15 +1816,55 @@ public class SignZYService {
            {
                try {
                    String idcard = sign.getIdcard();
                    loadSignFamilyByIdcard(idcard);
                    String[] hm = getHospitalMapping(null);      //获取机构映射
                    //获取数据
                    String responseSign = zysoftService.getSickCurrnetFamilySignInfo(idcard, hm[0], hm[1]);
                    System.out.print(responseSign);
                    Map<String,String> signInfo = zysoftService.getJwOne(responseSign);
                    if(signInfo!=null && !StringUtil.isEmpty(signInfo.get("CHARGE_TIME")))
                    {
                        loadSignFamilyByIdcard(idcard);
                        System.out.print("idcard:" + idcard + " had charged!\r\n");
                    }
                    else{
                        sign.setExpensesStatus("6");
                        signFamilyDao.save(sign);
                    }
                }
                catch (Exception ex)
                {
                    System.out.print("idcard faild!" +  ex.getCause());
                    ex.printStackTrace();
                }
            }
        }
    }
    /**
     * 重采退费【临时】
     */
    public void clearReCharge() throws Exception
    {
        //获取退费签约
        List<SignFamily> list = signFamilyDao.findReCharge();
        if(list!=null && list.size()>0)
        {
            System.out.print("clearReCharge num:"+list.size()+"\r\n");
            for(SignFamily sign :list)
            {
                try {
                    String idcard = sign.getIdcard();
                    loadSignFamilyByIdcard(idcard);
                }
                catch (Exception ex)
                {
                    ex.printStackTrace();
                }
            }
        }
    }
}

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -16,7 +16,6 @@ import static springfox.documentation.builders.PathSelectors.regex;
@EnableSwagger2
@Configuration
public class SwaggerConfig {
    private static final String PUBLIC_API = "Default";
    private static final String Doctor_API = "doctor";
    private static final String Patient_API = "patient";
    private static final String Other_API = "other";
@ -104,7 +103,10 @@ public class SwaggerConfig {
                        regex("/wlyy_service/.*"),
                        regex("/wlyy_service/.*"),
                        regex("/wechat/.*"),
                        regex("/nofilter/.*"),
                        regex("/idc10/.*"),
                        regex("/express/.*")
                ))
                .build()
                .apiInfo(otherApiInfo());

+ 106 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/HealthProblemDict.java

@ -0,0 +1,106 @@
package com.yihu.wlyy.entity.dict;
import javax.persistence.*;
import java.util.Date;
/**
 * Created by chenweida on 2017/8/9.
 */
@Entity
@Table(name = "health_problem_dict")
public class HealthProblemDict {
    private Long id;
    private String hpcode;
    private String hpname;
    private String code;//'字典编码'
    private String name;//'字典名称'
    private String description;//'描述'
    private String createUser;
    private Date createDate;
    private String updateUser;
    private Date updateDate;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateDate() {
        return createDate;
    }
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public Date getUpdateDate() {
        return updateDate;
    }
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
    @Transient
    public String getHpcode() {
        return hpcode;
    }
    public void setHpcode(String hpcode) {
        this.hpcode = hpcode;
    }
    @Transient
    public String getHpname() {
        return hpname;
    }
    public void setHpname(String hpname) {
        this.hpname = hpname;
    }
}

+ 60 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/HpIcd10Relation.java

@ -0,0 +1,60 @@
package com.yihu.wlyy.entity.dict;
import javax.persistence.*;
import java.util.Date;
/**
 * Created by chenweida on 2017/8/9.
 */
@Entity
@Table(name = "hp_icd10_relation")
public class HpIcd10Relation {
    private Long id;
    private Long hpId;//健康问题字典id
    private Long icd10Id;//icd10字典id
    private String createUser;
    private Date createDate;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getHpId() {
        return hpId;
    }
    public void setHpId(Long hpId) {
        this.hpId = hpId;
    }
    public Long getIcd10Id() {
        return icd10Id;
    }
    public void setIcd10Id(Long icd10Id) {
        this.icd10Id = icd10Id;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateDate() {
        return createDate;
    }
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
}

+ 114 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/Icd10Dict.java

@ -0,0 +1,114 @@
package com.yihu.wlyy.entity.dict;
import javax.persistence.*;
import java.util.Date;
/**
 * Created by chenweida on 2017/8/9.
 */
@Entity
@Table(name = "icd10_dict")
public class Icd10Dict {
    private Long id;
    private String code;//'icd10字典编码'
    private String name;//'icd10字典名称'
    private String phoneticCode;//字典名称拼音首字母
    private String chronicFlag;//是否慢病
    private String infectiousFlag;//是否传染病
    private String description;//'描述'
    private String createUser;
    private Date createDate;
    private String updateUser;
    private Date updateDate;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPhoneticCode() {
        return phoneticCode;
    }
    public void setPhoneticCode(String phoneticCode) {
        this.phoneticCode = phoneticCode;
    }
    public String getChronicFlag() {
        return chronicFlag;
    }
    public void setChronicFlag(String chronicFlag) {
        this.chronicFlag = chronicFlag;
    }
    public String getInfectiousFlag() {
        return infectiousFlag;
    }
    public void setInfectiousFlag(String infectiousFlag) {
        this.infectiousFlag = infectiousFlag;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateDate() {
        return createDate;
    }
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public Date getUpdateDate() {
        return updateDate;
    }
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
}

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -34,6 +34,7 @@ public class Prescription extends IdEntity {
    private Date finishTime;                //配送员确认送达或居民确认取药的时间
    private String patient;                  //关联 wlyy_patient code
    private String patientName;             //患者名称
    private String ssc;//社保卡号
    private Integer type;                    //1 处方 2 续方
    private Integer status;                  //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 3.调整完成 4.调整失败 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
    private String doctor;                   //开处方的医生code 关联 wlyy_doctor
@ -505,4 +506,12 @@ public class Prescription extends IdEntity {
    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
}

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java

@ -36,7 +36,8 @@ public class PrescriptionExpressage extends IdEntity{
    private Integer weight;                  //快递重量  单位是g
    //配送人信息
    private String hospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
    private String hospitalAddress;         // 机构地址
    private String hospitalAddress;         // 配送机构地址
    private String hospitalCode;            //配送机构code
    private String expressageName;          //配送人名称
    private String expressageCode;          //配送人code
    private String expressageMobile;        //配送人电话
@ -55,6 +56,13 @@ public class PrescriptionExpressage extends IdEntity{
    private Integer del;    //1可用 0删除
    public String getHospitalCode() {
        return hospitalCode;
    }
    public void setHospitalCode(String hospitalCode) {
        this.hospitalCode = hospitalCode;
    }
    @Column(name = "code", unique = true , nullable=false)
    public String getCode() {

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java

@ -18,6 +18,7 @@ public class PrescriptionInfo extends IdEntity{
    private String prescriptionCode;      //处方code 关联表wlyy_prescription code
    private String drugCode;               //药品code
    private String drugName;               //药品名称
    private String subjectClass;               //科目类别编码
    private String drugRate;               //吃药频率
    private String drugRateName;          //用药频次名称
    private String drugFormat;             //药品规格
@ -310,4 +311,12 @@ public class PrescriptionInfo extends IdEntity{
    public void setDrugRateName(String drugRateName) {
        this.drugRateName = drugRateName;
    }
    public String getSubjectClass() {
        return subjectClass;
    }
    public void setSubjectClass(String subjectClass) {
        this.subjectClass = subjectClass;
    }
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/service/SignFamilyService.java

@ -139,4 +139,6 @@ public class SignFamilyService extends IdEntity {
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisMsgPubSubListener.java

@ -65,10 +65,9 @@ public class RedisMsgPubSubListener extends JedisPubSub {
                //审核消息发送
                prescriptionInfoService.onMesSquareState(message);
            }else if("dispensingComplete".equals(title)){//配药完成
                //提醒健管师待取药
                //药品配送完成,提醒取药
                String prescriptionCode = json.getString("prescription");
                prescriptionService.dispensingComplete(prescriptionCode);
            }
        }catch (Exception e){
            logger.error("redis_error...",e);

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamDao.java

@ -93,5 +93,4 @@ public interface DoctorAdminTeamDao extends
    //  查询当前医生是否为团队长
    @Query("SELECT t.id from AdminTeam t WHERE t.available = true  AND t.leaderCode = ?1 ")
    Integer findLeader(String leaderCode);
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageDao.java

@ -15,4 +15,6 @@ public interface PrescriptionExpressageDao extends PagingAndSortingRepository<Pr
    @Query("from PrescriptionExpressage p where p.mailno=?1")
    PrescriptionExpressage findByPrescriptionExpressMailno(String mailno);
    @Query(" from PrescriptionExpressage p where p.prescriptionCode=?1 and p.del=1")
    PrescriptionExpressage findByPrescriptionCode(String prescriptionCode);
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/service/SignFamilyServiceDao.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.repository.service;
import com.yihu.wlyy.entity.service.ServiceItem;
import com.yihu.wlyy.entity.service.SignFamilyService;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -14,4 +15,8 @@ import java.util.List;
public interface SignFamilyServiceDao extends PagingAndSortingRepository<SignFamilyService, Long>, JpaSpecificationExecutor<SignFamilyService> {
    @Query("select s from ServiceItem s,SignFamilyServiceItem si where s.code=si.serviceItemCode and si.patient=?1")
    List<ServiceItem> getPatientServiceItems(String patient);
    @Modifying
    @Query(" update SignFamilyService s set s.del=0 where s.signCode=?3 and s.serviceCode=?2 and s.patient=?1")
    void deletePatientService(String patientCode, String serviceCode, String signCode);
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/service/SignFamilyServiceItemDao.java

@ -3,10 +3,15 @@ package com.yihu.wlyy.repository.service;
import com.yihu.wlyy.entity.service.SignFamilyService;
import com.yihu.wlyy.entity.service.SignFamilyServiceItem;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by chenweida on 2017/8/8.
 */
public interface SignFamilyServiceItemDao extends PagingAndSortingRepository<SignFamilyServiceItem, Long>, JpaSpecificationExecutor<SignFamilyServiceItem> {
    @Modifying
    @Query(" update SignFamilyServiceItem s set s.del=0 where s.signCode=?3 and s.serviceCode=?2 and s.patient=?1")
    void deletePatiengServiceItem(String patientCode, String serviceCode, String signCode);
}

+ 11 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -33,6 +33,7 @@ import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionLogService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
@ -126,7 +127,9 @@ public class ConsultTeamService extends ConsultService {
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    private WeiXinAccessTokenUtils accessTokenUtils;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    Map<Integer, String> relations = new HashMap<>();
@ -1013,8 +1016,11 @@ public class ConsultTeamService extends ConsultService {
     * @param reason
     * @return
     */
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason){
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason) throws Exception{
        String re = "";
        //获取智业处方详细
        String response = jwPrescriptionService.getLastRecipe(p.getSsc(),jwCode,null,null);
        //续方主表
        prescription.setCode(getCode());
        prescription.setParentCode(jwCode);
@ -1029,9 +1035,10 @@ public class ConsultTeamService extends ConsultService {
        prescription.setJwCode(jwCode);
        prescription.setPatient(p.getCode());
        prescription.setPatientName(p.getName());
        prescription.setSsc(p.getSsc());
        prescription.setReason(reason);
        prescription.setType(2);
        prescription.setStatus(0);
        prescription.setType(PrescriptionLog.PrescriptionLogType.create.getValue());
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.revieweding.getValue());
        prescription.setConsult(ct.getConsult());
        prescriptionDao.save(prescription);

+ 224 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -2,9 +2,11 @@ package com.yihu.wlyy.service.app.prescription;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -13,6 +15,7 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.ImUtill;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -58,7 +61,11 @@ public class PrescriptionInfoService extends BaseService {
    @Autowired
    private ImUtill imUtill;
    @Autowired
    private DoctorAdminTeamDao doctorAdminTeamDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
@ -546,7 +553,7 @@ public class PrescriptionInfoService extends BaseService {
     * @param size 分页大小
     * @return
     */
    public JSONArray getDoctorPrescriptionExpressage(String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
    public JSONArray getHDoctorPrescriptionExpressage(String teamCode,String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
@ -563,7 +570,7 @@ public class PrescriptionInfoService extends BaseService {
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " WHERE 1=1 " );
        List<Object> params = new ArrayList<>();
        setExpressageSql(pre_sql,params,type, doctor,  nameKey, startDate, endDate, hospital, state, page, size);
        setExpressageSql(pre_sql,params,teamCode,type, doctor,  nameKey, startDate, endDate, hospital, state, page, size);
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(),params.toArray());
        //通过缓存查找药品和疾病
        for(Map<String,Object> map :rs){
@ -573,7 +580,8 @@ public class PrescriptionInfoService extends BaseService {
        }
        return new JSONArray(rs);
    }
    public void setExpressageSql(StringBuffer pre_sql,List<Object> param,String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
    public void setExpressageSql(StringBuffer pre_sql,List<Object> param,String teamCode,String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
                pre_sql.append(" AND e.expressage_Code = ?");
@ -583,8 +591,12 @@ public class PrescriptionInfoService extends BaseService {
                param.add(doctor);
            }
        }
        if(StringUtils.isNotBlank(teamCode)){
            pre_sql.append(" AND p.admin_team_id = ? ");
            param.add(teamCode);
        }
        if(StringUtils.isNotBlank(nameKey)){
            pre_sql.append(" AND p.name = ? ");
            pre_sql.append(" AND p.name LIKE ? ");
            param.add("%"+nameKey+"%");
        }
        if(StringUtils.isNotBlank(startDate)){
@ -672,4 +684,212 @@ public class PrescriptionInfoService extends BaseService {
        }
        return 0;
    }
    public JSONObject getPrescriptionExpressageAsdoctorFilter(){
        JSONObject rs = new JSONObject();
        List<Map<String,Object>> states = new ArrayList<>();
        Map<String,Object> map1 = new HashMap<>();
        map1.put("name","订单已支付");
        map1.put("code",PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
        states.add(map1);
        Map<String,Object> map2 = new HashMap<>();
        map2.put("name","配药完成");
        map2.put("code",PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
        states.add(map2);
        Map<String,Object> map3 = new HashMap<>();
        map3.put("name","配送中");
        map3.put("code",PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
        states.add(map3);
        Map<String,Object> map4 = new HashMap<>();
        map4.put("name","药品到达服务站");
        map4.put("code",PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
        states.add(map4);
        Map<String,Object> map5 = new HashMap<>();
        map2.put("name","配药完成");
        map2.put("code",PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        states.add(map2);
        //设置配送状态下拉框
        rs.put("states",states);
        //1 自取 2快递配送 3健管师配送
        List<Map<String,Object>> dispensaryTypes = new ArrayList<>();
        Map<String,Object> type1 = new HashMap<>();
        type1.put("name","自取");
        type1.put("code","1");
        dispensaryTypes.add(type1);
        Map<String,Object> type2 = new HashMap<>();
        type2.put("name","快递配送");
        type2.put("code","2");
        dispensaryTypes.add(type2);
        Map<String,Object> type3 = new HashMap<>();
        type3.put("name","健管师配送");
        type3.put("code","3");
        dispensaryTypes.add(type3);
        //设置配送状态下拉框
        rs.put("dispensaryTypes",dispensaryTypes);
        return rs;
    }
    public JSONArray getDoctorPrescriptionExpressage(String teamCode, String nameKey,String startDate,String endDate,String hospital,String state,String dispensaryType,String AllocationType,Integer page,Integer size){
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.sex, " +
                " p.photo, " +
                " pr.`status`, " +
                " pr.`code`, " +
                " LEFT(pr.create_time,19) AS createTime, " +
                " pr.doctor, " +
                " pr.dispensary_type,"+
                " e.expressage_code AS expressageCode "+
                " FROM " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " +
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code " +
                " WHERE 1=1 " );
        List<Object> params = new ArrayList<>();
        setDoctorExpressageSql(pre_sql,params, teamCode,  nameKey, startDate, endDate, hospital, state,dispensaryType,AllocationType, page, size);
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(),params.toArray());
        //通过缓存查找药品和疾病
        for(Map<String,Object> map :rs){
            String code = (String)map.get("code");
            map.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(code));
            map.put("prescriptionDt", prescriptionDiagnosisService.getPrescriptionDiagnosis(code));
        }
        return new JSONArray(rs);
    }
    public void setDoctorExpressageSql(StringBuffer pre_sql,List<Object> param,String teamCode, String nameKey,String startDate,String endDate,String hospital,String state,String dispensaryType,String AllocationType,Integer page,Integer size){
        if(StringUtils.isNotBlank(nameKey)){
            pre_sql.append(" AND p.name LIKE ? ");
            param.add("%"+nameKey+"%");
        }
        if(StringUtils.isNotBlank(teamCode)){
            pre_sql.append(" AND p.admin_team_id = ? ");
            param.add("%"+teamCode+"%");
        }
        if(StringUtils.isNotBlank(startDate)){
            pre_sql.append(" AND pr.create_time >= ? ");
            param.add(startDate+" 00:00:00");
        }
        if(StringUtils.isNotBlank(endDate)){
            pre_sql.append(" AND pr.create_time <= ? ");
            param.add(startDate+" 23:59:59");
        }
        if(StringUtils.isNotBlank(hospital)){
            pre_sql.append(" AND e.hospital_code = ? ");
            param.add(hospital);
        }
        if(StringUtils.isNotBlank(state)){
            pre_sql.append(" AND pr.status = ? ");
            param.add(state);
        }
        if(StringUtils.isNotBlank(dispensaryType)){
            pre_sql.append(" AND pr.dispensary_type = ? ");
            param.add(dispensaryType);
        }
        if(StringUtils.isNotBlank(AllocationType)){
            //1为未分配建管师列表
            if("1".equals(AllocationType)){
                pre_sql.append(" AND pr.expressage_code IS NULL ");
            }
        }
        pre_sql.append(" ORDER BY r.reviewed_time DESC ");
        if(page!=null&&size!=null){
            pre_sql.append(" LIMIT "+(page-1)*size+","+size);
        }
    }
    public JSONObject getCountExpressage(String teamCode){
        StringBuffer pre_sql = new StringBuffer("SELECT count(1) AS count FROM  " +
                "  wlyy_prescription pr " +
                "  JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                "  WHERE pr.admin_team_id = ? "+
                "  AND pr.dispensary_type =3" +
                "  AND e.expressage_code IS NULL");
        List<Map<String,Object>> list = jdbcTemplate.queryForList(pre_sql.toString(),new Object[]{teamCode});
        if(list!=null&&list.size()>0){
            Map<String,Object> map = list.get(0);
            return new JSONObject(map);
        }else{
            JSONObject rs = new JSONObject();
            rs.put("count",0);
            return rs;
        }
    }
    public JSONArray getHospitalListTitle(String teamCode){
        StringBuffer pre_sql = new StringBuffer("SELECT e.hospital_code AS hospitalCode ,e.hospital_name AS hospitalName FROM " +
                "  wlyy_prescription pr " +
                "  JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                "  WHERE pr.admin_team_id = ? "+
                "  AND e.expressage_code IS NULL " +
                "  AND pr.dispensary_type =3 " +
                "  GROUP BY e.hospital_code ");
        List<Map<String,Object>> list = jdbcTemplate.queryForList(pre_sql.toString(),new Object[]{teamCode});
        return new JSONArray(list);
    }
    public JSONArray getTeamHealthDoctorCount(String doctor){
        Doctor d = doctorDao.findByCode(doctor);
        List<AdminTeam> adminTeams = doctorAdminTeamDao.findByOrgCode(d.getHospital());
        List<Map<String,Object>> rsList = new ArrayList<>();
        if(adminTeams!=null&&adminTeams.size()>0){
            for(AdminTeam adminTeam : adminTeams){
                Map<String,Object> m = new HashedMap();
                m.put("adminTeamCode",adminTeam.getId());
                m.put("adminTeamName",adminTeam.getName());
                StringBuffer pre_sql = new StringBuffer("SELECT " +
                        " COUNT(1) AS count " +
                        " FROM " +
                        " wlyy_admin_team_member m " +
                        " JOIN wlyy_doctor d ON d. CODE = m.doctor_code " +
                        " WHERE " +
                        " d.`level` = 3 " +
                        " AND m.team_id = ? ");
                List<Map<String,Object>> list = jdbcTemplate.queryForList(pre_sql.toString(),new Object[]{adminTeam.getId()});
                if(list!=null&&list.size()>0){
                    Map<String,Object> map = list.get(0);
                    m.put("count",map.get("count"));
                }else{
                    m.put("count",0);
                }
                rsList.add(m);
            }
        }
        return new JSONArray(rsList);
    }
    public int distributionHealthDoctor(String codes,String healthDoctor){
        if(StringUtils.isNotBlank(codes)){
            String code[] = codes.split(",");
            for(int i=0;i<code.length;i++){
                Doctor doctor = doctorDao.findByCode(healthDoctor);
                PrescriptionExpressage prescriptionExpressage  = prescriptionExpressageDao.findByPrescriptionCode(code[i]);
                prescriptionExpressage.setExpressageCode(healthDoctor);
                prescriptionExpressage.setExpressageMobile(doctor.getMobile());
                prescriptionExpressage.setExpressageName(doctor.getName());
                prescriptionExpressageDao.save(prescriptionExpressage);
            }
            return 1;
        }
        return 0;
    }
}

+ 140 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignFamilyServiceService.java

@ -72,6 +72,8 @@ public class SignFamilyServiceService {
            String signServiceCode = UUID.randomUUID().toString();
            signFamilyService.setCode(signServiceCode);
            signFamilyService.setCreateTime(new Date());
            signFamilyService.setPatient(patientCode);
            signFamilyService.setPatientName(sgnFamily.getName());
            signFamilyService.setSignCode(sgnFamily.getCode());
            signFamilyService.setSignTime(new Date());
            signFamilyService.setDel(1);
@ -82,6 +84,7 @@ public class SignFamilyServiceService {
                signFamilyServiceItem.setCode(UUID.randomUUID().toString());
                signFamilyServiceItem.setCreateTime(new Date());
                signFamilyServiceItem.setDel(1);
                signFamilyServiceItem.setPatient(patientCode);
                signFamilyServiceItem.setServiceCode(service.getCode());
                signFamilyServiceItem.setServiceItemCode(oneServiceItem.getCode());
                signFamilyServiceItem.setSignCode(sgnFamily.getCode());
@ -120,6 +123,8 @@ public class SignFamilyServiceService {
        String signServiceCode = UUID.randomUUID().toString();
        signFamilyService.setCode(signServiceCode);
        signFamilyService.setCreateTime(new Date());
        signFamilyService.setPatientName(sgnFamily.getName());
        signFamilyService.setPatient(patient);
        signFamilyService.setSignCode(sgnFamily.getCode());
        signFamilyService.setSignTime(new Date());
        signFamilyService.setDel(1);
@ -132,6 +137,7 @@ public class SignFamilyServiceService {
            signFamilyServiceItem.setDel(1);
            signFamilyServiceItem.setServiceCode(service.getCode());
            signFamilyServiceItem.setServiceItemCode(oneServiceItem.getCode());
            signFamilyServiceItem.setPatient(patient);
            signFamilyServiceItem.setSignCode(sgnFamily.getCode());
            signFamilyServiceItem.setSignServiceCode(signServiceCode);
            saveSignFamilyServiceItemeList.add(signFamilyServiceItem);
@ -152,12 +158,13 @@ public class SignFamilyServiceService {
     */
    public List<ServiceItem> getPatientServiceItem(String patient, String serviceCode) throws Exception {
        StringBuffer sql = new StringBuffer(" SELECT " +
                " DISTINCT s.code," +
                "   s.* " +
                " FROM " +
                "   wlyy_service_item s, " +
                "   wlyy_sign_family_service_item si " +
                " WHERE " +
                "   s.`code` = si.service_item_code ");
                "   s.`code` = si.service_item_code and si.del=1 ");
        if (!StringUtils.isEmpty(patient)) {
            sql.append(" and si.patient = '" + patient + "'");
        }
@ -173,4 +180,136 @@ public class SignFamilyServiceService {
        List<SignFamily> signFamilies = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SignFamily.class));
        return signFamilies.get(0);
    }
    /**
     * 给患者批量删除服务
     *
     * @param patients    患者code
     * @param serviceCode 服务code
     * @throws Exception
     */
    @Transactional
    public JSONObject patientsDeleteService(List<String> patients, String serviceCode) {
        JSONObject jo = new JSONObject();
        List<String> errorPatient = new ArrayList<>();
        for (String patientCode : patients) {
            if (!patientsDeleteService(patientCode, serviceCode)) {
                errorPatient.add(patientCode);
            }
        }
        jo.put("status", 1);//执行成功
        jo.put("errorPatients", errorPatient);//未成功的患者
        return jo;
    }
    /**
     * 给患者批量删除服务
     *
     * @param patientCode 患者code
     * @param serviceCode 服务code
     * @throws Exception
     */
    @Transactional
    public boolean patientsDeleteService(String patientCode, String serviceCode) {
        try {
            //判断患者是否有签约
            SignFamily signFamily = signFamilyDao.findByPatient(patientCode);
            if (signFamily == null) {
                return false;
            }
            //修改患者的服务状态为删除
            signFamilyServiceDao.deletePatientService(patientCode, serviceCode, signFamily.getCode());
            //修改患者的服务项状态为删除
            signFamilyServiceItemDao.deletePatiengServiceItem(patientCode, serviceCode, signFamily.getCode());
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
    /**
     * 按区给患者添加服务
     *
     * @param townCode
     * @param serviceCode
     * @return
     * @throws Exception
     */
    @Transactional
    public JSONObject patientAddServiceByTown(String townCode, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and left(s.hospital,6)='" + townCode + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsAddService(patients, serviceCode);
    }
    /**
     * 按区给患者删除服务
     *
     * @param townCode
     * @param serviceCode
     * @return
     * @throws Exception
     */
    @Transactional
    public JSONObject patientDeleteServiceByTown(String townCode, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and left(s.hospital,6)='" + townCode + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsDeleteService(patients, serviceCode);
    }
    /**
     * 按机构给患者添加服务
     *
     * @param hospital
     * @param serviceCode
     * @return
     * @throws Exception
     */
    public JSONObject patientAddServiceByHospital(String hospital, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and  s.hospita='" + hospital + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsAddService(patients, serviceCode);
    }
    /**
     * 按机构给患者删除服务
     *
     * @param hospital
     * @param serviceCode
     * @return
     * @throws Exception
     */
    public JSONObject patientDeleteServiceByHospital(String hospital, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and s.hospital='" + hospital + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsDeleteService(patients, serviceCode);
    }
    /**
     * 按团队给患者添加服务
     *
     * @param adminTemId
     * @param serviceCode
     * @return
     */
    public JSONObject patientAddServiceByAdminTeam(String adminTemId, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and  s.admin_team_code='" + adminTemId + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsAddService(patients, serviceCode);
    }
    /**
     * 按团队给患者删除服务
     *
     * @param adminTemId
     * @param serviceCode
     * @return
     */
    public JSONObject patientDeleteServiceByAdminTeam(String adminTemId, String serviceCode) throws Exception {
        String sql = "select patient from wlyy_sign_family s where s.`status`>0 and s.expenses_status=1  and s.admin_team_code='" + adminTemId + "'";
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsDeleteService(patients, serviceCode);
    }
}

+ 157 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/Icd10DictServcie.java

@ -0,0 +1,157 @@
package com.yihu.wlyy.service.system;
import com.yihu.wlyy.entity.dict.HealthProblemDict;
import com.yihu.wlyy.util.DateUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.thymeleaf.util.DartUtils;
import javax.annotation.PostConstruct;
import java.util.*;
/**
 * Created by chenweida on 2017/8/9.
 */
@Service
public class Icd10DictServcie {
    private final String keyIcd10 = "wlyy:dict:idc:Icd10:";
    private final String keyHealthProblem = "wlyy:dict:idc:HealthProblem:";
    private final String keyDict2healthProblem = "wlyy:dict:idc:Icd10ToHealthProblem:";
    private final String keyHealthProblem2Dict = "wlyy:dict:idc:HealthProblemToIcd10:";
    private final String ok = "wlyy:dict:idc:init";
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 根据icd10的 code 获取name
     *
     * @param Icd10Code
     * @return
     */
    public String getIcd10Name(String Icd10Code) {
        return redisTemplate.opsForValue().get(keyIcd10 + Icd10Code);
    }
    /**
     * 根据健康问题code获取name
     *
     * @param HealthProblemCode
     * @return
     */
    public String getHealthProblemName(String HealthProblemCode) {
        return redisTemplate.opsForValue().get(keyHealthProblem + HealthProblemCode);
    }
    /**
     * 根据icd10的 code 获取全部的健康问题
     *
     * @param Icd10Code
     * @return
     */
    public String getHealthProblemsByIcd10Code(String Icd10Code) {
        return redisTemplate.opsForValue().get(keyDict2healthProblem + Icd10Code);
    }
    /**
     * 根据健康问题的 code 获取全部的icd10
     *
     * @param HealthProblemCode
     * @return
     */
    public String getIcd10ByHealthProblemCode(String HealthProblemCode) {
        return redisTemplate.opsForValue().get(keyHealthProblem2Dict + HealthProblemCode);
    }
    //==============================初始化数据到redis=============================
    /**
     * 把icd10缓存到redis
     *
     * @return
     */
    @PostConstruct
    public boolean cacheDict() {
        if (redisTemplate.hasKey(ok)) {
            return true;
        }
        List<HealthProblemDict> healthProblemDicts = getHealthProblemDicts();
        //缓存keyIcd10
        cacheIcd10(healthProblemDicts);
        //缓存keyHealthProblem
        cacheHealthProblem(healthProblemDicts);
        //缓存keyHealthProblem2Dict
        cacheHealthProblem2Dict(healthProblemDicts);
        //缓存keyDict2healthProblem
        cacheDict2healthProblem(healthProblemDicts);
        redisTemplate.opsForValue().set(ok, DateUtil.dateToStrLong(new Date()) + "初始化完成");
        return true;
    }
    @Async
    private void cacheIcd10(List<HealthProblemDict> healthProblemDicts) {
        healthProblemDicts.stream().forEach(one -> {
            String key = keyIcd10 + one.getCode();
            redisTemplate.opsForValue().set(key, one.getName());
        });
    }
    @Async
    private void cacheHealthProblem(List<HealthProblemDict> healthProblemDicts) {
        healthProblemDicts.stream().forEach(one -> {
            String key = keyHealthProblem + one.getHpcode();
            redisTemplate.opsForValue().set(key, one.getHpname());
        });
    }
    /**
     * key是 code   value是 hpcode  1对1
     */
    @Async
    private void cacheDict2healthProblem(List<HealthProblemDict> healthProblemDicts) {
        healthProblemDicts.stream().forEach(one -> {
            String key = keyDict2healthProblem + one.getCode();
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("key", one.getHpcode());
            jsonObject.put("value", one.getHpname());
            redisTemplate.opsForValue().set(key, jsonObject.toString());
        });
    }
    /**
     * key是 hpcode    value是 code  1对多
     */
    @Async
    private void cacheHealthProblem2Dict(List<HealthProblemDict> healthProblemDicts) {
        Map<String, List<KeyValueModel>> saveMap = new HashMap<>();
        healthProblemDicts.stream().forEach(one -> {
            List<KeyValueModel> valueList = saveMap.get(one.getHpcode());
            if (valueList == null) {
                valueList = new ArrayList<KeyValueModel>();
            }
            valueList.add(new KeyValueModel(one.getCode(), one.getName()));
            saveMap.put(one.getHpcode(), valueList);
        });
        for (Map.Entry<String, List<KeyValueModel>> one : saveMap.entrySet()) {
            String key = keyHealthProblem2Dict + one.getKey();
            redisTemplate.opsForValue().set(key, JSONArray.fromObject(one.getValue()).toString());
        }
    }
    private List<HealthProblemDict> getHealthProblemDicts() {
        String sql = "select i.*,p.code hpcode,p.`name` hpname from icd10_dict i,hp_icd10_relation hp,health_problem_dict p where i.id=hp.icd10_id and hp.hp_id=p.id";
        return jdbcTemplate.query(sql, new BeanPropertyRowMapper(HealthProblemDict.class));
    }
}

+ 30 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/KeyValueModel.java

@ -0,0 +1,30 @@
package com.yihu.wlyy.service.system;
/**
 * Created by chenweida on 2017/8/9.
 */
public class KeyValueModel {
    private String key;
    private String value;
    public KeyValueModel(String key, String value) {
        this.key = key;
        this.value = value;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 50 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -25,54 +25,93 @@ public class JwPrescriptionService {
    /**
     * 获取字典列表
     * @param dictName
     * @param dictName 字典名称
     * @param hospital 药品code
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName) throws Exception{
    public String getDictForI(String dictName,String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getDictForI";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getRecipeTemplate(String dictName) throws Exception{
    /**
     * 获取处方模板
     * @param deptCode 科室编码
     * @param staffCode 人员code
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getRecipeTemplate(String deptCode,String staffCode, String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getRecipeTemplate";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("deptCode", deptCode));
        params.add(new BasicNameValuePair("staffCode", staffCode));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getLastRecipe(String dictName) throws Exception{
    /**
     * 获取历史处方记录
     * @param cardNo 社保卡号
     * @param recipeNo 医嘱号
     * @param applyTimeFrom 开始时间
     * @param applyTimeEnd 结束时间
     * @return
     * @throws Exception
     */
    public String getLastRecipe(String cardNo,String recipeNo,String applyTimeFrom,String applyTimeEnd) throws Exception{
        String url = jwUrl + "/third/prescription/getLastRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("recipeNo", recipeNo));
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String saveRecipe(String dictName) throws Exception{
    /**
     * 处方开方接口
     * @param prescriptionCode 续方code
     * @return
     * @throws Exception
     */
    public String saveRecipe(String prescriptionCode) throws Exception{
        String url = jwUrl + "/third/prescription/saveRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getDispUnSettleFeeList(String dictName) throws Exception{
        String url = jwUrl + "/third/prescription/getDispUnSettleFeeList";
    /**
     * 待结算费用列表接口
     * @param cardNo
     * @param visitNo
     * @return
     * @throws Exception
     */
    public String getDispUnSettleFeeInfoList(String cardNo,String visitNo) throws Exception{
        String url = jwUrl + "/third/prescription/getDispUnSettleFeeInfoList";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("visitNo", visitNo));
        String response = httpClientUtil.post(url, params, "UTF-8");

+ 77 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/icd/Icd10Controller.java

@ -0,0 +1,77 @@
package com.yihu.wlyy.web.common.icd;
import com.yihu.wlyy.service.system.Icd10DictServcie;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by chenweida on 2017/8/9.
 */
@RestController
@RequestMapping("/idc10/")
@Api(description = "icd10和健康问题接口管理")
public class Icd10Controller extends BaseController {
    @Autowired
    private Icd10DictServcie icd10DictServcie;
    @ApiOperation("根据icd10字典的code找到name")
    @RequestMapping(value = "/getIdc10NameByCode", method = RequestMethod.GET)
    public String getTopic(
            @ApiParam(required = true, name = "code", value = "icd10字典code") @RequestParam(required = true, value = "code") String code) {
        try {
            return write(200, "查询成功", "data", icd10DictServcie.getIcd10Name(code));
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @ApiOperation("根据icd10的code找到健康问题字典")
    @RequestMapping(value = "/getIcd10ByHealthProCode", method = RequestMethod.GET)
    public String getIcd10ByHealthProCode(
            @ApiParam(required = true, name = "code", value = "icd10字典code") @RequestParam(required = true, value = "code") String code) {
        try {
            return write(200, "查询成功", "data", icd10DictServcie.getIcd10ByHealthProblemCode(code));
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @ApiOperation("根据健康问题字典的code找到name")
    @RequestMapping(value = "/getHealthProNameByCode", method = RequestMethod.GET)
    public String getHealthProNameByCode(
            @ApiParam(required = true, name = "code", value = "健康问题字典code") @RequestParam(required = true, value = "code") String code) {
        try {
            return write(200, "查询成功", "data", icd10DictServcie.getHealthProblemName(code));
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @ApiOperation("根据健康问题字典的code找到icd10字典")
    @RequestMapping(value = "/getHealthProByIcd10Code", method = RequestMethod.GET)
    public String getHealthProByIcd10Code(
            @ApiParam(required = true, name = "code", value = "健康问题字典code") @RequestParam(required = true, value = "code") String code) {
        try {
            return write(200, "查询成功", "data", icd10DictServcie.getHealthProblemsByIcd10Code(code));
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @ApiOperation("初始化全部数据到redis")
    @RequestMapping(value = "/init2Redis", method = RequestMethod.POST)
    public String init2Redis() {
        try {
            icd10DictServcie.cacheDict();
            return write(200, "查询成功");
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
}

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -72,4 +72,5 @@ public class DataHandlingController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
}

+ 88 - 18
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -42,7 +42,6 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionFilter", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取过滤规则信息列表")
    public String getPrescriptionFilter(){
        try {
@ -54,7 +53,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getDoctorPrescription", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取全科医生/建管师续方列表/搜索")
    public String getDoctorPrescription(@RequestParam(required = true)@ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false)@ApiParam(value = "续方状态", name = "state") String state,
@ -74,7 +72,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getContinuedPrescriptionAsDoctor", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "续方详情")
    public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true)@ApiParam(value = "团队长标识:1:是;2否", name = "type") String type){
@ -87,7 +84,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/reviewPrescription", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "续方审核")
    public String reviewPrescription(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false)@ApiParam(value = "不同意原因", name = "reason") String reason,
@ -101,7 +97,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/updatePresInfo", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "调整处方")
    @ObserverRequired
    public String updatePresInfo(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
@ -117,7 +112,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getInfoTitle", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "调整处方-药品分类及种类数目")
    public String getInfoTitle(){
        try {
@ -129,7 +123,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getInfoListByParentCode", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "药品类别获取药品")
    private String getInfoListByParentCode(@RequestParam(required = true)@ApiParam(value = "药品类别Code", name = "code") String code){
        try {
@ -178,7 +171,6 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getDrugTimes", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "药品品使用频次字典")
    public String getDrugTimes(){
        try {
@ -189,10 +181,10 @@ public class PrescriptionInfoController extends BaseController{
        }
    }
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取续方订单列表")
    public String getDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type")  String type,
    @RequestMapping(value = "/getHDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表")
    public String getHDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type")  String type,
                                                  @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
@ -201,7 +193,7 @@ public class PrescriptionInfoController extends BaseController{
                                                  @RequestParam(required = false) @ApiParam(value = "页数", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getDoctorPrescriptionExpressage(type,"hxmD201703150222",nameKey,startDate,endDate,hospital,state,page,size));
            return write(200, "操作成功!", "data",prescriptionInfoService.getHDoctorPrescriptionExpressage(teamCode,type,getUID(),nameKey,startDate,endDate,hospital,state,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -209,11 +201,75 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/getPrescriptionExpressageFilter", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取续方订单列表过滤条件")
    @ApiOperation(value = "获取健康管理师续方订单列表过滤条件")
    public String getPrescriptionExpressageFilter(){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageFilter("hxmD201703150222"));
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageFilter(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionExpressageAsdoctorFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表过滤条件")
    public String getPrescriptionExpressageAsdoctorFilter(){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageAsdoctorFilter());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表")
    public String getDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital")String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType")String dispensaryType,
                                                  @RequestParam(required = false) @ApiParam(value = "未分配健管师", name = "传1为未分配健管师")String AllocationType,
                                                  @RequestParam(required = false) @ApiParam(value = "起始页", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
        try {
            return write(200, "操作成功!", "data",
                    prescriptionInfoService.
                            getDoctorPrescriptionExpressage(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType,AllocationType, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getCountExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取指定团队未分配建管师订单数目")
    public String getCountExpressage(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getCountExpressage(teamCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getHospitalListTitle", method = RequestMethod.GET)
    @ApiOperation(value = "获取服务站列表")
    public String getHospitalListTitle(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getHospitalListTitle(teamCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getTeamHealthDoctorCount", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生同社区底下所有团队建管师数目")
    public String getTeamHealthDoctorCount(){
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getTeamHealthDoctorCount(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -223,13 +279,27 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionDurgDict", method = RequestMethod.GET)
    @ApiOperation(value = "获取基卫的药品字典")
    public String getPrescriptionDurgDict(
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName,
            @RequestParam(required = true,name = "hospital") @ApiParam(value = "医院code", name = "hospital",required = true)  String hospital
    ){
        try {
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName));
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName,hospital));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/distributionHealthDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "配置建管师")
    public String distributionHealthDoctor(@RequestParam(required = true) @ApiParam(value = "续方Code字符串用','分割", name = "codes") String codes,
                                           @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor")String healthDoctor){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.distributionHealthDoctor( codes, healthDoctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

+ 157 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignFamilyServiceNoFilterController.java

@ -0,0 +1,157 @@
package com.yihu.wlyy.web.patient.sign;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.service.ServiceItem;
import com.yihu.wlyy.service.app.sign.SignFamilyServiceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
 * Created by chenweida on 2017/8/8.
 */
@RestController
@Api(description = "患者签约服务(没有走拦截器)")
@RequestMapping("/nofilter/sign/service")
public class PatientSignFamilyServiceNoFilterController extends BaseController {
    @Autowired
    private SignFamilyServiceService signFamilyServiceService;
    @RequestMapping(value = "/getPatientService", method = RequestMethod.GET)
    @ApiOperation("根据患者code获取患者的服务")
    public String getPatientService(
            @RequestParam(required = false, value = "patientCode") @ApiParam(required = false, value = "患者code", name = "patientCode") String patientCode
    ) {
        try {
            List<ServiceItem> serviceItems = signFamilyServiceService.getPatientServiceItem(patientCode, null);
            return write(200, "请求成功", "data", serviceItems);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientAddService", method = RequestMethod.POST)
    @ApiOperation("给患者添加服务")
    public String patientAddService(
            @RequestParam(required = true, value = "patientCodes") @ApiParam(required = true, value = "患者code,多个逗号分割", name = "patientCodes") String patientCodes,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            String[] patientCode = patientCodes.split(",");
            JSONObject jsonObject = signFamilyServiceService.patientsAddService(Arrays.asList(patientCode), serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientDeleteService", method = RequestMethod.POST)
    @ApiOperation("给患者删除服务")
    public String patientDeleteService(
            @RequestParam(required = true, value = "patientCodes") @ApiParam(required = true, value = "患者code,多个逗号分割", name = "patientCodes") String patientCodes,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            String[] patientCode = patientCodes.split(",");
            JSONObject jsonObject = signFamilyServiceService.patientsDeleteService(Arrays.asList(patientCode), serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientAddServiceByTown", method = RequestMethod.POST)
    @ApiOperation("按区给患者添加服务")
    public String patientAddServiceByTown(
            @RequestParam(required = true, value = "townCode") @ApiParam(required = true, value = "town区code(集美区350211)", name = "townCode") String townCode,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientAddServiceByTown(townCode, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientDeleteServiceByTown", method = RequestMethod.POST)
    @ApiOperation("按区给患者删除服务")
    public String patientDeleteServiceByTown(
            @RequestParam(required = true, value = "townCode") @ApiParam(required = true, value = "town区code(集美区350211)", name = "townCode") String townCode,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientDeleteServiceByTown(townCode, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientAddServiceByHospital", method = RequestMethod.POST)
    @ApiOperation("按机构给患者添加服务")
    public String patientAddServiceByHospital(
            @RequestParam(required = true, value = "hospital") @ApiParam(required = true, value = "机构code", name = "hospital") String hospital,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientAddServiceByHospital(hospital, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientDeleteServiceByHospital", method = RequestMethod.POST)
    @ApiOperation("按机构给患者删除服务")
    public String patientDeleteServiceByHospital(
            @RequestParam(required = true, value = "hospital") @ApiParam(required = true, value = "机构code", name = "hospital") String hospital,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientDeleteServiceByHospital(hospital, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientAddServiceByAdminTeam", method = RequestMethod.POST)
    @ApiOperation("按团队给患者添加服务")
    public String patientAddServiceByAdminTeam(
            @RequestParam(required = true, value = "adminTemId") @ApiParam(required = true, value = "行政团队ID", name = "adminTemId") String adminTemId,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientAddServiceByAdminTeam(adminTemId, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/patientDeleteServiceByAdminTeam", method = RequestMethod.POST)
    @ApiOperation("按团队给患者删除服务")
    public String patientDeleteServiceByAdminTeam(
            @RequestParam(required = true, value = "adminTemId") @ApiParam(required = true, value = "行政团队ID", name = "adminTemId") String adminTemId,
            @RequestParam(required = true, value = "serviceCode") @ApiParam(required = true, value = "服务code", name = "serviceCode") String serviceCode
    ) {
        try {
            JSONObject jsonObject = signFamilyServiceService.patientDeleteServiceByAdminTeam(adminTemId, serviceCode);
            return write(200, "请求成功", "data", jsonObject);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTagUtil.java

@ -390,7 +390,7 @@ public class WeiXinTagUtil {
    @Transactional
    public void addTagWithOpenid(String openid, String code, String name) {
        SignFamily signFamily = signFamilyDao.findByPatient(code);
        if (signFamily == null) {
        if (signFamily != null) {
            addTagWithOpenid(openid, signFamily.getHospital(), code, name);
        } else {
            saveLog(openid, code, name, null, 1, "患者还没有签约");

+ 30 - 25
patient-co/patient-co-wlyy/src/main/resources/application.yml

@ -289,7 +289,7 @@ spring:
      password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    host: 172.19.103.47 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
@ -408,30 +408,35 @@ wechat:
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
   #咨询回复
   template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
   #签约成功
   template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
   #签约失败
   template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
   #健康指导提醒
   template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
   #解约提醒
   template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
   #预约成功
   template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
   #预约取消
   template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
   #缴费提醒
   template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
   #健康教育
   template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
   #医生变更
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/