浏览代码

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

wangzhinan 6 年之前
父节点
当前提交
dc4350d4f7

+ 7 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java

@ -326,15 +326,19 @@ public class CustomerSynergyManageController extends BaseController {
    @RequestMapping(value = "/taskSubmit", method = RequestMethod.POST)
    @ApiOperation(value = "协同任务提交")
    @ResponseBody
    public String taskSubmit(@ApiParam(name="workorderCode",value="协同服务工单code",required = true)
    public String taskSubmit(@ApiParam(name="userCode",value="客服code",required = false)
                             @RequestParam(required = false)String userCode,
                             @ApiParam(name="workorderCode",value="协同服务工单code",required = true)
                             @RequestParam(required = true)String workorderCode,
                             @ApiParam(name="dealResultRemark",value="说明",required = false)
                             @RequestParam(required = false)String dealResultRemark,
                             @ApiParam(name="accessoryJson",value="附件的json",required = true)
                             @RequestParam(required = true)String accessoryJson){
        try{
            synergyManageService.taskSubmit(workorderCode,dealResultRemark,accessoryJson);
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            synergyManageService.taskSubmit(userCode,workorderCode,dealResultRemark,accessoryJson);
            return write(200,"提交成功");
        }catch (Exception e){
            error(e);

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java

@ -31,4 +31,8 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    ManageSynergyWorkorderServicerDO findByCode(String code);
    List<ManageSynergyWorkorderServicerDO> findByWorkorderCode(String workorderCode);
    @Modifying
    @Query("update ManageSynergyWorkorderServicerDO s set s.executorCode = ?2,s.executorName=?3 where s.workorderCode = ?1 and s.executorCode is not null")
    Integer updateWorkorderServicer(String workorderCode,String userCode,String userName);
}

+ 3 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -1154,7 +1154,7 @@ public class SynergyManageService extends BaseJpaService {
    @Transactional
    public void taskSubmit(String workorderCode,String dealResultRemark,String accessoryJson) throws Exception{
    public void taskSubmit(String userCode,String workorderCode,String dealResultRemark,String accessoryJson) throws Exception{
        JSONArray jsonArray = new JSONArray(accessoryJson);
        String fileName;
        String url;
@ -1171,6 +1171,8 @@ public class SynergyManageService extends BaseJpaService {
            accessoryList.add(manageSynergyAccessoryDO);
        }
        manageSynergyAccessoryDao.save(accessoryList);
        User user = userDao.findByCode(userCode);
        workorderServicerDao.updateWorkorderServicer(workorderCode,userCode,user.getName());
        ManageSynergyWorkorderDO manageSynergyWorkorderDO = workOrderDao.findByCode(workorderCode);
        manageSynergyWorkorderDO.setDealResultRemark(dealResultRemark);
        manageSynergyWorkorderDO.setStatus(3);

+ 23 - 19
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java

@ -66,6 +66,7 @@ public class ChildVaccinImmuneService extends BaseService {
	@Transactional(rollbackFor = Exception.class)
	public int getChildImmuneVaccinEveryDay()throws Exception{
		int result = 0;
        String nowShotDay = DateUtil.dateToStrShort(new Date());
		try {
			/*String sql ="SELECT" +
					" DISTINCT ci.`code`," +
@ -83,7 +84,6 @@ public class ChildVaccinImmuneService extends BaseService {
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			for (Map<String,Object> map : list){
				String barcode = String.valueOf(map.get("barcode"));
				System.out.println("===============barcode=============="+barcode);
				String deptStr = immuneService.findDept(barcode);
				if (StringUtils.isNotBlank(deptStr)){
					JSONObject jsonObject = new JSONObject(deptStr);
@ -108,19 +108,19 @@ public class ChildVaccinImmuneService extends BaseService {
											count++;
										}
									}
									//原来有的疫苗要判断是否有超过预约时间的7天,并且看提醒是否超过7天,超过7天可以重新提醒
									if (count>0 && childImmuneVaccin.getIsOut()==1){
										if (DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											//childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
											String uSql ="UPDATE wlyy_child_immune_vaccin SET is_out=0  AND `code`='"+childImmuneVaccin.getCode()+"'";
											jdbcTemplate.update(uSql);
										}else {
											//判断是否过了7天提醒时间
											String afterAlertSevenDay = DateUtil.dateToStr(DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7),DateUtil.YYYY_MM_DD);
											String nowShotDay = DateUtil.dateToStrShort(new Date());
                                    //原来有的疫苗要判断是否有超过预约时间的7天,并且看提醒是否超过7天,超过7天可以重新提醒
                                    if (count>0 && childImmuneVaccin.getIsOut()==1){
                                        String afterJzrqSevenDay = DateUtil.dateToStr(DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7),DateUtil.YYYY_MM_DD);
                                        String afterAlertSevenDay = DateUtil.dateToStr(DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7),DateUtil.YYYY_MM_DD);
                                        if ( DateUtil.strToDate(afterJzrqSevenDay,DateUtil.YYYY_MM_DD).before(DateUtil.strToDate(nowShotDay,DateUtil.YYYY_MM_DD))){
                                            //过了预约时间7天,更新为isOut=0,则不能预约了
                                            //childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
                                            String uSql ="UPDATE wlyy_child_immune_vaccin SET is_out=0  where `code`='"+childImmuneVaccin.getCode()+"'";
                                            jdbcTemplate.update(uSql);
                                        }else {
                                            //判断是否过了7天提醒时间
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.strToDate(afterAlertSevenDay,DateUtil.YYYY_MM_DD).before(DateUtil.strToDate(nowShotDay,DateUtil.YYYY_MM_DD))) {
												String updateSql = "UPDATE wlyy_child_immune_vaccin SET alert_tag=0  AND `code`='" + childImmuneVaccin.getCode() + "'";
												String updateSql = "UPDATE wlyy_child_immune_vaccin SET alert_tag=0  where `code`='" + childImmuneVaccin.getCode() + "'";
												jdbcTemplate.update(updateSql);
											}
										}
@ -158,8 +158,8 @@ public class ChildVaccinImmuneService extends BaseService {
										childImmuneVaccin.setAlert_tag(0);
										childImmuneVaccin.setDel(0);
										childImmuneVaccin.setCreate_time(new Date());
										if (DateUtil.getPreDays(DateUtil.strToDate(vaccinJsonJSONArray.getJSONObject(j).getString("jzRq")),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
                                        String afterJzrqSevenDay = DateUtil.dateToStr(DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7),DateUtil.YYYY_MM_DD);
                                        if ( DateUtil.strToDate(afterJzrqSevenDay,DateUtil.YYYY_MM_DD).before(DateUtil.strToDate(nowShotDay,DateUtil.YYYY_MM_DD))){	//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccin.setIsOut(0);
										}else {
											childImmuneVaccin.setIsOut(1);
@ -236,6 +236,8 @@ public class ChildVaccinImmuneService extends BaseService {
                    jsonObject.put("childName", map.get("name"));//儿童姓名
                    jsonObject.put("childCode", map.get("child_info_code"));//儿童code
                    jsonObject.put("vaccinName", map.get("ymmc"));//疫苗名称
                    jsonObject.put("jzrq",map.get("jzrq"));//接种日期
                    jsonObject.put("jzzc",map.get("jzzc"));//接种针次
                    jsonArray.put(jsonObject);
                }
            }
@ -260,7 +262,9 @@ public class ChildVaccinImmuneService extends BaseService {
			String childName = jsonObject.getString("childName");
			String vaccinName = jsonObject.getString("vaccinName");
			String vaccinCode = jsonObject.getString("vaccinCode");
			String sql ="SELECT" +
			String jzrq = jsonObject.getString("jzrq");
            String jzzc = jsonObject.getString("jzzc");
            String sql ="SELECT" +
					" cfi.relation," +
					" p.`code`," +
					" p.`name`," +
@ -270,7 +274,7 @@ public class ChildVaccinImmuneService extends BaseService {
					" LEFT JOIN wlyy_patient p ON cfi.family_code = p.`code`" +
					" WHERE" +
					" cfi.child_code = '"+childCode+"'" +
					" AND cfi.del = 0 and (p.openid is not null or p.openid !='')";
					" AND cfi.del = 0 and (p.openid is not null or p.openid !='') AND p.`code`='0fab4dd67e074e16ac86db6b6c15233e'";
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			if (list.size()==0){
				return -10000;
@ -285,10 +289,10 @@ public class ChildVaccinImmuneService extends BaseService {
							WechatTemplateConfig temp = templateConfigDao.findByScene("template_doctor_survey", "dsymjztx");
							JSONObject json = new JSONObject();
                            json.put("toUser",String.valueOf(map.get("code")));
                            json.put("keyword1", temp.getKeyword1());
                            json.put("keyword1", temp.getKeyword1().replace("key1",vaccinName).replace("key2",jzzc));
                            json.put("keyword2", temp.getKeyword2().replace("key1",DateUtil.dateToStr(new Date(), "yyyy-MM-dd")));
                            json.put("remark", temp.getRemark());
                            json.put("first", temp.getFirst().replace("key1",String.valueOf(map.get("name"))).replace("key2", childName));
                            json.put("first", temp.getFirst().replace("key1",String.valueOf(map.get("name"))).replace("key2", childName).replace("key3",jzrq));
                            json.put("url",temp.getUrl().replace("key1",childCode));
                            logger.info("weiTempJOSN:"+json.toString());
							pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 11,String.valueOf(map.get("openid")) , String.valueOf(map.get("name")), json);

+ 2 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml

@ -128,10 +128,12 @@ es:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUp: wlyy_followup
    patientRemindRecord: wlyy_patient_remind_record_prod
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUpContent: wlyy_followup_content
    patientRemindRecord: wlyy_patient_remind_record_prod
  host:  http://59.61.92.90:9065,http://59.61.92.90:9067
  tHost: 59.61.92.90:9066,59.61.92.90:9068
  clusterName: jkzl

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java

@ -33,6 +33,6 @@ public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildIm
	@Query("update ChildImmuneVaccin  c set c.alert_tag=?2 where c.code=?1")
	int updateAlertTagByCode(String code,int tag);
	@Query("select p from ChildImmuneVaccin p where p.barcode=?1 and p.del=0 and p.ymsx=1")
	@Query("select p from ChildImmuneVaccin p where p.barcode=?1 and p.del=0 and p.ymsx=1 order by p.jzrq")
	List<ChildImmuneVaccin> getChildImmuneVaccinByBarcodeAndYmsx(String barcode);
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -136,10 +136,10 @@ public class ChildFamilyImmuneService extends BaseService {
		String sql = "select DISTINCT t.*,m.child_name,m.birthday,m.childCode from wlyy_child_immune_vaccin t " +
				" inner join ( " +
				" select a.*,b.name as family_name ,c.name as child_name,c.barcode as barcode ,c.birthday as birthday,c.`code` AS childCode from  wlyy_child_family_immune a " +
				" inner join (select patient,name from wlyy_sign_family where type in (1,2) and `status` = 1 and expenses_status = 1 and doctor = '"+doctorcode+"' or doctor_health='"+doctorcode+"') b " +
				" inner join (select patient,name from wlyy_sign_family where type in (1,2) and `status` = 1 and expenses_status = 1 and (doctor = '"+doctorcode+"' or doctor_health='"+doctorcode+"')) b " +
				" on a.family_code = b.patient " +
				" left join wlyy_child_info c on c.`code` = a.child_code " +
				") m on m.barcode = t.barcode where t.ymsx=1";
				") m on m.barcode = t.barcode where t.ymsx=1 order by t.jzrq";
		if (limitType==1){
			int start = (pageNo-1)*pageSize;
			sql +=" limit "+start+","+pageSize;