Commit 76fc7f2ca5a1cd743811fdebf2c311cff5cbd9b1
1 parent
44c4e565d7
Exists in
luanping
#fix:处理威县数据同步问题,优化滦平无色高危儿数据
Showing 5 changed files with 279 additions and 22 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
- platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskController.java
- platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
View file @
76fc7f2
| ... | ... | @@ -54,9 +54,9 @@ |
| 54 | 54 | return "-"; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public void addBasicConfig(BasicConfig obj) { | |
| 57 | + public BasicConfig addBasicConfig(BasicConfig obj) { | |
| 58 | 58 | obj.setModifiedDate(System.currentTimeMillis()); |
| 59 | - basicConfigDao.addBasicConfig(obj); | |
| 59 | + return basicConfigDao.addBasicConfig(obj); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public void updateBasicConfig(BasicConfig obj) { |
platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java
View file @
76fc7f2
| ... | ... | @@ -217,13 +217,13 @@ |
| 217 | 217 | return out; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - public static void readExcl(String fileName) { | |
| 220 | + public static List<Map<String,Object>> readExcl(String fileName) { | |
| 221 | 221 | File file = new File(fileName); |
| 222 | 222 | Workbook wb = null; |
| 223 | 223 | try { |
| 224 | 224 | wb = Workbook.getWorkbook(file); |
| 225 | 225 | Sheet[] sheets = wb.getSheets(); |
| 226 | - | |
| 226 | + List<Map<String,Object>> list=new ArrayList<>(); | |
| 227 | 227 | for (Sheet s : sheets) { |
| 228 | 228 | System.out.println(s.getName() + " : "); |
| 229 | 229 | int rows = s.getRows(); |
| 230 | 230 | |
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | |
| ... | ... | @@ -233,30 +233,53 @@ |
| 233 | 233 | Cell[] cells = s.getRow(i); |
| 234 | 234 | if (cells.length > 0) { |
| 235 | 235 | //遍历每行中的每列 |
| 236 | + Map<String,Object> params=new HashMap<>(); | |
| 236 | 237 | for (int j = 0; j < cells.length; j++) { |
| 237 | 238 | String str = cells[j].getContents().trim(); |
| 238 | - if (j == 10 || j == 12) { | |
| 239 | - List<String> list = Arrays.asList(str.split("\n")); | |
| 240 | - System.out.println(j + "=content=" + list); | |
| 241 | - } else { | |
| 242 | - System.out.println(j + "=content=" + str); | |
| 239 | + if (j==0){ | |
| 240 | + params.put("level",getRiskFactorId(str)); | |
| 241 | + }else if (j==1){ | |
| 242 | + params.put("name",str); | |
| 243 | + }else if (j==2){ | |
| 244 | + //多个用;分割 | |
| 245 | + params.put("child",str); | |
| 246 | + }else if (j==3){ | |
| 247 | + //多个用;分割 | |
| 248 | + params.put("childs",str); | |
| 243 | 249 | } |
| 244 | - | |
| 245 | 250 | } |
| 246 | - | |
| 251 | + list.add(params); | |
| 247 | 252 | } |
| 248 | 253 | } |
| 249 | 254 | } |
| 250 | 255 | } |
| 251 | 256 | |
| 257 | + return list; | |
| 252 | 258 | } catch (IOException e) { |
| 253 | 259 | e.printStackTrace(); |
| 254 | 260 | } catch (BiffException e) { |
| 255 | 261 | e.printStackTrace(); |
| 256 | 262 | } |
| 263 | + return null; | |
| 264 | + } | |
| 257 | 265 | |
| 266 | + private static String getRiskFactorId(String str){ | |
| 267 | + String id=""; | |
| 268 | + if ("绿色".equals(str)) { | |
| 269 | + id="e637b361-99cf-41eb-84f2-f0dab596e928"; | |
| 270 | + }else if ("黄色".equals(str)){ | |
| 271 | + id="315107bd-91fe-42a1-9237-752f3c046a40"; | |
| 272 | + }else if ("橙色".equals(str)){ | |
| 273 | + id="49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"; | |
| 274 | + }else if ("红色".equals(str)){ | |
| 275 | + id="eb146c03-b19f-4e28-b85f-fda574b2283b"; | |
| 276 | + }else if ("紫色".equals(str)){ | |
| 277 | + id="224b2329-cb82-4da3-a071-8527f8283aab"; | |
| 278 | + } | |
| 279 | + return id; | |
| 258 | 280 | } |
| 259 | 281 | |
| 282 | + | |
| 260 | 283 | public static void writeWhExclFile(String filePath, OutputStream out, List<Map<String, Object>> values) { |
| 261 | 284 | File file = new File(filePath); |
| 262 | 285 | InputStream in = null; |
| ... | ... | @@ -1069,9 +1092,33 @@ |
| 1069 | 1092 | } |
| 1070 | 1093 | |
| 1071 | 1094 | |
| 1072 | - // public static void main(String[] args) { | |
| 1073 | -// ExcelUtil.writeExclFile("F:\\需求文档\\my.xls"); | |
| 1074 | -// } | |
| 1095 | + public static void main(String[] args) { | |
| 1096 | + List<Map<String,Object>> list= ExcelUtil.readExcl("F:\\美生医疗文档\\滦平\\无色高危儿.xls"); | |
| 1097 | + for (int i = 0,j=list.size(); i <j ; i++) { | |
| 1098 | + Map<String,Object> params= list.get(i); | |
| 1099 | + if ("eb146c03-b19f-4e28-b85f-fda574b2283b".equals(params.get("level"))){ | |
| 1100 | + //橙色 | |
| 1101 | + if ("新生儿疾病".equals(params.get("name"))){ | |
| 1102 | + String str= String.valueOf(params.get("child")); | |
| 1103 | + String []array= str.split(";"); | |
| 1104 | + System.out.println(params.get("level")+":"+array.length); | |
| 1105 | + } | |
| 1106 | + }else if ("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2".equals(params.get("level"))){ | |
| 1107 | + //红色 | |
| 1108 | + if ("新生儿因素".equals(params.get("name"))){ | |
| 1109 | + String str= String.valueOf(params.get("child")); | |
| 1110 | + String []array= str.split(";"); | |
| 1111 | + System.out.println(params.get("level")+":"+array.length); | |
| 1112 | + } | |
| 1113 | + }else if ("e637b361-99cf-41eb-84f2-f0dab596e928".equals(params.get("level"))){ | |
| 1114 | + //绿色 | |
| 1115 | + System.out.println(params.get("level")+":"+params.get("name")); | |
| 1116 | + }else if ("315107bd-91fe-42a1-9237-752f3c046a40".equals(params.get("level"))){ | |
| 1117 | + //黄色 | |
| 1118 | + System.out.println(params.get("level")+":"+params); | |
| 1119 | + } | |
| 1120 | + } | |
| 1121 | + } | |
| 1075 | 1122 | |
| 1076 | 1123 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java
View file @
76fc7f2
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | |
| 17 | 17 | import java.util.List; |
| 18 | 18 | |
| 19 | -@Controller("/patient") | |
| 19 | +@Controller | |
| 20 | 20 | public class PatientController { |
| 21 | 21 | @Autowired |
| 22 | 22 | private PatientsService patientsService; |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | * 获取威县孕产妇数据 |
| 27 | 27 | * @return |
| 28 | 28 | */ |
| 29 | - @RequestMapping(method = RequestMethod.GET, value = "/getPatients") | |
| 29 | + @RequestMapping(method = RequestMethod.GET, value = "/patient/getPatients") | |
| 30 | 30 | @ResponseBody |
| 31 | 31 | public BaseResponse getPatients(){ |
| 32 | 32 | BaseResponse baseResponse=new BaseResponse(); |
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | * 更新威县孕产妇数据 |
| 42 | 42 | * @return |
| 43 | 43 | */ |
| 44 | - @RequestMapping(method = RequestMethod.POST, value = "/updatePatients") | |
| 44 | + @RequestMapping(method = RequestMethod.POST, value = "/patient/updatePatients") | |
| 45 | 45 | @ResponseBody |
| 46 | 46 | public BaseResponse updatePatients(@RequestBody PatientsDTO patientsDTO){ |
| 47 | 47 | BaseResponse baseResponse=new BaseResponse(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RiskController.java
View file @
76fc7f2
| ... | ... | @@ -8,10 +8,12 @@ |
| 8 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
| 9 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 10 | 10 | import com.lyms.platform.common.result.BaseResponse; |
| 11 | +import com.lyms.platform.common.utils.ExcelUtil; | |
| 11 | 12 | import com.lyms.platform.common.utils.SystemConfig; |
| 12 | 13 | import com.lyms.platform.operate.web.facade.BasicConfigFacade; |
| 13 | 14 | import com.lyms.platform.operate.web.request.BasicConfigQueryRequest; |
| 14 | 15 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 16 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
| 15 | 17 | import com.lyms.platform.pojo.BasicConfig; |
| 16 | 18 | import com.lyms.platform.query.BasicConfigQuery; |
| 17 | 19 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -175,5 +177,217 @@ |
| 175 | 177 | } |
| 176 | 178 | |
| 177 | 179 | |
| 180 | + /** | |
| 181 | + * 滦平高危儿测试用 | |
| 182 | + * @return | |
| 183 | + */ | |
| 184 | + @RequestMapping(method = RequestMethod.GET, value = "/risk/addBabyRisk") | |
| 185 | + @ResponseBody | |
| 186 | + public BaseResponse addBabyRisk(){ | |
| 187 | + List<Map<String,Object>> list= ExcelUtil.readExcl("F:\\美生医疗文档\\滦平\\无色高危儿.xls"); | |
| 188 | + if (CollectionUtils.isNotEmpty(list)){ | |
| 189 | + | |
| 190 | + for (Map<String,Object> params :list){ | |
| 191 | + String parentId= String.valueOf(params.get("level")); | |
| 192 | + | |
| 193 | + if ("eb146c03-b19f-4e28-b85f-fda574b2283b".equals(params.get("level"))){ | |
| 194 | + //红色 | |
| 195 | + BasicConfigQuery basicConfigQuery=new BasicConfigQuery(); | |
| 196 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 197 | + basicConfigQuery.setParentId(parentId); | |
| 198 | + basicConfigQuery.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 199 | + basicConfigQuery.setName(String.valueOf(params.get("name"))); | |
| 200 | + List<BasicConfig> configList= basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 201 | + | |
| 202 | + String hongPId=null; | |
| 203 | + if (CollectionUtils.isEmpty(configList)){ | |
| 204 | + BasicConfig config = new BasicConfig(); | |
| 205 | + //对应高危等级颜色 | |
| 206 | + config.setParentId(parentId); | |
| 207 | + config.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 208 | + config.setName(String.valueOf(params.get("name"))); | |
| 209 | + config.setType(2); | |
| 210 | + config.setYn(YnEnums.YES.getId()); | |
| 211 | + //分值 | |
| 212 | + config.setCode("0"); | |
| 213 | + //父级ID | |
| 214 | + // config.setpId(pId); | |
| 215 | + config.setEnable(YnEnums.YES.getId()); | |
| 216 | + config.setCreateDate(System.currentTimeMillis()); | |
| 217 | + BasicConfig basicConfig= basicConfigService.addBasicConfig(config); | |
| 218 | + hongPId=basicConfig.getId(); | |
| 219 | + }else { | |
| 220 | + hongPId=configList.get(0).getId(); | |
| 221 | + } | |
| 222 | + | |
| 223 | + //二级 | |
| 224 | + String str= String.valueOf(params.get("child")); | |
| 225 | + String arrays[]= str.split(";"); | |
| 226 | + | |
| 227 | + for (int i = 0,j=arrays.length; i < j; i++) { | |
| 228 | + String name= arrays[i]; | |
| 229 | + BasicConfig three = new BasicConfig(); | |
| 230 | + three.setParentId(parentId); | |
| 231 | + three.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 232 | + three.setpId(hongPId); | |
| 233 | + three.setName(name); | |
| 234 | + three.setType(2); | |
| 235 | + three.setYn(YnEnums.YES.getId()); | |
| 236 | + three.setCode("0"); | |
| 237 | + //父级ID | |
| 238 | + three.setEnable(YnEnums.YES.getId()); | |
| 239 | + three.setCreateDate(System.currentTimeMillis()); | |
| 240 | + basicConfigService.addBasicConfig(three); | |
| 241 | + } | |
| 242 | + }else if ("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2".equals(params.get("level"))){ | |
| 243 | + //橙色 | |
| 244 | + BasicConfigQuery basicConfigQuery=new BasicConfigQuery(); | |
| 245 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 246 | + basicConfigQuery.setParentId(parentId); | |
| 247 | + basicConfigQuery.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 248 | + basicConfigQuery.setName(String.valueOf(params.get("name"))); | |
| 249 | + List<BasicConfig> configList= basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 250 | + | |
| 251 | + String chengPId=null; | |
| 252 | + if (CollectionUtils.isEmpty(configList)){ | |
| 253 | + BasicConfig config = new BasicConfig(); | |
| 254 | + //对应高危等级颜色 | |
| 255 | + config.setParentId(parentId); | |
| 256 | + config.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 257 | + config.setName(String.valueOf(params.get("name"))); | |
| 258 | + config.setType(2); | |
| 259 | + config.setYn(YnEnums.YES.getId()); | |
| 260 | + //分值 | |
| 261 | + config.setCode("0"); | |
| 262 | + //父级ID | |
| 263 | + // config.setpId(pId); | |
| 264 | + config.setEnable(YnEnums.YES.getId()); | |
| 265 | + config.setCreateDate(System.currentTimeMillis()); | |
| 266 | + BasicConfig basicConfig= basicConfigService.addBasicConfig(config); | |
| 267 | + chengPId=basicConfig.getId(); | |
| 268 | + }else { | |
| 269 | + chengPId=configList.get(0).getId(); | |
| 270 | + } | |
| 271 | + | |
| 272 | + //二级 | |
| 273 | + String str= String.valueOf(params.get("child")); | |
| 274 | + String arrays[]= str.split(";"); | |
| 275 | + | |
| 276 | + for (int i = 0,j=arrays.length; i < j; i++) { | |
| 277 | + String name= arrays[i]; | |
| 278 | + BasicConfig three = new BasicConfig(); | |
| 279 | + three.setParentId(parentId); | |
| 280 | + three.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 281 | + three.setpId(chengPId); | |
| 282 | + three.setName(name); | |
| 283 | + three.setType(2); | |
| 284 | + three.setYn(YnEnums.YES.getId()); | |
| 285 | + three.setCode("0"); | |
| 286 | + //父级ID | |
| 287 | + three.setEnable(YnEnums.YES.getId()); | |
| 288 | + three.setCreateDate(System.currentTimeMillis()); | |
| 289 | + basicConfigService.addBasicConfig(three); | |
| 290 | + } | |
| 291 | + }else if ("e637b361-99cf-41eb-84f2-f0dab596e928".equals(params.get("level"))){ | |
| 292 | + //绿色 | |
| 293 | + BasicConfig config = new BasicConfig(); | |
| 294 | + //对应高危等级颜色 | |
| 295 | + config.setParentId(parentId); | |
| 296 | + config.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 297 | + config.setName(String.valueOf(params.get("name"))); | |
| 298 | + config.setType(2); | |
| 299 | + config.setYn(YnEnums.YES.getId()); | |
| 300 | + //分值 | |
| 301 | + config.setCode("0"); | |
| 302 | + //父级ID | |
| 303 | + // config.setpId(pId); | |
| 304 | + config.setEnable(YnEnums.YES.getId()); | |
| 305 | + config.setCreateDate(System.currentTimeMillis()); | |
| 306 | + BasicConfig basicConfig= basicConfigService.addBasicConfig(config); | |
| 307 | + System.out.println(basicConfig); | |
| 308 | + }else if ("315107bd-91fe-42a1-9237-752f3c046a40".equals(params.get("level"))){ | |
| 309 | + //黄色 | |
| 310 | + //一级 | |
| 311 | + BasicConfigQuery basicConfigQuery=new BasicConfigQuery(); | |
| 312 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 313 | + basicConfigQuery.setParentId(parentId); | |
| 314 | + basicConfigQuery.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 315 | + basicConfigQuery.setName(String.valueOf(params.get("name"))); | |
| 316 | + List<BasicConfig> configList= basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 317 | + | |
| 318 | + String huangPId=null; | |
| 319 | + if (CollectionUtils.isEmpty(configList)){ | |
| 320 | + BasicConfig config = new BasicConfig(); | |
| 321 | + //对应高危等级颜色 | |
| 322 | + config.setParentId(parentId); | |
| 323 | + config.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 324 | + config.setName(String.valueOf(params.get("name"))); | |
| 325 | + config.setType(2); | |
| 326 | + config.setYn(YnEnums.YES.getId()); | |
| 327 | + //分值 | |
| 328 | + config.setCode("0"); | |
| 329 | + //父级ID | |
| 330 | + // config.setpId(pId); | |
| 331 | + config.setEnable(YnEnums.YES.getId()); | |
| 332 | + config.setCreateDate(System.currentTimeMillis()); | |
| 333 | + BasicConfig basicConfig= basicConfigService.addBasicConfig(config); | |
| 334 | + huangPId=basicConfig.getId(); | |
| 335 | + }else { | |
| 336 | + huangPId=configList.get(0).getId(); | |
| 337 | + } | |
| 338 | + | |
| 339 | + BasicConfigQuery bQuery=new BasicConfigQuery(); | |
| 340 | + bQuery.setYn(YnEnums.YES.getId()); | |
| 341 | + bQuery.setParentId(parentId); | |
| 342 | + bQuery.setpId(huangPId); | |
| 343 | + bQuery.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 344 | + bQuery.setName(String.valueOf(params.get("child"))); | |
| 345 | + List<BasicConfig> configLists= basicConfigService.queryBasicConfig(bQuery); | |
| 346 | + String pId=null; | |
| 347 | + if (CollectionUtils.isEmpty(configLists)){ | |
| 348 | + //二级 | |
| 349 | + BasicConfig two = new BasicConfig(); | |
| 350 | + two.setParentId(parentId); | |
| 351 | + two.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 352 | + two.setpId(huangPId); | |
| 353 | + two.setName(String.valueOf(params.get("child"))); | |
| 354 | + two.setType(2); | |
| 355 | + two.setYn(YnEnums.YES.getId()); | |
| 356 | + two.setCode("0"); | |
| 357 | + //父级ID | |
| 358 | + two.setEnable(YnEnums.YES.getId()); | |
| 359 | + two.setCreateDate(System.currentTimeMillis()); | |
| 360 | + BasicConfig twoConfig= basicConfigService.addBasicConfig(two); | |
| 361 | + pId=twoConfig.getId(); | |
| 362 | + }else { | |
| 363 | + pId=configLists.get(0).getId(); | |
| 364 | + } | |
| 365 | + | |
| 366 | + //三级 | |
| 367 | + String str= String.valueOf(params.get("childs")); | |
| 368 | + String arrays[]= str.split(";"); | |
| 369 | + | |
| 370 | + for (int i = 0,j=arrays.length; i < j; i++) { | |
| 371 | + String name= arrays[i]; | |
| 372 | + BasicConfig three = new BasicConfig(); | |
| 373 | + three.setParentId(parentId); | |
| 374 | + three.setTypeId("fb43fd6a-b152-4cb9-9181-c46f5612ba44"); | |
| 375 | + three.setpId(pId); | |
| 376 | + three.setName(name); | |
| 377 | + three.setType(2); | |
| 378 | + three.setYn(YnEnums.YES.getId()); | |
| 379 | + three.setCode("0"); | |
| 380 | + //父级ID | |
| 381 | + three.setEnable(YnEnums.YES.getId()); | |
| 382 | + three.setCreateDate(System.currentTimeMillis()); | |
| 383 | + basicConfigService.addBasicConfig(three); | |
| 384 | + } | |
| 385 | + } | |
| 386 | + } | |
| 387 | + } | |
| 388 | + | |
| 389 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 390 | + | |
| 391 | + } | |
| 178 | 392 | } |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
76fc7f2
| ... | ... | @@ -703,11 +703,7 @@ |
| 703 | 703 | <property name="jobDetail" ref="weekSyncWork"></property> |
| 704 | 704 | <property name="cronExpression" value="0 0 9 * * ?"></property> |
| 705 | 705 | </bean> |
| 706 | - <!-- 配置一个触发器 0 0 17 * * ?--> | |
| 707 | - <bean id="bookbuildingSyncWorkTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> | |
| 708 | - <property name="jobDetail" ref="bookbuildingSyncWork"></property> | |
| 709 | - <property name="cronExpression" value="0 0 17 * * ?"></property> | |
| 710 | - </bean> | |
| 706 | + | |
| 711 | 707 | <bean id="initUserSyncWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> |
| 712 | 708 | <!-- 要调用的bean --> |
| 713 | 709 | <property name="targetObject" ref="accessPermissionFacade"></property> |