zhangym hai 1 ano
pai
achega
28f71712fd

+ 4 - 5
src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java

@@ -114,12 +114,11 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             model.setWorkprocType(model.getWorkprocType());
             emsGmPcJh.setState("3");
             emsGmPcJh.setReceiveTime(new Date());
-            emsGmPcJhMapper.updateByPrimaryKeySelective(emsGmPcJh);
-            emsProdplanRoundService.add(model);
             EmsGmPcJh prodplan = emsGmPcJhMapper.selectByPrimaryKey(model.getParentid());
             int a = prodplan.getPlanWeight().intValue()*2;
             if (a>=emsProdplanRoundMapper.getPlanCount(model.getParentid()).intValue()){
-
+                emsGmPcJhMapper.updateByPrimaryKeySelective(emsGmPcJh);
+                emsProdplanRoundService.add(model);
             }else {
                 return failed("请检查新增的计划!");
             }
@@ -413,8 +412,8 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
        return failed();
     }
     @GetMapping("getstdchem")
-    public RESTfulResult getstdchem(@RequestParam("workprocType") String workprocType){
-        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getchemicalStandard(workprocType);
+    public RESTfulResult getstdchem(){
+        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getchemicalStandard();
         return success(emsProdplanRounds);
     }
 

+ 1 - 1
src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.java

@@ -36,7 +36,7 @@ public interface EmsProdplanRoundMapper extends IBaseMapper<EmsProdplanRound, St
     List<EmsProdplanRound> getsurfaceStandard();
 
     //化学成份执行标准
-    List<EmsProdplanRound> getchemicalStandard(@Param("workprocType") String workprocType);
+    List<EmsProdplanRound> getchemicalStandard();
 
     //审核页面数据获取
     List<Map<String, Object>> getAuditDate(HashMap<String, Object> parmas);

+ 2 - 2
src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.xml

@@ -832,7 +832,7 @@
   <select id="getchemicalStandard" resultMap="BaseResultMap">
     select distinct CHEMICAL_STANDARD
     from ems_prodplan_round
-   where CHEMICAL_STANDARD not like '%null%' and workproc_type = #{workprocType}
+   where CHEMICAL_STANDARD not like '%null%'
   </select>
    <select id="getTableDetailAsRadio" parameterType="java.util.HashMap" resultMap="BaseResultMap">
      <include refid="select"/>
@@ -852,7 +852,7 @@
     WHERE rownum=1
   </select>
   <select id="getPlanCount" resultType="java.math.BigDecimal">
-    select sum(ABS(PLAN_WEIGHT)) from ems_prodplan_round
+    select case when sum(ABS(PLAN_WEIGHT)) is null then 0 else sum(ABS(PLAN_WEIGHT)) end heji from ems_prodplan_round
     <where>
       <if test="parentid != null and parentid != '' ">
         and PARENTID = #{parentid}

+ 1 - 1
src/main/java/com/steerinfo/ems/emsprodplanround/service/IEmsProdplanRoundService.java

@@ -39,7 +39,7 @@ public interface IEmsProdplanRoundService extends IBaseService<EmsProdplanRound,
     //获取表面质量标准
     List<EmsProdplanRound>getsurfaceStandard();
     //化学成份执行标准
-    List<EmsProdplanRound> getchemicalStandard(String workprocType);
+    List<EmsProdplanRound> getchemicalStandard();
     // 审核页面查询
     PageList<Map<String, Object>> getAuditDateForPage(HashMap<String, Object> parmas, Integer pageNum,
                                                        Integer pageSize);

+ 2 - 2
src/main/java/com/steerinfo/ems/emsprodplanround/service/impl/EmsProdplanRoundServiceImpl.java

@@ -80,8 +80,8 @@ public class EmsProdplanRoundServiceImpl extends BaseServiceImpl<EmsProdplanRoun
     }
 
     @Override
-    public List<EmsProdplanRound> getchemicalStandard(String workprocType) {
-        return emsProdplanRoundMapper.getchemicalStandard(workprocType);
+    public List<EmsProdplanRound> getchemicalStandard() {
+        return emsProdplanRoundMapper.getchemicalStandard();
     }
 
     @Override