Browse Source

lrl -2021-10-12

lirl 3 years ago
parent
commit
c1571b8645

+ 1 - 1
pom.xml

@@ -110,7 +110,7 @@
 		<dependency>
 		<groupId>com.mosalc</groupId>
 		<artifactId>mswebservice</artifactId>
-		<version>1.0.0</version>
+		<version>1.0</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.axis2</groupId>

+ 19 - 8
src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java

@@ -183,6 +183,7 @@ public class EmsGmPcJhController extends BaseRESTfulController {
             EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
             emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
             emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
+            emsProdplanWeightAdjustment.setRecordWeight(model.getPlanWeight());
             emsGmPcJhMapper.updateByPrimaryKey(model);
             emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
         }
@@ -206,6 +207,7 @@ public class EmsGmPcJhController extends BaseRESTfulController {
                 return failed(null,"计划号为:"+model.getId()+"已经接收");
             }
             emsGmPcJhMapper.deleteByPrimaryKey(model.getId());
+            emsProdplanWeightAdjustmentMapper.deleteByPrimaryKey(model.getId());
         }
         return success();
     }
@@ -274,14 +276,23 @@ public class EmsGmPcJhController extends BaseRESTfulController {
             if (emsGmPcJh.getState().equals("3")) {
                 return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
             }
-            if (emsGmPcJh.getState().equals("1")) {
-                return failed(null, "操作失败,编号为" + emsGmPcJh.getId() + "正在审核");
-            }
-            model.setYxfWeight(new BigDecimal("0"));
-            model.setKxfWeight(model.getPlanWeight());
-            model.setUpdateTime(new Date());
-            model.setUpdateMan(userId);
-            emsGmPcJhService.updateState(model);
+//            if (emsGmPcJh.getState().equals("1")) {
+//                return failed(null, "操作失败,编号为" + emsGmPcJh.getId() + "正在审核");
+//            }
+            emsGmPcJh.setYxfWeight(new BigDecimal("0"));
+            emsGmPcJh.setKxfWeight(model.getPlanWeight());
+            emsGmPcJh.setState(model.getState());
+            emsGmPcJh.setUpdateTime(new Date());
+            emsGmPcJh.setSpecifications(model.getSpecifications());
+            emsGmPcJh.setGrades(model.getGrades());
+            emsGmPcJh.setLengths(model.getLengths());
+            emsGmPcJh.setPlanWeight(model.getPlanWeight());
+            emsGmPcJh.setUpdateMan(userId);
+            emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
+            EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
+            emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
+            emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
             result = true;
             soketMessage+=emsGmPcJh.getId()+",";
         }

+ 11 - 1
src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml

@@ -718,9 +718,19 @@
       <if test="state != null and state != ''">
         STATE = #{state},
       </if>
+<!--      <if test="grades != null and grades!= ''">-->
+<!--        GRADES = #{grades},-->
+<!--      </if>-->
+<!--      <if test="specifications != null and specifications != '' ">-->
+<!--        SPECIFICATIONS = #{specifications},-->
+<!--      </if>-->
+<!--      <if test="lengths != null and lengths != '' ">-->
+<!--        LENGTHS = #{lengths},-->
+<!--      </if>-->
       <if test="gmReviewer != null and gmReviewer != '' ">
         GM_REVIEWER = #{gmReviewer},
       </if>
+
       <if test="gmReviewerTime != null ">
         GM_REVIEWER_TIME = #{gmReviewerTime}
       </if>
@@ -774,7 +784,7 @@
          t2.AUDIT_STATUS,
          t2.GM_REVIEWER,
          t2.GM_REVIEWER_TIME,
-         t2.PLAN_WEIGHT_OLD - t2.PLAN_WEIGHT TZL
+         t2.PLAN_WEIGHT - t2.PLAN_WEIGHT_OLD TZL
     from ems_gm_pc_jh t
     left join ems_prodplan_weight_adjustment t2
       on t.id = t2.id

+ 6 - 10
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/controller/EmsProdplanWeightAdjustmentController.java

@@ -127,11 +127,6 @@ public class EmsProdplanWeightAdjustmentController extends BaseRESTfulController
         EmsProdplanWeightAdjustment emsProdplanWeightAdjustment;
         for (EmsProdplanWeightAdjustment model : models) {
             emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
-            System.out.println(models.length);
-            System.out.println(emsProdplanWeightAdjustment);
-            if (emsProdplanWeightAdjustment.getAuditStatus().equals("1")) {
-                return failed(null,"编号为"+emsProdplanWeightAdjustment.getId()+",已经提交申请,请勿重复操作");
-            }
             if (emsProdplanWeightAdjustment.getAuditStatus().equals("2")) {
                 return failed(null,"编号为"+emsProdplanWeightAdjustment.getId()+",领导部门已经审批,请勿重复操作");
             }
@@ -141,7 +136,6 @@ public class EmsProdplanWeightAdjustmentController extends BaseRESTfulController
             emsProdplanWeightAdjustment.setSubmitter(userId);
             emsProdplanWeightAdjustment.setSubmitTime(new Date());
             emsProdplanWeightAdjustment.setAuditStatus(model.getAuditStatus());
-            emsProdplanWeightAdjustment.setRecordWeight(emsProdplanWeightAdjustment.getPlanWeight());
             emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
             emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
             result = true;
@@ -252,12 +246,12 @@ public class EmsProdplanWeightAdjustmentController extends BaseRESTfulController
                     return failed(null,"计划编号为:"+emsProdplanWeightAdjustment.getId()+",审核失败,请勿重复操作");
                 }
                 EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(model.getId());
-                emsGmPcJh.setPlanWeight(emsProdplanWeightAdjustment.getPlanWeight());
                 emsProdplanWeightAdjustment.setReviewer(userId);
                 emsProdplanWeightAdjustment.setReviewerTime(new Date());
+                emsProdplanWeightAdjustment.setRecordWeight(emsGmPcJh.getPlanWeight());
                 emsProdplanWeightAdjustment.setAuditStatus("3");
-                emsProdplanWeightAdjustment.setPlanWeightOld(emsProdplanWeightAdjustment.getRecordWeight());
                 emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
+                emsGmPcJh.setPlanWeight(emsProdplanWeightAdjustment.getPlanWeight());
                 emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
 //                result = true;
 //                soketMessage+=model.getId()+",";
@@ -293,10 +287,12 @@ public class EmsProdplanWeightAdjustmentController extends BaseRESTfulController
                 if(emsProdplanWeightAdjustment.getAuditStatus().equals("4")){
                     return failed(null,"计划编号为:"+emsProdplanWeightAdjustment.getId()+",审核失败,请勿重复操作");
                 }
-                emsProdplanWeightAdjustment.setPlanWeight(emsProdplanWeightAdjustment.getPlanWeightOld());
+                EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(model.getId());
+                emsGmPcJh.setPlanWeight(emsProdplanWeightAdjustment.getRecordWeight());
+                emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
                 emsProdplanWeightAdjustment.setReviewer(userId);
                 emsProdplanWeightAdjustment.setReviewerTime(new Date());
-                emsProdplanWeightAdjustment.setAuditStatus("4");
+                emsProdplanWeightAdjustment.setAuditStatus("2");
                 emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
             }
         }