| | |
| | | if (allSendStateNot1AndNot9) { |
| | | //说æå
¨åéå¤±è´¥äº |
| | | serviceSubtask.setSendstate(5L); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtask.setRemark("-----getSendPreachform,åéæ¹å¼å
¨é¨å¤±è´¥"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.ReportReqVo; |
| | | import com.ruoyi.system.service.IBaseUserInfoService; |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.smartor.service.DingTalkService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.domain.*; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | log.info("------serviceQueryInfoçå
¥å为ï¼{}", serviceQueryInfo); |
| | | Map map = null; |
| | | try { |
| | | String url = configService.selectConfigByKey("token.360",serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); |
| | | String url = configService.selectConfigByKey("token.360", serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); |
| | | serviceQueryInfo.setUrl(url); |
| | | String url360 = configService.selectConfigByKey("url.360",serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); |
| | | String url360 = configService.selectConfigByKey("url.360", serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); |
| | | serviceQueryInfo.setUrl360(url360); |
| | | map = svyTaskSingleService.query360PatInfo(serviceQueryInfo); |
| | | } catch (Exception e) { |
| | |
| | | return returnParam(aBoolean, dataMap); |
| | | } |
| | | |
| | | /** |
| | | * 360æ£è
ä¿¡æ¯è·å |
| | | */ |
| | | @ApiOperation("360æ£è
ä¿¡æ¯è·åï¼æ¥æªæ¥ï¼") |
| | | @GetMapping("/query360PatInfolwl/{patid}") |
| | | public Map<String, Object> query360PatInfolwl(@PathVariable("patid") Long patid) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | if (patid == null) { |
| | | result.put("url", null); |
| | | result.put("error", "æ£è
id为空"); |
| | | return result; |
| | | } |
| | | LoginUser loginUser = getLoginUser(); |
| | | return serviceExternalService.query360PatInfolwl(patid, loginUser.getUser()); |
| | | } |
| | | |
| | | |
| | | private Map<String, Object> returnParam(Boolean b, Map dataMap) { |
| | |
| | | map.put("Data", map2); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.sms.smsUtils; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.domain.BaseSmsRequest; |
| | | import com.smartor.domain.BaseSmsaccount; |
| | | import com.smartor.domain.BatchBaseSmsRequest; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çä¿¡è´¦å·Controller |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Autowired |
| | | private MtSubmitSmUtil mtSubmitSmUtil; |
| | | |
| | | /** |
| | | * æ¥è¯¢çä¿¡è´¦å·å表 |
| | |
| | | return AjaxResult.error(ex.getMessage()); |
| | | } |
| | | return AjaxResult.success(sendMsg); |
| | | } else if (active.equals("nhfy")) { |
| | | Map<String, Object> smsResult = mtSubmitSmUtil.submitSm(baseSmsRequest.getPhoneNumber(), baseSmsRequest.getTemplateCode()); |
| | | return AjaxResult.success(smsResult.get("result")); |
| | | |
| | | } else { |
| | | if (baseSmsaccountService.sendMsg(baseSmsRequest) == null) { |
| | | return error(); |
| | |
| | | package com.ruoyi.web.controller.smartor.tools; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.ruoyi.common.core.domain.DingTalkReqVo; |
| | | import com.smartor.service.DingTalkService; |
| | | import com.taobao.api.ApiException; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.system.mapper.SysUserDeptMapper; |
| | | import com.smartor.service.IServiceSLTDHealthcareRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.view.RedirectView; |
| | |
| | | private IServiceSLTDHealthcareRecordService iServiceSLTDHealthcareRecordService; |
| | | |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.system.mapper.SysUserDeptMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | private ISysPostService postService; |
| | | |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Value("${isAdmin}") |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置失败任å¡é»è®¤å¼,å¹¶å°å¤±è´¥ä»»å¡éæ°ç½®ä¸ºæå |
| | | * <p> |
| | | * *@param failDay (失败天æ°ï¼è·ç¦»å½åæ¥æå¤±è´¥å¤©æ°) |
| | | * |
| | | * @return |
| | | */ |
| | | public void setFailSubTaskDefalutVal() { |
| | | String failDay = configService.selectConfigByKey("hosp.default.fail.day"); |
| | | if (StringUtils.isNotEmpty(failDay)) iServiceSubtaskService.setFailSubTaskDefalutVal(Long.valueOf(failDay)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¤ææ¥ææ¯å¦æ¯ä»å¤© |
| | |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public boolean isDateToday(Date date) { |
| | | private boolean isDateToday(Date date) { |
| | | if (date == null) { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * @param serviceSubtask |
| | | */ |
| | | public void sfHandlle(ServiceSubtask serviceSubtask) { |
| | | private void sfHandlle(ServiceSubtask serviceSubtask) { |
| | | //è¿ééè¦æ ¹æ®èº«ä»½è¯å»é(ç»å¾®ä¿¡å°ç¨åºçåºå®ä»»å¡ç¨ç) |
| | | List<ServiceSubtask> serviceSubtaskListFilter = new ArrayList<>(); |
| | | ServiceTask ivrTask1 = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- WebService (çä¿¡åé) --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>smartor</artifactId> |
| | | <groupId>org.apache.axis</groupId> |
| | | <artifactId>axis</artifactId> |
| | | <version>1.4</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>smartor</artifactId> |
| | | <groupId>org.apache.axis</groupId> |
| | | <artifactId>axis-jaxrpc</artifactId> |
| | | <version>1.4</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysConfigService |
| | | public interface ISysConfigService extends IConfigService |
| | | { |
| | | /** |
| | | * æ¥è¯¢åæ°é
ç½®ä¿¡æ¯ |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.DingTalkReqVo; |
| | | import com.ruoyi.common.core.service.IDingTalkService; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.domain.ReportReqVo; |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.smartor.service.DingTalkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.mapper.EquipmentinfoMapper; |
| | |
| | | @Autowired |
| | | private EquipmentinfoMapper equipmentinfoMapper; |
| | | |
| | | @Autowired |
| | | private DingTalkService dingTalkService; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | dingTalkReqVo.setContents(null); |
| | | dingTalkReqVo.setDeptId(Long.valueOf(reportReqVo.getDealDeptID())); |
| | | dingTalkReqVo.setUserId(reportReqVo.getDealPersionDingNO()); |
| | | IDingTalkService dingTalkService = SpringUtils.getBean(IDingTalkService.class); |
| | | aBoolean = dingTalkService.sendNotification(dingTalkReqVo); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import com.ruoyi.common.core.service.ISubtaskSmsService; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService iSysConfigService; |
| | | |
| | | @Autowired |
| | | private ServiceSubtaskMapper serviceSubtaskMapper; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | |
| | | List<SmsRecords> selectSmsRecordsList = smsRecordsMapper.selectSmsRecordsList(smsRecords); |
| | | for (SmsRecords record : selectSmsRecordsList) { |
| | | Boolean aBoolean = sendSMS(record.getOrgid(), record.getPhone(), record.getMsg()); |
| | | ServiceSubtask serviceSubtask = new ServiceSubtask(); |
| | | serviceSubtask.setId(record.getSubId()); |
| | | if (aBoolean) serviceSubtask.setVisitNotice(1); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | if (aBoolean) { |
| | | ISubtaskSmsService subtaskSmsService = SpringUtils.getBean(ISubtaskSmsService.class); |
| | | subtaskSmsService.updateSubtaskVisitNotice(record.getSubId(), 1); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | |
| | | } |
| | | log.info("-----------mapçå¼ä¸ºï¼{}", msgInfo); |
| | | |
| | | String token = LSHospTokenUtil.getToken(orgid,msgInfo.get("tokenUrl")); |
| | | ISubtaskSmsService subtaskSmsService = SpringUtils.getBean(ISubtaskSmsService.class); |
| | | String token = subtaskSmsService.getLSHospToken(orgid, msgInfo.get("tokenUrl")); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéï¼å°åï¼{}ï¼åæ°ï¼{}ï¼æºæIDï¼{}", msgInfo.get("address"), orgid); |
| | | String dxCode = getDXCode(msgInfo.get("address"), phone, content, msgInfo.get("sendPersonId"), msgInfo.get("sendPersonName"), MsgLSEnum.getHeaderByCode(msgInfo), token); |
| | | log.info("ãsfHandlleã丽水çä¿¡åéç»æï¼{}", dxCode); |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.system.mapper.SysUserDeptMapper; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | |
| | | @Service |
| | | public class SysUserDeptServiceImpl implements ISysUserDeptService { |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Autowired |
| | |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.smartor.domain.IvrLibaScriptAssort; |
| | | import com.smartor.domain.SvyLibScriptCategory; |
| | | import com.smartor.domain.SvyTaskVO; |
| | | import com.smartor.domain.SysUserOrg; |
| | | import com.smartor.mapper.IvrLibaScriptAssortMapper; |
| | | import com.smartor.mapper.SvyLibScriptCategoryMapper; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.smartor.mapper.SysUserOrgMapper; |
| | | import com.ruoyi.common.core.service.IUserExtInfoService; |
| | | import com.ruoyi.system.mapper.SysUserDeptMapper; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ç¨æ· ä¸å¡å±å¤ç |
| | | * ç¨æ· ä¸å¡å±å¤ï¿½? |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | |
| | | private SysUserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private SysUserOrgMapper sysUserOrgMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Autowired |
| | | private IvrLibaScriptAssortMapper ivrLibaScriptAssortMapper; |
| | | |
| | | @Autowired |
| | | private SvyLibScriptCategoryMapper svyLibScriptCategoryMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢å·²åé
ç¨æ·è§è²å�? |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªåé
ç¨æ·è§è²å�? |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿ç¨æ·åæ¥è¯¢ç¨æ· |
| | | * éè¿ç¨æ·åæ¥è¯¢ç¨ï¿½? |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param userName ç¨æ·ï¿½? |
| | | * @return ç¨æ·å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | |
| | | String[] split = userName.split("&"); |
| | | SysUser sysUser = userMapper.selectUserByUserNameByCondition(split[0], split[1], null); |
| | | |
| | | //è·åå½åç»éäººçæºæåé¢åº |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getUserId().toString()); |
| | | sysUserOrg.setOrgid(split[1].equals("null") ? "" : split[1]); |
| | | sysUserOrg.setCampusid(split[2].equals("null") ? "" : split[2]); |
| | | List<SysUserOrg> sysUserOrgs = sysUserOrgMapper.selectSysUserOrgList(sysUserOrg); |
| | | if (!CollectionUtils.isEmpty(sysUserOrgs)) { |
| | | sysUser.setOrgid(sysUserOrgs.get(0).getOrgid()); |
| | | sysUser.setCampusid(sysUserOrgs.get(0).getCampusid()); |
| | | //è·åå½åç»éäººçæºæåé¢ï¿½? |
| | | IUserExtInfoService userExtInfoService = SpringUtils.getBean(IUserExtInfoService.class); |
| | | Map<String, String> userOrgInfo = userExtInfoService.getUserOrgInfo( |
| | | sysUser.getUserId().toString(), |
| | | split[1], |
| | | split[2]); |
| | | if (!userOrgInfo.isEmpty()) { |
| | | sysUser.setOrgid(userOrgInfo.get("orgid")); |
| | | sysUser.setCampusid(userOrgInfo.get("campusid")); |
| | | } |
| | | |
| | | if (Objects.isNull(sysUser)) return sysUser; |
| | |
| | | //è·åå½åæºæçæ»¡æåº¦é®é¢åç±» |
| | | sysUser.setBelongDepts(list); |
| | | Map<String, Object> satisfactionCategories = new HashMap<>(); |
| | | //è·åè¯é³é®é¢åç±» |
| | | IvrLibaScriptAssort ivrLibaScriptAssort = new IvrLibaScriptAssort(); |
| | | ivrLibaScriptAssort.setOrgid(sysUser.getOrgid()); |
| | | ivrLibaScriptAssort.setType("myd"); |
| | | List<IvrLibaScriptAssort> ivrLibaScriptAssorts = ivrLibaScriptAssortMapper.selectIvrLibaScriptAssortList(ivrLibaScriptAssort); |
| | | List<Map<String, Object>> categoryList = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(ivrLibaScriptAssorts)) { |
| | | for (IvrLibaScriptAssort assort : ivrLibaScriptAssorts) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryid", assort.getId()); |
| | | map.put("categoryName", assort.getIndexAssortName()); |
| | | categoryList.add(map); |
| | | } |
| | | } |
| | | satisfactionCategories.put("voiceCategories", categoryList); |
| | | |
| | | //è·åé®å·é®é¢åç±» |
| | | SvyLibScriptCategory svyLibScriptCategory = new SvyLibScriptCategory(); |
| | | svyLibScriptCategory.setOrgid(sysUser.getOrgid()); |
| | | svyLibScriptCategory.setType("myd"); |
| | | List<SvyLibScriptCategory> svyLibScriptCategories = svyLibScriptCategoryMapper.selectSvyLibScriptCategoryList(svyLibScriptCategory); |
| | | List<Map<String, Object>> questionnaireCategorys = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(svyLibScriptCategories)) { |
| | | for (SvyLibScriptCategory scriptCategory : svyLibScriptCategories) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryid", scriptCategory.getId()); |
| | | map.put("categoryName", scriptCategory.getName()); |
| | | questionnaireCategorys.add(map); |
| | | } |
| | | } |
| | | satisfactionCategories.put("questionnaireCategorys", questionnaireCategorys); |
| | | |
| | | //设置å½åç¨æ·ç声é³é®é¢åç±»åé®å·é®é¢åç±» |
| | | sysUser.setSatisfactionCategories(satisfactionCategories); |
| | | IUserExtInfoService userExtInfoService3 = SpringUtils.getBean(IUserExtInfoService.class); |
| | | sysUser.setSatisfactionCategories(userExtInfoService3.getSatisfactionCategories(sysUser.getOrgid())); |
| | | } |
| | | return sysUser; |
| | | } |
| | |
| | | } |
| | | SysUser sysUser = userMapper.selectUserByUserNameByCondition(split[0], split[1], split[2]); |
| | | |
| | | //è·åå½åç»éäººçæºæåé¢åº |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getUserId().toString()); |
| | | sysUserOrg.setOrgid(split[1].equals("null") ? "" : split[1]); |
| | | sysUserOrg.setCampusid(split[3].equals("null") ? "" : split[3]); |
| | | List<SysUserOrg> sysUserOrgs = sysUserOrgMapper.selectSysUserOrgList(sysUserOrg); |
| | | if (!CollectionUtils.isEmpty(sysUserOrgs)) { |
| | | sysUser.setOrgid(sysUserOrgs.get(0).getOrgid()); |
| | | sysUser.setCampusid(sysUserOrgs.get(0).getCampusid()); |
| | | //è·åå½åç»éäººçæºæåé¢ï¿½? |
| | | IUserExtInfoService userExtInfoService2 = SpringUtils.getBean(IUserExtInfoService.class); |
| | | Map<String, String> userOrgInfo2 = userExtInfoService2.getUserOrgInfo( |
| | | sysUser.getUserId().toString(), |
| | | split[1], |
| | | split[3]); |
| | | if (!userOrgInfo2.isEmpty()) { |
| | | sysUser.setOrgid(userOrgInfo2.get("orgid")); |
| | | sysUser.setCampusid(userOrgInfo2.get("campusid")); |
| | | } |
| | | |
| | | log.info("selectUserByUserNameAndDeptIdçsysUserçå¼ä¸ºï¼{}", sysUser); |
| | |
| | | /** |
| | | * æ¥è¯¢ç¨æ·æå±è§è²ç» |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param userName ç¨æ·ï¿½? |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | |
| | | /** |
| | | * æ¥è¯¢ç¨æ·æå±å²ä½ç» |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param userName ç¨æ·ï¿½? |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªç¨æ·æ¯å¦ææ°æ®æé |
| | | * æ ¡éªç¨æ·æ¯å¦ææ°æ®æï¿½? |
| | | * |
| | | * @param userId ç¨æ·id |
| | | */ |
| | |
| | | user.setUserId(userId); |
| | | List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user); |
| | | if (StringUtils.isEmpty(users)) { |
| | | throw new ServiceException("没ææé访é®ç¨æ·æ°æ®ï¼"); |
| | | throw new ServiceException("没ææé访é®ç¨æ·æ°æ®"); |
| | | } |
| | | } |
| | | } |
| | |
| | | public int insertUser(SysUser user) { |
| | | // æ°å¢ç¨æ·ä¿¡æ¯ |
| | | int rows = userMapper.insertUser(user); |
| | | //æ°å¢ç¨æ·ä¸é¨é¨å
³è |
| | | //æ°å¢ç¨æ·ä¸é¨é¨å
³ï¿½? |
| | | // if (!CollectionUtils.isEmpty(user.getDepts())) { |
| | | // for (Long deptId : user.getDepts()) { |
| | | // SysUserDept sysUserDep = new SysUserDept(); |
| | |
| | | } |
| | | // æ°å¢ç¨æ·å²ä½å
³è |
| | | insertUserPost(user); |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ç |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ï¿½? |
| | | insertUserRole(user); |
| | | return rows; |
| | | } |
| | |
| | | @Transactional |
| | | public int updateUser(SysUser user) { |
| | | Long userId = user.getUserId(); |
| | | // å é¤ç¨æ·ä¸è§è²å
³è |
| | | // å é¤ç¨æ·ä¸è§è²å
³ï¿½? |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ç |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ï¿½? |
| | | insertUserRole(user); |
| | | // å é¤ç¨æ·ä¸å²ä½å
³è |
| | | // å é¤ç¨æ·ä¸å²ä½å
³ï¿½? |
| | | userPostMapper.deleteUserPostByUserId(userId); |
| | | // æ°å¢ç¨æ·ä¸å²ä½ç®¡ç |
| | | // æ°å¢ç¨æ·ä¸å²ä½ç®¡ï¿½? |
| | | insertUserPost(user); |
| | | //å é¤ç¨æ·ä¸é¨é¨çå
³è |
| | | Long[] ids = {user.getUserId()}; |
| | | //æ°å¢ç¨æ·ä¸é¨é¨å
³è |
| | | //æ°å¢ç¨æ·ä¸é¨é¨å
³ï¿½? |
| | | // sysUserDeptMapper.deleteSysUserDeptByIds(ids); |
| | | // if (!CollectionUtils.isEmpty(user.getDepts())) { |
| | | // for (Long deptId : user.getDepts()) { |
| | | // SysUserDept sysUserDep = new SysUserDept(); |
| | | // sysUserDep.setUserId(user.getUserId()); |
| | | // sysUserDep.setDeptId(deptId); |
| | | // //æ¥è¯¢æ¯å¦ å·²ç»å
³è该é¨é¨ |
| | | // //æ¥è¯¢æ¯å¦ å·²ç»å
³è该é¨ï¿½? |
| | | // List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDep); |
| | | // if (!CollectionUtils.isEmpty(sysUserDepts)) { |
| | | // SysUserDept sysUserDept = sysUserDepts.get(0); |
| | |
| | | * ç¨æ·ææè§è² |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @param roleIds è§è²ç» |
| | | * @param roleIds è§è²ï¿½? |
| | | */ |
| | | @Override |
| | | @Transactional |
| | |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·ç¶æ |
| | | * ä¿®æ¹ç¨æ·ç¶ï¿½? |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç»æ |
| | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·å¤´å |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param userName ç¨æ·ï¿½? |
| | | * @param avatar 头åå°å |
| | | * @return ç»æ |
| | | */ |
| | |
| | | /** |
| | | * éç½®ç¨æ·å¯ç |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param userName ç¨æ·ï¿½? |
| | | * @param password å¯ç |
| | | * @return ç»æ |
| | | */ |
| | |
| | | public void insertUserPost(SysUser user) { |
| | | Long[] posts = user.getPostIds(); |
| | | if (StringUtils.isNotEmpty(posts)) { |
| | | // æ°å¢ç¨æ·ä¸å²ä½ç®¡ç |
| | | // æ°å¢ç¨æ·ä¸å²ä½ç®¡ï¿½? |
| | | List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length); |
| | | for (Long postId : posts) { |
| | | SysUserPost up = new SysUserPost(); |
| | |
| | | * æ°å¢ç¨æ·è§è²ä¿¡æ¯ |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @param roleIds è§è²ç» |
| | | * @param roleIds è§è²ï¿½? |
| | | */ |
| | | public void insertUserRole(Long userId, Long[] roleIds, String orgid) { |
| | | if (StringUtils.isNotEmpty(roleIds)) { |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ç |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ï¿½? |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length); |
| | | for (Long roleId : roleIds) { |
| | | SysUserRole ur = new SysUserRole(); |
| | |
| | | @Override |
| | | @Transactional |
| | | public int deleteUserById(Long userId) { |
| | | // å é¤ç¨æ·ä¸è§è²å
³è |
| | | // å é¤ç¨æ·ä¸è§è²å
³ï¿½? |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // å é¤ç¨æ·ä¸å²ä½è¡¨ |
| | | userPostMapper.deleteUserPostByUserId(userId); |
| | |
| | | checkUserAllowed(new SysUser(userId)); |
| | | checkUserDataScope(userId); |
| | | } |
| | | // å é¤ç¨æ·ä¸è§è²å
³è |
| | | // å é¤ç¨æ·ä¸è§è²å
³ï¿½? |
| | | userRoleMapper.deleteUserRole(userIds); |
| | | // å é¤ç¨æ·ä¸å²ä½å
³è |
| | | // å é¤ç¨æ·ä¸å²ä½å
³ï¿½? |
| | | userPostMapper.deleteUserPost(userIds); |
| | | return userMapper.deleteUserByIds(userIds); |
| | | } |
| | |
| | | @Override |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) { |
| | | if (StringUtils.isNull(userList) || userList.size() == 0) { |
| | | throw new ServiceException("导å
¥ç¨æ·æ°æ®ä¸è½ä¸ºç©ºï¼"); |
| | | throw new ServiceException("导å
¥ç¨æ·æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | int successNum = 0; |
| | | int failureNum = 0; |
| | |
| | | user.setCreateBy(operName); |
| | | this.insertUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "ãè´¦å· " + user.getUserName() + " 导å
¥æå"); |
| | | successMsg.append("<br/>" + successNum + "ã账�?" + user.getUserName() + " 导å
¥æå"); |
| | | } else if (isUpdateSupport) { |
| | | BeanValidators.validateWithException(validator, user); |
| | | checkUserAllowed(user); |
| | |
| | | user.setUpdateBy(operName); |
| | | this.updateUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "ãè´¦å· " + user.getUserName() + " æ´æ°æå"); |
| | | successMsg.append("<br/>" + successNum + "è´¦å·?" + user.getUserName() + " æ´æ°æå"); |
| | | } else { |
| | | failureNum++; |
| | | failureMsg.append("<br/>" + failureNum + "ãè´¦å· " + user.getUserName() + " å·²åå¨"); |
| | | failureMsg.append("<br/>" + failureNum + "è´¦å·" + user.getUserName() + " å·²åå¨"); |
| | | } |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "ãè´¦å· " + user.getUserName() + " 导å
¥å¤±è´¥ï¼"; |
| | | String msg = "<br/>" + failureNum + "è´¦å·" + user.getUserName() + " 导å
¥å¤±è´¥"; |
| | | failureMsg.append(msg + e.getMessage()); |
| | | log.error(msg, e); |
| | | } |
| | |
| | | failureMsg.insert(0, "徿±æï¼å¯¼å
¥å¤±è´¥ï¼å
± " + failureNum + " æ¡æ°æ®æ ¼å¼ä¸æ£ç¡®ï¼é误å¦ä¸ï¼"); |
| | | throw new ServiceException(failureMsg.toString()); |
| | | } else { |
| | | successMsg.insert(0, "æåæ¨ï¼æ°æ®å·²å
¨é¨å¯¼å
¥æåï¼å
± " + successNum + " æ¡ï¼æ°æ®å¦ä¸ï¼"); |
| | | successMsg.insert(0, "æåæ¨ï¼æ°æ®å·²å
¨é¨å¯¼å
¥æåï¼å
±" + successNum + "æ¡ï¼æ°æ®å¦ä¸ï¼"); |
| | | } |
| | | return successMsg.toString(); |
| | | } |
| | |
| | | /** |
| | | * ç信模æ¿CODE |
| | | */ |
| | | @ApiModelProperty(value = "模æ¿ID") |
| | | @ApiModelProperty(value = "模æ¿ID;妿ååéä¸çè¯ï¼è¯¥å段就æ¯content") |
| | | private String templateCode; |
| | | |
| | | |
| | |
| | | private Long scriptid; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ 2 æ¯") |
| | | private Long defaultValue; |
| | | |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | @ApiModelProperty("主é®") |
| | |
| | | @Excel(name = "å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯") |
| | | @ApiModelProperty(value = "å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯") |
| | | private Long isException; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ï¼é»è®¤ï¼ 2 æ¯") |
| | | private Long defaultValue; |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "æå¡çåç§°") |
| | | private String sendTaskname; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ 2 æ¯") |
| | | private Long defaultValue; |
| | | } |
| | |
| | | private String hospitaldistrictcode; |
| | | |
| | | /** |
| | | * é¢åºç¼å·éå |
| | | */ |
| | | @ApiModelProperty(value = "é¢åºç¼å·éå") |
| | | private List<String> hospitaldistrictcodeList; |
| | | |
| | | /** |
| | | * é¢åºåç§° |
| | | */ |
| | | @ApiModelProperty(value = "é¢åºåç§°") |
| | |
| | | */ |
| | | @ApiModelProperty(value = "å
¥é¢ç§å®¤ä»£ç ") |
| | | private String deptcode; |
| | | /** |
| | | * å
¥é¢ç§å®¤ä»£ç |
| | | */ |
| | | @ApiModelProperty(value = "å
¥é¢ç§å®¤ä»£ç éå") |
| | | private List<String> deptcodeList; |
| | | |
| | | /** |
| | | * å
¥é¢ç§å®¤åç§° |
| | |
| | | @ApiModelProperty(value = "å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯") |
| | | private Integer isException; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ 2 æ¯") |
| | | private Long defaultValue; |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "æå¡çåç§°") |
| | | private String sendTaskname; |
| | | // |
| | | // /** |
| | | // * å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯ |
| | | // */ |
| | | // @ApiModelProperty(value = "å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯") |
| | | // private Integer isException; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ï¼é»è®¤ï¼ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ï¼é»è®¤ï¼ 2 æ¯") |
| | | private Long defaultValue; |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦æ¯ç¨æ·éæ©çé项") |
| | | private Boolean isUserOperation = false; |
| | | |
| | | // /** |
| | | // * å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯ |
| | | // */ |
| | | // @ApiModelProperty(value = "å¼å¸¸é项ï¼1å¦ï¼é»è®¤ï¼ 2æ¯") |
| | | // private Integer isException; |
| | | |
| | | /** |
| | | * é»è®¤é项ï¼1 å¦ 2 æ¯ |
| | | */ |
| | | @ApiModelProperty("é»è®¤é项ï¼1 å¦ 2 æ¯") |
| | | private Long defaultValue; |
| | | } |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.ruoyi.common.core.domain.DingTalkReqVo; |
| | | import com.ruoyi.common.core.service.IDingTalkService; |
| | | import com.smartor.domain.HeCategory; |
| | | import com.taobao.api.ApiException; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | * @author smartor |
| | | * @date 2023-03-04 |
| | | */ |
| | | public interface DingTalkService { |
| | | public interface DingTalkService extends IDingTalkService { |
| | | /** |
| | | * åéééæ¶æ¯ |
| | | * |
| | |
| | | package com.smartor.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.smartor.domain.ExternalDept; |
| | | import com.smartor.domain.PatArchive; |
| | | import com.smartor.domain.ServiceSubtaskDetail; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | * æ£æ¥æ¥åæå¡ |
| | | */ |
| | | public Boolean addInspectBGService(Map dataMap); |
| | | |
| | | public Map<String, Object> query360PatInfolwl(Long patid, SysUser sysUser); |
| | | } |
| | |
| | | public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | //导åºé访 |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsExport(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | |
| | | |
| | | public List<PatArchiveSrmVO> sendMsgTemplate(List<PatArchiveSrmVO> patArchiveSrmVOS); |
| | | |
| | | public List<ServiceSubtaskDiagname> convertToDiagnameList(List<ServiceSubtask> subtaskList) ; |
| | | public List<ServiceSubtaskDiagname> convertToDiagnameList(List<ServiceSubtask> subtaskList); |
| | | |
| | | public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity); |
| | | |
| | |
| | | * @return noContinueCountãContinueCount å detail å表 |
| | | */ |
| | | Map<String, Object> getContinueNurseCount(ServiceSubtaskCotinueCountVO vo); |
| | | } |
| | | |
| | | /** |
| | | * 设置失败任å¡é»è®¤å¼,å¹¶å°å¤±è´¥ä»»å¡éæ°ç½®ä¸ºæå |
| | | * <p> |
| | | * *@param failDay (失败天æ°ï¼è·ç¦»å½åæ¥æå¤±è´¥å¤©æ°) |
| | | * |
| | | * @return |
| | | */ |
| | | public void setFailSubTaskDefalutVal(Long failDay); |
| | | } |
| | |
| | | import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; |
| | | import com.dingtalk.api.response.OapiUserListidResponse; |
| | | import com.dingtalk.api.response.OapiV2UserGetbymobileResponse; |
| | | import com.ruoyi.common.core.domain.DingTalkReqVo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.smartor.service.DingTalkService; |
| | | import com.taobao.api.ApiException; |
| | | import lombok.extern.log4j.Log4j; |
| | |
| | | */ |
| | | @Override |
| | | public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp) { |
| | | if (patMedInhosp.getCry() == 0) { |
| | | patMedInhosp.setDeptcodeList(patMedInhosp.getLeaveldeptcodes()); |
| | | patMedInhosp.setHospitaldistrictcodeList(patMedInhosp.getLeavehospitaldistrictcodes()); |
| | | patMedInhosp.setLeaveldeptcodes(null); |
| | | patMedInhosp.setLeavehospitaldistrictcodes(null); |
| | | patMedInhosp.setInhospstate("0"); |
| | | } else if (patMedInhosp.getCry() == 1) { |
| | | patMedInhosp.setInhospstate("1"); |
| | | } |
| | | |
| | | List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp); |
| | | for (PatMedInhosp patMedInhosp1 : patMedInhospList) { |
| | | String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid()); |
| | |
| | | PatMedOuthospQueryReq patMedOuthospQueryReq = DtoConversionUtils.sourceToTarget(patMedOuthosp, PatMedOuthospQueryReq.class); |
| | | patMedOuthospQueryReq.setBeginAdmitdate(patMedOuthosp.getBeginTime()); |
| | | patMedOuthospQueryReq.setEndAdmitdate(patMedOuthosp.getEndTime()); |
| | | if(!CollectionUtils.isEmpty(patMedOuthosp.getDeptcodes())) { |
| | | String result = String.join(",", patMedOuthosp.getDeptcodes()); |
| | | patMedOuthospQueryReq.setDeptcode(result); |
| | | } |
| | | |
| | | List<PatMedOuthosp> patMedOuthospQueryResps = patMedOuthospMapper.callSpQueryOuthosp(patMedOuthospQueryReq); |
| | | if (patMedOuthosp.getPageNum() != null) { |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthospQueryResps) { |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.AesUtils; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> query360PatInfolwl(Long patid, SysUser sysUser) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | PatArchive pa = patArchiveMapper.selectPatArchiveByPatid(patid); |
| | | if (pa.getPatientno() == null) { |
| | | result.put("url", null); |
| | | result.put("error", "æ£è
ç¼å·ä¸ºç©º"); |
| | | return result; |
| | | } |
| | | |
| | | StringBuffer sbf = new StringBuffer("http://cfdata.nhyfy.cn/cfdata/h360/patient-summary?"); |
| | | sbf.append("referer=thirdparty"); |
| | | sbf.append("&encode=1"); |
| | | sbf.append("&patientMainIndexNum=" + AesUtils.encrypt(pa.getPatientno())); |
| | | sbf.append("&workId=" + AesUtils.encrypt(sysUser.getUserName())); |
| | | sbf.append("&workName=" + AesUtils.encrypt(sysUser.getNickName())); |
| | | sbf.append("&hisOrgCode=" + AesUtils.encrypt("20001001")); |
| | | sbf.append("&hisOrgName=" + AesUtils.encrypt("åå大å¦éå±ç¬¬ä¸å»é¢")); |
| | | sbf.append("&hisHosCode=" + AesUtils.encrypt("30001002")); |
| | | sbf.append("&hisHosName=" + AesUtils.encrypt("åå大å¦éå±ç¬¬ä¸å»é¢")); |
| | | String url360 = null; |
| | | try { |
| | | url360 = URLEncoder.encode(sbf.toString(), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | StringBuffer stringBuffer = new StringBuffer("http://cfdata.nhyfy.cn/cfdata/login/nologin?"); |
| | | //accountNo对æ¥äººä¸ç»ï¼å
空ç--------------------------------------------------------------- |
| | | stringBuffer.append("accountNo="); |
| | | stringBuffer.append("&source=third"); |
| | | stringBuffer.append("&redirectUrl=" + url360); |
| | | |
| | | result.put("url", stringBuffer.toString()); |
| | | result.put("error", null); |
| | | return result; |
| | | } |
| | | |
| | | private Boolean getType(String type, Map dataMap) { |
| | | switch (type) { |
| | | case "BR_DA_DangAnJL": |
| | |
| | | String professionalTitleName = getStringValue(diagnosisMap, "professionalTitleName"); |
| | | if (professionalTitleName.contains("å»å¸")) { |
| | | sysUser.setUserType("å»ç"); |
| | | sysUser.setSearchscope("1"); |
| | | } |
| | | if (professionalTitleName.contains("æ¤")) { |
| | | sysUser.setUserType("æ¤å£«"); |
| | | sysUser.setSearchscope("2"); |
| | | } |
| | | sysUser.setTitle(getStringValue(diagnosisMap, "professionalTitleName")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //å¦æç¨æ·çæ£è
èå´ä¸ºç©ºï¼åé»è®¤ä¸º0 |
| | | if (StringUtils.isEmpty(sysUser.getSearchscope())) sysUser.setSearchscope("0"); |
| | | sysUser.setPhonenumber(getStringValue(dataItem, "telephone")); |
| | | sysUser.setUserCode(getStringValue(dataItem, "jobNumber")); |
| | | //设置æ§å« |
| | |
| | | sysUser.setCreateBy("admin"); |
| | | sysUser.setCreateBy("admin"); |
| | | sysUser.setOrgid("" + getLongValue(dataItem, "orgId")); |
| | | // sysUser.setCampusid("" + getLongValue(dataItem, "cmpusId")); |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | sysUser.setPassword(passwordEncoder.encode(userPwd)); |
| | | |
| | | SysUser sysUser1 = sysUser2Mapper.selectUserByUserName(sysUser.getUserName()); |
| | | if (ObjectUtils.isNotEmpty(sysUser1)) { |
| | | //ç±äººå·¥ç»´æ¤çåæ®µæ¯ä¸éè¦æ´æ°ç |
| | | sysUser.setSearchscope(null); |
| | | sysUser.setPassword(null); |
| | | sysUser.setUserId(sysUser1.getUserId()); |
| | | sysUser2Mapper.updateUser(sysUser); |
| | | } else { |
| | |
| | | patMedInhosp.setNurseId(dto.getChiefNurseId() == null ? "" : dto.getChiefNurseId().toString()); |
| | | patMedInhosp.setNurseName(dto.getChiefNurseName()); |
| | | patMedInhosp.setSerialnum(dto.getHealthcareRecordNo()); |
| | | patMedInhosp.setInhospno(dto.getHealthcareRecordNo()); |
| | | patMedInhosp.setFuflag("1"); |
| | | if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) |
| | | patMedInhosp.setFuflag("0"); |
| | |
| | | |
| | | private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | PatArchive patArchive = new PatArchive(); |
| | | patArchive.setPatientno(dto.getPatientId() == null ? null : String.valueOf(dto.getPatientId())); |
| | | patArchive.setPatientno(dto.getMedicalRecordNo() == null ? null : String.valueOf(dto.getMedicalRecordNo())); |
| | | patArchive.setPatidHis(dto.getPatientId() == null ? null : String.valueOf(dto.getPatientId())); |
| | | patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); |
| | | patArchive.setName(dto.getPatientName()); |
| | | patArchive.setSourcefrom(2L); |
| | |
| | | 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) && !Long.valueOf(split[2]).equals(subid)) { |
| | | 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) { |
| | |
| | | |
| | | if (svyTaskTemplateScriptVO.getSort() != null && svyTaskTemplateScriptVO.getSort().equals(nextScriptno)) { |
| | | // log.error("svyTaskTemplateScriptVOçå¼ä¸ºï¼{}", svyTaskTemplateScriptVO); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]), Long.valueOf(split[2])); |
| | | 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")); |
| | |
| | | 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]), Long.valueOf(split[2])); |
| | | 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")); |
| | |
| | | for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) { |
| | | if (svyTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = cacheList.get(0).getSvyTaskTemplateTargetoptions(); |
| | | List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions(); |
| | | svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions); |
| | | Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid, subid); |
| | | if (map == null) continue; |
| | |
| | | for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : cacheList) { |
| | | if (ivrTaskTemplateScriptVO.getSort() != null && ivrTaskTemplateScriptVO.getSort() == 1L) { |
| | | //è¯´ææ¯ç¬¬ä¸é¢ |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = cacheList.get(0).getIvrTaskScriptTargetoptionList(); |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | //å®ä¿©é½æ¯ivr_task_templatescript_id,æä»¥è¿ééè¦è®¾ç½®ä¸ä¸ |
| | | ivrTaskTemplateScriptVO.setId(ivrTaskTemplateScriptVO.getScriptID()); |
| | |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setTaskid(taskid); |
| | | serviceSubtaskVO.setPatid(patid); |
| | | serviceSubtaskVO.setPatid(subid); |
| | | serviceSubtaskVO.setSubId(subid); |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | |
| | | String score = "0"; |
| | |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.smartor.common.FtpService; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | |
| | | |
| | | @Autowired |
| | | private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService; |
| | | |
| | | @Autowired |
| | | private IIvrTaskTemplateTargetoptionService iIvrTaskTemplateTargetoptionService; |
| | | |
| | | @Autowired |
| | | private IServiceOutPathService iServiceOutPathService; |
| | |
| | | result.put("详æ
", detail); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 设置失败任å¡é»è®¤å¼,å¹¶å°å¤±è´¥ä»»å¡éæ°ç½®ä¸ºæå |
| | | * |
| | | * @param failDay (失败天æ°ï¼è·ç¦»å½åæ¥æå¤±è´¥å¤©æ°) |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void setFailSubTaskDefalutVal(Long failDay) { |
| | | //1.å
å»sys_configä¸ï¼è·ååªäºç§å®¤æç
åºéè¦é»è®¤é®å·é»è®¤å¼ |
| | | IConfigService configService = SpringUtils.getBean(IConfigService.class); |
| | | String deptConfigValue = configService.selectConfigByKey("hosp.default.dept"); |
| | | String wardConfigValue = configService.selectConfigByKey("hosp.default.ward"); |
| | | List<String> leaveWard = null; |
| | | List<String> leaveDept = null; |
| | | if (deptConfigValue != null && !deptConfigValue.isEmpty()) { |
| | | leaveDept = Arrays.stream(deptConfigValue.split(",")).filter(s -> !s.trim().isEmpty()).collect(Collectors.toList()); |
| | | } |
| | | if (wardConfigValue != null && !wardConfigValue.isEmpty()) { |
| | | leaveWard = Arrays.stream(wardConfigValue.split(",")).filter(s -> !s.trim().isEmpty()).collect(Collectors.toList()); |
| | | } |
| | | log.info("离é¢ç
åºleaveWard: {}, 离é¢ç§å®¤leaveDept: {}", leaveWard, leaveDept); |
| | | if (leaveWard == null && leaveDept == null) return; |
| | | |
| | | //2.è·åleaveWardï¼leaveDeptä¸çservic_subtask表ä¸sendstate=5çä»»å¡ |
| | | ServiceSubtaskEntity serviceSubtaskEntity = new ServiceSubtaskEntity(); |
| | | serviceSubtaskEntity.setSendstate(5L); |
| | | serviceSubtaskEntity.setLeavehospitaldistrictcodes(leaveWard); |
| | | serviceSubtaskEntity.setLeaveldeptcodes(leaveDept); |
| | | if (!Objects.isNull(leaveWard) && !Objects.isNull(leaveDept)) serviceSubtaskEntity.setDeptOrDistrict("2"); |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskEntity); |
| | | |
| | | if (CollectionUtils.isEmpty(serviceSubtasks)) return; |
| | | |
| | | //3.妿æ¥åºæ¥çéåä¸ä¸ºç©ºï¼åè¿è¡å¾ªç¯ |
| | | for (ServiceSubtask serviceSubtask : serviceSubtasks) { |
| | | Integer preachformSize = 0; |
| | | Boolean flag = false; |
| | | ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); |
| | | serviceSubtaskPreachform.setSubid(serviceSubtask.getId()); |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) |
| | | preachformSize = serviceSubtaskPreachforms.size(); |
| | | if (serviceSubtask.getUpdateTime() != null && DateUtils.differentDaysByMillisecond(new Date(), serviceSubtask.getUpdateTime()) >= failDay) { |
| | | //3.1 夿å½åserviceSubtaskçupdateTimeæ¯ä¸æ¯ä¸ºç©ºï¼å¦æä¸ä¸ºç©ºï¼å夿å½åæ¶é´æ¯ä¸æ¯ä¸updateTimeå·®è·å¤§äºçäºfailDay |
| | | flag = saveServiceSubtaskDetail(serviceSubtask); |
| | | } else if (serviceSubtask.getVisitTime() != null && DateUtils.differentDaysByMillisecond(new Date(), serviceSubtask.getVisitTime()) >= failDay + preachformSize) { |
| | | //3.2 妿å½åserviceSubtaskçupdateTimeä¸ºç©ºï¼æ ¹æ®å½åserviceSubtaskçsubid廿¥service_subtask_preachformå¾å°sizeï¼å¦æsize为空ï¼åé»è®¤0ï¼ï¼åæ ¹æ®å½åæ¶é´æ¯ä¸æ¯ä¸å½åserviceSubtaskçvisitTimeå·®è·å¤§äºçäºfailDay + size |
| | | flag = saveServiceSubtaskDetail(serviceSubtask); |
| | | } else { |
| | | //3.3 妿2.1ä¸2.2é½ä¸ºfalseï¼åcontinue |
| | | continue; |
| | | } |
| | | |
| | | //4.妿flag为trueï¼åæ´æ°service_subtask表ä¸çsendstate为6ï¼preachform为1 |
| | | if (flag) { |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setPreachform("1"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } else { |
| | | //å é¤è¯¯æ°å¢detailéçæ°æ® |
| | | ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); |
| | | serviceSubtaskDetail.setSubId(serviceSubtask.getId()); |
| | | List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskDetails)) { |
| | | for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetails) { |
| | | serviceSubtaskDetail1.setDelFlag("1"); |
| | | serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Boolean saveServiceSubtaskDetail(ServiceSubtask serviceSubtask) { |
| | | Boolean result = true; |
| | | //3.4 妿3.1æ3.2为trueçè¯ï¼æ ¹æ®type夿ä»ä¹ç±»å |
| | | if (serviceSubtask.getType().equals("1")) { |
| | | //3.3.1 妿typeæ¯ 1 ï¼åç¨å½åserviceSubtaskçtemplateidå»ivr_task_temaplate_scriptä¸è·åé®é¢åé项ï¼å°é®é¢åé项çé»è®¤å¼æ¾å°service_detailä¸ |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript(); |
| | | ivrTaskTemplateScript.setTemplateID(serviceSubtask.getTemplateid()); |
| | | List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript); |
| | | for (IvrTaskTemplateScript its : ivrTaskTemplateScripts) { |
| | | IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(its, IvrTaskTemplateScriptVO.class); |
| | | IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption(); |
| | | ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId()); |
| | | List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = iIvrTaskTemplateTargetoptionService.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption); |
| | | ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions); |
| | | Integer integer = setSFDetailInfo(ivrTaskTemplateScriptVO, serviceSubtask); |
| | | if (Objects.isNull(integer) || integer == 0) result = false; |
| | | } |
| | | |
| | | } else if (serviceSubtask.getType().equals("2")) { |
| | | //3.3.2 妿typeæ¯ 2,åç¨å½åserviceSubtaskçtemplateidå»svy_task_temaplate_scriptä¸è·åé®é¢åé项ï¼å°é®é¢åé项çé»è®¤å¼æ¾å°service_detailä¸ |
| | | SvyTaskTemplateScript svyTaskTemplateScript = new SvyTaskTemplateScript(); |
| | | svyTaskTemplateScript.setTemplateID(serviceSubtask.getTemplateid()); |
| | | List<SvyTaskTemplateScript> svyTaskTemplateScripts = svyTaskTemplateScriptService.selectSvyTaskTemplateScriptList(svyTaskTemplateScript); |
| | | for (SvyTaskTemplateScript taskTemplateScript : svyTaskTemplateScripts) { |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(taskTemplateScript, SvyTaskTemplateScriptVO.class); |
| | | SvyTaskTemplateScriptVO svyTaskTemplateScriptVO1 = svyTaskTemplateScriptService.selectInfoByCondition(svyTaskTemplateScriptVO); |
| | | Integer integer = setWJDetailInfo(svyTaskTemplateScriptVO1, serviceSubtask); |
| | | if (Objects.isNull(integer) || integer == 0) result = false; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private Integer setWJDetailInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, ServiceSubtask serviceSubtask) { |
| | | log.info("-----setWJDetailInfoçå
¥å为ï¼{}", svyTaskTemplateScriptVO); |
| | | |
| | | ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO(); |
| | | if (svyTaskTemplateScriptVO.getScriptType().equals("1") || svyTaskTemplateScriptVO.getScriptType().equals("2")) { |
| | | //1ã2为åéæå¤é |
| | | for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) { |
| | | //å°é®é¢é项记å½ä¸æ¥ |
| | | if (StringUtils.isEmpty(serviceSubtaskDetailVO.getTargetvalue())) { |
| | | serviceSubtaskDetailVO.setTargetvalue(svyTaskTemplateTargetoption.getOptioncontent()); |
| | | } else { |
| | | serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + "&" + svyTaskTemplateTargetoption.getOptioncontent()); |
| | | } |
| | | if (svyTaskTemplateTargetoption.getDefaultValue() != null && svyTaskTemplateTargetoption.getDefaultValue() == 2) { |
| | | serviceSubtaskDetailVO.setAsrtext(StringUtils.isNotBlank(serviceSubtaskDetailVO.getAsrtext()) ? serviceSubtaskDetailVO.getAsrtext() + "&" + svyTaskTemplateTargetoption.getOptioncontent() : svyTaskTemplateTargetoption.getOptioncontent()); |
| | | serviceSubtaskDetailVO.setMatchedtext(StringUtils.isNotBlank(serviceSubtaskDetailVO.getMatchedtext()) ? serviceSubtaskDetailVO.getMatchedtext() + "&" + svyTaskTemplateTargetoption.getOptioncontent() : svyTaskTemplateTargetoption.getOptioncontent()); |
| | | } |
| | | |
| | | } |
| | | //妿asrtextåmatchedtexté½ä¸ºç©ºï¼å没æé»è®¤å¼ï¼åä¸è¿è¡å¤ç |
| | | if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext()) && StringUtils.isEmpty(serviceSubtaskDetailVO.getMatchedtext())) { |
| | | return 0; |
| | | } |
| | | } |
| | | ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskDetailVO.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent()); |
| | | serviceSubtaskDetailVO.setCategoryid(svyTaskTemplateScriptVO.getCategoryid()); |
| | | serviceSubtaskDetailVO.setTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskDetailVO.setTargetid(svyTaskTemplateScriptVO.getTargetid() != null ? svyTaskTemplateScriptVO.getTargetid().intValue() : null); |
| | | serviceSubtaskDetailVO.setPatid(serviceSubtask.getPatid()); |
| | | serviceSubtaskDetailVO.setScriptid(svyTaskTemplateScriptVO.getId()); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptno()) ? Long.valueOf(svyTaskTemplateScriptVO.getScriptno()) : null); |
| | | serviceSubtaskDetailVO.setValueType(svyTaskTemplateScriptVO.getScriptType()); |
| | | serviceSubtaskDetailVO.setComment(null); |
| | | serviceSubtaskDetailVO.setCreateTime(new Date()); |
| | | serviceSubtaskDetailVO.setUpdateTime(new Date()); |
| | | serviceSubtaskDetailVO.setTemplateType(2); |
| | | serviceSubtaskDetailVO.setLibTemplateid(serviceSubtask.getLibtemplateid() != null ? serviceSubtask.getLibtemplateid().intValue() : null); |
| | | if (ObjectUtils.isNotEmpty(serviceTask)) { |
| | | serviceSubtaskDetailVO.setGuid(serviceTask.getGuid()); |
| | | serviceSubtaskDetailVO.setOrgid(serviceTask.getOrgid()); |
| | | } |
| | | serviceSubtaskDetailVO.setSubId(serviceSubtask.getId()); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(svyTaskTemplateScriptVO.getId()); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class); |
| | | |
| | | //å
ç¨subidåscriptidæ¥è¯¢ä¸ä¸æ¯å¦åå¨ï¼å¦æåå¨åæ´æ°ï¼ä¸åå¨åæå
¥ |
| | | ServiceSubtaskDetailDTO existServiceSubtaskDetail = serviceSubtaskDetailMapper.isExistServiceSubtaskDetail(serviceSubtaskDetailVO.getSubId(), serviceSubtaskDetailVO.getScriptid()); |
| | | if (ObjectUtils.isNotEmpty(existServiceSubtaskDetail)) { |
| | | serviceSubtaskDetail.setId(existServiceSubtaskDetail.getId()); |
| | | serviceSubtaskDetail.setUpdateTime(new Date()); |
| | | return serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail); |
| | | } else { |
| | | return serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); |
| | | } |
| | | } |
| | | |
| | | private Integer setSFDetailInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask) { |
| | | |
| | | ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO(); |
| | | if (ivrTaskTemplateScriptVO.getScriptType() != null && (ivrTaskTemplateScriptVO.getScriptType().equals("1") || ivrTaskTemplateScriptVO.getScriptType().equals("2"))) { |
| | | //1ã2为åéæå¤é |
| | | for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) { |
| | | //å°é®é¢é项记å½ä¸æ¥ |
| | | if (StringUtils.isEmpty(serviceSubtaskDetailVO.getTargetvalue())) { |
| | | serviceSubtaskDetailVO.setTargetvalue(ivrTaskTemplateTargetoption.getTargetvalue()); |
| | | } else { |
| | | serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + "&" + ivrTaskTemplateTargetoption.getTargetvalue()); |
| | | } |
| | | if (ivrTaskTemplateTargetoption.getDefaultValue() != null && ivrTaskTemplateTargetoption.getDefaultValue() == 2) { |
| | | //å»çæå¨å¡«æ¥æ¶ï¼å¼æ¯å¨ivrtextä¸ |
| | | serviceSubtaskDetailVO.setAsrtext(StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext()) ? ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetailVO.getAsrtext() + "&" + ivrTaskTemplateTargetoption.getTargetvalue()); |
| | | serviceSubtaskDetailVO.setMatchedtext(StringUtils.isEmpty(serviceSubtaskDetailVO.getMatchedtext()) ? ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetailVO.getMatchedtext() + "&" + ivrTaskTemplateTargetoption.getTargetvalue()); |
| | | } |
| | | } |
| | | //妿asrtextåmatchedtexté½ä¸ºç©ºï¼å没æé»è®¤å¼ï¼ä¸è¿è¡å¤ç |
| | | if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext()) && StringUtils.isEmpty(serviceSubtaskDetailVO.getMatchedtext())) { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | serviceSubtaskDetailVO.setTargetid(ivrTaskTemplateScriptVO.getTargetid() != null ? ivrTaskTemplateScriptVO.getTargetid().intValue() : null); |
| | | serviceSubtaskDetailVO.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent()); |
| | | serviceSubtaskDetailVO.setTaskid(serviceSubtask.getTaskid()); |
| | | serviceSubtaskDetailVO.setPatid(serviceSubtask.getPatid()); |
| | | serviceSubtaskDetailVO.setScriptid(ivrTaskTemplateScriptVO.getScriptID() == null ? ivrTaskTemplateScriptVO.getId() : ivrTaskTemplateScriptVO.getScriptID()); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId()); |
| | | serviceSubtaskDetailVO.setValueType(ivrTaskTemplateScriptVO.getScriptType()); |
| | | serviceSubtaskDetailVO.setComment(null); |
| | | serviceSubtaskDetailVO.setCreateTime(new Date()); |
| | | serviceSubtaskDetailVO.setGuid(ivrTaskTemplateScriptVO.getGuid()); |
| | | serviceSubtaskDetailVO.setOrgid(ivrTaskTemplateScriptVO.getOrgid()); |
| | | serviceSubtaskDetailVO.setUpdateTime(new Date()); |
| | | serviceSubtaskDetailVO.setSubId(serviceSubtask.getId()); |
| | | serviceSubtaskDetailVO.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId()); |
| | | serviceSubtaskDetailVO.setTemplateType(1); |
| | | serviceSubtaskDetailVO.setTemplateid(ivrTaskTemplateScriptVO.getTemplateID() == null ? null : ivrTaskTemplateScriptVO.getTemplateID().toString()); |
| | | serviceSubtaskDetailVO.setLibTemplateid(serviceSubtask.getLibtemplateid() != null ? serviceSubtask.getLibtemplateid().intValue() : null); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class); |
| | | //å
ç¨subidåscriptidæ¥è¯¢ä¸ä¸æ¯å¦åå¨ï¼å¦æåå¨åæ´æ°ï¼ä¸åå¨åæå
¥ |
| | | ServiceSubtaskDetailDTO existServiceSubtaskDetail = serviceSubtaskDetailMapper.isExistServiceSubtaskDetail(serviceSubtaskDetailVO.getSubId(), serviceSubtaskDetailVO.getScriptid()); |
| | | if (ObjectUtils.isNotEmpty(existServiceSubtaskDetail)) { |
| | | serviceSubtaskDetail.setId(existServiceSubtaskDetail.getId()); |
| | | serviceSubtaskDetail.setUpdateTime(new Date()); |
| | | return serviceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail); |
| | | } else { |
| | | return serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | <result property="picturePath" column="picture_path"/> |
| | | <result property="isEnd" column="is_end"/> |
| | | <result property="isException" column="is_exception"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrLibaScriptTargetoptionVo"> |
| | | select id, |
| | | targetid, |
| | | default_value, |
| | | is_end, |
| | | is_exception, |
| | | picture_path, |
| | |
| | | resultMap="IvrLibaScriptTargetoptionResult"> |
| | | <include refid="selectIvrLibaScriptTargetoptionVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="targetid != null and targetid != ''">and targetid = #{targetid}</if> |
| | | <if test="targetname != null and targetname != ''">and targetname = #{targetname}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | | <if test="targettype != null and targettype != ''">and targettype = #{targettype}</if> |
| | | <if test="categoryName != null and categoryName != ''">and categoryName like concat('%', #{categoryName}, |
| | | '%') |
| | | </if> |
| | | <if test="targetvalue != null and targetvalue != ''">and targetvalue = #{targetvalue}</if> |
| | | <if test="targetregex != null and targetregex != ''">and targetregex = #{targetregex}</if> |
| | | <if test="targetregex2 != null and targetregex2 != ''">and targetregex2 = #{targetregex2}</if> |
| | | <if test="optiondesc != null and optiondesc != ''">and optiondesc = #{optiondesc}</if> |
| | | <if test="language != null and language != ''">and language = #{language}</if> |
| | | <if test="version != null ">and version = #{version}</if> |
| | | <if test="isEnd != null ">and is_end = #{isEnd}</if> |
| | | <if test="groupid != null and groupid != ''">and groupid = #{groupid}</if> |
| | | <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if> |
| | | <if test="warnup != null ">and warnup = #{warnup}</if> |
| | | <if test="warndown != null ">and warndown = #{warndown}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="nodynamiccruxsJson != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if> |
| | | <if test="dynamiccruxsJson != null ">and dynamiccruxs = #{dynamiccruxsJson}</if> |
| | | <if test="appendflag != null">and appendflag = #{appendflag}</if> |
| | | <if test="appenddesc != null">and appenddesc = #{appenddesc}</if> |
| | | <if test="picturePath != null">and picture_path = #{picturePath}</if> |
| | | <if test="isException != null">and is_exception = #{isException}</if> |
| | | and del_flag = 0 |
| | | <if test="targetid != null and targetid != ''">and targetid = #{targetid}</if> |
| | | <if test="defaultValue != null">and default_value = #{defaultValue}</if> |
| | | <if test="targetname != null and targetname != ''">and targetname = #{targetname}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | | <if test="targettype != null and targettype != ''">and targettype = #{targettype}</if> |
| | | <if test="categoryName != null and categoryName != ''">and categoryName like concat('%', #{categoryName}, |
| | | '%') |
| | | </if> |
| | | <if test="targetvalue != null and targetvalue != ''">and targetvalue = #{targetvalue}</if> |
| | | <if test="targetregex != null and targetregex != ''">and targetregex = #{targetregex}</if> |
| | | <if test="targetregex2 != null and targetregex2 != ''">and targetregex2 = #{targetregex2}</if> |
| | | <if test="optiondesc != null and optiondesc != ''">and optiondesc = #{optiondesc}</if> |
| | | <if test="language != null and language != ''">and language = #{language}</if> |
| | | <if test="version != null ">and version = #{version}</if> |
| | | <if test="isEnd != null ">and is_end = #{isEnd}</if> |
| | | <if test="groupid != null and groupid != ''">and groupid = #{groupid}</if> |
| | | <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if> |
| | | <if test="warnup != null ">and warnup = #{warnup}</if> |
| | | <if test="warndown != null ">and warndown = #{warndown}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="nodynamiccruxsJson != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if> |
| | | <if test="dynamiccruxsJson != null ">and dynamiccruxs = #{dynamiccruxsJson}</if> |
| | | <if test="appendflag != null">and appendflag = #{appendflag}</if> |
| | | <if test="appenddesc != null">and appenddesc = #{appenddesc}</if> |
| | | <if test="picturePath != null">and picture_path = #{picturePath}</if> |
| | | <if test="isException != null">and is_exception = #{isException}</if> |
| | | </select> |
| | | |
| | | <select id="selectIvrLibaScriptTargetoptionByTargetoptionid" parameterType="String" |
| | |
| | | <if test="picturePath != null">picture_path,</if> |
| | | <if test="isEnd != null ">is_end,</if> |
| | | <if test="isException != null ">is_exception,</if> |
| | | <if test="defaultValue != null ">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="picturePath != null">#{picturePath},</if> |
| | | <if test="isEnd != null ">#{isEnd},</if> |
| | | <if test="isException != null ">#{isException},</if> |
| | | <if test="defaultValue != null ">#{defaultValue},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="picturePath != null">picture_path = #{picturePath},</if> |
| | | <if test="isEnd != null ">is_end = #{isEnd},</if> |
| | | <if test="isException != null ">is_exception = #{isException},</if> |
| | | <if test="defaultValue != null ">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <result property="sendTaskid" column="send_taskid"/> |
| | | <result property="sendTaskname" column="send_taskname"/> |
| | | <result property="isException" column="is_exception"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrLibaTemplateTargetoptionVo"> |
| | | select id, |
| | | targetid, |
| | | is_exception, |
| | | default_value, |
| | | send_taskid, |
| | | send_taskname, |
| | | is_end, |
| | |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="targetid != null ">and targetid = #{targetid}</if> |
| | | <if test="isException != null ">and is_exception = #{isException}</if> |
| | | <if test="defaultValue != null ">and default_value = #{defaultValue}</if> |
| | | <if test="isEnd != null ">and is_end = #{isEnd}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="targetname != null ">and targetname = #{targetname}</if> |
| | |
| | | <if test="sendTaskid != null">send_taskid,</if> |
| | | <if test="sendTaskname != null">send_taskname,</if> |
| | | <if test="isException != null">is_exception,</if> |
| | | <if test="defaultValue != null">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="targetid != null">#{targetid},</if> |
| | |
| | | <if test="sendTaskid != null">#{sendTaskid},</if> |
| | | <if test="sendTaskname != null">#{sendTaskname},</if> |
| | | <if test="isException != null">#{isException},</if> |
| | | <if test="defaultValue != null">#{defaultValue},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if> |
| | | <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if> |
| | | <if test="isException != null">is_exception = #{isException},</if> |
| | | <if test="defaultValue != null">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | |
| | | <if test="nodynamiccruxsJson == null ">nodynamiccruxs = #{nodynamiccruxsJson},</if> |
| | | <if test="dynamiccruxsJson == null ">dynamiccruxs = #{dynamiccruxsJson},</if> |
| | | <if test="defaultValue == null ">default_value = #{defaultValue},</if> |
| | | |
| | | </trim> |
| | | where id = #{id} |
| | |
| | | <result property="sendTaskid" column="send_taskid"/> |
| | | <result property="sendTaskname" column="send_taskname"/> |
| | | <result property="isException" column="is_exception"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrTaskTemplateTargetoptionVo"> |
| | |
| | | targetvalue, |
| | | targetregex2, |
| | | targetregex, |
| | | default_value, |
| | | optiondesc, language, version, groupid, isabnormal, warnup, warndown, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, scriptid, nodynamiccruxs, dynamiccruxs, next_question |
| | | from ivr_task_template_targetoption |
| | | </sql> |
| | |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if> |
| | | <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if> |
| | | <if test="defaultValue != null">and default_value = #{defaultValue}</if> |
| | | </select> |
| | | |
| | | <select id="selectIvrTaskTemplateTargetoptionById" parameterType="Long" |
| | |
| | | <if test="sendTaskid != null">send_taskid,</if> |
| | | <if test="sendTaskname != null">send_taskname,</if> |
| | | <if test="isException != null ">is_exception,</if> |
| | | <if test="defaultValue != null">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskid != null">#{taskid},</if> |
| | |
| | | <if test="sendTaskid != null">#{sendTaskid},</if> |
| | | <if test="sendTaskname != null">#{sendTaskname},</if> |
| | | <if test="isException != null ">#{isException},</if> |
| | | <if test="defaultValue != null">#{defaultValue},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if> |
| | | <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if> |
| | | <if test="isException != null ">is_exception = #{isException},</if> |
| | | <if test="defaultValue != null">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="hospitaldistrictcodeList != null and hospitaldistrictcodeList.size()>0"> |
| | | AND b.hospitaldistrictcode IN |
| | | <foreach collection="hospitaldistrictcodeList" item="hospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{hospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND b.leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | AND b.deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," |
| | | close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | |
| | | <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq" |
| | | resultType="com.smartor.domain.PatMedRes"> |
| | | SELECT SUM(rc) AS rc, |
| | | SUM(rs) AS rs, |
| | | SUM(scsf) AS scsf, |
| | | SUM(zcsf) AS zcsf, |
| | | SUM(zbsf) AS zbsf |
| | | SUM(rs) AS rs, |
| | | SUM(scsf) AS scsf, |
| | | SUM(zcsf) AS zcsf, |
| | | SUM(zbsf) AS zbsf |
| | | FROM ( |
| | | <!-- åºé¢äººæ¬¡ï¼å»æ date_format å
è£
ï¼ä½¿æ¥æå段索å¼çæ --> |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM pat_med_inhosp |
| | | JOIN pat_archive ON pat_archive.id = pat_med_inhosp.patid |
| | | WHERE pat_med_inhosp.del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND pat_med_inhosp.orgid = #{orgid} |
| | | </if> |
| | | AND pat_archive.idcardno IS NOT NULL |
| | | <if test="zy != null"> |
| | | AND pat_med_inhosp.inhospstate = 0 |
| | | AND pat_med_inhosp.starttime >= #{startDate} |
| | | AND pat_med_inhosp.starttime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND pat_med_inhosp.deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="cy != null"> |
| | | AND pat_med_inhosp.inhospstate = 1 |
| | | AND pat_med_inhosp.endtime >= #{startDate} |
| | | AND pat_med_inhosp.endtime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND pat_med_inhosp.leaveldeptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | UNION ALL |
| | | <!-- é访æå¡/馿¬¡/忬¡/ä¸ç
é访ï¼åå¹¶ä¸ºåæ¬¡æ«æï¼ç¨æ¡ä»¶èå代æ¿4个 UNION ALL --> |
| | | SELECT |
| | | 0 AS rc, |
| | | COUNT(1) AS rs, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count = 1 THEN 1 ELSE 0 END) AS scsf, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count > 1 THEN 1 ELSE 0 END) AS zcsf, |
| | | SUM(CASE WHEN service_type = 13 THEN 1 ELSE 0 END) AS zbsf |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND service_type IN (2, 13) |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND visit_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND visit_time < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | </if> |
| | | <!-- åºé¢äººæ¬¡ï¼å»æ date_format å
è£
ï¼ä½¿æ¥æå段索å¼çæ --> |
| | | SELECT |
| | | COUNT(1) AS rc, |
| | | 0 AS rs, |
| | | 0 AS scsf, |
| | | 0 AS zcsf, |
| | | 0 AS zbsf |
| | | FROM pat_med_inhosp |
| | | JOIN pat_archive ON pat_archive.id = pat_med_inhosp.patid |
| | | WHERE pat_med_inhosp.del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND pat_med_inhosp.orgid = #{orgid} |
| | | </if> |
| | | AND pat_archive.idcardno IS NOT NULL |
| | | <if test="zy != null"> |
| | | AND pat_med_inhosp.inhospstate = 0 |
| | | AND pat_med_inhosp.starttime >= #{startDate} |
| | | AND pat_med_inhosp.starttime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND deptcode IN |
| | | AND pat_med_inhosp.deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | <if test="cy != null"> |
| | | AND pat_med_inhosp.inhospstate = 1 |
| | | AND pat_med_inhosp.endtime >= #{startDate} |
| | | AND pat_med_inhosp.endtime < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND pat_med_inhosp.leaveldeptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | UNION ALL |
| | | <!-- é访æå¡/馿¬¡/忬¡/ä¸ç
é访ï¼åå¹¶ä¸ºåæ¬¡æ«æï¼ç¨æ¡ä»¶èå代æ¿4个 UNION ALL --> |
| | | SELECT |
| | | 0 AS rc, |
| | | COUNT(1) AS rs, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count = 1 THEN 1 ELSE 0 END) AS scsf, |
| | | SUM(CASE WHEN service_type = 2 AND visit_count > 1 THEN 1 ELSE 0 END) AS zcsf, |
| | | SUM(CASE WHEN service_type = 13 THEN 1 ELSE 0 END) AS zbsf |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND service_type IN (2, 13) |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND visit_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND visit_time < DATE_ADD(#{endDate}, INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | ) AS combined_data |
| | | </select> |
| | | |
| | |
| | | <result property="appendflag" column="appendflag"/> |
| | | <result property="appenddesc" column="appenddesc"/> |
| | | <result property="guid" column="guid"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyLibScriptOptionVo"> |
| | | select id, |
| | | topicid, |
| | | svyid, |
| | | default_value, |
| | | guid, |
| | | picture_path, |
| | | appendflag, |
| | |
| | | <if test="appenddesc != null">and appenddesc = #{appenddesc}</if> |
| | | <if test="picturePath != null">and picture_path = #{picturePath}</if> |
| | | <if test="isException != null">and is_exception = #{isException}</if> |
| | | <if test="defaultValue != null">and default_value = #{defaultValue}</if> |
| | | </select> |
| | | |
| | | <select id="selectSvyLibScriptOptionByOptionid" parameterType="Long" resultMap="SvyLibScriptOptionResult"> |
| | |
| | | <if test="picturePath != null">picture_path,</if> |
| | | <if test="guid != null">guid,</if> |
| | | <if test="isException != null">is_exception,</if> |
| | | <if test="defaultValue != null">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="topicid != null">#{topicid},</if> |
| | |
| | | <if test="picturePath != null">#{picturePath},</if> |
| | | <if test="guid != null">#{guid},</if> |
| | | <if test="isException != null">#{isException},</if> |
| | | <if test="defaultValue != null">#{defaultValue},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="appenddesc != null">appenddesc = #{appenddesc},</if> |
| | | <if test="picturePath != null">picture_path = #{picturePath},</if> |
| | | <if test="isException != null">is_exception = #{isException},</if> |
| | | <if test="defaultValue != null">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <result property="prompt" column="prompt"/> |
| | | <result property="sendTaskid" column="send_taskid"/> |
| | | <result property="sendTaskname" column="send_taskname"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyLibTemplateTargetoptionVo"> |
| | |
| | | score, |
| | | prompt, |
| | | option_no, |
| | | default_value, |
| | | appendflag, |
| | | appenddesc, |
| | | categoryName, |
| | |
| | | <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if> |
| | | <if test="language != null and language != ''">and language = #{language}</if> |
| | | <if test="version != null and version != ''">and version = #{version}</if> |
| | | <if test="defaultValue != null">and default_value = #{defaultValue}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | |
| | | <if test="prompt != null">prompt,</if> |
| | | <if test="sendTaskid != null">send_taskid,</if> |
| | | <if test="sendTaskname != null">send_taskname,</if> |
| | | <if test="defaultValue != null">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="groupid != null">#{groupid},</if> |
| | |
| | | <if test="prompt != null">#{prompt},</if> |
| | | <if test="sendTaskid != null">#{sendTaskid},</if> |
| | | <if test="sendTaskname != null">#{sendTaskname},</if> |
| | | <if test="defaultValue != null">#{defaultValue},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="prompt != null">prompt = #{prompt},</if> |
| | | <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if> |
| | | <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if> |
| | | <if test="defaultValue != null">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <result property="prompt" column="prompt"/> |
| | | <result property="sendTaskid" column="send_taskid"/> |
| | | <result property="sendTaskname" column="send_taskname"/> |
| | | <result property="defaultValue" column="default_value"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSvyTaskTemplateTargetoptionVo"> |
| | |
| | | categoryName, |
| | | targetvalue, |
| | | targetregex2, |
| | | default_value, |
| | | targetregex, |
| | | optioncontent, language, version, groupid, isabnormal, warnup, warndown, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, scriptid, nodynamiccruxs, dynamiccruxs, next_question, picture_path |
| | | from svy_task_template_targetoption |
| | |
| | | resultMap="SvyTaskTemplateTargetoptionResult"> |
| | | <include refid="selectSvyTaskTemplateTargetoptionVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="prompt != null ">and prompt = #{prompt}</if> |
| | | <if test="templateID != null ">and templateID = #{templateID}</if> |
| | | <if test="targetid != null ">and targetid = #{targetid}</if> |
| | | <if test="targetname != null and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if> |
| | | <if test="targettype != null and targettype != ''">and targettype = #{targettype}</if> |
| | | <if test="categoryName != null and categoryName != ''">and categoryName like concat('%', #{categoryName}, |
| | | '%') |
| | | </if> |
| | | <if test="targetvalue != null and targetvalue != ''">and targetvalue = #{targetvalue}</if> |
| | | <if test="targetregex2 != null and targetregex2 != ''">and targetregex2 = #{targetregex2}</if> |
| | | <if test="targetregex != null and targetregex != ''">and targetregex = #{targetregex}</if> |
| | | <if test="optioncontent != null and optioncontent != ''">and optioncontent = #{optioncontent}</if> |
| | | <if test="language != null and language != ''">and language = #{language}</if> |
| | | <if test="version != null and version != ''">and version = #{version}</if> |
| | | <if test="groupid != null and groupid != ''">and groupid = #{groupid}</if> |
| | | <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if> |
| | | <if test="warnup != null ">and warnup = #{warnup}</if> |
| | | <if test="warndown != null ">and warndown = #{warndown}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | | <!-- <if test="nodynamiccruxs != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if>--> |
| | | <!-- <if test="dynamiccruxs != null ">and dynamiccruxs = #{dynamiccruxsJson}</if>--> |
| | | <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if> |
| | | <if test="picturePath != null and picturePath != ''">and picture_path = #{picturePath}</if> |
| | | <if test="optionCode != null">and option_code = #{optionCode}</if> |
| | | <if test="appendflag != null">and appendflag = #{appendflag}</if> |
| | | <if test="appenddesc != null">and appenddesc = #{appenddesc}</if> |
| | | <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if> |
| | | <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if> |
| | | and del_flag = 0 |
| | | <if test="taskid != null ">and taskid = #{taskid}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="prompt != null ">and prompt = #{prompt}</if> |
| | | <if test="templateID != null ">and templateID = #{templateID}</if> |
| | | <if test="targetid != null ">and targetid = #{targetid}</if> |
| | | <if test="targetname != null and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if> |
| | | <if test="targettype != null and targettype != ''">and targettype = #{targettype}</if> |
| | | <if test="categoryName != null and categoryName != ''">and categoryName like concat('%', #{categoryName}, |
| | | '%') |
| | | </if> |
| | | <if test="targetvalue != null and targetvalue != ''">and targetvalue = #{targetvalue}</if> |
| | | <if test="defaultValue != null">and default_value = #{defaultValue}</if> |
| | | <if test="targetregex2 != null and targetregex2 != ''">and targetregex2 = #{targetregex2}</if> |
| | | <if test="targetregex != null and targetregex != ''">and targetregex = #{targetregex}</if> |
| | | <if test="optioncontent != null and optioncontent != ''">and optioncontent = #{optioncontent}</if> |
| | | <if test="language != null and language != ''">and language = #{language}</if> |
| | | <if test="version != null and version != ''">and version = #{version}</if> |
| | | <if test="groupid != null and groupid != ''">and groupid = #{groupid}</if> |
| | | <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if> |
| | | <if test="warnup != null ">and warnup = #{warnup}</if> |
| | | <if test="warndown != null ">and warndown = #{warndown}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="pid != null ">and pid = #{pid}</if> |
| | | <if test="guid != null and guid != ''">and guid = #{guid}</if> |
| | | <if test="scriptid != null ">and scriptid = #{scriptid}</if> |
| | | <!-- <if test="nodynamiccruxs != null ">and nodynamiccruxs = #{nodynamiccruxsJson}</if>--> |
| | | <!-- <if test="dynamiccruxs != null ">and dynamiccruxs = #{dynamiccruxsJson}</if>--> |
| | | <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if> |
| | | <if test="picturePath != null and picturePath != ''">and picture_path = #{picturePath}</if> |
| | | <if test="optionCode != null">and option_code = #{optionCode}</if> |
| | | <if test="appendflag != null">and appendflag = #{appendflag}</if> |
| | | <if test="appenddesc != null">and appenddesc = #{appenddesc}</if> |
| | | <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if> |
| | | <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if> |
| | | </select> |
| | | |
| | | <select id="selectSvyTaskTemplateTargetoptionById" parameterType="Long" |
| | |
| | | <if test="prompt != null">prompt,</if> |
| | | <if test="sendTaskid != null">send_taskid,</if> |
| | | <if test="sendTaskname != null">send_taskname,</if> |
| | | <if test="defaultValue != null">default_value,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskid != null">#{taskid},</if> |
| | |
| | | <if test="prompt != null">#{prompt},</if> |
| | | <if test="sendTaskid != null">#{sendTaskid},</if> |
| | | <if test="sendTaskname != null">#{sendTaskname}</if> |
| | | <if test="defaultValue != null">#{defaultValue}</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="prompt != null">score = #{prompt},</if> |
| | | <if test="sendTaskid != null">send_taskid= #{sendTaskid},</if> |
| | | <if test="sendTaskname != null">send_taskname = #{sendTaskname},</if> |
| | | <if test="defaultValue != null">default_value = #{defaultValue},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |