| | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonParser; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.common.reflect.TypeToken; |
| | |
| | | import com.smartor.common.SendService; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.ServiceTaskMapper; |
| | | import com.smartor.mapper.SysUserImportMapper; |
| | | import com.smartor.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | |
| | | @Autowired |
| | | private PlatformTransactionManager transactionManager; |
| | | |
| | | @Autowired |
| | | private SysUserImportMapper sysUserImportMapper; |
| | | |
| | | @Value("${localIP}") |
| | | private String localIP; |
| | |
| | | } |
| | | |
| | | public void importData() { |
| | | // String filePath = "path/to/your/file.txt"; // 替换为你的文件路径 |
| | | // |
| | | // try { |
| | | // // 读取文件内容 |
| | | // String jsonContent = new String(Files.readAllBytes(Paths.get(filePath))); |
| | | // |
| | | // // 创建ObjectMapper对象 |
| | | // ObjectMapper objectMapper = new ObjectMapper(); |
| | | // |
| | | // // 解析JSON为JsonNode |
| | | // JsonNode rootNode = objectMapper.readTree(jsonContent); |
| | | // // 获取resultList |
| | | // JsonNode resultListNode = rootNode.path("results").path("resultList"); |
| | | // // 遍历resultList中的每个对象 |
| | | // for (JsonNode item : resultListNode) { |
| | | // String userName = item.path("staffNum").asText(); |
| | | // String idCard = item.path("idCard").asText(); |
| | | // String personnelStampNum = item.path("defaultWardId").asText(); |
| | | // String personnelStampNum = item.path("defaultWardName").asText(); |
| | | // String deptName = item.path("defaultDeptName").asText(); |
| | | // String deptCode = item.path("defaultDeptId").asText(); |
| | | // String phonenumber = item.path("telphone").asText(); |
| | | // String nickName = item.path("staffName").asText(); |
| | | // String sex = item.path("staffSex").asText(); |
| | | // |
| | | // } |
| | | // |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | String filePath = "C:\\Users\\86176\\Desktop\\新建文本文档 4.txt"; // 替换为你的文件路径 |
| | | |
| | | try { |
| | | // 读取文件内容 |
| | | String jsonContent = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8); |
| | | |
| | | // 创建ObjectMapper对象 |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | // 解析JSON为JsonNode |
| | | JsonNode rootNode = objectMapper.readTree(jsonContent); |
| | | // 获取resultList |
| | | JsonNode resultListNode = rootNode.path("results").path("resultList"); |
| | | // 遍历resultList中的每个对象 |
| | | for (JsonNode item : resultListNode) { |
| | | |
| | | SysUserImport person = objectMapper.treeToValue(item, SysUserImport.class); |
| | | person.setStaffPhoto(""); |
| | | sysUserImportMapper.insertSysUserImport(person); |
| | | |
| | | } |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); |
| | | |
| | | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("4"); |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); |
| | | Boolean aBoolean = sendService.sendMsg(sendMagParam); |
| | | try { |
| | | |
| | | //任务发送记录 |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | | serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); |
| | | serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); |
| | | serviceSubtaskRecord.setPreachform("4"); |
| | | serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); |
| | | serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败"); |
| | | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); |
| | | |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("4"); |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); |
| | | Boolean aBoolean = sendService.sendMsg(sendMagParam); |
| | | |
| | | //任务发送记录 |
| | | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); |
| | | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); |
| | | serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); |
| | | serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); |
| | | serviceSubtaskRecord.setPreachform("4"); |
| | | serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); |
| | | serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败"); |
| | | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); |
| | | } catch (Exception e) { |
| | | continue; |
| | | } |
| | | } |
| | | } else if (descByCode.equals("公众号")) { |
| | | log.error("公众号进来了吗?{}", descByCode); |
| | |
| | | serviceSubtask.setResult("success"); |
| | | } else { |
| | | serviceSubtask.setResult("error"); |
| | | serviceSubtask.setSendstate(5L); |
| | | serviceSubtask.setRemark(map.get("msg").toString()); |
| | | } |
| | | iServiceSubtaskService.updateServiceSubtask(serviceSubtask); |
| | |
| | | patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode()); |
| | | //如果是出院,先通过患者编号和流水号去查一下,患者是否存在,如果存在,则进行修改 |
| | | PatMedInhosp inhosp = new PatMedInhosp(); |
| | | inhosp.setInhospno(patArchive.getPatientno()); |
| | | inhosp.setPatno(patArchive.getPatientno()); |
| | | inhosp.setSerialnum(patMedInhosp.getSerialnum()); |
| | | List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhospList(inhosp); |
| | | if (CollectionUtils.isNotEmpty(patMedInhosps)) { |
| | |
| | | |
| | | String result = HttpUtils.sendPost(thirdWXUrl, new Gson().toJson(xinHuaWXReq)); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | log.error("jsonObject的数据为:{}", jsonObject.toString()); |
| | | // String code = (String) jsonObject.get("code"); |
| | | return jsonObject.toString(); |
| | | } |