ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java
@@ -8,7 +8,9 @@ import com.ruoyi.common.utils.sms.smsUtils; import com.ruoyi.framework.config.ServerConfig; import com.smartor.domain.HtmlContentVO; import com.smartor.domain.ServiceOutPath; import com.smartor.domain.smsVO; import com.smartor.service.IServiceOutPathService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +23,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.Date; @RestController @Api(description = "知信接口") @@ -44,6 +47,9 @@ @Value("${pub_key}") private String pub_key; @Autowired private IServiceOutPathService iServiceOutPathService; /** * @param @@ -62,13 +68,24 @@ @ApiOperation("短信发送") @PostMapping("/sendAsk") public AjaxResult sendAsk(@RequestBody smsVO vo) throws UnsupportedEncodingException { // String format = String.format("%03X", vo.getId()); // String url=ip + ":" + req_path + "/wt?p=" + format; RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); String taskId = rsaPublicKeyExample.encryptedData(vo.getTaskId().toString(), pub_key); String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key); String url = null; url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(vo.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key); ServiceOutPath serviceOutPath = new ServiceOutPath(); serviceOutPath.setParam1(taskId); serviceOutPath.setParam2(patid); serviceOutPath.setParam3(vo.getTaskName()); serviceOutPath.setParam6(subId); serviceOutPath.setCreateTime(new Date()); iServiceOutPathService.insertServiceOutPath(serviceOutPath); String format = String.format("%03X", serviceOutPath.getId()); serviceOutPath.setRadix(format); serviceOutPath.setUpdateTime(new Date()); iServiceOutPathService.updateServiceOutPath(serviceOutPath); String url=ip + ":" + req_path + "/wt?p=" + format; //String url = = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(vo.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; String content="您好,邀请您填写出院调查表,请点击" + url + "填写。感谢您配合!"; ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -325,6 +325,18 @@ } /** * 获取随访统计比例 */ @ApiOperation("获取随访满意度统计") @PostMapping("/getSfStatisticsJoy") public AjaxResult getSfStatisticsJoy(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { return error("服务类型不能为空"); } return success(serviceSubtaskService.getSfStatisticsJoy(serviceSubtaskCountReq)); } /** * 随访统计导出 */ //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") @@ -348,4 +360,18 @@ return success(serviceStatistics); } /** * 获取随访统计比例 */ @ApiOperation("获取随访满意度明细") @PostMapping("/getSfStatisticsJoydetails") public AjaxResult getSfStatisticsJoydetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size()==0&& serviceSubtaskCountReq.getDeptcodes().size()==0) { return error("科室或病区不能为空"); } return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq)); } } ruoyi-admin/src/main/resources/application-druid.yml
@@ -34,7 +34,7 @@ # password: Hxerp2000 # driverClassName: com.mysql.cj.jdbc.Driver # 公司本地 url: jdbc:mysql://192.168.100.10:3306/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://haiershi.a1.luyouxia.net:23844/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: smartor password: Smartor.2023 driverClassName: com.mysql.cj.jdbc.Driver ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
@@ -31,10 +31,13 @@ @PostMapping("/collect") @ApiOperation("同步病人相关数据") public AjaxResult hnDataGather(@RequestBody HnDataGatherVO hnDataGatherVO) { try { Integer count =ichService.sync(); return AjaxResult.success(count); } catch (Exception ex) { return AjaxResult.error(ex.getMessage()); } //Boolean aBoolean = ichService.hnDataGather(hnDataGatherVO); Integer count= ichService.sync(); return AjaxResult.success(count); } /** ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
@@ -171,21 +171,23 @@ for (PatMedInhosp pm : patMedInhospList) { try { //患者基本信息 PatArchive patArchive = new PatArchive(); patArchive.setPatientno(pm.getPatno()); List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive); if (patArchives.size() > 0) { PatArchive pa1 = new PatArchive(); pa1.setPatientno(pm.getPatno()); List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa1); if (CollectionUtils.isNotEmpty(patArchives1)) { patArchives.get(0).setId(patArchives1.get(0).getId()); patArchives.get(0).setUpdateTime(new Date()); count += patArchiveMapper.updatePatArchive(patArchives.get(0)); } else { patArchives.get(0).setCreateTime(new Date()); count += patArchiveMapper.insertPatArchiveSingle(patArchives.get(0)); if(ObjectUtils.isNotEmpty(pm.getPatno())) { PatArchive patArchive = new PatArchive(); patArchive.setPatientno(pm.getPatno()); patArchive.setPageSize(5); List<PatArchive> patArchives = chMapper.selectPatArchiveList(patArchive); if (patArchives.size() > 0) { PatArchive pa1 = new PatArchive(); pa1.setPatientno(pm.getPatno()); List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa1); if (CollectionUtils.isNotEmpty(patArchives1)) { patArchives.get(0).setId(patArchives1.get(0).getId()); patArchives.get(0).setUpdateTime(new Date()); count += patArchiveMapper.updatePatArchive(patArchives.get(0)); } else { patArchives.get(0).setCreateTime(new Date()); count += patArchiveMapper.insertPatArchiveSingle(patArchives.get(0)); } } } }catch (Exception ex) { ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -643,8 +643,15 @@ serviceSubtaskMapper.updateServiceSubtask(ss); continue; } String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), serviceSubtask.getSendname(), patArchive.getPatidHis(), wxqqxx); String wxCode = ""; if (visitHosp == 3) {//市一医院 String urlTemp="http://192.200.54.14:5003/sfjk/SendMessage?sfzh="+serviceSubtask.getSfzh() +"&title=您好,邀请您填写出院调查表,请点击填写。&content=您好,邀请您填写出院调查表,请点击填写。&phone="+patArchive.getTelcode() +"&url="+url+"&key=ff76f8904f5f32b5ee1739e8ea46e60g"; HttpUtils.sendGet(urlTemp); }else{ wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), serviceSubtask.getSendname(), patArchive.getPatidHis(), wxqqxx); } Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); //任务发送记录 ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -394,7 +394,7 @@ <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> <if test="viptype != null ">and viptype = #{viptype}</if> <if test="pattype != null ">and pattype = #{pattype}</if> <if test="patientno != null ">and patientno = #{patientno}</if> <if test="patientno != null ">and patientno = #{patientno} </if> <if test="patidHis != null ">and patid_his = #{patidHis}</if> <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if> <if test="ageUnit != null ">and age_unit = #{ageUnit}</if> @@ -419,6 +419,9 @@ <if test="lastEndTime != null and lastEndTime != ''"> and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') <= #{lastEndTime} </if> <if test="pageSize != null and pageSize!='' ">and rownum<#{pageSize}</if> </where> </select> smartor/src/main/java/com/smartor/domain/ServiceSubtaskCount.java
@@ -31,6 +31,18 @@ @ApiModelProperty(value = "数量") private Long count; @ApiModelProperty(value = "填写满意度数量") private Integer joyCount; @ApiModelProperty(value = "所有满意度数量") private Integer joyAllCount; @ApiModelProperty(value = "满意度比例") private String joyTotal; @ApiModelProperty(value = "满意度名称") private String joyName; public ServiceSubtaskCount(String month, Long serviceType, Long count) { this.serviceType = serviceType; this.month = month; smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
@@ -179,4 +179,13 @@ @ApiModelProperty(value = "医生姓名") private String drname; @ApiModelProperty(value = "填写满意度数量") private Integer joyCount=0; @ApiModelProperty(value = "所有满意度数量") private Integer joyAllCount=0; @ApiModelProperty(value = "满意度比例") private String joyTotal=""; } smartor/src/main/java/com/smartor/domain/smsVO.java
@@ -13,6 +13,9 @@ @ApiModelProperty(value = "短信内容") private String content; @ApiModelProperty(value = "任务ID") private String subId; @ApiModelProperty(value = "问卷ID") private String taskId; smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; /** * 单一任务(随访)Mapper接口 @@ -94,6 +95,10 @@ public List<ServiceSubtask> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskCount> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskCount> getSfStatisticsJoydetails(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<PatMedRes> getDeptRanking(PatMedReq patMedReq); public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest serviceStatisticsRequest); smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -129,5 +129,9 @@ public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskStatistic> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskCount> getSfStatisticsJoydetails(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request); } smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -117,10 +117,10 @@ } if (StringUtils.isNotEmpty(externalDept.getShiJianDM()) && externalDept.getShiJianDM().equals("1")) { int i = sysDeptMapper.insertDept(sysDept); log.info("ServiceExternalServiceImpl---addDeptInfo是否新增成功:{}", i); log.info("ServiceExternalServiceImpl---addDeptInfo01是否新增成功:{}", i); } else { int i = sysDeptMapper.updateDept(sysDept); log.info("ServiceExternalServiceImpl---addDeptInfo是否修改成功:{}", i); log.info("ServiceExternalServiceImpl---addDeptInfo02是否修改成功:{}", i); } return true; } @@ -170,8 +170,9 @@ int i = sysUserMapper.insertUser(sysUser); log.info("ServiceExternalServiceImpl---addDeptInfo是否新增成功:{}", i); } else { sysUser.setUserId(sysUser1.getUserId()); int i = sysUserMapper.updateUser(sysUser); log.info("ServiceExternalServiceImpl---addDeptInfo是否修改成功:{}", i); log.info("ServiceExternalServiceImpl---addDeptInfo是否修改成功03:{}", i); } return true; } smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -2282,6 +2282,74 @@ return serviceSubtaskStatistics; } /** * 获取随访统计比例 * * @param serviceSubtaskCountReq * @return */ @Override public List<ServiceSubtaskStatistic> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq) { log.error("getSfStatistics的入参为:{}", serviceSubtaskCountReq); List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>(); // 根据条件进行分组 Map<String, List<ServiceSubtask>> collect = new HashMap<>(); if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) { if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); } else { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown"))); } } else if (serviceSubtaskCountReq.getDeptcodes() != null && serviceSubtaskCountReq.getDeptcodes().size() > 0) { if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); } else { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown"))); } } List<ServiceSubtaskCount> joySubCount=serviceSubtaskMapper.getSfStatisticsJoy(serviceSubtaskCountReq); for (List<ServiceSubtask> serviceSubtaskList : collect.values()) { if (CollectionUtils.isEmpty(serviceSubtaskList)) { continue; } ServiceSubtaskStatistic statistic = getStatisticJoy(serviceSubtaskList,joySubCount); if(statistic.getJoyCount()!=0&&statistic.getJoyAllCount()!=0) { Double joyTotal = Double.parseDouble(statistic.getJoyCount() + "") / Double.parseDouble(statistic.getJoyAllCount() + "") * 100; statistic.setJoyTotal(String.format("%.2f", joyTotal)+"%"); } //及时率 ServiceSubtask ss = new ServiceSubtask(); ss.setOrgid(serviceSubtaskList.get(0).getOrgid()); // 如果有医生编码,设置医生编码用于及时率查询 if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { ss.setDrcode(serviceSubtaskList.get(0).getDrcode()); }else { if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) { ss.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); } else if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getDeptcodes())) { ss.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); } } ss.setStarttime(serviceSubtaskCountReq.getStartTime()); ss.setEndtime(serviceSubtaskCountReq.getEndTime()); if (serviceSubtaskCountReq.getEndTime() != null && new Date().before(serviceSubtaskCountReq.getEndTime())) { ss.setEndtime(new Date()); } Double jsRate = serviceSubtaskMapper.selectTimelyRate(ss); statistic.setRate(jsRate); if (ObjectUtils.isNotEmpty(statistic)) { serviceSubtaskStatistics.add(statistic); } } return serviceSubtaskStatistics; } private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList) { ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); //格式化为两位小数的百分比 @@ -2295,6 +2363,112 @@ //出院人次 serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); for (ServiceSubtask serviceSubtask : serviceSubtaskList) { //无需随访人次 if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); } //应随访人次 if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L); } //首次出院随访 if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) { if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) { serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L); } if (serviceSubtask.getSendstate() != null && ( serviceSubtask.getSendstate() == 6)) { serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) { serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L); } if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp(); serviceSubtaskStatistic.setFollowUpRate(percentFormat.format(rate)); } else { serviceSubtaskStatistic.setFollowUpRate("0.00%"); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L); } }//二次出院随访 else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) { if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) { serviceSubtaskStatistic.setPendingFollowUpAgain(serviceSubtaskStatistic.getPendingFollowUpAgain() + 1L); } if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) { serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) { serviceSubtaskStatistic.setFollowUpFailAgain(serviceSubtaskStatistic.getFollowUpFailAgain() + 1L); } if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccessAgain() + serviceSubtaskStatistic.getFollowUpFailAgain()) / serviceSubtaskStatistic.getNeedFollowUpAgain(); serviceSubtaskStatistic.setFollowUpRateAgain(percentFormat.format(rate)); } else { serviceSubtaskStatistic.setFollowUpRateAgain("0.00%"); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); } if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) { serviceSubtaskStatistic.setAbnormalAgain(serviceSubtaskStatistic.getAbnormalAgain() + 1L); } } } return serviceSubtaskStatistic; } private ServiceSubtaskStatistic getStatisticJoy(List<ServiceSubtask> serviceSubtaskList,List<ServiceSubtaskCount> joySubCount) { ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); //格式化为两位小数的百分比 DecimalFormat percentFormat = new DecimalFormat("##.##%"); serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname()); //出院人次 serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); serviceSubtaskStatistic.setJoyCount(0); serviceSubtaskStatistic.setJoyAllCount(0); for (ServiceSubtask serviceSubtask : serviceSubtaskList) { //满意度 List<ServiceSubtaskCount> joyCountTemp= joySubCount.stream().filter(r->r.getSubTaskId().equals(serviceSubtask.getId())) .collect(Collectors.toList()); if(joyCountTemp!=null&&joyCountTemp.size()>0){ if(ObjectUtils.isNotEmpty(joyCountTemp.get(0).getJoyCount())) serviceSubtaskStatistic.setJoyCount(serviceSubtaskStatistic.getJoyCount()+joyCountTemp.get(0).getJoyCount()); if(ObjectUtils.isNotEmpty(joyCountTemp.get(0).getJoyAllCount())) serviceSubtaskStatistic.setJoyAllCount(serviceSubtaskStatistic.getJoyAllCount()+joyCountTemp.get(0).getJoyAllCount()); } //无需随访人次 if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L); @@ -2489,4 +2663,8 @@ int remainingCalls = (int) (remainingHours * phoneUpEveryHour); return remainingCalls; } public List<ServiceSubtaskCount> getSfStatisticsJoydetails(ServiceSubtaskCountReq serviceSubtaskCountReq) { return serviceSubtaskMapper.getSfStatisticsJoydetails(serviceSubtaskCountReq); } } smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -90,6 +90,10 @@ <result property="month" column="month"/> <result property="serviceType" column="service_type"/> <result property="subTaskId" column="subTaskId"/> <result property="joyCount" column="joyCount"/> <result property="joyAllCount" column="joyAllCount"/> <result property="joyTotal" column="joyTotal"/> <result property="joyName" column="joyName"/> </resultMap> @@ -338,6 +342,8 @@ <if test="sort != null and sort==3">order by long_send_time desc</if> <if test="sort != null and sort==5">order by admindate asc</if> <if test="sort != null and sort==6">order by admindate desc</if> <if test="sort != null and sort==7">order by visit_time asc</if> <if test="sort != null and sort==8">order by visit_time desc</if> <!-- order by update_time desc,id desc --> </select> @@ -1074,6 +1080,118 @@ </where> </select> <select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq" resultMap="ServiceSubtaskResult2"> SELECT sub_id as subTaskId,COUNT(sub_id) joyCount, (SELECT COUNT(1) FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key='joyCount')) joyAllCount FROM service_subtask_detail a WHERE sub_id IN(SELECT id FROM service_subtask t <where> del_flag=0 <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> AND leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> <if test="deptcodes != null and deptcodes.size() > 0"> AND deptcode IN <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> #{deptcode} </foreach> </if> <if test="serviceType != null and serviceType.size() > 0"> AND service_type IN <foreach collection="serviceType" item="serviceType" open="(" separator="," close=")"> #{serviceType} </foreach> </if> <if test="startTime != null and endTime!=null"> AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d') AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') </if> <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if> </where> ) AND targetid IN ( SELECT id FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key='joyCount')) GROUP BY sub_id </select> <select id="getSfStatisticsJoydetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq" resultMap="ServiceSubtaskResult2"> SELECT joyName,joyCount,joyAllCount,ROUND(joyCount/joyAllCount,2) joyTotal FROM ( SELECT targetname joyName, (select COUNT(sub_id) FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t <where> del_flag=0 <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> AND leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> <if test="deptcodes != null and deptcodes.size() > 0"> AND deptcode IN <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> #{deptcode} </foreach> </if> <if test="serviceType != null and serviceType.size() > 0"> AND service_type IN <foreach collection="serviceType" item="serviceType" open="(" separator="," close=")"> #{serviceType} </foreach> </if> <if test="startTime != null and endTime!=null"> AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d') AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') </if> </where> ) AND targetid=a.id) joyCount , (SELECT COUNT(*) from (select sub_id FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t <where> del_flag=0 <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> <if test="deptcodes != null and deptcodes.size() > 0"> AND deptcode IN <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> #{deptcode} </foreach> </if> <if test="serviceType != null and serviceType.size() > 0"> AND service_type IN <foreach collection="serviceType" item="serviceType" open="(" separator="," close=")"> #{serviceType} </foreach> </if> <if test="startTime != null and endTime!=null"> AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d') AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') </if> </where> GROUP BY sub_id ) ) ta ) joyAllCount FROM ivr_liba_target a WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key= 'joyCount') )a1 </select> <select id="getDataByTime" resultMap="ServiceSubtaskResult"> select id, smartor/src/main/resources/mapper/smartor/SysUserMapper.xml
@@ -125,7 +125,7 @@ AND u.user_id = #{userId} </if> <if test="userName != null and userName != ''"> AND u.user_name like concat('%', #{userName}, '%') AND u.user_name = #{userName} </if> <if test="nickName != null and nickName != ''"> AND u.nick_name like concat('%', #{nickName}, '%') @@ -323,7 +323,8 @@ <insert id="batchUser" useGeneratedKeys="true" keyProperty="userId"> insert into sys_user( user_id, dept_id, user_name, nick_name, email, avatar, phonenumber, sex, password, status, create_by, remark, user_type, dept_info, hosp_info, searchscope, id_card, title, job_phone, birthday, his_user_id, guid, orgid,user_code, user_type, dept_info, hosp_info, searchscope, id_card, title, job_phone, birthday, his_user_id, guid, orgid,user_code, create_time ) values <foreach collection="list" item="item" separator=",">