| | |
| | | //@PreAuthorize("@ss.hasPermi('system:taskcall:export')") |
| | | @Log(title = "åä¸ä»»å¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/patItemExport") |
| | | public void patItemExport(HttpServletResponse response, ServiceSubtaskEntity serviceSubtaskVO) { |
| | | public void patItemExport(HttpServletResponse response, ServiceSubtaskVO serviceSubtaskVO) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | serviceSubtaskVO.setOrgid(user.getOrgid()); |
| | | List<ServiceSubtaskRes> serviceSubtaskList = null; |
| | | if (serviceSubtaskVO != null) { |
| | | serviceSubtaskList = serviceSubtaskService.patItem(serviceSubtaskVO); |
| | | ServiceSubtaskEntity serviceSubtaskEntity = DtoConversionUtils.sourceToTarget(serviceSubtaskVO, ServiceSubtaskEntity.class); |
| | | serviceSubtaskList = serviceSubtaskService.patItem(serviceSubtaskEntity); |
| | | } |
| | | List<ServiceSubtaskExport> serviceSubtaskExports = null; |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = null; |
| | |
| | | serviceSubtaskExport.setEndDay(endDay); |
| | | } |
| | | } |
| | | QuestionResultVO questionResultVO = new QuestionResultVO(); |
| | | questionResultVO.setServiceType(serviceSubtaskVO.getServiceType()); |
| | | questionResultVO.setEndOutHospTime(serviceSubtaskVO.getEndOutHospTime()); |
| | | questionResultVO.setStartOutHospTime(serviceSubtaskVO.getStartOutHospTime()); |
| | | serviceSubtaskDetailRatioExports = serviceSubtaskService.getDetailRatio(questionResultVO, serviceSubtaskList); |
| | | SltdMydTotalVO sltdMydTotalVO = new SltdMydTotalVO(); |
| | | sltdMydTotalVO.setServiceTypeList(Arrays.asList(serviceSubtaskVO.getServiceType())); |
| | | sltdMydTotalVO.setEndOutHospTime(serviceSubtaskVO.getEndOutHospTime()); |
| | | sltdMydTotalVO.setStartOutHospTime(serviceSubtaskVO.getStartOutHospTime()); |
| | | serviceSubtaskDetailRatioExports = serviceSubtaskService.getDetailRatio(sltdMydTotalVO, serviceSubtaskList); |
| | | } |
| | | |
| | | |
| | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.DTO.QuestionResultDTO; |
| | | import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; |
| | | import com.smartor.domain.VO.MydTrendReqVO; |
| | | import com.smartor.domain.VO.QuestionCountKsOrBqVO; |
| | | import com.smartor.domain.VO.QuestionResultVO; |
| | | import com.smartor.domain.VO.SltdMydTotalVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.service.IServiceSubtaskDetailService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * æ¥è¯¢æ£è
éè®¿ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("çç«å德满æåº¦æ°æ®ç»è®¡") |
| | | @PostMapping("/sltaMydTotalByScore") |
| | | public Map<String, Object> sltaMydTotal(@RequestBody QuestionResultVO questionResultVO) { |
| | | @PostMapping("/sltdMydTotalByScore") |
| | | public Map<String, Object> sltdMydTotalByScore(@RequestBody SltdMydTotalVO sltdMydTotalVO) { |
| | | List<ServiceSubtaskRes> serviceSubtaskResList = null; |
| | | ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | serviceSubtaskEntity.setServiceType(questionResultVO.getServiceType()); |
| | | serviceSubtaskEntity.setEndOutHospTime(questionResultVO.getEndOutHospTime()); |
| | | serviceSubtaskEntity.setStartOutHospTime(questionResultVO.getStartOutHospTime()); |
| | | serviceSubtaskEntity.setDeptOrDistrict(questionResultVO.getDeptOrDistrict()); |
| | | serviceSubtaskEntity.setLeavehospitaldistrictcodes(questionResultVO.getLeavehospitaldistrictcodes()); |
| | | if (serviceSubtaskEntity != null) { |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskService.getServiceSubtasks(serviceSubtaskEntity); |
| | | serviceSubtaskResList = DtoConversionUtils.sourceToTarget(serviceSubtasks, ServiceSubtaskRes.class); |
| | | if (CollectionUtils.isNotEmpty(sltdMydTotalVO.getServiceTypeList())) { |
| | | //serviceTypeå¯è½ä¼åºç°å¤ä¸ªï¼ä¸æ³å¤åæ¹æ³äºï¼ä¸ä¸ªä¸ä¸ªæ¥è¯¢å§ |
| | | for (String st : sltdMydTotalVO.getServiceTypeList()) { |
| | | ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | serviceSubtaskEntity.setServiceType(st); |
| | | serviceSubtaskEntity.setEndOutHospTime(sltdMydTotalVO.getEndOutHospTime()); |
| | | serviceSubtaskEntity.setStartOutHospTime(sltdMydTotalVO.getStartOutHospTime()); |
| | | serviceSubtaskEntity.setDeptOrDistrict(sltdMydTotalVO.getDeptOrDistrict()); |
| | | serviceSubtaskEntity.setLeavehospitaldistrictcodes(sltdMydTotalVO.getLeavehospitaldistrictcodes()); |
| | | serviceSubtaskEntity.setLeaveldeptcodes(sltdMydTotalVO.getLeaveldeptcodes()); |
| | | if (serviceSubtaskEntity != null) { |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskService.getServiceSubtasks(serviceSubtaskEntity); |
| | | List<ServiceSubtaskRes> serviceSubtaskRes = DtoConversionUtils.sourceToTarget(serviceSubtasks, ServiceSubtaskRes.class); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskResList)) { |
| | | serviceSubtaskResList.addAll(serviceSubtaskRes); |
| | | } else { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskResList)) serviceSubtaskResList = serviceSubtaskRes; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | List<ServiceSubtaskDetailRatioExport> detailList = serviceSubtaskService.getDetailRatio(questionResultVO, serviceSubtaskResList); |
| | | |
| | | // æ questiontext åç»å转æ¢ä¸º QuestionResultVO |
| | | List<QuestionResultDTO> result = new ArrayList<>(); |
| | | if (!detailList.isEmpty()) { |
| | | Map<String, List<ServiceSubtaskDetailRatioExport>> groupedMap = detailList.stream().collect(Collectors.groupingBy(ServiceSubtaskDetailRatioExport::getQuestiontext)); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskResList)) { |
| | | List<ServiceSubtaskDetailRatioExport> detailList = serviceSubtaskService.getDetailRatio(sltdMydTotalVO, serviceSubtaskResList); |
| | | |
| | | groupedMap.forEach((questionText, exportList) -> { |
| | | QuestionResultDTO questionResultDTO = new QuestionResultDTO(); |
| | | questionResultDTO.setQeustionText(questionText); |
| | | questionResultDTO.setSubtaskDetailRatioExportList(exportList); |
| | | result.add(questionResultDTO); |
| | | }); |
| | | if (CollectionUtils.isNotEmpty(detailList)) { |
| | | Map<String, List<ServiceSubtaskDetailRatioExport>> groupedMap = detailList.stream().collect(Collectors.groupingBy(ServiceSubtaskDetailRatioExport::getQuestiontext)); |
| | | |
| | | groupedMap.forEach((questionText, exportList) -> { |
| | | QuestionResultDTO questionResultDTO = new QuestionResultDTO(); |
| | | questionResultDTO.setQeustionText(questionText); |
| | | questionResultDTO.setSubtaskDetailRatioExportList(exportList); |
| | | BigDecimal allCount = new BigDecimal("0"); |
| | | BigDecimal allScore = new BigDecimal("0.00"); |
| | | |
| | | for (ServiceSubtaskDetailRatioExport ssdre : exportList) { |
| | | if (StringUtils.isNotEmpty(ssdre.getCount())) |
| | | allCount.add(BigDecimal.valueOf(Long.valueOf(ssdre.getCount()))); |
| | | allScore.add(BigDecimal.valueOf(Double.valueOf(ssdre.getScore()))); |
| | | } |
| | | |
| | | if (allCount.compareTo(BigDecimal.ZERO) > 0) |
| | | questionResultDTO.setAvgScore(allScore.divide(allCount, 2).toString()); |
| | | result.add(questionResultDTO); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return success(result); |
| | |
| | | public Map<String, Object> statQuestionOptionByKsOrBq(@RequestBody QuestionCountKsOrBqVO questionResultVO) { |
| | | return success(serviceSubtaskService.statQuestionOptionByKsOrBq(questionResultVO)); |
| | | } |
| | | |
| | | @ApiOperation("çç«åå¾·æ£è
满æåº¦è¶å¿") |
| | | @PostMapping("/mydTrend") |
| | | public Map<String, Object> mydTrend(@RequestBody MydTrendReqVO mydTrendReqVO) { |
| | | return success(serviceSubtaskService.mydTrend(mydTrendReqVO)); |
| | | } |
| | | |
| | | @ApiOperation("çç«åå¾·æ£è
满æåº¦ç»´æ¤") |
| | | @PostMapping("/sltdMydTotalByDimension") |
| | | public Map<String, Object> sltdMydTotalByDimension(@RequestBody MydTrendReqVO mydTrendReqVO) { |
| | | return success(serviceSubtaskService.sltdMydTotalByDimension(mydTrendReqVO)); |
| | | } |
| | | |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.view.RedirectView; |
| | |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | // @Value("${wx_appid}") |
| | | // private String wxAppid; |
| | |
| | | // @IpWhitelist |
| | | @GetMapping("/SSOLogin") |
| | | public RedirectView SSOLogin(@RequestParam(required = false) String campusid, @RequestParam(required = false) String deptId, @RequestParam(required = false) String systype, String orgid, String userName, String token) { |
| | | log.info("SSOLoginçå
¥åï¼campusidï¼{}, deptId:{}, systype:{}, orgid:{}, userName:{}, token:{}",campusid,deptId,systype,orgid,userName,token); |
| | | log.info("SSOLoginçå
¥åï¼campusidï¼{}, deptId:{}, systype:{}, orgid:{}, userName:{}, token:{}", campusid, deptId, systype, orgid, userName, token); |
| | | if (StringUtils.isEmpty(userName) && StringUtils.isEmpty(token) && StringUtils.isEmpty(orgid)) { |
| | | throw new BaseException("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | String path = null; |
| | | if (StringUtils.isEmpty(systype)) path = sysConfigService.selectConfigByKey("sys.qddz"); |
| | | else path = sysConfigService.selectConfigByKey("sys.qddz.yd"); |
| | | log.info("qddzçæ¥è¯¢å¼ä¸ºï¼pathï¼{}",path); |
| | | |
| | | if (active.equals("nhfy")){ |
| | | //ååéä¸çï¼å
ä¸èµ°å
ç»ï¼ç´æ¥è·³å°ç»é页 |
| | | path = sysConfigService.selectConfigByKey("sys.qddz.yd"); |
| | | log.info("ãNHFYSSOç»å½ãéå®åå°åï¼{}", path); |
| | | return buildRedirect(path); |
| | | } |
| | | log.info("qddzçæ¥è¯¢å¼ä¸ºï¼pathï¼{}", path); |
| | | |
| | | if (StringUtils.isEmpty(path)) { |
| | | throw new BaseException("请é
ç½®å端å°å"); |
| | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | |
| | | |
| | | /** |
| | | * åå
¸å·¥å
·ç±» |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DictUtils |
| | | { |
| | | public class DictUtils { |
| | | /** |
| | | * åé符 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 设置åå
¸ç¼å |
| | | * |
| | | * @param key åæ°é® |
| | | * |
| | | * @param key åæ°é® |
| | | * @param dictDatas åå
¸æ°æ®å表 |
| | | */ |
| | | public static void setDictCache(String key, List<SysDictData> dictDatas) |
| | | { |
| | | SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas); |
| | | public static void setDictCache(String key, List<SysDictData> dictDatas) { |
| | | SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas, 120, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
¸ç¼å |
| | | * |
| | | * |
| | | * @param key åæ°é® |
| | | * @return dictDatas åå
¸æ°æ®å表 |
| | | */ |
| | | public static List<SysDictData> getDictCache(String key) |
| | | { |
| | | public static List<SysDictData> getDictCache(String key) { |
| | | JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); |
| | | if (StringUtils.isNotNull(arrayCache)) |
| | | { |
| | | if (StringUtils.isNotNull(arrayCache)) { |
| | | return arrayCache.toList(SysDictData.class); |
| | | } |
| | | return null; |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸å¼è·ååå
¸æ ç¾ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @param dictValue åå
¸å¼ |
| | | * @return åå
¸æ ç¾ |
| | | */ |
| | | public static String getDictLabel(String dictType, String dictValue) |
| | | { |
| | | public static String getDictLabel(String dictType, String dictValue) { |
| | | return getDictLabel(dictType, dictValue, SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸æ ç¾è·ååå
¸å¼ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @param dictLabel åå
¸æ ç¾ |
| | | * @return åå
¸å¼ |
| | | */ |
| | | public static String getDictValue(String dictType, String dictLabel) |
| | | { |
| | | public static String getDictValue(String dictType, String dictLabel) { |
| | | return getDictValue(dictType, dictLabel, SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸å¼è·ååå
¸æ ç¾ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @param dictValue åå
¸å¼ |
| | | * @param separator åé符 |
| | | * @return åå
¸æ ç¾ |
| | | */ |
| | | public static String getDictLabel(String dictType, String dictValue, String separator) |
| | | { |
| | | public static String getDictLabel(String dictType, String dictValue, String separator) { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | |
| | | if (StringUtils.isNotNull(datas)) |
| | | { |
| | | if (StringUtils.containsAny(separator, dictValue)) |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | for (String value : dictValue.split(separator)) |
| | | { |
| | | if (value.equals(dict.getDictValue())) |
| | | { |
| | | if (StringUtils.isNotNull(datas)) { |
| | | if (StringUtils.containsAny(separator, dictValue)) { |
| | | for (SysDictData dict : datas) { |
| | | for (String value : dictValue.split(separator)) { |
| | | if (value.equals(dict.getDictValue())) { |
| | | propertyString.append(dict.getDictLabel()).append(separator); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | if (dictValue.equals(dict.getDictValue())) |
| | | { |
| | | } else { |
| | | for (SysDictData dict : datas) { |
| | | if (dictValue.equals(dict.getDictValue())) { |
| | | return dict.getDictLabel(); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸æ ç¾è·ååå
¸å¼ |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * |
| | | * @param dictType åå
¸ç±»å |
| | | * @param dictLabel åå
¸æ ç¾ |
| | | * @param separator åé符 |
| | | * @return åå
¸å¼ |
| | | */ |
| | | public static String getDictValue(String dictType, String dictLabel, String separator) |
| | | { |
| | | public static String getDictValue(String dictType, String dictLabel, String separator) { |
| | | StringBuilder propertyString = new StringBuilder(); |
| | | List<SysDictData> datas = getDictCache(dictType); |
| | | |
| | | if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | for (String label : dictLabel.split(separator)) |
| | | { |
| | | if (label.equals(dict.getDictLabel())) |
| | | { |
| | | if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) { |
| | | for (SysDictData dict : datas) { |
| | | for (String label : dictLabel.split(separator)) { |
| | | if (label.equals(dict.getDictLabel())) { |
| | | propertyString.append(dict.getDictValue()).append(separator); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (SysDictData dict : datas) |
| | | { |
| | | if (dictLabel.equals(dict.getDictLabel())) |
| | | { |
| | | } else { |
| | | for (SysDictData dict : datas) { |
| | | if (dictLabel.equals(dict.getDictLabel())) { |
| | | return dict.getDictValue(); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * å 餿å®åå
¸ç¼å |
| | | * |
| | | * |
| | | * @param key åå
¸é® |
| | | */ |
| | | public static void removeDictCache(String key) |
| | | { |
| | | public static void removeDictCache(String key) { |
| | | SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key)); |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空åå
¸ç¼å |
| | | */ |
| | | public static void clearDictCache() |
| | | { |
| | | public static void clearDictCache() { |
| | | Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*"); |
| | | SpringUtils.getBean(RedisCache.class).deleteObject(keys); |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * |
| | | * @param configKey åæ°é® |
| | | * @return ç¼åé®key |
| | | */ |
| | | public static String getCacheKey(String configKey) |
| | | { |
| | | public static String getCacheKey(String configKey) { |
| | | return CacheConstants.SYS_DICT_KEY + configKey; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain.DTO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 满æåº¦è¶å¿è¯·æ±å¯¹è±¡ |
| | | * |
| | | * @author ls |
| | | * @date 2026-09-11 |
| | | */ |
| | | |
| | | @ApiModel(value = "MydTrendReqVO", description = "满æåº¦è¶å¿è¯·æ±å¯¹è±¡") |
| | | @Data |
| | | public class MydTrendReqDTO extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "åç±»") |
| | | private String period; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "维度") |
| | | private String dimension; |
| | | |
| | | @ApiModelProperty(value = "æ»å(å¹³åå)") |
| | | private String totalScore; |
| | | |
| | | } |
| | |
| | | * é®å·é¢ç® |
| | | */ |
| | | @ApiModelProperty(value = "é®å·é¢ç®") |
| | | private String qeustionText; |
| | | private String questionText; |
| | | |
| | | /** |
| | | * é®å·ç»æéå |
| | |
| | | private String qeustionText; |
| | | |
| | | /** |
| | | * å¹³åå |
| | | */ |
| | | @ApiModelProperty(value = "å¹³åå") |
| | | private String avgScore; |
| | | |
| | | /** |
| | | * é®å·ç»æéå |
| | | */ |
| | | @ApiModelProperty(value = "é®å·ç»æéå") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain.VO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 满æåº¦è¶å¿è¯·æ±å¯¹è±¡ |
| | | * |
| | | * @author ls |
| | | * @date 2026-09-11 |
| | | */ |
| | | |
| | | @ApiModel(value = "MydTrendReqVO", description = "满æåº¦è¶å¿è¯·æ±å¯¹è±¡") |
| | | @Data |
| | | public class MydTrendReqVO extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼å§æ¥æ") |
| | | private Date startFinishTime; |
| | | |
| | | /** |
| | | * ç»æåºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»ææ¥æ") |
| | | private Date endFinishTime; |
| | | |
| | | @ApiModelProperty(value = "åºé´ç±»åï¼å¤©,å¨ï¼æï¼å¹´") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "维度类åï¼1ï¼ç»´åº¦ 2ï¼é¢åº") |
| | | private String dimensionType; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "é¨é¨codeéå") |
| | | private List<String> leaveldeptcodes; |
| | | |
| | | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | |
| | | |
| | | @ApiModelProperty(value = "é®é¢ç±»åï¼1.åé 2å¤é 3é®ç 4填空 5å
¶å®ï¼") |
| | | private String valueType; |
| | | |
| | | @ApiModelProperty(value = "任塿¨¡æ¿ID") |
| | | private String taskTemplateid; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | * 宿æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "宿æ¶é´(å¼å§æ¥è¯¢)") |
| | | private Date finishtimeStart; |
| | | |
| | |
| | | * 宿æ¶é´(ç»ææ¥è¯¢) |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "宿æ¶é´(ç»ææ¥è¯¢)") |
| | | private Date finishtimeEnd; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain.VO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é®é¢ç»æDTO |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-02-02 |
| | | */ |
| | | |
| | | @ApiModel(value = "QuestionResultVO", description = "é®é¢ç»æVO") |
| | | @Data |
| | | public class SltdMydTotalVO extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç§å®¤ä¸ç
åºçæ¥è¯¢æ¯orè¿æ¯and: 1:and(é»è®¤)(离é¢ç
åºä¸ç¦»é¢ç§å®¤ç»å) 2:or(离é¢ç
åºä¸ç¦»é¢ç§å®¤ç»å) 3:and(离é¢ç
åºä¸é访ç§å®¤ç»å) 4:or(离é¢ç
åºä¸é访ç§å®¤ç»å) |
| | | */ |
| | | @ApiModelProperty(value = "ç§å®¤ä¸ç
åºçæ¥è¯¢æ¯orè¿æ¯and: 1:and(é»è®¤)(离é¢ç
åºä¸ç¦»é¢ç§å®¤ç»å) 2:or(离é¢ç
åºä¸ç¦»é¢ç§å®¤ç»å) 3:and(离é¢ç
åºä¸é访ç§å®¤ç»å) 4:or(离é¢ç
åºä¸é访ç§å®¤ç»å)") |
| | | private String deptOrDistrict = "1"; |
| | | |
| | | /** |
| | | * åºé¢ç
åºç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "åºé¢ç
åºéå(åé¨é¨äºéä¸å¿
å¡«)") |
| | | private List<String> leavehospitaldistrictcodes; |
| | | |
| | | /** |
| | | * é¨é¨code |
| | | */ |
| | | @Excel(name = " é¨é¨code") |
| | | @ApiModelProperty(value = "é¨é¨codeéå(åç
åºäºéä¸å¿
å¡«)") |
| | | private List<String> leaveldeptcodes; |
| | | |
| | | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼å§åºé¢æ¥æ") |
| | | private Date startOutHospTime; |
| | | |
| | | /** |
| | | * ç»æåºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»æåºé¢æ¥æ") |
| | | private Date endOutHospTime; |
| | | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼å§å®ææ¥æ") |
| | | private Date startFinishTime; |
| | | |
| | | /** |
| | | * ç»æåºé¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»æå®ææ¥æ") |
| | | private Date endFinishTime; |
| | | |
| | | |
| | | /** |
| | | * é®é¢å
容 |
| | | */ |
| | | @ApiModelProperty(value = "é®é¢å
容") |
| | | private String questionContent; |
| | | |
| | | /** |
| | | * é®é¢å
容 |
| | | */ |
| | | @ApiModelProperty(value = "å¼å§æ¥è¯¢åæ°") |
| | | private Double startScore; |
| | | |
| | | /** |
| | | * é®é¢å
容 |
| | | */ |
| | | @ApiModelProperty(value = "ç»ææ¥è¯¢åæ°") |
| | | private Double endScore; |
| | | |
| | | /** |
| | | * æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥) |
| | | */ |
| | | @Excel(name = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯ç®¡çï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访)") |
| | | @ApiModelProperty(value = "å¿
å¡«æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯ç®¡çï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访)") |
| | | private List<String> serviceTypeList; |
| | | |
| | | @ApiModelProperty(value = "é®é¢ç±»åï¼1.åé 2å¤é 3é®ç 4填空 5å
¶å®ï¼") |
| | | private String valueType; |
| | | } |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.DTO.MydTrendReqDTO; |
| | | import com.smartor.domain.DTO.QuestionCountKsOrBqDTO; |
| | | import com.smartor.domain.VO.PatSatisfactionReqVO; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | |
| | | * @param loopCount 轮次ï¼0=é¦è½®ï¼ |
| | | */ |
| | | public int countActiveByScheduleIdAndLoop(@Param("scheduleId") Long scheduleId, @Param("loopCount") Long loopCount); |
| | | |
| | | public List<MydTrendReqDTO> mydTrend(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); |
| | | |
| | | public List<MydTrendReqDTO> sltdMydTotalByDimension(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); |
| | | |
| | | public List<MydTrendReqDTO> sltdMydTotalByYQ(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); |
| | | |
| | | /** |
| | | * ä»»å¡ç»ï¼appltype=5ï¼ï¼æåæä¸è½®æ¬¡çå
¨é¨ subtaskï¼ç¨äºå
éå°ä¸ä¸è½®ï¼ã |
| | |
| | | * @param endOutHospTime |
| | | * @return |
| | | */ |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOption(@Param("taskIds") List<Long> taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOption(@Param("taskIds") List<Long> taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); |
| | | |
| | | /** |
| | | * æ ¹æ®åä»»å¡ ID ç»è®¡é®é¢çé项çç¾åæ¯ï¼ç¨äºæ»¡æåº¦ç»è®¡ serviceType=6ï¼ |
| | |
| | | * @param endOutHospTime |
| | | * @return |
| | | */ |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(@Param("subtaskIds") List<Long> subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(@Param("subtaskIds") List<Long> subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); |
| | | |
| | | /** |
| | | * æ ¹æ®ç§å®¤ãç
åºãé¢ç®ç±»åç»è®¡çç§å®¤ãç
åºè¯å |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.DTO.MydTrendReqDTO; |
| | | import com.smartor.domain.DTO.QuestionCountKsOrBqDTO; |
| | | import com.smartor.domain.DTO.QuestionResultDTO; |
| | | import com.smartor.domain.ServiceSubtask; |
| | |
| | | * @param serviceSubtaskRes |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> getDetailRatio(QuestionResultVO questionResultVO, List<ServiceSubtaskRes> serviceSubtaskRes); |
| | | public List<ServiceSubtaskDetailRatioExport> getDetailRatio(SltdMydTotalVO sltdMydTotalVO, List<ServiceSubtaskRes> serviceSubtaskRes); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param taskIds |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType); |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startFinishTime, Date endFinishTime, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType); |
| | | |
| | | /** |
| | | * æ ¹æ®åä»»å¡ ID ç»è®¡é®é¢çé项çç¾åæ¯ï¼ç¨äºæ»¡æåº¦ç»è®¡ serviceType=6ï¼ |
| | |
| | | * @param subtaskIds åä»»å¡ ID å表 |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType); |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, Date startFinishTime, Date endFinishTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType); |
| | | |
| | | public List<QuestionCountKsOrBqDTO> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO); |
| | | public Map<String, Map<String, List<QuestionCountKsOrBqDTO>>> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO); |
| | | |
| | | public String scanGenerateSubtask(ServiceTask serviceTaskVo); |
| | | |
| | | public List<MydTrendReqDTO> mydTrend(MydTrendReqVO mydTrendReqVO); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç»åº¦è¿è¡å¯¹æ¯æ»¡æåº¦åæ° |
| | | * @param mydTrendReqVO |
| | | * @return |
| | | */ |
| | | public List<MydTrendReqDTO> sltdMydTotalByDimension(MydTrendReqVO mydTrendReqVO); |
| | | |
| | | public Integer matchOptionIndex(String url, String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options, String uuid); |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUserRole; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.common.enums.EmergencyLevelEnum; |
| | | import com.smartor.common.enums.ImportFlagEnum; |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | @Autowired |
| | | private ServiceSubtaskServiceImpl serviceSubtaskServiceImpl; |
| | | @Autowired |
| | | private ServiceSubtaskMapper serviceSubtaskMapper; |
| | | |
| | | @Override |
| | | public List<ServiceSLTDInhospResDTO> queryHealthcareRecordList(ServiceSLTDInhospReqVO reqVO) { |
| | |
| | | queryInhosp.setInhospstate("1"); |
| | | patMedInhospList = patMedInhospService.selectPatMedInhosp(queryInhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhospList)) { |
| | | //妿ä¸ä¸ºç©ºï¼åå°å
¥é¢æ¶é´è¿è¡æ´æ° |
| | | PatMedInhosp pmOut = patMedInhospList.get(0); |
| | | PatMedInhosp pmIn = existingInhosps.get(0); |
| | | pmOut.setStarttime(pmIn.getStarttime()); |
| | | pmOut.setUpdateTime(new Date()); |
| | | patMedInhospService.updatePatMedInhosp(pmOut); |
| | | //çç«åå¾·éè¦å°å¼å§æ¥æä¸å
¥é¢æ¥æç¸ççä»»å¡ï¼æ¹æä¸æ§è¡ |
| | | try { |
| | | if ("sltd".equals(active) && DateUtils.isSameDay(pmOut.getStarttime(), pmIn.getEndtime())) { |
| | | ServiceSubtask serviceSubtask = new ServiceSubtask(); |
| | | serviceSubtask.setInhospid(pmOut.getInhospid()); |
| | | serviceSubtask.setSendstate(4L); |
| | | serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("å°åºé¢æ¶é´çäºå
¥é¢æ¶é´çinhospidç任塿´æ°å¤±è´¥äº, inhospid={}", pmOut.getInhospid(), e); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | |
| | | * ä¿åé®å·çæ¡ (弿¥å¤çï¼å¿«éè¿å) |
| | | * |
| | | * @param serviceSubTaskAnswerReq çæ¡è¯·æ± |
| | | * @param flag æ å¿ä½ |
| | | * @param flag æ å¿ä½ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | |
| | | String threadName = Thread.currentThread().getName(); |
| | | log.info("[{}] å¼å§å¼æ¥å¤çä¿åé®å·çæ¡", threadName); |
| | | try { |
| | | //åæ°è§£å¯ |
| | | Long tid = null; |
| | | Long pid = null; |
| | | Long subid = null; |
| | | if (ObjectUtils.isNotEmpty(serviceSubTaskAnswerReq)) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | //åæ°è§£å¯ |
| | | Long tid = null; |
| | | Long pid = null; |
| | | Long subid = null; |
| | | if (ObjectUtils.isNotEmpty(serviceSubTaskAnswerReq)) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | |
| | | if (flag == 0) { |
| | | tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key)); |
| | | pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key)); |
| | | if (StringUtils.isNotEmpty(serviceSubTaskAnswerReq.getParam6())) |
| | | subid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam6(), pri_key)); |
| | | } else if (flag == 1) { |
| | | tid = Long.valueOf(serviceSubTaskAnswerReq.getParam1()); |
| | | pid = Long.valueOf(serviceSubTaskAnswerReq.getParam2()); |
| | | subid = Long.valueOf(serviceSubTaskAnswerReq.getParam6()); |
| | | if (flag == 0) { |
| | | tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key)); |
| | | pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key)); |
| | | if (StringUtils.isNotEmpty(serviceSubTaskAnswerReq.getParam6())) |
| | | subid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam6(), pri_key)); |
| | | } else if (flag == 1) { |
| | | tid = Long.valueOf(serviceSubTaskAnswerReq.getParam1()); |
| | | pid = Long.valueOf(serviceSubTaskAnswerReq.getParam2()); |
| | | subid = Long.valueOf(serviceSubTaskAnswerReq.getParam6()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æ ¹æ® PIDãTIDãSUBID æå»ºéè¦å¤çç cache key |
| | | String scriptCacheKeyPrefix = pid + "-" + tid + "-" + subid; |
| | | Set<String> targetKeys = new HashSet<>(); |
| | | //æ ¹æ® PIDãTIDãSUBID æå»ºéè¦å¤çç cache key |
| | | String scriptCacheKeyPrefix = pid + "-" + tid + "-" + subid; |
| | | Set<String> targetKeys = new HashSet<>(); |
| | | |
| | | if (serviceSubTaskAnswerReq != null && serviceSubTaskAnswerReq.getType() != null) { |
| | | if (serviceSubTaskAnswerReq.getType() == 2) { |
| | | targetKeys.add(scriptCacheKeyPrefix + "-WJscriptCache"); |
| | | } else if (serviceSubTaskAnswerReq.getType() == 1) { |
| | | targetKeys.add(scriptCacheKeyPrefix + "-SFscriptCache"); |
| | | if (serviceSubTaskAnswerReq != null && serviceSubTaskAnswerReq.getType() != null) { |
| | | if (serviceSubTaskAnswerReq.getType() == 2) { |
| | | targetKeys.add(scriptCacheKeyPrefix + "-WJscriptCache"); |
| | | } else if (serviceSubTaskAnswerReq.getType() == 1) { |
| | | targetKeys.add(scriptCacheKeyPrefix + "-SFscriptCache"); |
| | | } |
| | | } else { |
| | | //å¦ææ²¡æ typeï¼åéåææ keyï¼ä¿çåæå
¼å®¹æ§ï¼ |
| | | Set<String> allKeys = redisCache.getAllKeys(); |
| | | for (String key : allKeys) { |
| | | try { |
| | | if (key.contains(scriptCacheKeyPrefix) && (key.endsWith("-WJscriptCache") || key.endsWith("-SFscriptCache"))) { |
| | | targetKeys.add(key); |
| | | } |
| | | } catch (Exception e) { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | //å¦ææ²¡æ typeï¼åéåææ keyï¼ä¿çåæå
¼å®¹æ§ï¼ |
| | | Set<String> allKeys = redisCache.getAllKeys(); |
| | | for (String key : allKeys) { |
| | | |
| | | //ç¨äºæ¹éæ´æ°çåä»»å¡å表ï¼é¿å
å¨å¾ªç¯ä¸é夿¥è¯¢ï¼ |
| | | Map<String, ServiceSubtask> subtaskCache = new HashMap<>(); |
| | | String subtaskCacheKey = subid != null ? subid.toString() : pid + "-" + tid; |
| | | |
| | | //å
æ¥è¯¢ä¸æ¬¡åä»»å¡ä¿¡æ¯ |
| | | ServiceSubtaskEntity ssVO = new ServiceSubtaskEntity(); |
| | | if (subid != null) { |
| | | ssVO.setSubId(subid); |
| | | } else { |
| | | ssVO.setTaskid(tid); |
| | | ssVO.setPatid(pid); |
| | | } |
| | | List<ServiceSubtask> initialSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(ssVO); |
| | | if (CollectionUtils.isNotEmpty(initialSubtaskList)) { |
| | | subtaskCache.put(subtaskCacheKey, initialSubtaskList.get(0)); |
| | | } |
| | | |
| | | String score = "0"; |
| | | Long nextScriptno = null; |
| | | aa: |
| | | for (String key : targetKeys) { |
| | | String[] split = key.split("-"); |
| | | //å
å¤æï¼æ¯ä¸æ¯å½åæäº¤äººçï¼ä¸æ¯å½åæäº¤äººçï¼è·³è¿ |
| | | try { |
| | | if (key.contains(scriptCacheKeyPrefix) && (key.endsWith("-WJscriptCache") || key.endsWith("-SFscriptCache"))) { |
| | | targetKeys.add(key); |
| | | if (ObjectUtils.isNotEmpty(split[0]) && ObjectUtils.isNotEmpty(split[1]) && !Long.valueOf(split[0]).equals(pid) && !Long.valueOf(split[1]).equals(tid) && !Objects.isNull(split[2]) && !Long.valueOf(split[2]).equals(subid)) { |
| | | continue; |
| | | } |
| | | } catch (Exception e) { |
| | | //è¿é乿以è¦å¤çå¼å¸¸ï¼æ¯å 为æçKEY就䏿¯æä»¬è¦çKEY,没æå»æªåï¼æå¼å¸¸ä¸å¤çï¼ç´æ¥ä¸ä¸ä¸ª |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | if (key.contains("-WJscriptCache")) { |
| | | List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); |
| | | cacheList.sort(Comparator.comparingLong(SvyTaskTemplateScriptVO::getSort)); |
| | | log.info("é®å·åçç»æï¼{}", CollectionUtils.isEmpty(cacheList) ? null : cacheList.size()); |
| | | |
| | | //ç¨äºæ¹éæ´æ°çåä»»å¡å表ï¼é¿å
å¨å¾ªç¯ä¸é夿¥è¯¢ï¼ |
| | | Map<String, ServiceSubtask> subtaskCache = new HashMap<>(); |
| | | String subtaskCacheKey = subid != null ? subid.toString() : pid + "-" + tid; |
| | | //æ ¡éªä¸ä¸é¢çåºå·æ¯å¦æé®é¢ (å¦ææ ¹æ®é项æ åºè·³è½¬ï¼å°±ä¼å¯¼è´é误) |
| | | cacheList = checkQuestionSort(cacheList); |
| | | |
| | | //å
æ¥è¯¢ä¸æ¬¡åä»»å¡ä¿¡æ¯ |
| | | ServiceSubtaskEntity ssVO = new ServiceSubtaskEntity(); |
| | | if (subid != null) { |
| | | ssVO.setSubId(subid); |
| | | } else { |
| | | ssVO.setTaskid(tid); |
| | | ssVO.setPatid(pid); |
| | | } |
| | | List<ServiceSubtask> initialSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(ssVO); |
| | | if (CollectionUtils.isNotEmpty(initialSubtaskList)) { |
| | | subtaskCache.put(subtaskCacheKey, initialSubtaskList.get(0)); |
| | | } |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //è¿ä¸ªæ¶é´è¦æ¾å°ç¬¬ä¸é¢ |
| | | for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) { |
| | | if (svyTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, subid); |
| | | if (map == null) continue aa; |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null || score.isEmpty()) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String score = "0"; |
| | | Long nextScriptno = null; |
| | | aa: |
| | | for (String key : targetKeys) { |
| | | String[] split = key.split("-"); |
| | | //å
å¤æï¼æ¯ä¸æ¯å½åæäº¤äººçï¼ä¸æ¯å½åæäº¤äººçï¼è·³è¿ |
| | | try { |
| | | if (ObjectUtils.isNotEmpty(split[0]) && ObjectUtils.isNotEmpty(split[1]) && !Long.valueOf(split[0]).equals(pid) && !Long.valueOf(split[1]).equals(tid) && !Objects.isNull(split[2]) && !Long.valueOf(split[2]).equals(subid)) { |
| | | continue; |
| | | } |
| | | } catch (Exception e) { |
| | | //è¿é乿以è¦å¤çå¼å¸¸ï¼æ¯å 为æçKEY就䏿¯æä»¬è¦çKEY,没æå»æªåï¼æå¼å¸¸ä¸å¤çï¼ç´æ¥ä¸ä¸ä¸ª |
| | | continue; |
| | | } |
| | | if (key.contains("-WJscriptCache")) { |
| | | List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); |
| | | cacheList.sort(Comparator.comparingLong(SvyTaskTemplateScriptVO::getSort)); |
| | | log.info("é®å·åçç»æï¼{}", CollectionUtils.isEmpty(cacheList) ? null : cacheList.size()); |
| | | } else { |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = cacheList.get(i); |
| | | log.info("svyTaskTemplateScriptVOçä¿¡æ¯ä¸ºï¼{}ï¼içå¼ä¸ºï¼{}", svyTaskTemplateScriptVO.getScriptno(), i); |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(i).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | |
| | | //æ ¡éªä¸ä¸é¢çåºå·æ¯å¦æé®é¢ (å¦ææ ¹æ®é项æ åºè·³è½¬ï¼å°±ä¼å¯¼è´é误) |
| | | cacheList = checkQuestionSort(cacheList); |
| | | |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //è¿ä¸ªæ¶é´è¦æ¾å°ç¬¬ä¸é¢ |
| | | for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) { |
| | | if (svyTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, subid); |
| | | if (map == null) continue aa; |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), Objects.isNull(split[2]) ? null : Long.valueOf(split[2])); |
| | | log.error("nextScriptNoçä¿¡æ¯ä¸ºï¼{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null || score.isEmpty()) { |
| | | if (score == null) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = cacheList.get(i); |
| | | log.info("svyTaskTemplateScriptVOçä¿¡æ¯ä¸ºï¼{}ï¼içå¼ä¸ºï¼{}", svyTaskTemplateScriptVO.getScriptno(), i); |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(i).getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), Objects.isNull(split[2]) ? null : Long.valueOf(split[2])); |
| | | log.error("nextScriptNoçä¿¡æ¯ä¸ºï¼{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (key.contains("-SFscriptCache")) { |
| | | List<IvrTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); |
| | | cacheList.sort(Comparator.comparingLong(IvrTaskTemplateScriptVO::getSort)); |
| | | log.error("çµè¯é访é®å·åçç»æï¼{}", CollectionUtils.isEmpty(cacheList) ? null : cacheList.size()); |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //è¿ä¸ªæ¶é´è¦æ¾å°ç¬¬ä¸é¢ |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : cacheList) { |
| | | if (ivrTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList(); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid, subid); |
| | | } else if (key.contains("-SFscriptCache")) { |
| | | List<IvrTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key); |
| | | cacheList.sort(Comparator.comparingLong(IvrTaskTemplateScriptVO::getSort)); |
| | | log.error("çµè¯é访é®å·åçç»æï¼{}", CollectionUtils.isEmpty(cacheList) ? null : cacheList.size()); |
| | | for (int i = 0; i < cacheList.size(); i++) { |
| | | if (i == 0) { |
| | | //è¿ä¸ªæ¶é´è¦æ¾å°ç¬¬ä¸é¢ |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : cacheList) { |
| | | if (ivrTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList(); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, tid, pid, subid); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null || score.isEmpty()) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(i), IvrTaskTemplateScriptVO.class); |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(cacheList.get(i).getIvrTaskScriptTargetoptionList(), IvrTaskTemplateTargetoption.class); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && Long.valueOf(ivrTaskTemplateScriptVO.getSort()).equals(nextScriptno)) { |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), Objects.isNull(split[2]) ? null : Long.valueOf(split[2])); |
| | | log.error("----nextScriptNo2çä¿¡æ¯ä¸ºï¼{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null || score.isEmpty()) { |
| | | if (score == null) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(i), IvrTaskTemplateScriptVO.class); |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(cacheList.get(i).getIvrTaskScriptTargetoptionList(), IvrTaskTemplateTargetoption.class); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && Long.valueOf(ivrTaskTemplateScriptVO.getSort()).equals(nextScriptno)) { |
| | | Map<String, String> map = setSFInfo(ivrTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), Objects.isNull(split[2]) ? null : Long.valueOf(split[2])); |
| | | log.error("----nextScriptNo2çä¿¡æ¯ä¸ºï¼{}", map.get("nextScriptNo")); |
| | | if (!Objects.isNull(map.get("nextScriptNo"))) |
| | | nextScriptno = Long.valueOf(map.get("nextScriptNo")); |
| | | if (score == null) { |
| | | score = map.get("score"); |
| | | } else { |
| | | score = String.valueOf(Double.parseDouble(score) + Double.parseDouble(map.get("score"))); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | //å°è¯¥ key å value ä» redis ä¸ï¼å é¤ |
| | | redisCache.deleteObject(key); |
| | | |
| | | //æ¥è¯¢åºè¯¥ä»»å¡ä¸æ£å¨æ§è¡çæ£è
ä¿¡æ¯ï¼ä½¿ç¨ç¼åï¼ |
| | | String currentSubtaskKey = subid != null ? subid.toString() : pid + "-" + tid; |
| | | ServiceSubtask serviceSubtask; |
| | | |
| | | if (!subtaskCache.containsKey(currentSubtaskKey)) { |
| | | ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | if (subid != null) { |
| | | serviceSubtaskEntity.setSubId(subid); |
| | | } else { |
| | | serviceSubtaskEntity.setTaskid(tid); |
| | | serviceSubtaskEntity.setPatid(pid); |
| | | continue; |
| | | } |
| | | //å°è¯¥ key å value ä» redis ä¸ï¼å é¤ |
| | | redisCache.deleteObject(key); |
| | | |
| | | //æ¥è¯¢åºè¯¥ä»»å¡ä¸æ£å¨æ§è¡çæ£è
ä¿¡æ¯ï¼ä½¿ç¨ç¼åï¼ |
| | | String currentSubtaskKey = subid != null ? subid.toString() : pid + "-" + tid; |
| | | ServiceSubtask serviceSubtask; |
| | | |
| | | if (!subtaskCache.containsKey(currentSubtaskKey)) { |
| | | ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | if (subid != null) { |
| | | serviceSubtaskEntity.setSubId(subid); |
| | | } else { |
| | | serviceSubtaskEntity.setTaskid(tid); |
| | | serviceSubtaskEntity.setPatid(pid); |
| | | } |
| | | // ssVO.setSendstate(3L); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | | serviceSubtask = serviceSubtaskList.get(0); |
| | | subtaskCache.put(currentSubtaskKey, serviceSubtask); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskList)) { |
| | | serviceSubtask = serviceSubtaskList.get(0); |
| | | subtaskCache.put(currentSubtaskKey, serviceSubtask); |
| | | } else { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | serviceSubtask = subtaskCache.get(currentSubtaskKey); |
| | | } |
| | | } else { |
| | | serviceSubtask = subtaskCache.get(currentSubtaskKey); |
| | | } |
| | | |
| | | serviceSubtask.setIsabnormal(serviceSubTaskAnswerReq.getIsabnormal()); |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setExcep(serviceSubTaskAnswerReq.getExcep()); |
| | | serviceSubtask.setFinishtime(new Date()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | log.error("å°è¯¥keyåvalueä»redisä¸,serviceSubtaskçå¼ä¸º--------ï¼{}", serviceSubtask); |
| | | if (score != null && !score.isEmpty()) serviceSubtask.setScore(score); |
| | | serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask); |
| | | serviceSubtask.setIsabnormal(serviceSubTaskAnswerReq.getIsabnormal()); |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setExcep(serviceSubTaskAnswerReq.getExcep()); |
| | | serviceSubtask.setFinishtime(new Date()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | log.error("å°è¯¥keyåvalueä»redisä¸,serviceSubtaskçå¼ä¸º--------ï¼{}", serviceSubtask); |
| | | if (score != null && !score.isEmpty()) serviceSubtask.setScore(score); |
| | | serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask); |
| | | |
| | | //å°å½ååéç¶ææ¹æ 9 宿ï¼ç¼å preachform æ¥è¯¢ï¼ |
| | | String currentPreachform = serviceSubtask.getCurrentPreachform(); |
| | | if (StringUtils.isNotEmpty(currentPreachform)) { |
| | | ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); |
| | | serviceSubtaskPreachform.setPreachform(currentPreachform); |
| | | if (subid != null) { |
| | | serviceSubtaskPreachform.setSubid(subid); |
| | | } else { |
| | | Long id = serviceSubtask.getId(); |
| | | Long tid_ = serviceSubtask.getTaskid(); |
| | | if (id != null) { |
| | | serviceSubtaskPreachform.setSubid(id); |
| | | } else if (tid_ != null) { |
| | | serviceSubtaskPreachform.setTaskid(tid_); |
| | | //å°å½ååéç¶ææ¹æ 9 宿ï¼ç¼å preachform æ¥è¯¢ï¼ |
| | | String currentPreachform = serviceSubtask.getCurrentPreachform(); |
| | | if (StringUtils.isNotEmpty(currentPreachform)) { |
| | | ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); |
| | | serviceSubtaskPreachform.setPreachform(currentPreachform); |
| | | if (subid != null) { |
| | | serviceSubtaskPreachform.setSubid(subid); |
| | | } else { |
| | | Long id = serviceSubtask.getId(); |
| | | Long tid_ = serviceSubtask.getTaskid(); |
| | | if (id != null) { |
| | | serviceSubtaskPreachform.setSubid(id); |
| | | } else if (tid_ != null) { |
| | | serviceSubtaskPreachform.setTaskid(tid_); |
| | | } |
| | | } |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) { |
| | | ServiceSubtaskPreachform ssp = serviceSubtaskPreachforms.get(0); |
| | | ssp.setSendstate("9"); |
| | | serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(ssp); |
| | | } |
| | | } |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) { |
| | | ServiceSubtaskPreachform ssp = serviceSubtaskPreachforms.get(0); |
| | | ssp.setSendstate("9"); |
| | | serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(ssp); |
| | | } |
| | | } |
| | | |
| | | } |
| | | log.info("[{}] 宿弿¥å¤çä¿åé®å·çæ¡", Thread.currentThread().getName()); |
| | | return 1; |
| | | } catch (Exception e) { |
| | | log.error("[{}] 弿¥å¤çä¿åé®å·çæ¡åçå¼å¸¸ : {},请æ±ç对象为ï¼{}", Thread.currentThread().getName(), e.getMessage(), e, serviceSubTaskAnswerReq); |
| | | throw new RuntimeException("ä¿åé®å·çæ¡å¤±è´¥", e); |
| | | } |
| | | log.info("[{}] 宿弿¥å¤çä¿åé®å·çæ¡", Thread.currentThread().getName()); |
| | | return 1; |
| | | } catch (Exception e) { |
| | | log.error("[{}] 弿¥å¤çä¿åé®å·çæ¡åçå¼å¸¸ : {},请æ±ç对象为ï¼{}", Thread.currentThread().getName(), e.getMessage(), e,serviceSubTaskAnswerReq); |
| | | throw new RuntimeException("ä¿åé®å·çæ¡å¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq, Long flag) { |
| | | Long tid = Long.valueOf(serviceSubTaskCacheReq.getParam1()); |
| | |
| | | serviceSubtaskDetailVO.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent()); |
| | | serviceSubtaskDetailVO.setIsMydException(svyTaskTemplateScriptVO.getIsMydException()); |
| | | serviceSubtaskDetailVO.setDimension(svyTaskTemplateScriptVO.getDimension()); |
| | | if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScore())) |
| | | serviceSubtaskDetailVO.setScore(svyTaskTemplateScriptVO.getScore().replaceFirst("^0+(?!$)", "")); |
| | | serviceSubtaskDetailVO.setCategoryid(svyTaskTemplateScriptVO.getCategoryid()); |
| | | serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid)); |
| | | serviceSubtaskDetailVO.setTargetid(svyTaskTemplateScriptVO.getTargetid() != null ? svyTaskTemplateScriptVO.getTargetid().intValue() : null); |
| | |
| | | String orgid = selectServiceSubtaskList.get(0).getOrgid(); |
| | | //æ¯å®-é访å¼å¸¸æç¤º å
¶ä»-å¼å¸¸æ»¡æåº¦æç¤º |
| | | boolean addTrace = false; |
| | | if(StringUtils.isNotEmpty(orgid) && orgid.equals("47255004333112711A1001")){ |
| | | if (StringUtils.isNotEmpty(orgid) && orgid.equals("47255004333112711A1001")) { |
| | | if (stt != null) { |
| | | addTrace = Long.valueOf(1L).equals(stt.getIsabnormal()); |
| | | } |
| | | }else { |
| | | } else { |
| | | addTrace = StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getIsMydException()); |
| | | } |
| | | //夿ä¸ä¸å½åçé®é¢æ¯ä¸æ¯æ»¡æåº¦é®é¢ï¼å¹¶ä¸ dutyDeptCode æ¯å¦æå¼ï¼å¹¶ä¸é项æ¯ä¸æ¯å¼å¸¸é项ï¼å¦æå
¨ç¬¦åï¼å徿»¡æåº¦é®é¢å¼å¸¸è¡¨æ°å¢ |
| | | if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getDutyDeptCode()) && stt != null && Long.valueOf(1L).equals(stt.getIsabnormal()) || StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getDutyDeptCode()) |
| | | && addTrace) { |
| | | if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getDutyDeptCode()) && stt != null && Long.valueOf(1L).equals(stt.getIsabnormal()) || StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getDutyDeptCode()) && addTrace) { |
| | | isabnormalFlag = 1L; |
| | | ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace(); |
| | | subtaskDetailTrace.setDetailId(serviceSubtaskDetail.getId()); |
| | |
| | | String orgid = selectServiceSubtaskList.get(0).getOrgid(); |
| | | //æ¯å®-é访å¼å¸¸æç¤º å
¶ä»-å¼å¸¸æ»¡æåº¦æç¤º |
| | | boolean addTrace = false; |
| | | if(StringUtils.isNotEmpty(orgid) && orgid.equals("47255004333112711A1001")){ |
| | | if (StringUtils.isNotEmpty(orgid) && orgid.equals("47255004333112711A1001")) { |
| | | if (stt != null) { |
| | | addTrace = Long.valueOf(1L).equals(stt.getIsabnormal()); |
| | | } |
| | | }else { |
| | | } else { |
| | | addTrace = StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIsMydException()); |
| | | } |
| | | //夿ä¸ä¸å½åçé®é¢æ¯ä¸æ¯æ»¡æåº¦é®é¢ï¼å¹¶ä¸dutyDeptCodeæ¯å¦æå¼ï¼å¹¶ä¸é项æ¯ä¸æ¯å¼å¸¸é项ï¼å¦æå
¨ç¬¦åï¼å徿»¡æåº¦é®é¢å¼å¸¸è¡¨æ°å¢ |
| | | if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) && 1 == stt.getIsabnormal() || StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) |
| | | && addTrace) { |
| | | if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) && 1 == stt.getIsabnormal() || StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getDutyDeptCode()) && addTrace) { |
| | | isabnormalFlag = "1"; |
| | | ServiceSubtaskDetailTrace subtaskDetailTrace = new ServiceSubtaskDetailTrace(); |
| | | subtaskDetailTrace.setDetailId(serviceSubtaskDetail.getId()); |
| | |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.common.ScheduleSubtaskBuilder; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.domain.DTO.MydTrendReqDTO; |
| | | import com.smartor.domain.DTO.QuestionCountKsOrBqDTO; |
| | | import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; |
| | | import com.smartor.domain.*; |
| | |
| | | serviceSubtask.setUpdateTime(DateUtils.getNowDate()); |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 6) |
| | | serviceSubtask.setFinishtime(new Date()); |
| | | |
| | | return serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) { |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startFinishTime, Date endFinishTime, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) { |
| | | //å
æ¸
çä¸ä¸é夿°æ® |
| | | List<Long> repeatIds = serviceSubtaskDetailMapper.selectRepeatDetailIds(); |
| | | if (!CollectionUtils.isEmpty(repeatIds)) { |
| | | serviceSubtaskDetailMapper.deleteRepeatDetailByIds(repeatIds); |
| | | } |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOption(taskIds, startOutHospTime, endOutHospTime, scoreStart, scoreEnd, scriptContent, valueType); |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOption(taskIds, startOutHospTime, endOutHospTime, startFinishTime, endFinishTime, scoreStart, scoreEnd, scriptContent, valueType); |
| | | |
| | | // å¤ç targetvalueï¼æ & å岿夿¡è®°å½ |
| | | List<ServiceSubtaskDetailRatioExport> result = new ArrayList<>(); |
| | |
| | | * æ ¹æ®ç§å®¤æç
åºç»è®¡é®å·é项(ç§å®¤ãé¢ç®æ¥è¯¢çç§å®¤è¯å表) |
| | | */ |
| | | @Override |
| | | public List<QuestionCountKsOrBqDTO> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO vo) { |
| | | public Map<String, Map<String, List<QuestionCountKsOrBqDTO>>> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO vo) { |
| | | |
| | | // 1. æ¥æç» |
| | | List<QuestionCountKsOrBqDTO> sourceList = serviceSubtaskMapper.statQuestionOptionByKsOrBq(vo); |
| | | if (CollectionUtils.isEmpty(sourceList)) { |
| | | return Collections.emptyList(); |
| | | return Collections.emptyMap(); |
| | | } |
| | | |
| | | // 2. 夿æç§å®¤è¿æ¯æç
åº |
| | | boolean byDept = vo.getLeaveldeptcodes() != null; |
| | | boolean byDistrict = !byDept && vo.getLeavehospitaldistrictcodes() != null; |
| | | if (!byDept && !byDistrict) { |
| | | return Collections.emptyList(); |
| | | return Collections.emptyMap(); |
| | | } |
| | | |
| | | // 3. key = ç§å®¤/ç
åº + é¢ç® + é项 |
| | | Map<String, QuestionCountKsOrBqDTO> map = new LinkedHashMap<>(); |
| | | |
| | | for (QuestionCountKsOrBqDTO dto : sourceList) { |
| | | |
| | | if (StringUtils.isEmpty(dto.getTargetvalue())) { |
| | | continue; |
| | | } |
| | | |
| | | // åç»åï¼ç§å®¤ æ ç
åº |
| | | String groupName = byDept ? dto.getDeptname() : dto.getLeavehospitaldistrictname(); |
| | | if (StringUtils.isEmpty(groupName)) { |
| | | continue; |
| | | } |
| | | |
| | | // å
³é®ï¼ä¸¤è¾¹é½ç¨ trimAllï¼å
¼å®¹å
¨è§ç©ºæ ¼ |
| | | String asrtext = trimAll(dto.getAsrtext()); |
| | | String questionKey = dto.getTaskid() + "\u0001" + trimAll(dto.getQeustionText()); |
| | | String asrtext = trimAll(dto.getAsrtext()); // ç¨æ·å®é
éä¸çé项 |
| | | String questionText = trimAll(dto.getQuestionText()); // é¢ç® |
| | | if (StringUtils.isEmpty(questionText)) { |
| | | continue; |
| | | } |
| | | |
| | | // æå targetvalueï¼æ¯ä¸ªé项é½è¦æä¸æ¡è®°å½ |
| | | for (String raw : dto.getTargetvalue().split("&")) { |
| | | String option = trimAll(raw); // â ä¿®å¤ç¹ï¼ç¨ trimAll è䏿¯ trim |
| | | |
| | | String option = trimAll(raw); |
| | | if (option.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | String key = buildKey(groupName, option, questionKey); |
| | | // key = ç§å®¤/ç
åº + é¢ç® + é项 |
| | | String key = buildKey(groupName, questionText, option); |
| | | |
| | | QuestionCountKsOrBqDTO item = map.get(key); |
| | | if (item == null) { |
| | | item = DtoConversionUtils.sourceToTarget(dto, QuestionCountKsOrBqDTO.class); |
| | | item.setTargetvalue(option); // è¾åºç targetvalue å°±æ¯å½åé项 |
| | | item.setTargetvalue(option); |
| | | item.setAsrtext(option); |
| | | item.setQuestionText(dto.getQuestionText()); |
| | | item.setAnswerCount("0"); |
| | | item.setSingleScore("0"); |
| | | map.put(key, item); |
| | | } |
| | | |
| | | // åªæå½åé项 == ç¨æ·å®é
éä¸çéé¡¹ï¼æç´¯å |
| | | if (option.equals(asrtext)) { |
| | | item.setAnswerCount(String.valueOf(parseCount(item.getAnswerCount()) + 1)); |
| | | item.setSingleScore(String.valueOf(new BigDecimal(item.getSingleScore()).add(new BigDecimal(dto.getSingleScore())))); |
| | | int count = parseCount(item.getAnswerCount()) + 1; |
| | | item.setAnswerCount(String.valueOf(count)); |
| | | |
| | | BigDecimal totalScore = new BigDecimal(item.getSingleScore()) |
| | | .add(new BigDecimal(dto.getSingleScore() == null ? "0" : dto.getSingleScore())); |
| | | item.setSingleScore(totalScore.toPlainString()); |
| | | } |
| | | } |
| | | } |
| | | ArrayList<QuestionCountKsOrBqDTO> questionCountKsOrBqDTOS = new ArrayList<>(map.values()); |
| | | for (QuestionCountKsOrBqDTO questionCountKsOrBqDTO : questionCountKsOrBqDTOS) { |
| | | String singleScore = questionCountKsOrBqDTO.getSingleScore(); |
| | | String answerCount = questionCountKsOrBqDTO.getAnswerCount(); |
| | | |
| | | // 4. 计ç®å¹³åå |
| | | for (QuestionCountKsOrBqDTO dto : map.values()) { |
| | | String answerCount = dto.getAnswerCount(); |
| | | String singleScore = dto.getSingleScore(); |
| | | |
| | | BigDecimal avg; |
| | | if (StringUtils.isEmpty(answerCount) |
| | | || BigDecimal.ZERO.compareTo(new BigDecimal(answerCount.trim())) == 0) { |
| | | // 餿°ä¸º 0ï¼é¿å
/ by zero |
| | | avg = BigDecimal.ZERO; |
| | | } else { |
| | | avg = new BigDecimal(singleScore) |
| | | avg = new BigDecimal(singleScore == null ? "0" : singleScore) |
| | | .divide(new BigDecimal(answerCount.trim()), 2, RoundingMode.HALF_UP); |
| | | } |
| | | questionCountKsOrBqDTO.setAvgScore(avg.toPlainString()); |
| | | |
| | | dto.setAvgScore(avg.toPlainString()); |
| | | } |
| | | |
| | | return questionCountKsOrBqDTOS; |
| | | // 5. 转æ Map<String, Map<String, List<QuestionCountKsOrBqDTO>>> |
| | | // 第ä¸å± keyï¼ç§å®¤/ç
åº |
| | | // 第äºå± keyï¼é¢ç® |
| | | // 第äºå± valueï¼è¯¥é¢ç®ä¸çææé项å表 |
| | | Map<String, Map<String, List<QuestionCountKsOrBqDTO>>> result = new LinkedHashMap<>(); |
| | | |
| | | for (QuestionCountKsOrBqDTO dto : map.values()) { |
| | | |
| | | // åç»å |
| | | String groupName = byDept ? dto.getDeptname() : dto.getLeavehospitaldistrictname(); |
| | | if (StringUtils.isEmpty(groupName)) { |
| | | continue; |
| | | } |
| | | |
| | | // é¢ç®å |
| | | String questionText = dto.getQuestionText(); |
| | | if (StringUtils.isEmpty(questionText)) { |
| | | continue; |
| | | } |
| | | |
| | | // 第ä¸å±ï¼ç§å®¤/ç
åº |
| | | Map<String, List<QuestionCountKsOrBqDTO>> questionMap = |
| | | result.computeIfAbsent(groupName, k -> new LinkedHashMap<>()); |
| | | |
| | | // 第äºå±ï¼é¢ç® |
| | | List<QuestionCountKsOrBqDTO> optionList = |
| | | questionMap.computeIfAbsent(questionText, k -> new ArrayList<>()); |
| | | |
| | | optionList.add(dto); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) { |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, Date startFinishTime, Date endFinishTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) { |
| | | //å
æ¸
çä¸ä¸é夿°æ® |
| | | List<Long> repeatIds = serviceSubtaskDetailMapper.selectRepeatDetailIds(); |
| | | if (!CollectionUtils.isEmpty(repeatIds)) { |
| | | serviceSubtaskDetailMapper.deleteRepeatDetailByIds(repeatIds); |
| | | } |
| | | |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOptionBySubtaskIds(subtaskIds, startOutHospTime, endOutHospTime, scoreStart, scoreEnd, scriptContent, valueType); |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOptionBySubtaskIds(subtaskIds, startOutHospTime, endOutHospTime, startFinishTime, endFinishTime, scoreStart, scoreEnd, scriptContent, valueType); |
| | | // å¤ç targetvalueï¼æ & å岿夿¡è®°å½ |
| | | List<ServiceSubtaskDetailRatioExport> result = new ArrayList<>(); |
| | | for (ServiceSubtaskDetailRatioExport export : serviceSubtaskDetailRatioExports) { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /** |
| | | * 满æåº¦è¶å¿æ¥è¯¢ |
| | | * |
| | | * @param mydTrendReqVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MydTrendReqDTO> mydTrend(MydTrendReqVO mydTrendReqVO) { |
| | | List<MydTrendReqDTO> list = serviceSubtaskMapper.mydTrend(mydTrendReqVO.getStartFinishTime(), mydTrendReqVO.getEndFinishTime(), mydTrendReqVO.getType()); |
| | | if (mydTrendReqVO.getType().equals("week")) list = getWeekDate(mydTrendReqVO, list); |
| | | if (mydTrendReqVO.getType().equals("year")) list = getYearDate(mydTrendReqVO, list); |
| | | if (mydTrendReqVO.getType().equals("month")) list = getMonthDate(mydTrendReqVO, list); |
| | | if (mydTrendReqVO.getType().equals("day")) list = getDayDate(mydTrendReqVO, list); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<MydTrendReqDTO> sltdMydTotalByDimension(MydTrendReqVO mydTrendReqVO) { |
| | | List<MydTrendReqDTO> list = null; |
| | | if (mydTrendReqVO.getDimensionType().equals("1")) |
| | | list = serviceSubtaskMapper.sltdMydTotalByDimension(mydTrendReqVO.getStartFinishTime(), mydTrendReqVO.getEndFinishTime(), mydTrendReqVO.getType()); |
| | | else if (mydTrendReqVO.getDimensionType().equals("2")) |
| | | list = serviceSubtaskMapper.sltdMydTotalByYQ(mydTrendReqVO.getStartFinishTime(), mydTrendReqVO.getEndFinishTime(), mydTrendReqVO.getType()); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | public ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, ServiceTaskdept serviceTaskdept, PatArchive patArchive) { |
| | | ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class); |
| | |
| | | /** |
| | | * é®é¢ç»æå æ¯ |
| | | * |
| | | * @param questionResultVO |
| | | * @param sltdMydTotalVO |
| | | * @param serviceSubtaskRes |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> getDetailRatio(QuestionResultVO questionResultVO, List<ServiceSubtaskRes> serviceSubtaskRes) { |
| | | public List<ServiceSubtaskDetailRatioExport> getDetailRatio(SltdMydTotalVO sltdMydTotalVO, List<ServiceSubtaskRes> serviceSubtaskRes) { |
| | | List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = null; |
| | | if (StringUtils.isNotEmpty(questionResultVO.getServiceType()) && questionResultVO.getServiceType().equals("2")) { |
| | | if (CollectionUtils.isNotEmpty(sltdMydTotalVO.getServiceTypeList()) && sltdMydTotalVO.getServiceTypeList().contains("2") && (sltdMydTotalVO.getServiceTypeList().contains("6") || sltdMydTotalVO.getServiceTypeList().contains("14"))) { |
| | | //serviceTypeï¼å³æéè®¿åææ»¡æåº¦ï¼ææ¶æ²¡æ³ç»è®¡ |
| | | return serviceSubtaskDetailRatioExports; |
| | | } else if (CollectionUtils.isNotEmpty(sltdMydTotalVO.getServiceTypeList()) && sltdMydTotalVO.getServiceTypeList().contains("2")) { |
| | | //è·åserviceSubtaskListä¸çæætaskid |
| | | List<Long> taskIds = serviceSubtaskRes.stream().map(ServiceSubtaskRes::getTaskid).filter(ObjectUtils::isNotEmpty).distinct().collect(Collectors.toList()); |
| | | serviceSubtaskDetailRatioExports = statQuestionOption(taskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(), questionResultVO.getValueType()); |
| | | } else if (StringUtils.isNotEmpty(questionResultVO.getServiceType()) && questionResultVO.getServiceType().equals("6")) { |
| | | serviceSubtaskDetailRatioExports = statQuestionOption(taskIds, sltdMydTotalVO.getStartFinishTime(), sltdMydTotalVO.getEndFinishTime(), sltdMydTotalVO.getStartOutHospTime(), sltdMydTotalVO.getEndOutHospTime(), sltdMydTotalVO.getQuestionContent(), sltdMydTotalVO.getStartScore(), sltdMydTotalVO.getEndScore(), sltdMydTotalVO.getValueType()); |
| | | } else if (CollectionUtils.isNotEmpty(sltdMydTotalVO.getServiceTypeList()) && sltdMydTotalVO.getServiceTypeList().contains("6") || sltdMydTotalVO.getServiceTypeList().contains("14")) { |
| | | //满æåº¦ç»è®¡ ï¼éè¿ subtask ç id å»ç»è®¡ï¼ |
| | | List<Long> subtaskIds = serviceSubtaskRes.stream().map(ServiceSubtaskRes::getId).collect(Collectors.toList()); |
| | | serviceSubtaskDetailRatioExports = statQuestionOptionBySubtaskIds(subtaskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(), questionResultVO.getValueType()); |
| | | serviceSubtaskDetailRatioExports = statQuestionOptionBySubtaskIds(subtaskIds, sltdMydTotalVO.getStartOutHospTime(), sltdMydTotalVO.getEndOutHospTime(), sltdMydTotalVO.getStartFinishTime(), sltdMydTotalVO.getEndFinishTime(), sltdMydTotalVO.getQuestionContent(), sltdMydTotalVO.getStartScore(), sltdMydTotalVO.getEndScore(), sltdMydTotalVO.getValueType()); |
| | | } |
| | | return serviceSubtaskDetailRatioExports; |
| | | } |
| | |
| | | private static Boolean isBlankChar(char c) { |
| | | return c == '\u3000' // å
¨è§ç©ºæ ¼ |
| | | || c == ' ' // åè§ç©ºæ ¼ |
| | | || c == '\t' |
| | | || c == '\n' |
| | | || c == '\r' |
| | | || c == '\f' |
| | | || Character.isWhitespace(c); |
| | | || c == '\t' || c == '\n' || c == '\r' || c == '\f' || Character.isWhitespace(c); |
| | | } |
| | | |
| | | private String buildKey(String groupName, String option, String questionKey) { |
| | | return questionKey + KEY_SEP + groupName + KEY_SEP + option; |
| | | |
| | | private String buildKey(String groupName, String questionText, String option) { |
| | | return groupName + "\u0001" + questionText + "\u0001" + option; |
| | | } |
| | | |
| | | private static int parseCount(String s) { |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private List<MydTrendReqDTO> getWeekDate(MydTrendReqVO mydTrendReqVO, List<MydTrendReqDTO> list) { |
| | | // 1. è®¡ç®æ»å¨æ°ï¼å SQL éçå
¬å¼ä¿æä¸è´ï¼ |
| | | long days = (mydTrendReqVO.getEndFinishTime().getTime() - mydTrendReqVO.getStartFinishTime().getTime()) / (1000L * 60 * 60 * 24); |
| | | int totalWeeks = (int) (days / 7) + 1; |
| | | |
| | | // 2. å·²ææ°æ®ï¼period -> totalScore |
| | | Map<Integer, String> exist = new HashMap<>(); |
| | | for (MydTrendReqDTO row : list) { |
| | | // period æ¯æ°åï¼å¯è½æ¯ Integer / Long / BigDecimalï¼ç»ä¸è½¬ int |
| | | int p = Integer.parseInt(StringUtils.isNotEmpty(row.getPeriod()) ? row.getPeriod() : "0"); |
| | | exist.put(p, row.getTotalScore() != null ? row.getTotalScore() : "0"); |
| | | // ä¸é¢è¿è¡æä½ çåé»è¾ä¿çï¼è½ç¶çèµ·æ¥æç¹å¤ä½ï¼ |
| | | exist.put(p, String.valueOf(row.getTotalScore() != null ? row.getTotalScore() : 0)); |
| | | } |
| | | |
| | | // 3. è¡¥å
¨ 1..totalWeeks |
| | | List<MydTrendReqDTO> result = new ArrayList<>(totalWeeks); |
| | | |
| | | // è·åæ´ä½çå¼å§æ¶é´ |
| | | long startTimeMillis = mydTrendReqVO.getStartFinishTime().getTime(); |
| | | long endTimeMillis = mydTrendReqVO.getEndFinishTime().getTime(); |
| | | long oneWeekMillis = 7L * 24 * 60 * 60 * 1000; // ä¸å¨çæ¯«ç§æ° |
| | | |
| | | for (int i = 1; i <= totalWeeks; i++) { |
| | | MydTrendReqDTO row = new MydTrendReqDTO(); |
| | | row.setPeriod(String.valueOf(i)); |
| | | row.setTotalScore(exist.getOrDefault(i, "0")); |
| | | |
| | | // -------- æ°å¢ï¼è®¾ç½®æ¯å¨ç startDate å endDate -------- |
| | | // å½åå¨å¼å§æ¶é´ = æ´ä½å¼å§æ¶é´ + (i - 1) * 7天 |
| | | long currentStartMillis = startTimeMillis + (long) (i - 1) * oneWeekMillis; |
| | | |
| | | // å½åå¨ç»ææ¶é´ = å½åå¨å¼å§æ¶é´ + 7天 - 1毫ç§ï¼ä¿è¯æ¯è¿ä¸å¨çæåä¸å»ï¼ |
| | | long currentEndMillis = currentStartMillis + oneWeekMillis - 1; |
| | | |
| | | // å¦ææ¯æåä¸å¨ï¼ç»ææ¶é´ä¸è½è¶
è¿æ´ä½ç endTime |
| | | if (i == totalWeeks) { |
| | | currentEndMillis = endTimeMillis; |
| | | } |
| | | |
| | | row.setStartDate(new Date(currentStartMillis)); |
| | | row.setEndDate(new Date(currentEndMillis)); |
| | | // ---------------------------------------------------- |
| | | |
| | | result.add(row); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private List<MydTrendReqDTO> getYearDate(MydTrendReqVO mydTrendReqVO, List<MydTrendReqDTO> list) { |
| | | // è·åæ´ä½å¼å§åç»ææ¶é´ |
| | | Date startTime = mydTrendReqVO.getStartFinishTime(); |
| | | Date endTime = mydTrendReqVO.getEndFinishTime(); |
| | | |
| | | // 1. 计ç®å¹´ä»½èå´ |
| | | // ä½¿ç¨ Calendar è·åèµ·å§å¹´ä»½åç»æå¹´ä»½ |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(startTime); |
| | | int startYear = cal.get(Calendar.YEAR); |
| | | |
| | | cal.setTime(endTime); |
| | | int endYear = cal.get(Calendar.YEAR); |
| | | |
| | | // æ»å¹´æ° (å
å«é¦å°¾) |
| | | int totalYears = endYear - startYear + 1; |
| | | |
| | | // 2. å·²ææ°æ®ï¼period -> totalScore (å设 period åçæ¯å¹´ä»½å符串ï¼å¦ "2024") |
| | | Map<String, String> exist = new HashMap<>(); |
| | | for (MydTrendReqDTO row : list) { |
| | | String period = row.getPeriod() != null ? row.getPeriod() : ""; |
| | | exist.put(period, row.getTotalScore() != null ? row.getTotalScore() : "0"); |
| | | } |
| | | |
| | | // 3. è¡¥å
¨ææå¹´ä»½ |
| | | List<MydTrendReqDTO> result = new ArrayList<>(totalYears); |
| | | |
| | | for (int i = 0; i < totalYears; i++) { |
| | | int currentYear = startYear + i; |
| | | String periodKey = String.valueOf(currentYear); |
| | | |
| | | MydTrendReqDTO row = new MydTrendReqDTO(); |
| | | row.setPeriod(periodKey); |
| | | // å¦ææ²¡æè¯¥å¹´ä»½çæ°æ®ï¼é»è®¤ç» "0" |
| | | row.setTotalScore(exist.getOrDefault(periodKey, "0")); |
| | | |
| | | // -------- 设置该年份ç startDate å endDate -------- |
| | | Calendar yearCal = Calendar.getInstance(); |
| | | // 设置为该年ç 1æ1æ¥ 00:00:00 |
| | | yearCal.set(currentYear, Calendar.JANUARY, 1, 0, 0, 0); |
| | | yearCal.set(Calendar.MILLISECOND, 0); |
| | | row.setStartDate(yearCal.getTime()); |
| | | |
| | | // 设置为该年ç 12æ31æ¥ 23:59:59 |
| | | yearCal.set(currentYear, Calendar.DECEMBER, 31, 23, 59, 59); |
| | | yearCal.set(Calendar.MILLISECOND, 999); |
| | | row.setEndDate(yearCal.getTime()); |
| | | // ---------------------------------------------------- |
| | | |
| | | result.add(row); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private List<MydTrendReqDTO> getMonthDate(MydTrendReqVO mydTrendReqVO, List<MydTrendReqDTO> list) { |
| | | // è·åæ´ä½å¼å§åç»ææ¶é´ |
| | | Date startTime = mydTrendReqVO.getStartFinishTime(); |
| | | Date endTime = mydTrendReqVO.getEndFinishTime(); |
| | | |
| | | // 1. è®¡ç®æä»½èå´ |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(startTime); |
| | | int startYear = cal.get(Calendar.YEAR); |
| | | int startMonth = cal.get(Calendar.MONTH); // 注æï¼Calendar.MONTH ä» 0 å¼å§ |
| | | |
| | | cal.setTime(endTime); |
| | | int endYear = cal.get(Calendar.YEAR); |
| | | int endMonth = cal.get(Calendar.MONTH); |
| | | |
| | | // æ»ææ° = (ç»æå¹´ - å¼å§å¹´) * 12 + (ç»ææ - å¼å§æ) + 1 |
| | | int totalMonths = (endYear - startYear) * 12 + (endMonth - startMonth) + 1; |
| | | |
| | | // 2. å·²ææ°æ®ï¼period -> totalScore (period åçæ¯æä»½å符串ï¼å¦ "2024-06") |
| | | Map<String, String> exist = new HashMap<>(); |
| | | for (MydTrendReqDTO row : list) { |
| | | String period = row.getPeriod() != null ? row.getPeriod() : ""; |
| | | exist.put(period, row.getTotalScore() != null ? row.getTotalScore() : "0"); |
| | | } |
| | | |
| | | // 3. è¡¥å
¨æææä»½ |
| | | List<MydTrendReqDTO> result = new ArrayList<>(totalMonths); |
| | | |
| | | Calendar monthCal = Calendar.getInstance(); |
| | | monthCal.set(startYear, startMonth, 1, 0, 0, 0); |
| | | monthCal.set(Calendar.MILLISECOND, 0); |
| | | |
| | | for (int i = 0; i < totalMonths; i++) { |
| | | int currentYear = monthCal.get(Calendar.YEAR); |
| | | int currentMonth = monthCal.get(Calendar.MONTH) + 1; // 转æ 1-12 æ |
| | | |
| | | // æ¼æ¥ periodï¼æ ¼å¼ï¼yyyy-MMï¼æ¯å¦ "2024-06" |
| | | // å¦æä½ å¸ææ¯ "2024-6"ï¼å¯ä»¥æ String.format æ¹æ currentMonth |
| | | String periodKey = String.format("%04d-%02d", currentYear, currentMonth); |
| | | |
| | | MydTrendReqDTO row = new MydTrendReqDTO(); |
| | | row.setPeriod(periodKey); |
| | | row.setTotalScore(exist.getOrDefault(periodKey, "0")); |
| | | |
| | | // -------- 设置该æç startDate å endDate -------- |
| | | // 彿å¼å§æ¶é´ï¼1å· 00:00:00.000 |
| | | Calendar startCal = (Calendar) monthCal.clone(); |
| | | row.setStartDate(startCal.getTime()); |
| | | |
| | | // å½æç»ææ¶é´ï¼ä¸ä¸ªæ1å· 00:00:00.000 å 1 æ¯«ç§ |
| | | Calendar endCal = (Calendar) monthCal.clone(); |
| | | endCal.add(Calendar.MONTH, 1); |
| | | endCal.add(Calendar.MILLISECOND, -1); |
| | | row.setEndDate(endCal.getTime()); |
| | | // ---------------------------------------------------- |
| | | |
| | | result.add(row); |
| | | |
| | | // è¿å
¥ä¸ä¸ä¸ªæ |
| | | monthCal.add(Calendar.MONTH, 1); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private List<MydTrendReqDTO> getDayDate(MydTrendReqVO mydTrendReqVO, List<MydTrendReqDTO> list) { |
| | | // è·åæ´ä½å¼å§åç»ææ¶é´ |
| | | Date startTime = mydTrendReqVO.getStartFinishTime(); |
| | | Date endTime = mydTrendReqVO.getEndFinishTime(); |
| | | |
| | | // 1. è®¡ç®æ»å¤©æ° |
| | | long oneDayMillis = 24L * 60 * 60 * 1000; |
| | | // 注æï¼è¿éåªç®æ¥æå·®ï¼ä¸èèæ¶åç§ï¼å¦åå¯è½å·®ä¸å¤© |
| | | Calendar startCal = Calendar.getInstance(); |
| | | startCal.setTime(startTime); |
| | | startCal.set(Calendar.HOUR_OF_DAY, 0); |
| | | startCal.set(Calendar.MINUTE, 0); |
| | | startCal.set(Calendar.SECOND, 0); |
| | | startCal.set(Calendar.MILLISECOND, 0); |
| | | |
| | | Calendar endCal = Calendar.getInstance(); |
| | | endCal.setTime(endTime); |
| | | endCal.set(Calendar.HOUR_OF_DAY, 0); |
| | | endCal.set(Calendar.MINUTE, 0); |
| | | endCal.set(Calendar.SECOND, 0); |
| | | endCal.set(Calendar.MILLISECOND, 0); |
| | | |
| | | long days = (endCal.getTimeInMillis() - startCal.getTimeInMillis()) / oneDayMillis; |
| | | int totalDays = (int) days + 1; |
| | | |
| | | // 2. å·²ææ°æ®ï¼period -> totalScore (period åçæ¯æ¥æå符串ï¼å¦ "2024-06-01") |
| | | Map<String, String> exist = new HashMap<>(); |
| | | for (MydTrendReqDTO row : list) { |
| | | String period = row.getPeriod() != null ? row.getPeriod() : ""; |
| | | exist.put(period, row.getTotalScore() != null ? row.getTotalScore() : "0"); |
| | | } |
| | | |
| | | // 3. è¡¥å
¨æææ¥æ |
| | | List<MydTrendReqDTO> result = new ArrayList<>(totalDays); |
| | | |
| | | Calendar dayCal = (Calendar) startCal.clone(); |
| | | for (int i = 0; i < totalDays; i++) { |
| | | // æ¼æ¥ periodï¼æ ¼å¼ï¼yyyy-MM-dd |
| | | String periodKey = String.format("%04d-%02d-%02d", dayCal.get(Calendar.YEAR), dayCal.get(Calendar.MONTH) + 1, dayCal.get(Calendar.DAY_OF_MONTH)); |
| | | |
| | | MydTrendReqDTO row = new MydTrendReqDTO(); |
| | | row.setPeriod(periodKey); |
| | | row.setTotalScore(exist.getOrDefault(periodKey, "0")); |
| | | |
| | | // -------- 设置该天ç startDate å endDate -------- |
| | | Calendar startOfDay = (Calendar) dayCal.clone(); |
| | | row.setStartDate(startOfDay.getTime()); |
| | | |
| | | Calendar endOfDay = (Calendar) dayCal.clone(); |
| | | endOfDay.set(Calendar.HOUR_OF_DAY, 23); |
| | | endOfDay.set(Calendar.MINUTE, 59); |
| | | endOfDay.set(Calendar.SECOND, 59); |
| | | endOfDay.set(Calendar.MILLISECOND, 999); |
| | | row.setEndDate(endOfDay.getTime()); |
| | | // ---------------------------------------------------- |
| | | |
| | | result.add(row); |
| | | |
| | | // è¿å
¥ä¸ä¸å¤© |
| | | dayCal.add(Calendar.DAY_OF_MONTH, 1); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | |
| | | <if test="id != null "> |
| | | and id = #{id} |
| | | </if> |
| | | <if test="inhospid != null "> |
| | | and inhospid = #{inhospid} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | |
| | | <if test="phone != null and phone != ''"> |
| | | AND phone = #{phone} |
| | | </if> |
| | | <if test="finishtimeStart != null"> |
| | | AND date_format(finishtime,'%y%m%d') >= date_format(#{finishtimeStart},'%y%m%d') |
| | | </if> |
| | | <if test="finishtimeEnd != null"> |
| | | AND date_format(finishtime,'%y%m%d') <= date_format(#{finishtimeEnd},'%y%m%d') |
| | | </if> |
| | | <if test="deptOrDistrict==1"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | |
| | | and sendstate in (1, 2, 3) |
| | | </select> |
| | | |
| | | <select id="mydTrend" resultType="com.smartor.domain.DTO.MydTrendReqDTO"> |
| | | SELECT CASE #{type} |
| | | WHEN 'year' THEN DATE_FORMAT(d.create_time, '%Y') |
| | | WHEN 'quarter' THEN CONCAT(YEAR(d.create_time), '-Q', QUARTER(d.create_time)) |
| | | WHEN 'month' THEN DATE_FORMAT(d.create_time, '%Y-%m') |
| | | WHEN 'week' THEN FLOOR(DATEDIFF(d.create_time, #{startFinishTime}) / 7) + 1 |
| | | ELSE DATE_FORMAT(d.create_time, '%Y-%m-%d') |
| | | END AS period, |
| | | ROUND(avg(d.score), 2) AS totalScore |
| | | FROM service_subtask_detail d |
| | | JOIN service_task t ON d.taskid = t.taskid |
| | | WHERE t.service_type IN (6, 14) |
| | | AND t.del_flag = 0 |
| | | AND d.del_flag = 0 |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time < DATE_ADD(#{endFinishTime}, INTERVAL 1 DAY) |
| | | GROUP BY period |
| | | ORDER BY period; |
| | | </select> |
| | | |
| | | <select id="sltdMydTotalByDimension" resultType="com.smartor.domain.DTO.MydTrendReqDTO"> |
| | | SELECT |
| | | p.period, |
| | | dim.dimension, |
| | | IFNULL(ROUND(SUM(d.score), 2), 0) AS totalScore |
| | | FROM ( |
| | | <!-- çææ¥è¯¢èå´å
å®é
åºç°è¿çæ¶é´æ®µ --> |
| | | SELECT DISTINCT |
| | | CASE #{type} |
| | | WHEN 'year' THEN DATE_FORMAT(d.create_time, '%Y') |
| | | WHEN 'quarter' THEN CONCAT(YEAR(d.create_time), '-Q', QUARTER(d.create_time)) |
| | | WHEN 'month' THEN DATE_FORMAT(d.create_time, '%Y-%m') |
| | | WHEN 'week' THEN FLOOR(DATEDIFF(d.create_time, #{startFinishTime}) / 7) + 1 |
| | | ELSE DATE_FORMAT(d.create_time, '%Y-%m-%d') |
| | | END AS period |
| | | FROM service_subtask_detail d |
| | | WHERE d.del_flag = 0 |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time < #{endFinishTime} |
| | | ) p |
| | | CROSS JOIN ( |
| | | <!-- ææéè¦å±ç¤ºç dimension --> |
| | | SELECT DISTINCT dimension |
| | | FROM service_subtask_detail |
| | | WHERE del_flag = 0 |
| | | AND dimension IS NOT NULL |
| | | ) dim |
| | | LEFT JOIN service_task t |
| | | ON t.service_type IN (6, 14) |
| | | AND t.del_flag = 0 |
| | | LEFT JOIN service_subtask_detail d |
| | | ON d.taskid = t.taskid |
| | | AND d.del_flag = 0 |
| | | AND d.dimension = dim.dimension |
| | | AND CASE #{type} |
| | | WHEN 'year' THEN DATE_FORMAT(d.create_time, '%Y') |
| | | WHEN 'quarter' THEN CONCAT(YEAR(d.create_time), '-Q', QUARTER(d.create_time)) |
| | | WHEN 'month' THEN DATE_FORMAT(d.create_time, '%Y-%m') |
| | | WHEN 'week' THEN FLOOR(DATEDIFF(d.create_time, #{startFinishTime}) / 7) + 1 |
| | | ELSE DATE_FORMAT(d.create_time, '%Y-%m-%d') |
| | | END = p.period |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time < #{endFinishTime} |
| | | GROUP BY p.period, dim.dimension |
| | | ORDER BY p.period, dim.dimension |
| | | </select> |
| | | |
| | | <select id="sltdMydTotalByYQ" resultType="com.smartor.domain.DTO.MydTrendReqDTO"> |
| | | SELECT p.period, |
| | | c.campusid, |
| | | IFNULL(ROUND(AVG(d.score), 2), 0) AS totalScore |
| | | FROM ( |
| | | -- çææ¥è¯¢èå´å
å®é
åºç°è¿çæ¶é´æ®µ |
| | | SELECT DISTINCT CASE #{type} |
| | | WHEN 'year' THEN DATE_FORMAT(d.create_time, '%Y') |
| | | WHEN 'quarter' THEN CONCAT(YEAR(d.create_time), '-Q', QUARTER(d.create_time)) |
| | | WHEN 'month' THEN DATE_FORMAT(d.create_time, '%Y-%m') |
| | | WHEN 'week' THEN FLOOR(DATEDIFF(d.create_time, #{startFinishTime}) / 7) + 1 |
| | | ELSE DATE_FORMAT(d.create_time, '%Y-%m-%d') |
| | | END AS period |
| | | FROM service_subtask_detail d |
| | | WHERE d.del_flag = 0 |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time < #{endFinishTime}) p |
| | | CROSS JOIN ( |
| | | -- ææéè¦å±ç¤ºçé¢åº |
| | | SELECT DISTINCT campusid |
| | | FROM service_task |
| | | WHERE service_type IN (6, 14) |
| | | AND del_flag = 0 |
| | | AND campusid IS NOT NULL) c |
| | | LEFT JOIN service_task t |
| | | ON t.campusid = c.campusid |
| | | AND t.service_type IN (6, 14) |
| | | AND t.del_flag = 0 |
| | | LEFT JOIN service_subtask_detail d |
| | | ON d.taskid = t.taskid |
| | | AND d.del_flag = 0 |
| | | AND CASE #{type} |
| | | WHEN 'year' THEN DATE_FORMAT(d.create_time, '%Y') |
| | | WHEN 'quarter' THEN CONCAT(YEAR(d.create_time), '-Q', QUARTER(d.create_time)) |
| | | WHEN 'month' THEN DATE_FORMAT(d.create_time, '%Y-%m') |
| | | WHEN 'week' THEN FLOOR(DATEDIFF(d.create_time, #{startFinishTime}) / 7) + 1 |
| | | ELSE DATE_FORMAT(d.create_time, '%Y-%m-%d') |
| | | END = p.period |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time < #{endFinishTime} |
| | | GROUP BY p.period, c.campusid |
| | | ORDER BY p.period, c.campusid; |
| | | </select> |
| | | |
| | | <!-- ä»»å¡ç»ï¼appltype=5ï¼æ»å¨è°åº¦ç¨ï¼ææ¬è½®å
¨é subtaskï¼ä½ä¸ºä¸ä¸è½®çå
鿍¡æ¿ --> |
| | | <select id="selectByScheduleIdAndLoop" resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |
| | |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="startFinishTime != null"> |
| | | AND date_format(s.finishtime,'%y%m%d') >= date_format(#{startFinishTime},'%y%m%d') |
| | | </if> |
| | | <if test="endFinishTime != null"> |
| | | AND date_format(s.finishtime,'%y%m%d') <= date_format(#{endFinishTime},'%y%m%d') |
| | | </if> |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext, |
| | |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="startFinishTime != null"> |
| | | AND date_format(s.finishtime,'%y%m%d') >= date_format(#{startFinishTime},'%y%m%d') |
| | | </if> |
| | | <if test="endFinishTime != null"> |
| | | AND date_format(s.finishtime,'%y%m%d') <= date_format(#{endFinishTime},'%y%m%d') |
| | | </if> |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext, |
| | | d.score, |
| | | d.targetvalue, |
| | | d.asrtext |
| | | d.asrtext, |
| | | t.task_name, |
| | | s.deptcode, |
| | | s.deptname, |
| | | s.leavehospitaldistrictcode, |
| | | s.leavehospitaldistrictname, |
| | | d.value_type |
| | | ORDER BY |
| | | d.questiontext, |
| | | t.taskid |
| | |
| | | |
| | | <select id="statQuestionOptionByKsOrBq" resultType="com.smartor.domain.DTO.QuestionCountKsOrBqDTO" |
| | | parameterType="com.smartor.domain.VO.QuestionCountKsOrBqVO"> |
| | | SELECT questiontext, |
| | | d.taskid, |
| | | s.deptname, |
| | | d.create_time as createTime, |
| | | s.leavehospitaldistrictname, |
| | | d.targetvalue, |
| | | d.asrtext, |
| | | COUNT(d.asrtext) AS answercount, |
| | | d.score AS singleScore |
| | | FROM service_subtask_detail d, |
| | | service_task s |
| | | WHERE d.taskid = s.taskid |
| | | AND deptname IS NOT NULL |
| | | AND leavehospitaldistrictname IS NOT NULL |
| | | SELECT |
| | | s.deptname AS deptname, |
| | | s.leavehospitaldistrictname AS leavehospitaldistrictname, |
| | | d.questiontext AS questionText, |
| | | d.targetvalue AS targetvalue, -- ææéé¡¹æ¼æ¥ |
| | | d.asrtext AS asrtext, -- ç¨æ·å®é
éä¸çé项 |
| | | d.score AS singleScore -- åæ¡è®°å½çåæ° |
| | | FROM service_subtask_detail d |
| | | JOIN service_subtask s ON d.sub_id = s.id |
| | | WHERE s.del_flag = 0 |
| | | AND d.del_flag = 0 |
| | | AND s.service_type IN ('6', '14') |
| | | <if test="taskTemplateid != null"> |
| | | AND s.templateid = #{taskTemplateid} |
| | | </if> |
| | | <if test="endFinishTime != null"> |
| | | AND d.create_time < #{endFinishTime} |
| | | </if> |
| | | <if test="startFinishTime != null"> |
| | | AND d.create_time >= #{startFinishTime} |
| | | AND d.create_time >= #{startFinishTime} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | <if test="deptOrDistrict ==1"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | <if test="deptOrDistrict ==2"> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | GROUP BY d.questiontext, |
| | | d.taskid, |
| | | d.score, |
| | | s.deptname, |
| | | d.targetvalue, |
| | | d.create_time, |
| | | s.leavehospitaldistrictname, |
| | | d.asrtext |
| | | ORDER BY d.taskid |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | |
| | | and endtime |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | | |