Parcourir la source

Merge branch 'dev' of yeshijie/patient-co-management into dev

chenweida il y a 7 ans
Parent
commit
6f1f34e517

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

@ -122,16 +122,11 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "getRecipeTemplate",method = RequestMethod.POST)
	@RequestMapping(value = "getRecipeTemplate",method = RequestMethod.POST)
	@ApiOperation("处方模板获取接口")
	@ApiOperation("处方模板获取接口")
	public Result getRecipeTemplate(@ApiParam(name="deptCode",value="科室编码",defaultValue = "5")
									@RequestParam(value = "deptCode",required = true) String deptCode,
									@ApiParam(name="staffCode",value="人员code",defaultValue = "7")
									@RequestParam(value = "staffCode",required = true) String staffCode,
									@ApiParam(name="hospital",value="医院code",defaultValue = "")
									@RequestParam(value = "hospital",required = false) String hospital)
	public Result getRecipeTemplate(@ApiParam(name="doctor",value="医生code",defaultValue = "5")
									@RequestParam(value = "doctor",required = true) String doctor)
	{
	{
		try {
		try {
			String re = prescriptionService.getRecipeTemplate(staffCode,deptCode,hospital);
			String re = prescriptionService.getRecipeTemplate(doctor);
			return Result.success("处方模板获取接口!",re);
			return Result.success("处方模板获取接口!",re);
		} catch (Exception ex) {
		} catch (Exception ex) {

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

@ -23,6 +23,8 @@ public class DoctorMapping extends IdEntity {
	private String jwDocotrSex;
	private String jwDocotrSex;
	// 基卫医生身份证
	// 基卫医生身份证
	private String jwDocotrIdcard;
	private String jwDocotrIdcard;
	//基位医生科室代码
//	private String jwDept;
	// 基卫医生医院
	// 基卫医生医院
	private String jwDoctorHospital;
	private String jwDoctorHospital;
	// 基卫医生医院名称
	// 基卫医生医院名称

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

@ -2,7 +2,6 @@ package com.yihu.wlyy.service.service.prescription;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.SystemConfig;
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.StringUtil;
import com.yihu.wlyy.service.common.util.WebserviceUtil;
import com.yihu.wlyy.service.common.util.WebserviceUtil;
import com.yihu.wlyy.service.service.LogService;
import com.yihu.wlyy.service.service.LogService;
@ -321,75 +320,75 @@ public class PrescriptionCAService {
        return re;
        return re;
    }
    }
    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("msgBody", msgBody);
            params.put("msgHeader", msgHeader);
            System.out.print(WebserviceUtil.post(caUrl, caNamespace, "XMCA6_UnifiedCallInterface", params) + "\r\n");
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }
//    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("msgBody", msgBody);
//            params.put("msgHeader", msgHeader);
//            System.out.print(WebserviceUtil.post(caUrl, caNamespace, "XMCA6_UnifiedCallInterface", params) + "\r\n");
//
//
//
//        }
//        catch (Exception ex)
//        {
//            ex.printStackTrace();
//        }
//    }
}
}

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

@ -6,7 +6,9 @@ import com.yihu.wlyy.service.dao.DoctorMappingDao;
import com.yihu.wlyy.service.dao.HospitalDao;
import com.yihu.wlyy.service.dao.HospitalDao;
import com.yihu.wlyy.service.dao.PatientDao;
import com.yihu.wlyy.service.dao.PatientDao;
import com.yihu.wlyy.service.dao.SignFamilyDao;
import com.yihu.wlyy.service.dao.SignFamilyDao;
import com.yihu.wlyy.service.dao.*;
import com.yihu.wlyy.service.dao.prescription.*;
import com.yihu.wlyy.service.dao.prescription.*;
import com.yihu.wlyy.service.entity.Doctor;
import com.yihu.wlyy.service.entity.Hospital;
import com.yihu.wlyy.service.entity.Hospital;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.SignFamily;
import com.yihu.wlyy.service.entity.SignFamily;
@ -62,6 +64,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private HospitalDao hospitalDao;
    private HospitalDao hospitalDao;
    @Autowired
    @Autowired
    private PrescriptionPayDao prescriptionPayDao;
    private PrescriptionPayDao prescriptionPayDao;
    @Autowired
    private DoctorDao doctorDao;
    @Value("${redisChannel.prescription}")
    @Value("${redisChannel.prescription}")
    private String channelTopic;
    private String channelTopic;
@ -337,22 +341,25 @@ public class PrescriptionService extends ZysoftBaseService{
    /**
    /**
     * 7.2 处方模板获取接口
     * 7.2 处方模板获取接口
     * @param staffCode 员工编码
     * @param deptCode 部门编码
     * @param hospital
     * @param code 医生code
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public String getRecipeTemplate(String staffCode,String deptCode,String hospital)  throws Exception
    public String getRecipeTemplate(String code)  throws Exception
    {
    {
        String[] hospitalMapping = getHospitalMapping(hospital); //获取机构映射
        hospital = hospitalMapping[0];
        Doctor doctor = doctorDao.findByCode(code);
        String[] hospitalMapping = getHospitalMapping(doctor.getHospital()); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        header.put("LICENCE",licence);
        String staffCode = null;
        String deptCode = null;
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("staffCode",staffCode);
        params.put("staffCode",staffCode);
        params.put("deptCode",deptCode);
        params.put("deptCode",deptCode);
@ -388,8 +395,8 @@ public class PrescriptionService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("cardNo",cardNo);
        params.put("cardNo",cardNo);
        params.put("recipeNo",recipeNo);
        params.put("recipeNo",recipeNo);
        params.put("applyTimeFrom",applyTimeFrom);
        params.put("applyTimeEnd",applyTimeEnd);
//        params.put("applyTimeFrom",applyTimeFrom);
//        params.put("applyTimeEnd",applyTimeEnd);
        String response = postSecond("getLastRecipe","调阅历史处方接口",params,null,header,false,2);
        String response = postSecond("getLastRecipe","调阅历史处方接口",params,null,header,false,2);

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -55,14 +55,14 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type=?3 order by a.createTime desc")
    List<Message> getSysTemMessageByType(String doctor, String prescriptionStatus, Integer type);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6)")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6)")
    List<Message> getSystemMessage(String doctor,Pageable pageRequest);
    List<Message> getSystemMessage(String doctor,Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=6 and a.prescriptionStatus='0' ")
    List<Message> getPrescriptionMessage(String doctor,Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")
    List<Message> getPrescriptionMessage(String doctor,Integer type,Pageable pageRequest);
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    int findMessageNum(String doctor, Integer type);
    int findMessageNum(String doctor, Integer type);

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -152,7 +152,7 @@ public class MessageService extends BaseService {
        }
        }
        //获取续方消息
        //获取续方消息
        List<Message> prescriptionMessage = messageDao.getSysTemMessageByType(doctor,"0",6);
        List<Message> prescriptionMessage = messageDao.getSysTemMessageByPrescription(doctor,"0");
        JSONObject prescriptionJson = new JSONObject();
        JSONObject prescriptionJson = new JSONObject();
        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
            prescriptionJson.put("amount", prescriptionMessage.size());
            prescriptionJson.put("amount", prescriptionMessage.size());
@ -449,12 +449,12 @@ public class MessageService extends BaseService {
    /**
    /**
     * 获取续方消息
     * 获取续方消息
     */
     */
    public List<Message> getPrescriptionMessage(String doctor, Integer page, Integer pagesize) throws Exception {
    public List<Message> getPrescriptionMessage(String doctor,Integer type, Integer page, Integer pagesize) throws Exception {
        // 排序
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        // 分页信息
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.getPrescriptionMessage(doctor, pageRequest);
        return messageDao.getPrescriptionMessage(doctor,type, pageRequest);
    }
    }
    /**
    /**

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

@ -49,18 +49,14 @@ public class JwPrescriptionService {
    /**
    /**
     * 获取处方模板
     * 获取处方模板
     * @param deptCode 科室编码
     * @param staffCode 人员code
     * @param hospital 医院code
     * @param doctor 医生code
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public String getRecipeTemplate(String deptCode,String staffCode, String hospital) throws Exception{
    public String getRecipeTemplate(String doctor) throws Exception{
        String url = jwUrl + "/third/prescription/getRecipeTemplate";
        String url = jwUrl + "/third/prescription/getRecipeTemplate";
        List<NameValuePair> params = new ArrayList<>();
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("deptCode", deptCode));
        params.add(new BasicNameValuePair("staffCode", staffCode));
        params.add(new BasicNameValuePair("hospital", hospital));
        params.add(new BasicNameValuePair("doctor", doctor));
        String response = httpClientUtil.post(url, params, "UTF-8");
        String response = httpClientUtil.post(url, params, "UTF-8");

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -192,9 +192,11 @@ public class DoctorMessageController extends BaseController {
    public String getPrescriptionMessage(@ApiParam(value = "第几页", defaultValue = "1")
    public String getPrescriptionMessage(@ApiParam(value = "第几页", defaultValue = "1")
                                   @RequestParam Integer page,
                                   @RequestParam Integer page,
                                   @ApiParam(value = "每页几行", defaultValue = "10")
                                   @ApiParam(value = "每页几行", defaultValue = "10")
                                   @RequestParam Integer pagesize) {
                                   @RequestParam Integer pagesize,
                                   @ApiParam(value = "类型(6团队长待审核,7健管师待取药)", defaultValue = "6")
                                   @RequestParam Integer type) {
        try {
        try {
            List<Message> list = messageService.getPrescriptionMessage(getUID(), page, pagesize);
            List<Message> list = messageService.getPrescriptionMessage(getUID(),type, page, pagesize);
            return write(200, "获取消息成功!", "list", list);
            return write(200, "获取消息成功!", "list", list);
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);