瀏覽代碼

术语导入

zhaops 3 年之前
父節點
當前提交
1dbb8b62c7

+ 5 - 3
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -673,7 +673,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param hospitalId
      * @param type
      */
-    public void importExcel(MultipartFile file, Long hospitalId, Integer type, String userId) {
+    public Boolean importExcel(MultipartFile file, Long hospitalId, Integer type, String userId) {
         if (hospitalId == null) {
             hospitalId = Long.valueOf(SysUserUtils.getCurrentHospitalID());
         }
@@ -687,7 +687,8 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         if (ListUtil.isEmpty(originList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
         }
-        importDataProcess(originList, hospitalId, type, userId);
+        Boolean data = importDataProcess(originList, hospitalId, type, userId);
+        return data;
     }
 
     /**
@@ -697,7 +698,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param hospitalId
      * @param type
      */
-    public boolean importDataProcess(List<MappingConfigWrapper> originList, Long hospitalId, Integer type, String userId) {
+    public Boolean importDataProcess(List<MappingConfigWrapper> originList, Long hospitalId, Integer type, String userId) {
         List<MappingConfigWrapper> tempList = Lists.newLinkedList();
 
         Date now = DateUtil.now();
@@ -749,6 +750,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
             } else {
                 item.setCode("");
             }
+            rowId++;
         }
 
         //医院术语名称不允许为空

+ 3 - 2
src/main/java/com/diagbot/web/MappingConfigController.java

@@ -91,11 +91,12 @@ public class MappingConfigController {
     @PostMapping(value = "/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcel")
     @Transactional
-    public void importExcel(@RequestParam("file") MultipartFile file,
+    public RespDTO<Boolean> importExcel(@RequestParam("file") MultipartFile file,
                             @RequestParam("hospitalId") Long hospitalId,
                             @RequestParam("type") Integer type,
                             @RequestParam("uesrId") String userId) {
-        mappingConfigFacade.importExcel(file, hospitalId, type, userId);
+        Boolean data = mappingConfigFacade.importExcel(file, hospitalId, type, userId);
+        return RespDTO.onSuc(data);
     }