Przeglądaj źródła

lrl - 2021-09-24

lirl 3 lat temu
rodzic
commit
8c9bad95af
22 zmienionych plików z 1227 dodań i 65 usunięć
  1. 2 2
      pom.xml
  2. 144 6
      src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java
  3. 5 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.java
  4. 76 10
      src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml
  5. 12 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/model/EmsGmPcJh.java
  6. 7 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/service/IEmsGmPcJhService.java
  7. 16 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/service/impl/EmsGmPcJhServiceImpl.java
  8. 1 8
      src/main/java/com/steerinfo/ems/emsprodplanmonth/controller/EmsProdplanMonthController.java
  9. 99 5
      src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java
  10. 8 0
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.java
  11. 45 3
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.xml
  12. 21 0
      src/main/java/com/steerinfo/ems/emsprodplanround/model/EmsProdplanRound.java
  13. 10 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/IEmsProdplanRoundService.java
  14. 21 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/impl/EmsProdplanRoundServiceImpl.java
  15. 211 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/controller/EmsProdplanWeightAdjustmentController.java
  16. 11 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/mapper/EmsProdplanWeightAdjustmentMapper.java
  17. 292 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/mapper/EmsProdplanWeightAdjustmentMapper.xml
  18. 156 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/model/EmsProdplanWeightAdjustment.java
  19. 23 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/service/IEmsProdplanWeightAdjustmentService.java
  20. 36 0
      src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/service/impl/EmsProdplanWeightAdjustmentServiceImpl.java
  21. 1 1
      src/main/java/com/steerinfo/ems/emswaterrealtime/service/IEmsWaterRealtimeService.java
  22. 30 30
      src/main/java/com/steerinfo/task/SpringCronTask.java

+ 2 - 2
pom.xml

@@ -112,7 +112,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>
@@ -214,7 +214,7 @@
 <!--				  <password>123456</password>-->
 <!--				  <targetPackage>com.steerinfo.ems</targetPackage>-->
 <!--				  <tables>-->
-<!--					<param>EMS_GM_PC_JH</param>-->
+<!--					<param>ems_prodplan_weight_adjustment</param>-->
 <!--				  </tables>-->
 <!--				</configuration>-->
 <!--				<executions>-->

+ 144 - 6
src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java

@@ -4,6 +4,8 @@ import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.Utils.DateUtils;
 import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
 import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -43,6 +45,8 @@ public class EmsGmPcJhController extends BaseRESTfulController {
     IEmsGmPcJhService emsGmPcJhService;
     @Autowired
     EmsGmPcJhMapper emsGmPcJhMapper;
+    @Autowired
+    EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
 
     @ApiOperation(value="获取列表", notes="分页查询")
     @ApiImplicitParams({
@@ -52,6 +56,27 @@ public class EmsGmPcJhController extends BaseRESTfulController {
     //@RequiresPermissions("emsgmpcjh:view")
     @GetMapping(value = "/")
     public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        if(parmas.get("grades") != null && !parmas.get("grades").toString().isEmpty()){
+            String grades = parmas.get("grades").toString();
+            if(!grades.startsWith("'")){
+                grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("grades", grades);
+        }
+        if(parmas.get("specifications") != null && !parmas.get("specifications").toString().isEmpty()){
+            String grades = parmas.get("specifications").toString();
+            if(!grades.startsWith("'")){
+                grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("specifications", grades);
+        }
+        if(parmas.get("lengthTimesWidth") != null && !parmas.get("lengthTimesWidth").toString().isEmpty()){
+            String grades = parmas.get("lengthTimesWidth").toString();
+            if(!grades.startsWith("'")){
+                grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("lengthTimesWidth", grades);
+        }
         PageList<EmsGmPcJh> list = emsGmPcJhService.queryForPage(parmas, pageNum, pageSize);
         return success(list);
     }
@@ -84,6 +109,12 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         model.setCreateTime(new Date());
         model.setCreateMan(userId);
         EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = new EmsProdplanWeightAdjustment();
+        emsProdplanWeightAdjustment.setId(model.getId());
+        emsProdplanWeightAdjustment.setAuditStatus("0");
+        emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
+        emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
+        emsProdplanWeightAdjustmentMapper.insert(emsProdplanWeightAdjustment);
         return success(emsGmPcJh);
     }
 
@@ -102,7 +133,7 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         model.setKxfWeight(model.getPlanWeight() == null ? new BigDecimal("0"): model.getPlanWeight());
         model.setYxfWeight(new BigDecimal("0"));
         model.setCreateTime(new Date());
-        model.setState("1");
+        model.setState("2");
         model.setCreateMan(userId);
         EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
         return success(emsGmPcJh);
@@ -129,16 +160,23 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         for (EmsGmPcJh model : models) {
             EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
             if(emsGmPcJh.getState().equals("2")) {
-                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
             }
-            if (model.getState().equals("1")) {
-                return failed(model, "计划号为:" + model.getId() + "已下发无法做修改操作,请取消下发");
+            if (emsGmPcJh.getState().equals("1")) {
+                return failed(model, "操作失败,计划号为:" + model.getId() + "正在审核");
+            }
+            if (emsGmPcJh.getState().equals("3")) {
+                return failed(model, "操作失败,计划号为:" + model.getId() + "已接收");
             }
             model.setYxfWeight(new BigDecimal("0"));
             model.setKxfWeight(model.getPlanWeight());
             model.setUpdateMan(userId);
             model.setUpdateTime(new Date());
+            EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
+            emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
+            emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
             emsGmPcJhMapper.updateByPrimaryKey(model);
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
         }
         return success();
     }
@@ -151,10 +189,13 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         for (EmsGmPcJh model : models) {
             EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
             if(emsGmPcJh.getState().equals("2")) {
-                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
             }
             if (model.getState().equals("1")) {
-                return failed(model,"计划号为:"+model.getId()+"已下发无法做删除操作,请取消下发");
+                return failed(null,"计划号为:"+model.getId()+"正在审核");
+            }
+            if (model.getState().equals("3")) {
+                return failed(null,"计划号为:"+model.getId()+"已经接收");
             }
             emsGmPcJhMapper.deleteByPrimaryKey(model.getId());
         }
@@ -173,16 +214,83 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         for (EmsGmPcJh model : models) {
             EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
             if(emsGmPcJh.getState().equals("2")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
+            }
+            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);
+        }
+        return success();
+    }
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsGmPcJh信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "emsGmPcJh", value = "详细实体emsGmPcJh", required = true, dataType = "EmsGmPcJh")
+    })
+    //@RequiresPermissions("emsgmpcjh:update")
+    @PutMapping(value = "/submitaudit", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult submitaudit(@RequestBody EmsGmPcJh[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (EmsGmPcJh model : models) {
+            EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
+            if(emsGmPcJh.getState().equals("2")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
+            }
+            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);
+        }
+        return success();
+    }
+    //@RequiresPermissions("emsgmpcjh:update")
+    @PutMapping(value = "/passaudits", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult passaudits(@RequestBody EmsGmPcJh[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (EmsGmPcJh model : models) {
+            EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
+            if(emsGmPcJh.getState().equals("2")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
+            }
+            if (emsGmPcJh.getState().equals("3")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
+            }
+            model.setUpdateMan(userId);
             emsGmPcJhService.updateState(model);
         }
         return success();
     }
+
+    //@RequiresPermissions("emsgmpcjh:update")
+    @PutMapping(value = "/turndown", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult turndown(@RequestBody EmsGmPcJh[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (EmsGmPcJh model : models) {
+            EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
+            if (emsGmPcJh.getState().equals("3")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
+            }
+            emsGmPcJhService.updateState(model);
+        }
+        return success();
+    }
+
     @ApiOperation(value="获取列表", notes="分页模糊查询")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
@@ -201,6 +309,35 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         return success(gmPcJhDataForPage);
     }
 
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    @GetMapping("/getXsDdDate")
+    public RESTfulResult getXsDdDate(@RequestParam HashMap<String,Object> parmas,Integer pageNum,Integer pageSize){
+        PageList<Map<String, Object>>  getXsDdDateForPage= emsGmPcJhService.getXsDdDate(parmas, pageNum, pageSize);
+        return success(getXsDdDateForPage);
+    }
+
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    @GetMapping("/getShData")
+    public RESTfulResult getShData(@RequestParam HashMap<String,Object> parmas,Integer pageNum,Integer pageSize){
+        if(parmas.get("workprocType") != null && !parmas.get("workprocType").toString().isEmpty()){
+            String workprocType = parmas.get("workprocType").toString();
+            if(!workprocType.startsWith("'")){
+                workprocType = "'" + workprocType.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("workprocType", workprocType);
+        }
+        PageList<Map<String, Object>> xsShData = emsGmPcJhService.getXsShData(parmas, pageNum, pageSize);
+        return success(xsShData);
+    }
+
     @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsGmPcJh信息来更新详细信息")
     @ApiImplicitParams({
             @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
@@ -258,4 +395,5 @@ public class EmsGmPcJhController extends BaseRESTfulController {
         }
         return null;
     }
+
 }

+ 5 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.java

@@ -1,6 +1,7 @@
 package com.steerinfo.ems.emsgmpcjh.mapper;
 
 import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
 import com.steerinfo.framework.mapper.IBaseMapper;
 
 import java.util.HashMap;
@@ -17,4 +18,8 @@ public interface EmsGmPcJhMapper extends IBaseMapper<EmsGmPcJh, String> {
     int  updateState(EmsGmPcJh emsGmPcJh);
     //轮次计划页面查询
     List<Map<String, Object>> getGmPcJhData(HashMap<String, Object> parmas);
+    //重量调整页面查询
+    List<Map<String,Object>> getXsDdDate(HashMap<String,Object> parmas);
+    //计划审核页面查询
+    List<Map<String,Object>> getShData(HashMap<String,Object> parmas);
 }

+ 76 - 10
src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml

@@ -25,12 +25,13 @@
     <result column="DIMENSION" jdbcType="VARCHAR" property="dimension" />
     <result column="KXF_WEIGHT" jdbcType="DECIMAL" property="kxfWeight" />
     <result column="YXF_WEIGHT" jdbcType="DECIMAL" property="yxfWeight" />
+    <result column="DELIVERY_DATE" jdbcType="TIMESTAMP" property="deliveryDate"/>
     <result column="PLAN_WEIGHT" jdbcType="DECIMAL" property="planWeight" />
   </resultMap>
   <sql id="columns">
     ID, JH_TIME, STATE, GRADES, SPECIFICATIONS, LENGTHS, CHEMICAL_STANDARD, SURFACE_STANDARD, 
     WORKPROC_TYPE, IATERAL_AREA, LENGTH_TIMES_WIDTH, TRANSPORT_TYPE, RECEIVE_TIME, CREATE_MAN, 
-    CREATE_TIME, UPDATE_MAN, UPDATE_TIME, MEMO, PURPOSE, UNITID, DIMENSION, KXF_WEIGHT, 
+    CREATE_TIME, UPDATE_MAN, UPDATE_TIME, MEMO, PURPOSE, UNITID, DIMENSION, KXF_WEIGHT, DELIVERY_DATE,
     YXF_WEIGHT, PLAN_WEIGHT
   </sql>
   <sql id="columns_alias">
@@ -51,10 +52,10 @@
         and STATE = #{state}
       </if>
       <if test="grades != null and grades != ''">
-        and GRADES = #{grades}
+        and GRADES in (${grades})
       </if>
       <if test="specifications != null and specifications != ''">
-        and SPECIFICATIONS = #{specifications}
+        and SPECIFICATIONS in (${specifications})
       </if>
       <if test="lengths != null">
         and LENGTHS = #{lengths}
@@ -72,7 +73,7 @@
         and IATERAL_AREA = #{iateralArea}
       </if>
       <if test="lengthTimesWidth != null and lengthTimesWidth != ''">
-        and LENGTH_TIMES_WIDTH = #{lengthTimesWidth}
+        and LENGTH_TIMES_WIDTH in (${lengthTimesWidth})
       </if>
       <if test="transportType != null and transportType != ''">
         and TRANSPORT_TYPE = #{transportType}
@@ -117,6 +118,7 @@
         and JH_TIME BETWEEN TO_DATE(#{startTime},'yyyy-mm-dd') AND TO_DATE(#{endTime},'yyyy-mm-dd')
       </if>
       AND ID like '%G-%'
+      order by  JH_TIME desc, ID desc
     </where>
   </sql>
   <sql id="whereLike">
@@ -280,7 +282,7 @@
       RECEIVE_TIME, CREATE_MAN, CREATE_TIME, 
       UPDATE_MAN, UPDATE_TIME, MEMO, 
       PURPOSE, UNITID, DIMENSION, 
-      KXF_WEIGHT, YXF_WEIGHT, PLAN_WEIGHT
+      KXF_WEIGHT, YXF_WEIGHT, PLAN_WEIGHT,DELIVERY_DATE
       )
     values (#{id,jdbcType=VARCHAR}, #{jhTime,jdbcType=TIMESTAMP}, #{state,jdbcType=VARCHAR}, 
       #{grades,jdbcType=VARCHAR}, #{specifications,jdbcType=VARCHAR}, #{lengths,jdbcType=DECIMAL}, 
@@ -289,7 +291,7 @@
       #{receiveTime,jdbcType=TIMESTAMP}, #{createMan,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{updateMan,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{memo,jdbcType=VARCHAR}, 
       #{purpose,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{dimension,jdbcType=VARCHAR}, 
-      #{kxfWeight,jdbcType=DECIMAL}, #{yxfWeight,jdbcType=DECIMAL}, #{planWeight,jdbcType=DECIMAL}
+      #{kxfWeight,jdbcType=DECIMAL}, #{yxfWeight,jdbcType=DECIMAL}, #{planWeight,jdbcType=DECIMAL},#{deliveryDate,jdbcType=TIMESTAMP}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
@@ -467,7 +469,8 @@
       DIMENSION = #{dimension,jdbcType=VARCHAR},
       KXF_WEIGHT = #{kxfWeight,jdbcType=DECIMAL},
       YXF_WEIGHT = #{yxfWeight,jdbcType=DECIMAL},
-      PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL}
+      PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      DELIVERY_DATE   = #{deliveryDate,jdbcType=TIMESTAMP}
     where ID = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
@@ -724,7 +727,7 @@
   <select id="getGmPcJhData" parameterType="java.util.HashMap" resultType="Map">
     SELECT  ID as id , to_char(JH_TIME,'yyyy-mm-dd') as jhTime, STATE as state, GRADES as grades, SPECIFICATIONS as specifications, LENGTHS as lengths, CHEMICAL_STANDARD as chemicalstandard, SURFACE_STANDARD as surfacestandard,
     WORKPROC_TYPE as workprocType, IATERAL_AREA as iateralArea,  LENGTH_TIMES_WIDTH as lengthtimeswidth, TRANSPORT_TYPE as transportType , RECEIVE_TIME as receivetime, CREATE_MAN as createman,
-    CREATE_TIME as createtime, UPDATE_MAN as updateman, UPDATE_TIME as updatime , MEMO as memo , PURPOSE as purpose, UNITID as unitid, DIMENSION as dimension, PLAN_WEIGHT as planweight,KXF_WEIGHT,YXF_WEIGHT
+    CREATE_TIME as createtime, UPDATE_MAN as updateman, UPDATE_TIME as updatime , MEMO as memo , PURPOSE as purpose, UNITID as unitid, DIMENSION as dimension, PLAN_WEIGHT as planweight,KXF_WEIGHT,YXF_WEIGHT,TO_CHAR(DELIVERY_DATE,'yyyy-mm-dd') as deliveryDate
     FROM
     EMS_GM_PC_JH
     <where>
@@ -737,9 +740,72 @@
       <if test="id !=null and id != ''">
        and ID= #{id}
       </if>
-      and state in ('1','2')
+      and state in ('2','3')
       order by jhTime,ID
     </where>
   </select>
-  
+  <!--国贸计划查询-->
+<select id="getXsDdDate" parameterType="java.util.HashMap" resultType="Map">
+  select t.id,
+         to_char(t.jh_time,'yyyy-mm-dd') jh_time,
+         t.WORKPROC_TYPE,
+         to_char(t.DELIVERY_DATE,'yyyy-mm-dd') DELIVERY_DATE,
+         t.state,
+         t.grades,
+         t.specifications,
+         t.lengths,
+         t2.plan_weight,
+         t2.plan_weight_old,
+         t2.submitter,
+         to_char(t2.submit_time,'yyyy-mm-dd') submit_time,
+         t2.reviewer,
+         to_char(t2.reviewer_time,'yyyy-mm-dd') reviewer_time,
+         t2.AUDIT_STATUS,
+         t2.PLAN_WEIGHT_OLD - t2.PLAN_WEIGHT TZL
+    from ems_gm_pc_jh t
+    left join ems_prodplan_weight_adjustment t2
+      on t.id = t2.id
+      <where>
+        <if test="id != null and id != '' ">
+          and t.id = #{id}
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
+          and t.jh_time between to_date(#{startTime}, 'yyyy-mm-dd') and to_date(#{endTime}, 'yyyy-mm-dd')
+        </if>
+        and t.id like '%G-%'
+        and t.state = '3'
+      </where>
+</select>
+  <!--审核页面查询-->
+  <select id="getShData" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select t.id,
+       t.jh_time,
+       t.state,
+       t.workproc_type,
+       t.Delivery_Date,
+       t.grades,
+       t.specifications,
+       t.lengths,
+       t.length_times_width,
+       t.plan_weight,
+       t.transport_type,
+       t.purpose,
+       t.create_man,
+       t.create_time
+      from ems_gm_pc_jh t
+      <where>
+        <if test="startTime != null and startTime != ''  and endTime != null  and endTime != '' ">
+         and t.jh_time between to_date(#{startTime},'yyyy-mm-dd') and to_date(#{endTime},'yyyy-mm-dd')
+        </if>
+        <if test="workprocType != null and workprocType != ''">
+          and t.workproc_type in (${workprocType})
+        </if>
+        <if test="id != null and id != '' ">
+          and t.id = #{id}
+        </if>
+        and t.state in ('1','2','3','4')
+        and t.id like '%G-%'
+      </where>
+      order by t.jh_time desc,t.id desc
+  </select>
 </mapper>

+ 12 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/model/EmsGmPcJh.java

@@ -157,6 +157,18 @@ public class EmsGmPcJh implements IBasePO<String> {
     @ApiModelProperty(value="计划量",required=false)
     private BigDecimal planWeight;
 
+    @ApiModelProperty(value = "交货日期", required =false )
+    @JSONField(format = "yyyy-MM-dd")
+    private Date deliveryDate;
+
+    public Date getDeliveryDate() {
+        return deliveryDate;
+    }
+
+    public void setDeliveryDate(Date deliveryDate) {
+        this.deliveryDate = deliveryDate;
+    }
+
     private String type;
 
     public String getType() {

+ 7 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/service/IEmsGmPcJhService.java

@@ -28,5 +28,12 @@ public interface IEmsGmPcJhService extends IBaseService<EmsGmPcJh, String>{
     //轮次计划查询
     PageList<Map<String, Object>>  getGmPcJhDataForPage(HashMap<String, Object> parmas, Integer pageNum,
                                                          Integer pageSize);
+    //重量调整页面查询
+    PageList<Map<String, Object>>  getXsDdDate(HashMap<String, Object> parmas, Integer pageNum,
+                                                        Integer pageSize);
+
+    //审核页面查询
+    PageList<Map<String, Object>>  getXsShData(HashMap<String, Object> parmas, Integer pageNum,
+                                               Integer pageSize);
 
 }

+ 16 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/service/impl/EmsGmPcJhServiceImpl.java

@@ -56,4 +56,20 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
         return plist;
     }
 
+    @Override
+    public PageList<Map<String, Object>> getXsDdDate(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String, Object>> xsDdDate = emsGmPcJhMapper.getXsDdDate(parmas);
+        PageList<Map<String,Object>> plist = new PageList<Map<String,Object>>(xsDdDate);
+        return plist;
+    }
+
+    @Override
+    public PageList<Map<String, Object>> getXsShData(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String, Object>> shData = emsGmPcJhMapper.getShData(parmas);
+        PageList<Map<String,Object>> plist = new PageList<Map<String,Object>>(shData);
+        return plist;
+    }
+
 }

+ 1 - 8
src/main/java/com/steerinfo/ems/emsprodplanmonth/controller/EmsProdplanMonthController.java

@@ -96,19 +96,12 @@ public class EmsProdplanMonthController extends BaseRESTfulController {
     public RESTfulResult add(@RequestBody EmsProdplanMonth[] models){
         String userId = JwtUtil.getUseridByToken();
         for (int i = 0; i < models.length; i++) {
-
             EmsProdplanMonth model = models[i];
             model.setCreateman(userId);
             model.setCreatetime(new Date());
             Map map = new HashMap();
             map.put("may",new SimpleDateFormat("yyyy-MM").format(model.getMay()));
-            if(model.getWorkprocid() != null && !"".equals(model.getWorkprocid())){
-                String  workprocid =  model.getWorkprocid();
-                if(!workprocid.startsWith(",")){
-                    workprocid = "'"+workprocid.replaceAll(",", "','").replaceAll(",", "','")+"'";
-                }
-                map.put("workprocid",workprocid);
-            }
+            map.put("workprocid",model.getWorkprocid());
             map.put("productid",model.getProductid());
             List list = emsProdplanMonthMapper.selectByParameters(map);
             if(list.size()>0){

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

@@ -7,6 +7,8 @@ import com.steerinfo.ems.emsprodplanmonth.mapper.EmsProdplanMonthMapper;
 import com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth;
 import com.steerinfo.ems.emsprodplanmonth.service.IEmsProdplanMonthService;
 import com.steerinfo.ems.emsprodplanround.mapper.EmsProdplanRoundMapper;
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
+import com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.math.BigDecimal;
+import java.util.stream.Collectors;
 
 /**
  * EmsProdplanRound RESTful接口:
@@ -106,7 +109,7 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             model.setCreateman(userId);
             model.setWorkprocType(model.getWorkprocType());
             emsProdplanRoundService.add(model);
-            emsGmPcJh.setState("2");
+            emsGmPcJh.setState("3");
             emsGmPcJh.setReceiveTime(new Date());
             emsGmPcJhMapper.updateByPrimaryKeySelective(emsGmPcJh);
         }
@@ -196,6 +199,9 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             if(model.getState().equals("1")){
                 return  failed(null,"存在已下发的计划,无法再次做下发");
             }
+            if (model.getAuditState().equals("3")) {
+                return  failed(null,"存在审核不通过的计划, 无法下发");
+            }
             model.setState("1");
             emsProdplanRoundMapper.updateByPrimaryKey(model);
         }
@@ -247,8 +253,8 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             if (model.getState().equals("1") || model.getState().equals("2")) {
                 return failed(null, "数据已下发或者被接收,无法删除");
             }
-            emsProdplanRoundMapper.deleteByPrimaryKey(model.getId());
-            deleteNbjh(model);
+             emsProdplanRoundMapper.deleteByPrimaryKey(model.getId());
+             updateNbjh(model);
         }
         return  success();
     }
@@ -281,8 +287,8 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
         return success(emsProdplanRounds);
     }
 
-    //如果是内部计划 则判断有没有轮次计划 做删除操作
-    public void deleteNbjh(EmsProdplanRound emsProdplanRound) {
+    public void updateNbjh(EmsProdplanRound emsProdplanRound) {
+        //如果是内部计划 则判断有没有轮次计划 做删除操作
         if (emsProdplanRound.getId().substring(0,1).equals("N")) {
             if (emsProdplanRound.getParentid() != null || !emsProdplanRound.getParentid().equals("")) {
                 Map<String,Object> map =  new HashMap();
@@ -293,5 +299,93 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
                 }
             }
         }
+        //如果是外部计划 则判断有没有轮次计划 做修改操作
+        if (emsProdplanRound.getId().substring(0,1).equals("G")) {
+            if (emsProdplanRound.getParentid() != null || !emsProdplanRound.getParentid().equals("")) {
+                Map<String,Object> map =  new HashMap();
+                map.put("parentid",emsProdplanRound.getParentid());
+                List list = emsProdplanRoundMapper.selectByParameters(map);
+                if (list.size()<1) {
+                    EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(emsProdplanRound.getParentid());
+                     emsGmPcJh.setState("2");
+                     emsGmPcJhMapper.updateByPrimaryKeySelective(emsGmPcJh);
+                }
+            }
+        }
+    }
+
+
+    @ApiOperation(value="获取列表", notes="审核页面分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsprodplanround:view")
+    @GetMapping(value = "/getAuditDate")
+    //获取未审核的数据
+    public RESTfulResult getAuditDateForPage (@RequestParam HashMap parmas,Integer pageNum, Integer pageSize) {
+        PageList list = emsProdplanRoundService.getAuditDateForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+
+    @ApiOperation(value="获取列表", notes="审核页面修改")
+    @PutMapping(value = "updateAuditState", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateAuditState(@RequestBody EmsProdplanRound[] models){
+        for (int i = 0; i < models.length; i++) {
+            EmsProdplanRound  model = models[i];
+            if(model.getState().equals("2")){
+                return failed(null,"操作失败,存在已经下发或者接收的计划");
+            }
+            EmsProdplanRound emsProdplanRound = emsProdplanRoundMapper.selectByPrimaryKey(model.getId());
+            if (emsProdplanRound.getAuditState().equals("1")){
+                return failed(null,"编号为"+model.getId()+"已经再审核中,请勿重复操作");
+            }
+            if (emsProdplanRound.getAuditState().equals("2")){
+                return  failed(null,"编号为"+model.getId()+"已经审核通过,请勿重复操作");
+            }
+            if(emsProdplanRound.getAuditState().equals("3")){
+                return failed(null,"编号为"+model.getId()+"审核失败,请勿重复操作");
+            }
+            model.setAuditState("1");
+             emsProdplanRoundService.updateAuditState(model);
+        }
+            return  success();
+    }
+    @ApiOperation(value="修改列表", notes="审核页面修改")
+    @PutMapping(value = "updateAudit", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateAudit(@RequestBody EmsProdplanRound[] models){
+        for (EmsProdplanRound model : models) {
+            if (model.getState().equals("2")) {
+                return failed("操作失败,编号为"+model.getId()+"已经接收");
+            }
+            emsProdplanRoundService.updateAuditState(model);
+        }
+        return success();
+    }
+    @ApiOperation(value="获取子节点", notes="销售订单重量调整")
+    @GetMapping(value = "/getRounds")
+    public RESTfulResult getRounds(@RequestParam HashMap parmas){
+        EmsProdplanRound emsProdplanRound =  new EmsProdplanRound();
+        emsProdplanRound.setParentid(parmas.get("parentid").toString());
+        List<EmsProdplanRound> rounds = emsProdplanRoundService.getRounds(emsProdplanRound);
+        Map<String,List<EmsProdplanRound>> stringListMap =
+                (HashMap<String, List<EmsProdplanRound>>) rounds.stream().collect(
+                        Collectors.groupingBy(EmsProdplanRound::getParentid)
+                );
+        List mapList = new ArrayList<>();
+        //数据,进行组装
+        mapList.add(stringListMap);
+        return success(mapList);
+    }
+
+    @PutMapping(value = "/addSave", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult addSave(@RequestBody EmsProdplanRound model){
+       if (model.getId() != null ) {
+           EmsProdplanRound emsProdplanRound = emsProdplanRoundMapper.selectByPrimaryKey(model.getId());
+            emsProdplanRound.setPlanWeight(model.getPlanWeight());
+            emsProdplanRoundMapper.updateByPrimaryKey(emsProdplanRound);
+            return success();
+       }
+       return failed();
     }
 }

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

@@ -5,6 +5,7 @@ import com.steerinfo.framework.mapper.IBaseMapper;
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.ibatis.annotations.Mapper;
 
@@ -12,6 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
 public interface EmsProdplanRoundMapper extends IBaseMapper<EmsProdplanRound, String> {
 
     EmsProdplanRound getbeyondWeight(HashMap<String,Object> parmas);
+
     EmsProdplanRound getSumPlanWeight(List ids);
     //获取编号
     String getMaxidAsGm(EmsProdplanRound emsProdplanRound);
@@ -25,4 +27,10 @@ public interface EmsProdplanRoundMapper extends IBaseMapper<EmsProdplanRound, St
     List<EmsProdplanRound> getdimension();
     //获取表面质量标准
     List<EmsProdplanRound> getsurfaceStandard();
+    //审核页面数据获取
+    List<Map<String, Object>> getAuditDate(HashMap<String, Object> parmas);
+    //审核
+    Integer updateAuditState(EmsProdplanRound emsProdplanRound);
+    //
+    List<EmsProdplanRound> getRounds(EmsProdplanRound emsProdplanRound);
 }

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

@@ -31,13 +31,15 @@
     <result column="DIMENSION" jdbcType="VARCHAR" property="dimension"/>
     <result column="STATUS" jdbcType="VARCHAR" property="status"/>
     <result column="ERR_MSG" jdbcType="VARCHAR" property="err_msg"/>
+    <result column="DELIVERY_DATE" jdbcType="TIMESTAMP" property="deliveryDate"/>
+    <result column="AUDITSTATE" jdbcType="VARCHAR" property="auditState"/>
     <result column="GOINFO" jdbcType="VARCHAR" property="goinfo"/>
     <result column="FETCH_PLAN_WEIGHT" jdbcType="DECIMAL" property="fetchPlanWeight"/>
   </resultMap>
   <sql id="columns">
     ID, MAY, SQNO, UNITID, DESCRIBE, STATE, GRADES, PLAN_WEIGHT, SPECIFICATIONS, LENGTHS, 
     CHEMICAL_STANDARD, SURFACE_STANDARD, MEMO, ISSUED_TIME, CREATEMAN, CREATETIME, UPDATEMAN, 
-    UPDATETIME, TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE, MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,STATUS,ERR_MSG,GOINFO,FETCH_PLAN_WEIGHT
+    UPDATETIME, TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE, MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,STATUS,ERR_MSG,GOINFO,FETCH_PLAN_WEIGHT,DELIVERY_DATE,AUDITSTATE
   </sql>
   <sql id="columns_alias">
     t.ID, t.MAY, t.SQNO, t.UNITID, t.DESCRIBE, t.STATE, t.GRADES, t.PLAN_WEIGHT, t.SPECIFICATIONS, 
@@ -283,7 +285,7 @@
       MEMO, ISSUED_TIME, CREATEMAN, 
       CREATETIME, UPDATEMAN, UPDATETIME, 
       TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE,
-      MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,GOINFO)
+      MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,GOINFO,DELIVERY_DATE,AUDITSTATE)
     values (#{id,jdbcType=VARCHAR}, #{may,jdbcType=TIMESTAMP}, #{sqno,jdbcType=DECIMAL},
       #{unitid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, 
       #{grades,jdbcType=VARCHAR}, #{planWeight,jdbcType=DECIMAL}, #{specifications,jdbcType=VARCHAR}, 
@@ -291,7 +293,10 @@
       #{memo,jdbcType=VARCHAR}, #{issuedTime,jdbcType=TIMESTAMP}, #{createman,jdbcType=VARCHAR}, 
       #{createtime,jdbcType=TIMESTAMP}, #{updateman,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, 
       #{transportType,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, #{workprocType,jdbcType=VARCHAR}, 
-      #{msgFlag,jdbcType=VARCHAR}, #{readFlag,jdbcType=VARCHAR},#{parentid,jdbcType=VARCHAR},#{iateralArea,jdbcType=VARCHAR},#{lengthTimesWidth,jdbcType=VARCHAR},#{dimension,jdbcType=VARCHAR},#{goinfo,jdbcType=VARCHAR})
+      #{msgFlag,jdbcType=VARCHAR}, #{readFlag,jdbcType=VARCHAR},#{parentid,jdbcType=VARCHAR},
+      #{iateralArea,jdbcType=VARCHAR},#{lengthTimesWidth,jdbcType=VARCHAR},
+      #{dimension,jdbcType=VARCHAR},#{goinfo,jdbcType=VARCHAR},
+      #{deliveryDate,jdbcType=TIMESTAMP},#{auditState,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
     insert into EMS_PRODPLAN_ROUND
@@ -748,4 +753,41 @@
              from ems_prodplan_round
             where SURFACE_STANDARD not like '%null%'
   </select>
+  <!---->
+  <select id="getAuditDate" parameterType="java.util.HashMap"  resultMap="BaseResultMap">
+    <include refid="select"/>
+    <where>
+      <if test="workprocType != null and workprocType != '' ">
+       and WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
+        and MAY BETWEEN  to_date(#{startTime},'yyyy-mm-dd') and to_date(#{endTime},'yyyy-mm-dd')
+      </if>
+        and AUDITSTATE in ('1','2','3')
+    </where>
+  </select>
+  <!---->
+  <select id="updateAuditState" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="Integer">
+    UPDATE ems_prodplan_round
+    <set>
+      <if test="auditState != null and auditState != '' ">
+        AUDITSTATE = #{auditState}
+      </if>
+    </set>
+    <where>
+      <if test="id != null and id != '' ">
+        ID = #{id}
+      </if>
+    </where>
+  </select>
+  <!---->
+  <select id="getRounds" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <where>
+      <if test="parentid != null and parentid != '' ">
+       and  parentid =#{parentid}
+      </if>
+      and  id like '%G-%'
+    </where>
+  </select>
 </mapper>

+ 21 - 0
src/main/java/com/steerinfo/ems/emsprodplanround/model/EmsProdplanRound.java

@@ -183,6 +183,27 @@ public class EmsProdplanRound implements IBasePO<String> {
     private String goinfo;
     @ApiModelProperty
     private BigDecimal  fetchPlanWeight;
+    //交货时间
+    @JSONField(format = "yyyy-mm-dd")
+    private Date deliveryDate;
+
+    public Date getDeliveryDate() {
+        return deliveryDate;
+    }
+
+    public void setDeliveryDate(Date deliveryDate) {
+        this.deliveryDate = deliveryDate;
+    }
+    //审核状态
+    private String auditState;
+
+    public String getAuditState() {
+        return auditState;
+    }
+
+    public void setAuditState(String auditState) {
+        this.auditState = auditState;
+    }
 
     public String getGoinfo() {
         return goinfo;

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

@@ -2,10 +2,13 @@ package com.steerinfo.ems.emsprodplanround.service;
 
 import com.steerinfo.framework.service.IBaseService;
 import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
+import com.steerinfo.framework.service.pagehelper.PageList;
+
 import java.util.Date;
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * EmsProdplanRound服务接口:
@@ -37,4 +40,11 @@ public interface IEmsProdplanRoundService extends IBaseService<EmsProdplanRound,
     List<EmsProdplanRound> getdimension();
     //获取表面质量标准
     List<EmsProdplanRound>getsurfaceStandard();
+    // 审核页面查询
+    PageList<Map<String, Object>> getAuditDateForPage(HashMap<String, Object> parmas, Integer pageNum,
+                                                       Integer pageSize);
+    //审核
+    Integer updateAuditState(EmsProdplanRound emsProdplanRound);
+    //
+    List<EmsProdplanRound> getRounds(EmsProdplanRound emsProdplanRound);
 }

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

@@ -5,12 +5,15 @@ import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
 import com.steerinfo.ems.emsprodplanround.mapper.EmsProdplanRoundMapper;
 import com.steerinfo.ems.emsprodplanround.service.IEmsProdplanRoundService;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import com.steerinfo.framework.service.pagehelper.PageList;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.Date;
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * EmsProdplanRound服务实现:
@@ -75,4 +78,22 @@ public class EmsProdplanRoundServiceImpl extends BaseServiceImpl<EmsProdplanRoun
     public List<EmsProdplanRound> getsurfaceStandard() {
         return emsProdplanRoundMapper.getsurfaceStandard();
     }
+
+    @Override
+    public PageList<Map<String, Object>> getAuditDateForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> auditDate = emsProdplanRoundMapper.getAuditDate(parmas);
+        PageList<Map<String,Object>> plist = new PageList<Map<String,Object>>(auditDate);
+        return plist;
+    }
+
+    @Override
+    public Integer updateAuditState(EmsProdplanRound emsProdplanRound) {
+        return emsProdplanRoundMapper.updateAuditState(emsProdplanRound);
+    }
+
+    @Override
+    public List<EmsProdplanRound> getRounds(EmsProdplanRound emsProdplanRound) {
+        return emsProdplanRoundMapper.getRounds(emsProdplanRound);
+    }
 }

+ 211 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/controller/EmsProdplanWeightAdjustmentController.java

@@ -0,0 +1,211 @@
+package com.steerinfo.ems.emsprodplanweightadjustment.controller;
+
+import com.steerinfo.auth.utils.JwtUtil;
+import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
+import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
+import com.steerinfo.ems.emsprodplanweightadjustment.service.IEmsProdplanWeightAdjustmentService;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanWeightAdjustment RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-22 05:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-22
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanWeightAdjustment RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/emsprodplanweightadjustments")
+public class EmsProdplanWeightAdjustmentController extends BaseRESTfulController {
+
+    @Autowired
+    IEmsProdplanWeightAdjustmentService emsProdplanWeightAdjustmentService;
+    @Autowired
+    EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
+    @Autowired
+    EmsGmPcJhMapper emsGmPcJhMapper;
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsprodplanweightadjustment:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanWeightAdjustment> list = emsProdplanWeightAdjustmentService.queryForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsprodplanweightadjustment:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanWeightAdjustment> list = emsProdplanWeightAdjustmentService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据EmsProdplanWeightAdjustment对象创建")
+    @ApiImplicitParam(name = "emsProdplanWeightAdjustment", value = "详细实体emsProdplanWeightAdjustment", required = true, dataType = "EmsProdplanWeightAdjustment")
+    //@RequiresPermissions("emsprodplanweightadjustment:create")
+    @PostMapping(value = "/")
+    public RESTfulResult add(@ModelAttribute EmsProdplanWeightAdjustment model){
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentService.add(model);
+        return success(emsProdplanWeightAdjustment);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanweightadjustment:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentService.getById(id);
+        return success(emsProdplanWeightAdjustment);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanWeightAdjustment信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "emsProdplanWeightAdjustment", value = "详细实体emsProdplanWeightAdjustment", required = true, dataType = "EmsProdplanWeightAdjustment")
+    })
+    //@RequiresPermissions("emsprodplanweightadjustment:update")
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody EmsProdplanWeightAdjustment model){
+        model.setId(id);
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentService.modify(model);
+        return success(emsProdplanWeightAdjustment);
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanweightadjustment:delete")
+    @DeleteMapping(value = "/{id}")//String
+    public RESTfulResult delete(@PathVariable String id){
+    	List<String> list = Arrays.asList(id.split(","));
+    	if(ListUtils.isNotEmpty(list)) {
+	    	List<String> ids = ListUtils.convertList(list);
+			  emsProdplanWeightAdjustmentService.delete(ids);
+    	}
+      return success();
+    }
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanWeightAdjustment信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "emsProdplanWeightAdjustment", value = "详细实体emsProdplanWeightAdjustment", required = true, dataType = "EmsProdplanWeightAdjustment")
+    })
+    @PutMapping(value = "/submitaudit",produces = "application/json;charset=UTF-8")
+    public RESTfulResult submitaudit(@RequestBody EmsProdplanWeightAdjustment[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (EmsProdplanWeightAdjustment model : models) {
+            EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("1")) {
+                return failed(null,"领导部门还未审批,请勿重复操作");
+            }
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("2")) {
+                return failed(null,"该计划领导部门已经审批,请勿重复操作");
+            }
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("3")) {
+                return failed(null,"该计划生产部已经同意,请勿重复操作");
+            }
+            emsProdplanWeightAdjustment.setSubmitter(userId);
+            emsProdplanWeightAdjustment.setReviewerTime(new Date());
+            emsProdplanWeightAdjustment.setAuditStatus(model.getAuditStatus());
+            emsProdplanWeightAdjustment.setRecordWeight(emsProdplanWeightAdjustment.getPlanWeight());
+            emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
+        }
+            return success(null,"提交成功");
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanWeightAdjustment信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "emsProdplanWeightAdjustment", value = "详细实体emsProdplanWeightAdjustment", required = true, dataType = "EmsProdplanWeightAdjustment")
+    })
+    @PutMapping(value = "approval/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult approval(@PathVariable String id){
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(id);
+        if (emsProdplanWeightAdjustment != null ) {
+           if (emsProdplanWeightAdjustment.getAuditStatus().equals("2")) {
+               return failed(null,"该计划领导部门已经审批,请勿重复操作");
+           }
+           if (emsProdplanWeightAdjustment.getAuditStatus().equals("3")) {
+               return failed(null,"该计划生产部已经审批,请勿重复操作");
+           }
+           if(emsProdplanWeightAdjustment.getAuditStatus().equals("4")){
+               return failed(null,"该计划审核失败,请勿重复操作");
+           }
+            emsProdplanWeightAdjustment.setAuditStatus("2");
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
+        }
+        return success();
+    }
+
+    @PutMapping(value = "agreement/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult agreement(@PathVariable String id){
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(id);
+        if (emsProdplanWeightAdjustment != null ) {
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("0")) {
+                return failed(null,"该计划还未走审批流程,操作失败");
+            }
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("1")) {
+                return failed(null,"领导部门还未审批,操作失败");
+            }
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("3")) {
+                return failed(null,"该计划生产部已经审批,请勿重复操作");
+            }
+            if(emsProdplanWeightAdjustment.getAuditStatus().equals("4")){
+                return failed(null,"该计划审核失败,请勿重复操作");
+            }
+            EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(id);
+            emsGmPcJh.setPlanWeight(emsProdplanWeightAdjustment.getPlanWeight());
+            emsProdplanWeightAdjustment.setAuditStatus("3");
+            emsProdplanWeightAdjustment.setPlanWeightOld(emsProdplanWeightAdjustment.getRecordWeight());
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
+            emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
+        }
+            return success();
+    }
+    @PutMapping(value = "rejected/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult rejected(@PathVariable String id){
+        EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(id);
+        if (emsProdplanWeightAdjustment != null ) {
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("0")) {
+                return failed(null,"该计划还未走审批流程,操作失败");
+            }
+            if (emsProdplanWeightAdjustment.getAuditStatus().equals("1")) {
+                return failed(null, "领导部门还未审批,操作失败");
+            }
+            if(emsProdplanWeightAdjustment.getAuditStatus().equals("4")){
+                return failed(null,"该计划审核失败,请勿重复操作");
+            }
+            emsProdplanWeightAdjustment.setPlanWeight(emsProdplanWeightAdjustment.getPlanWeightOld());
+            emsProdplanWeightAdjustment.setAuditStatus("4");
+            emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
+        }
+            return success();
+    }
+
+}

+ 11 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/mapper/EmsProdplanWeightAdjustmentMapper.java

@@ -0,0 +1,11 @@
+package com.steerinfo.ems.emsprodplanweightadjustment.mapper;
+
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EmsProdplanWeightAdjustmentMapper extends IBaseMapper<EmsProdplanWeightAdjustment, String> {
+
+}

+ 292 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/mapper/EmsProdplanWeightAdjustmentMapper.xml

@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment">
+    <id column="ID" jdbcType="VARCHAR" property="id" />
+    <result column="PLAN_WEIGHT" jdbcType="DECIMAL" property="planWeight" />
+    <result column="PLAN_WEIGHT_OLD" jdbcType="DECIMAL" property="planWeightOld" />
+    <result column="SUBMITTER" jdbcType="VARCHAR" property="submitter" />
+    <result column="SUBMIT_TIME" jdbcType="TIMESTAMP" property="submitTime" />
+    <result column="REVIEWER" jdbcType="VARCHAR" property="reviewer" />
+    <result column="REVIEWER_TIME" jdbcType="TIMESTAMP" property="reviewerTime" />
+    <result column="AUDIT_STATUS" jdbcType="VARCHAR" property="auditStatus" />
+    <result column="RECORD_WEIGHT" jdbcType="DECIMAL" property="recordWeight"/>
+  </resultMap>
+  <sql id="columns">
+    ID, PLAN_WEIGHT, PLAN_WEIGHT_OLD, SUBMITTER, SUBMIT_TIME, REVIEWER, REVIEWER_TIME, 
+    AUDIT_STATUS,RECORD_WEIGHT
+  </sql>
+  <sql id="columns_alias">
+    t.ID, t.PLAN_WEIGHT, t.PLAN_WEIGHT_OLD, t.SUBMITTER, t.SUBMIT_TIME, t.REVIEWER, t.REVIEWER_TIME, 
+    t.AUDIT_STATUS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_WEIGHT_ADJUSTMENT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID = #{id}
+      </if>
+      <if test="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="planWeightOld != null">
+        and PLAN_WEIGHT_OLD = #{planWeightOld}
+      </if>
+      <if test="submitter != null and submitter != ''">
+        and SUBMITTER = #{submitter}
+      </if>
+      <if test="submitTime != null">
+        and TO_CHAR(SUBMIT_TIME,'yyyy-MM-dd') = #{submitTime}
+      </if>
+      <if test="reviewer != null and reviewer != ''">
+        and REVIEWER = #{reviewer}
+      </if>
+      <if test="reviewerTime != null">
+        and TO_CHAR(REVIEWER_TIME,'yyyy-MM-dd') = #{reviewerTime}
+      </if>
+      <if test="auditStatus != null and auditStatus != ''">
+        and AUDIT_STATUS = #{auditStatus}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID LIKE '%${id}%'
+      </if>
+      <if test="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="planWeightOld != null">
+        and PLAN_WEIGHT_OLD = #{planWeightOld}
+      </if>
+      <if test="submitter != null and submitter != ''">
+        and SUBMITTER LIKE '%${submitter}%'
+      </if>
+      <if test="submitTime != null">
+        and TO_CHAR(SUBMIT_TIME,'yyyy-MM-dd') = #{submitTime}
+      </if>
+      <if test="reviewer != null and reviewer != ''">
+        and REVIEWER LIKE '%${reviewer}%'
+      </if>
+      <if test="reviewerTime != null">
+        and TO_CHAR(REVIEWER_TIME,'yyyy-MM-dd') = #{reviewerTime}
+      </if>
+      <if test="auditStatus != null and auditStatus != ''">
+        and AUDIT_STATUS LIKE '%${auditStatus}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    where 1!=1 
+      <if test="planWeight != null">
+        or PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="planWeightOld != null">
+        or PLAN_WEIGHT_OLD = #{planWeightOld}
+      </if>
+      <if test="submitter != null and submitter != ''">
+        or SUBMITTER = #{submitter}
+      </if>
+      <if test="submitTime != null">
+        or TO_CHAR(SUBMIT_TIME,'yyyy-MM-dd') = '#{submitTime}'
+      </if>
+      <if test="reviewer != null and reviewer != ''">
+        or REVIEWER = #{reviewer}
+      </if>
+      <if test="reviewerTime != null">
+        or TO_CHAR(REVIEWER_TIME,'yyyy-MM-dd') = '#{reviewerTime}'
+      </if>
+      <if test="auditStatus != null and auditStatus != ''">
+        or AUDIT_STATUS = #{auditStatus}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment">
+    insert into EMS_PRODPLAN_WEIGHT_ADJUSTMENT (ID, PLAN_WEIGHT, PLAN_WEIGHT_OLD, 
+      SUBMITTER, SUBMIT_TIME, REVIEWER, 
+      REVIEWER_TIME, AUDIT_STATUS,RECORD_WEIGHT)
+    values (#{id,jdbcType=VARCHAR}, #{planWeight,jdbcType=DECIMAL}, #{planWeightOld,jdbcType=DECIMAL}, 
+      #{submitter,jdbcType=VARCHAR}, #{submitTime,jdbcType=TIMESTAMP}, #{reviewer,jdbcType=VARCHAR}, 
+      #{reviewerTime,jdbcType=TIMESTAMP}, #{auditStatus,jdbcType=VARCHAR},#{recordWeight,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment">
+    insert into EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="planWeight != null">
+        PLAN_WEIGHT,
+      </if>
+      <if test="planWeightOld != null">
+        PLAN_WEIGHT_OLD,
+      </if>
+      <if test="submitter != null">
+        SUBMITTER,
+      </if>
+      <if test="submitTime != null">
+        SUBMIT_TIME,
+      </if>
+      <if test="reviewer != null">
+        REVIEWER,
+      </if>
+      <if test="reviewerTime != null">
+        REVIEWER_TIME,
+      </if>
+      <if test="auditStatus != null">
+        AUDIT_STATUS,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="planWeight != null">
+        #{planWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="planWeightOld != null">
+        #{planWeightOld,jdbcType=DECIMAL},
+      </if>
+      <if test="submitter != null">
+        #{submitter,jdbcType=VARCHAR},
+      </if>
+      <if test="submitTime != null">
+        #{submitTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="reviewer != null">
+        #{reviewer,jdbcType=VARCHAR},
+      </if>
+      <if test="reviewerTime != null">
+        #{reviewerTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="auditStatus != null">
+        #{auditStatus,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment">
+    update EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    set PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      PLAN_WEIGHT_OLD = #{planWeightOld,jdbcType=DECIMAL},
+      SUBMITTER = #{submitter,jdbcType=VARCHAR},
+      SUBMIT_TIME = #{submitTime,jdbcType=TIMESTAMP},
+      REVIEWER = #{reviewer,jdbcType=VARCHAR},
+      REVIEWER_TIME = #{reviewerTime,jdbcType=TIMESTAMP},
+      AUDIT_STATUS = #{auditStatus,jdbcType=VARCHAR},
+      RECORD_WEIGHT = #{recordWeight,jdbcType=DECIMAL}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment">
+    update EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    <set>
+      <if test="planWeight != null">
+        PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="planWeightOld != null">
+        PLAN_WEIGHT_OLD = #{planWeightOld,jdbcType=DECIMAL},
+      </if>
+      <if test="submitter != null">
+        SUBMITTER = #{submitter,jdbcType=VARCHAR},
+      </if>
+      <if test="submitTime != null">
+        SUBMIT_TIME = #{submitTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="reviewer != null">
+        REVIEWER = #{reviewer,jdbcType=VARCHAR},
+      </if>
+      <if test="reviewerTime != null">
+        REVIEWER_TIME = #{reviewerTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="auditStatus != null">
+        AUDIT_STATUS = #{auditStatus,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into EMS_PRODPLAN_WEIGHT_ADJUSTMENT 
+      (ID, 
+      PLAN_WEIGHT, PLAN_WEIGHT_OLD, SUBMITTER, 
+      SUBMIT_TIME, REVIEWER, REVIEWER_TIME, 
+      AUDIT_STATUS)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.id,jdbcType=VARCHAR}, 
+      #{item.planWeight,jdbcType=DECIMAL}, #{item.planWeightOld,jdbcType=DECIMAL}, #{item.submitter,jdbcType=VARCHAR}, 
+      #{item.submitTime,jdbcType=TIMESTAMP}, #{item.reviewer,jdbcType=VARCHAR}, #{item.reviewerTime,jdbcType=TIMESTAMP}, 
+      #{item.auditStatus,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+     set
+       ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
+       </foreach>
+       ,PLAN_WEIGHT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.planWeight,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN_WEIGHT_OLD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.planWeightOld,jdbcType=DECIMAL}
+       </foreach>
+       ,SUBMITTER=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.submitter,jdbcType=VARCHAR}
+       </foreach>
+       ,SUBMIT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.submitTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,REVIEWER=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.reviewer,jdbcType=VARCHAR}
+       </foreach>
+       ,REVIEWER_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.reviewerTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,AUDIT_STATUS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.auditStatus,jdbcType=VARCHAR}
+       </foreach>
+     where ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.id,jdbcType=VARCHAR}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from EMS_PRODPLAN_WEIGHT_ADJUSTMENT
+    where ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>

+ 156 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/model/EmsProdplanWeightAdjustment.java

@@ -0,0 +1,156 @@
+package com.steerinfo.ems.emsprodplanweightadjustment.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="null")
+public class EmsProdplanWeightAdjustment implements IBasePO<String> {
+    /**
+     * 主键(ID,VARCHAR,100)
+     */
+    @ApiModelProperty(value="主键",required=true)
+    private String id;
+
+    /**
+     * 计划量(PLAN_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计划量",required=false)
+    private BigDecimal planWeight;
+
+    /**
+     * 初始计划量(PLAN_WEIGHT_OLD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="初始计划量",required=false)
+    private BigDecimal planWeightOld;
+
+    /**
+     * 提交人(SUBMITTER,VARCHAR,100)
+     */
+    @ApiModelProperty(value="提交人",required=false)
+    private String submitter;
+
+    /**
+     * 提交时间(SUBMIT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="提交时间",required=false)
+    private Date submitTime;
+
+    /**
+     * 审核人(REVIEWER,VARCHAR,100)
+     */
+    @ApiModelProperty(value="审核人",required=false)
+    private String reviewer;
+
+    /**
+     * 审核时间(REVIEWER_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="审核时间",required=false)
+    private Date reviewerTime;
+
+    /**
+     * 状态(0未通过1已通过)(AUDIT_STATUS,VARCHAR,2)
+     */
+    @ApiModelProperty(value="状态(0未通过1已通过)",required=false)
+    private String auditStatus;
+
+    @ApiModelProperty(value = "保留上一次重量",required = false)
+    private BigDecimal recordWeight;
+
+    public BigDecimal getRecordWeight() {
+        return recordWeight;
+    }
+
+    public void setRecordWeight(BigDecimal recordWeight) {
+        this.recordWeight = recordWeight;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+
+    public BigDecimal getPlanWeight() {
+        return planWeight;
+    }
+
+    public void setPlanWeight(BigDecimal planWeight) {
+        this.planWeight = planWeight;
+    }
+
+    public BigDecimal getPlanWeightOld() {
+        return planWeightOld;
+    }
+
+    public void setPlanWeightOld(BigDecimal planWeightOld) {
+        this.planWeightOld = planWeightOld;
+    }
+
+    public String getSubmitter() {
+        return submitter;
+    }
+
+    public void setSubmitter(String submitter) {
+        this.submitter = submitter == null ? null : submitter.trim();
+    }
+
+    public Date getSubmitTime() {
+        return submitTime;
+    }
+
+    public void setSubmitTime(Date submitTime) {
+        this.submitTime = submitTime;
+    }
+
+    public String getReviewer() {
+        return reviewer;
+    }
+
+    public void setReviewer(String reviewer) {
+        this.reviewer = reviewer == null ? null : reviewer.trim();
+    }
+
+    public Date getReviewerTime() {
+        return reviewerTime;
+    }
+
+    public void setReviewerTime(Date reviewerTime) {
+        this.reviewerTime = reviewerTime;
+    }
+
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus == null ? null : auditStatus.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", planWeight=").append(planWeight);
+        sb.append(", planWeightOld=").append(planWeightOld);
+        sb.append(", submitter=").append(submitter);
+        sb.append(", submitTime=").append(submitTime);
+        sb.append(", reviewer=").append(reviewer);
+        sb.append(", reviewerTime=").append(reviewerTime);
+        sb.append(", auditStatus=").append(auditStatus);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 23 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/service/IEmsProdplanWeightAdjustmentService.java

@@ -0,0 +1,23 @@
+package com.steerinfo.ems.emsprodplanweightadjustment.service;
+
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanWeightAdjustment服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-22 05:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-22
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanWeightAdjustment服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IEmsProdplanWeightAdjustmentService extends IBaseService<EmsProdplanWeightAdjustment, String>{
+
+}

+ 36 - 0
src/main/java/com/steerinfo/ems/emsprodplanweightadjustment/service/impl/EmsProdplanWeightAdjustmentServiceImpl.java

@@ -0,0 +1,36 @@
+package com.steerinfo.ems.emsprodplanweightadjustment.service.impl;
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
+import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
+import com.steerinfo.ems.emsprodplanweightadjustment.service.IEmsProdplanWeightAdjustmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanWeightAdjustment服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-22 05:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-22
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanWeightAdjustment服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsProdplanWeightAdjustmentService")
+public class EmsProdplanWeightAdjustmentServiceImpl extends BaseServiceImpl<EmsProdplanWeightAdjustment, String> implements IEmsProdplanWeightAdjustmentService {
+
+    @Autowired
+    private EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
+
+    @Override
+    protected IBaseMapper<EmsProdplanWeightAdjustment, String> getMapper() {
+        return emsProdplanWeightAdjustmentMapper;
+    }
+}

+ 1 - 1
src/main/java/com/steerinfo/ems/emswaterrealtime/service/IEmsWaterRealtimeService.java

@@ -23,7 +23,7 @@ public interface IEmsWaterRealtimeService extends IBaseService<EmsWaterRealtime,
 
     List<EmsWaterRealtime> getWaterListByArmMeter();
 
-   int dataGeneration();
+    int dataGeneration();
 
     void getcalpoint();
 

+ 30 - 30
src/main/java/com/steerinfo/task/SpringCronTask.java

@@ -254,36 +254,36 @@ public class SpringCronTask implements SchedulingConfigurer{
 					 tCm0318Service.getDataAsWscj(DateUtils.getDate());
 					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
 				}
-				 else if(taskId.equalsIgnoreCase("120")){
-					 // 获取大用户水系统数据 5分钟一次
-					 long start = new Date().getTime();
-					 emsWaterRealtimeService.getWaterListByArmMeter();
-					 emsWaterRealtimeService.dataGeneration();
-					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
-				 } else if(taskId.equalsIgnoreCase("121")){
-					 // 根据计量点配置生成水数据 10分钟一次
-					 long start = new Date().getTime();
-					 emsWaterRealtimeService.getWaterTenMinutes();
-					 try {
-						 emsWaterRealtimeService.getWaterListToMosaic();
-					 } catch (AxisFault e) {
-						 e.printStackTrace();
-					 } finally {
-						 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
-					 }
-				 }
-				 else if(taskId.equalsIgnoreCase("116")){
-					// 动力、水(计量点)小时表定时统计(自动补全24小时内的小时用量值)
-					long start = new Date().getTime();
-					tRmCalpointService.statHourData();
-					logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
-				}
-				 else if (taskId.equalsIgnoreCase("102")) {
-					 // 计量点定时任务(天)
-					 long start = new Date().getTime();
-					 tRmCalpointValueService.statData(new Date());
-					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
-				 }
+//				 else if(taskId.equalsIgnoreCase("120")){
+//					 // 获取大用户水系统数据 5分钟一次
+//					 long start = new Date().getTime();
+//					 emsWaterRealtimeService.getWaterListByArmMeter();
+//					 emsWaterRealtimeService.dataGeneration();
+//					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
+//				 } else if(taskId.equalsIgnoreCase("121")){
+//					 // 根据计量点配置生成水数据 10分钟一次
+//					 long start = new Date().getTime();
+//					 emsWaterRealtimeService.getWaterTenMinutes();
+//					 try {
+//						 emsWaterRealtimeService.getWaterListToMosaic();
+//					 } catch (AxisFault e) {
+//						 e.printStackTrace();
+//					 } finally {
+//						 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
+//					 }
+//				 }
+//				 else if(taskId.equalsIgnoreCase("116")){
+//					// 动力、水(计量点)小时表定时统计(自动补全24小时内的小时用量值)
+//					long start = new Date().getTime();
+//					tRmCalpointService.statHourData();
+//					logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
+//				}
+//				 else if (taskId.equalsIgnoreCase("102")) {
+//					 // 计量点定时任务(天)
+//					 long start = new Date().getTime();
+//					 tRmCalpointValueService.statData(new Date());
+//					 logger.info("定时任务"+taskId+"执行时长:" + (new Date().getTime() - start)/1000 + "秒");
+//				 }
 //				 else if (taskId.equalsIgnoreCase("106")) {
 //					// 获取MES水质监测数据
 //					long start = new Date().getTime();