Procházet zdrojové kódy

2021-7-27 zhangyan
1.修复原材料信息维护无数据新增bug

QuietShadow před 3 roky
rodič
revize
f5838ade94

+ 2 - 2
src/main/java/com/steerinfo/ems/emsprodplanyear/controller/EmsProdplanYearController.java

@@ -77,12 +77,12 @@ public class EmsProdplanYearController extends BaseRESTfulController {
         stringListMap.entrySet().stream().sorted(
                 Map.Entry.comparingByKey()).forEachOrdered(x-> sortListMap.put(x.getKey(),x.getValue())
         );
+        // 返回实际行数
+        list.setTotal((long) Math.ceil(list.getTotal()/(double)parentNum));
         List mapList = new ArrayList<>();
         //数据,进行组装
         mapList.add(sortListMap);
         list.setList(mapList);
-        // 返回实际行数
-        list.setTotal(list.getTotal()/parentNum);
         return success(list);
     }
 

+ 7 - 8
src/main/java/com/steerinfo/ems/trmmaterial/controller/TRmMaterialController.java

@@ -1,25 +1,24 @@
 package com.steerinfo.ems.trmmaterial.controller;
 
 import com.steerinfo.auth.utils.JwtUtil;
-import com.steerinfo.ems.trmmaterial.mapper.TRmMaterialMapper;
-import com.steerinfo.ems.trmworkproc.model.TRmWorkproc;
+import com.steerinfo.ems.trmmaterial.model.TRmMaterial;
+import com.steerinfo.ems.trmmaterial.service.ITRmMaterialService;
 import com.steerinfo.ems.trmworkprocmaterial.service.ITRmWorkprocMaterialService;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
-import com.steerinfo.ems.trmmaterial.model.TRmMaterial;
-import com.steerinfo.ems.trmmaterial.service.ITRmMaterialService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * TRmMaterial RESTful接口:
@@ -81,7 +80,7 @@ public class TRmMaterialController extends BaseRESTfulController {
              }
         }
         String maxId = tRmMaterialService.getMaxId();
-        maxId = String.format("%03d", Integer.parseInt(maxId) + 1);
+        maxId = String.format("%04d", Integer.parseInt(maxId) + 1);
         model.setId("Y"+maxId);
         model.setSeqno(maxId);
         model.setCreateman(JwtUtil.getUseridByToken());

+ 1 - 1
src/main/java/com/steerinfo/ems/trmmaterial/mapper/TRmMaterialMapper.xml

@@ -327,7 +327,7 @@
 
     <!--获取最大值-->
     <select id="getMaxId" resultType="string">
-        select max(to_number(SUBSTR(ID,2))) from T_RM_MATERIAL
+        select nvl(max(to_number(SUBSTR(ID,2))),'000') from T_RM_MATERIAL
     </select>
 
     <!--获取最大序列-->