Browse Source

Merge branch 'master' of https://git.steerinfo.com/XTEMS/xt-ems-api

QuietShadow 3 năm trước cách đây
mục cha
commit
3fc5d2f3e6
21 tập tin đã thay đổi với 1735 bổ sung59 xóa
  1. 1 1
      pom.xml
  2. 0 1
      src/main/java/com/steerinfo/auth/shiro/realm/OssServiceClient.java
  3. 2 0
      src/main/java/com/steerinfo/ems/dispatchplog/service/impl/DispatchPLogServiceImpl.java
  4. 261 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java
  5. 20 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.java
  6. 745 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml
  7. 417 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/model/EmsGmPcJh.java
  8. 32 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/service/IEmsGmPcJhService.java
  9. 59 0
      src/main/java/com/steerinfo/ems/emsgmpcjh/service/impl/EmsGmPcJhServiceImpl.java
  10. 2 2
      src/main/java/com/steerinfo/ems/emsprodplanmonth/mapper/EmsProdplanMonthMapper.xml
  11. 85 41
      src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java
  12. 13 2
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.java
  13. 39 2
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.xml
  14. 12 3
      src/main/java/com/steerinfo/ems/emsprodplanround/model/EmsProdplanRound.java
  15. 13 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/IEmsProdplanRoundService.java
  16. 30 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/impl/EmsProdplanRoundServiceImpl.java
  17. 1 1
      src/main/java/com/steerinfo/ems/tcm0325/controller/TCm0325Controller.java
  18. 0 1
      src/main/java/com/steerinfo/feigen/model/LgWeight.java
  19. 1 1
      src/main/java/com/steerinfo/feigen/service/BfhydFeigenService.java
  20. 1 3
      src/main/java/com/steerinfo/feigen/service/LgWeightFeigenService.java
  21. 1 1
      src/main/resources/bootstrap.yml

+ 1 - 1
pom.xml

@@ -214,7 +214,7 @@
 <!--				  <password>123456</password>-->
 <!--				  <targetPackage>com.steerinfo.ems</targetPackage>-->
 <!--				  <tables>-->
-<!--					<param>EMS_WATER_REALTIME</param>-->
+<!--					<param>EMS_GM_PC_JH</param>-->
 <!--				  </tables>-->
 <!--				</configuration>-->
 <!--				<executions>-->

+ 0 - 1
src/main/java/com/steerinfo/auth/shiro/realm/OssServiceClient.java

@@ -12,7 +12,6 @@ import com.steerinfo.framework.controller.RESTfulResult;
 public interface OssServiceClient {
 
 	@RequestMapping(value="/v1/sysusers/{id}", method=RequestMethod.GET)
-
     public RESTfulResult getUser(@PathVariable("id") String id);
 	
 	@RequestMapping(value="/v1/sysusers/user/token/", method=RequestMethod.GET)

+ 2 - 0
src/main/java/com/steerinfo/ems/dispatchplog/service/impl/DispatchPLogServiceImpl.java

@@ -1,5 +1,7 @@
 package com.steerinfo.ems.dispatchplog.service.impl;
 
+import com.steerinfo.framework.datasource.DataSourceKey;
+import com.steerinfo.framework.datasource.TargetDataSource;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.ems.dispatchplog.model.DispatchPLog;

+ 261 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java

@@ -0,0 +1,261 @@
+package com.steerinfo.ems.emsgmpcjh.controller;
+
+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.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.rmi.MarshalledObject;
+import java.util.*;
+
+/**
+ * EmsGmPcJh RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-10 07:00
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-10
+ * 作者:generator
+ * 参考:
+ * 描述:EmsGmPcJh RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/emsgmpcjhs")
+public class EmsGmPcJhController extends BaseRESTfulController {
+    private static  final  String AT2005 = "G-G1-";
+    private static  final  String AT2006 = "G-G2-";
+    private static  final  String AT2004 = "G-L1-";
+    private static  final  String AT2007 = "G-X1-";
+
+    @Autowired
+    IEmsGmPcJhService emsGmPcJhService;
+    @Autowired
+    EmsGmPcJhMapper emsGmPcJhMapper;
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsgmpcjh:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsGmPcJh> list = emsGmPcJhService.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("emsgmpcjh:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsGmPcJh> list = emsGmPcJhService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+
+    @ApiOperation(value="创建", notes="根据EmsGmPcJh对象创建GM计划")
+    @ApiImplicitParam(name = "emsGmPcJh", value = "详细实体emsGmPcJh", required = true, dataType = "EmsGmPcJh")
+    //@RequiresPermissions("emsgmpcjh:create")
+    @PostMapping(value = "/")
+    public RESTfulResult add(@RequestBody EmsGmPcJh model){
+        String userId = JwtUtil.getUseridByToken();
+        String yyyymmdd = DateUtils.dateStr(model.getJhTime(), "yyyyMMdd");
+        model.setStartTime(yyyymmdd);
+        model.setType(this.getType(model));
+        String maxid = emsGmPcJhService.getMaxid(model);
+        model.setId(maxid);
+        model.setKxfWeight(model.getPlanWeight());
+        model.setYxfWeight(new BigDecimal("0"));
+        model.setCreateTime(new Date());
+        model.setCreateMan(userId);
+        EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
+        return success(emsGmPcJh);
+    }
+
+    @ApiOperation(value="创建", notes="根据EmsGmPcJh对象创建GM计划")
+    @ApiImplicitParam(name = "emsGmPcJh", value = "详细实体emsGmPcJh", required = true, dataType = "EmsGmPcJh")
+    //@RequiresPermissions("emsgmpcjh:create")
+    @PostMapping(value = "/addNbJH")
+    public RESTfulResult addNbJH(@RequestBody EmsGmPcJh model){
+        String userId = JwtUtil.getUseridByToken();
+        String yyyymmdd = DateUtils.dateStr(model.getJhTime(), "yyyyMMdd");
+        model.setStartTime(yyyymmdd);
+        model.setType(this.getNbJH(model));
+        String maxid = emsGmPcJhService.getMaxid(model);
+        model.setId(maxid);
+        model.setPlanWeight(model.getPlanWeight() == null ? new BigDecimal("0"): model.getPlanWeight());
+        model.setKxfWeight(model.getPlanWeight() == null ? new BigDecimal("0"): model.getPlanWeight());
+        model.setYxfWeight(new BigDecimal("0"));
+        model.setCreateTime(new Date());
+        model.setState("1");
+        model.setCreateMan(userId);
+        EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
+        return success(emsGmPcJh);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsgmpcjh:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        EmsGmPcJh emsGmPcJh = emsGmPcJhService.getById(id);
+        return success(emsGmPcJh);
+    }
+
+    @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 = "/batchupdate", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@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 (model.getState().equals("1")) {
+                return failed(model, "计划号为:" + model.getId() + "已下发无法做修改操作,请取消下发");
+            }
+            model.setYxfWeight(new BigDecimal("0"));
+            model.setKxfWeight(model.getPlanWeight());
+            model.setUpdateMan(userId);
+            model.setUpdateTime(new Date());
+            emsGmPcJhMapper.updateByPrimaryKey(model);
+        }
+        return success();
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsgmpcjh:delete")
+    @DeleteMapping(value = "/delete",produces  = "application/json;charset=UTF-8")//String
+    public RESTfulResult delete(@RequestBody EmsGmPcJh[] models){
+        for (EmsGmPcJh model : models) {
+            EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
+            if(emsGmPcJh.getState().equals("2")) {
+                return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
+            }
+            if (model.getState().equals("1")) {
+                return failed(model,"计划号为:"+model.getId()+"已下发无法做删除操作,请取消下发");
+            }
+            emsGmPcJhMapper.deleteByPrimaryKey(model.getId());
+        }
+        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 = "/updatestate", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updatestate(@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()+"已经接收");
+            }
+            model.setYxfWeight(new BigDecimal("0"));
+            model.setKxfWeight(model.getPlanWeight());
+            model.setUpdateTime(new Date());
+            model.setUpdateMan(userId);
+            emsGmPcJhService.updateState(model);
+        }
+        return success();
+    }
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    @GetMapping("/getGmDates")
+    public RESTfulResult getGmDates(@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>> gmPcJhDataForPage = emsGmPcJhService.getGmPcJhDataForPage(parmas, pageNum, pageSize);
+        return success(gmPcJhDataForPage);
+    }
+
+    @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 = "/batchcopy", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult batchcopy(@RequestBody EmsGmPcJh[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (EmsGmPcJh model : models) {
+            String yyyymmdd = DateUtils.dateStr(model.getJhTime(), "yyyyMMdd");
+            model.setStartTime(yyyymmdd);
+            model.setType(this.getType(model));
+            String maxid = emsGmPcJhService.getMaxid(model);
+            model.setId(maxid);
+            model.setState("0");
+            model.setKxfWeight(model.getPlanWeight());
+            model.setYxfWeight(new BigDecimal("0"));
+            model.setUpdateTime(null);
+            model.setUpdateMan(null);
+            model.setCreateTime(new Date());
+            model.setCreateMan(userId);
+            emsGmPcJhService.add(model);
+        }
+        return success();
+    }
+
+    public String getType (EmsGmPcJh emsGmPcJh){
+        if (emsGmPcJh.getWorkprocType().equals("AT2004")){
+            return AT2004;
+        }
+        if(emsGmPcJh.getWorkprocType().equals("AT2005")){
+            return AT2005;
+        }
+        if (emsGmPcJh.getWorkprocType().equals("AT2006")){
+            return AT2006;
+        }
+        if (emsGmPcJh.getWorkprocType().equals("AT2007")) {
+            return  AT2007;
+        }
+        return null;
+    }
+    public String getNbJH (EmsGmPcJh emsGmPcJh){
+        if (emsGmPcJh.getWorkprocType().equals("AT2004")){
+            return "N-L1-";
+        }
+        if(emsGmPcJh.getWorkprocType().equals("AT2005")){
+            return "N-G1-";
+        }
+        if (emsGmPcJh.getWorkprocType().equals("AT2006")){
+            return "N-G2-";
+        }
+        if (emsGmPcJh.getWorkprocType().equals("AT2007")) {
+            return  "N-X1-";
+        }
+        return null;
+    }
+}

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

@@ -0,0 +1,20 @@
+package com.steerinfo.ems.emsgmpcjh.mapper;
+
+import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.framework.mapper.IBaseMapper;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EmsGmPcJhMapper extends IBaseMapper<EmsGmPcJh, String> {
+    //获取国贸编号
+    String getMaxid(EmsGmPcJh emsGmPcJh);
+    //下发与取消下发
+    int  updateState(EmsGmPcJh emsGmPcJh);
+    //轮次计划页面查询
+    List<Map<String, Object>> getGmPcJhData(HashMap<String, Object> parmas);
+}

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

@@ -0,0 +1,745 @@
+<?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.emsgmpcjh.mapper.EmsGmPcJhMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    <id column="ID" jdbcType="VARCHAR" property="id" />
+    <result column="JH_TIME" jdbcType="DATE" property="jhTime" />
+    <result column="STATE" jdbcType="VARCHAR" property="state" />
+    <result column="GRADES" jdbcType="VARCHAR" property="grades" />
+    <result column="SPECIFICATIONS" jdbcType="VARCHAR" property="specifications" />
+    <result column="LENGTHS" jdbcType="DECIMAL" property="lengths" />
+    <result column="CHEMICAL_STANDARD" jdbcType="VARCHAR" property="chemicalStandard" />
+    <result column="SURFACE_STANDARD" jdbcType="VARCHAR" property="surfaceStandard" />
+    <result column="WORKPROC_TYPE" jdbcType="VARCHAR" property="workprocType" />
+    <result column="IATERAL_AREA" jdbcType="VARCHAR" property="iateralArea" />
+    <result column="LENGTH_TIMES_WIDTH" jdbcType="VARCHAR" property="lengthTimesWidth" />
+    <result column="TRANSPORT_TYPE" jdbcType="VARCHAR" property="transportType" />
+    <result column="RECEIVE_TIME" jdbcType="TIMESTAMP" property="receiveTime" />
+    <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
+    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="UPDATE_MAN" jdbcType="VARCHAR" property="updateMan" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="PURPOSE" jdbcType="VARCHAR" property="purpose" />
+    <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
+    <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="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, 
+    YXF_WEIGHT, PLAN_WEIGHT
+  </sql>
+  <sql id="columns_alias">
+    t.ID, t.JH_TIME, t.STATE, t.GRADES, t.SPECIFICATIONS, t.LENGTHS, t.CHEMICAL_STANDARD, 
+    t.SURFACE_STANDARD, t.WORKPROC_TYPE, t.IATERAL_AREA, t.LENGTH_TIMES_WIDTH, t.TRANSPORT_TYPE, 
+    t.RECEIVE_TIME, t.CREATE_MAN, t.CREATE_TIME, t.UPDATE_MAN, t.UPDATE_TIME, t.MEMO, 
+    t.PURPOSE, t.UNITID, t.DIMENSION, t.KXF_WEIGHT, t.YXF_WEIGHT, t.PLAN_WEIGHT
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM EMS_GM_PC_JH
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM EMS_GM_PC_JH t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="state != null and state != ''">
+        and STATE = #{state}
+      </if>
+      <if test="grades != null and grades != ''">
+        and GRADES = #{grades}
+      </if>
+      <if test="specifications != null and specifications != ''">
+        and SPECIFICATIONS = #{specifications}
+      </if>
+      <if test="lengths != null">
+        and LENGTHS = #{lengths}
+      </if>
+      <if test="chemicalStandard != null and chemicalStandard != ''">
+        and CHEMICAL_STANDARD = #{chemicalStandard}
+      </if>
+      <if test="surfaceStandard != null and surfaceStandard != ''">
+        and SURFACE_STANDARD = #{surfaceStandard}
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        and WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="iateralArea != null and iateralArea != ''">
+        and IATERAL_AREA = #{iateralArea}
+      </if>
+      <if test="lengthTimesWidth != null and lengthTimesWidth != ''">
+        and LENGTH_TIMES_WIDTH = #{lengthTimesWidth}
+      </if>
+      <if test="transportType != null and transportType != ''">
+        and TRANSPORT_TYPE = #{transportType}
+      </if>
+      <if test="receiveTime != null">
+        and TO_CHAR(RECEIVE_TIME,'yyyy-MM-dd') = #{receiveTime}
+      </if>
+      <if test="createMan != null and createMan != ''">
+        and CREATE_MAN = #{createMan}
+      </if>
+      <if test="createTime != null">
+        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+      </if>
+      <if test="updateMan != null and updateMan != ''">
+        and UPDATE_MAN = #{updateMan}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO = #{memo}
+      </if>
+      <if test="purpose != null and purpose != ''">
+        and PURPOSE = #{purpose}
+      </if>
+      <if test="unitid != null and unitid != ''">
+        and UNITID = #{unitid}
+      </if>
+      <if test="dimension != null and dimension != ''">
+        and DIMENSION = #{dimension}
+      </if>
+      <if test="kxfWeight != null">
+        and KXF_WEIGHT = #{kxfWeight}
+      </if>
+      <if test="yxfWeight != null">
+        and YXF_WEIGHT = #{yxfWeight}
+      </if>
+      <if test="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="startTime != null and startTime !='' and endTime != null and endTime != ''">
+        and JH_TIME BETWEEN TO_DATE(#{startTime},'yyyy-mm-dd') AND TO_DATE(#{endTime},'yyyy-mm-dd')
+      </if>
+      AND ID like '%G-%'
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID LIKE '%${id}%'
+      </if>
+      <if test="jhTime != null">
+        and TO_CHAR(JH_TIME,'yyyy-MM-dd') = #{jhTime}
+      </if>
+      <if test="state != null and state != ''">
+        and STATE LIKE '%${state}%'
+      </if>
+      <if test="grades != null and grades != ''">
+        and GRADES LIKE '%${grades}%'
+      </if>
+      <if test="specifications != null and specifications != ''">
+        and SPECIFICATIONS LIKE '%${specifications}%'
+      </if>
+      <if test="lengths != null">
+        and LENGTHS = #{lengths}
+      </if>
+      <if test="chemicalStandard != null and chemicalStandard != ''">
+        and CHEMICAL_STANDARD LIKE '%${chemicalStandard}%'
+      </if>
+      <if test="surfaceStandard != null and surfaceStandard != ''">
+        and SURFACE_STANDARD LIKE '%${surfaceStandard}%'
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        and WORKPROC_TYPE LIKE '%${workprocType}%'
+      </if>
+      <if test="iateralArea != null and iateralArea != ''">
+        and IATERAL_AREA LIKE '%${iateralArea}%'
+      </if>
+      <if test="lengthTimesWidth != null and lengthTimesWidth != ''">
+        and LENGTH_TIMES_WIDTH LIKE '%${lengthTimesWidth}%'
+      </if>
+      <if test="transportType != null and transportType != ''">
+        and TRANSPORT_TYPE LIKE '%${transportType}%'
+      </if>
+      <if test="receiveTime != null">
+        and TO_CHAR(RECEIVE_TIME,'yyyy-MM-dd') = #{receiveTime}
+      </if>
+      <if test="createMan != null and createMan != ''">
+        and CREATE_MAN LIKE '%${createMan}%'
+      </if>
+      <if test="createTime != null">
+        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
+      </if>
+      <if test="updateMan != null and updateMan != ''">
+        and UPDATE_MAN LIKE '%${updateMan}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </if>
+      <if test="purpose != null and purpose != ''">
+        and PURPOSE LIKE '%${purpose}%'
+      </if>
+      <if test="unitid != null and unitid != ''">
+        and UNITID LIKE '%${unitid}%'
+      </if>
+      <if test="dimension != null and dimension != ''">
+        and DIMENSION LIKE '%${dimension}%'
+      </if>
+      <if test="kxfWeight != null">
+        and KXF_WEIGHT = #{kxfWeight}
+      </if>
+      <if test="yxfWeight != null">
+        and YXF_WEIGHT = #{yxfWeight}
+      </if>
+      <if test="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from EMS_GM_PC_JH
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from EMS_GM_PC_JH
+    where 1!=1 
+      <if test="jhTime != null">
+        or TO_CHAR(JH_TIME,'yyyy-MM-dd') = '#{jhTime}'
+      </if>
+      <if test="state != null and state != ''">
+        or STATE = #{state}
+      </if>
+      <if test="grades != null and grades != ''">
+        or GRADES = #{grades}
+      </if>
+      <if test="specifications != null and specifications != ''">
+        or SPECIFICATIONS = #{specifications}
+      </if>
+      <if test="lengths != null">
+        or LENGTHS = #{lengths}
+      </if>
+      <if test="chemicalStandard != null and chemicalStandard != ''">
+        or CHEMICAL_STANDARD = #{chemicalStandard}
+      </if>
+      <if test="surfaceStandard != null and surfaceStandard != ''">
+        or SURFACE_STANDARD = #{surfaceStandard}
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        or WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="iateralArea != null and iateralArea != ''">
+        or IATERAL_AREA = #{iateralArea}
+      </if>
+      <if test="lengthTimesWidth != null and lengthTimesWidth != ''">
+        or LENGTH_TIMES_WIDTH = #{lengthTimesWidth}
+      </if>
+      <if test="transportType != null and transportType != ''">
+        or TRANSPORT_TYPE = #{transportType}
+      </if>
+      <if test="receiveTime != null">
+        or TO_CHAR(RECEIVE_TIME,'yyyy-MM-dd') = '#{receiveTime}'
+      </if>
+      <if test="createMan != null and createMan != ''">
+        or CREATE_MAN = #{createMan}
+      </if>
+      <if test="createTime != null">
+        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
+      </if>
+      <if test="updateMan != null and updateMan != ''">
+        or UPDATE_MAN = #{updateMan}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="memo != null and memo != ''">
+        or MEMO = #{memo}
+      </if>
+      <if test="purpose != null and purpose != ''">
+        or PURPOSE = #{purpose}
+      </if>
+      <if test="unitid != null and unitid != ''">
+        or UNITID = #{unitid}
+      </if>
+      <if test="dimension != null and dimension != ''">
+        or DIMENSION = #{dimension}
+      </if>
+      <if test="kxfWeight != null">
+        or KXF_WEIGHT = #{kxfWeight}
+      </if>
+      <if test="yxfWeight != null">
+        or YXF_WEIGHT = #{yxfWeight}
+      </if>
+      <if test="planWeight != null">
+        or PLAN_WEIGHT = #{planWeight}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    insert into EMS_GM_PC_JH (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, YXF_WEIGHT, PLAN_WEIGHT
+      )
+    values (#{id,jdbcType=VARCHAR}, #{jhTime,jdbcType=TIMESTAMP}, #{state,jdbcType=VARCHAR}, 
+      #{grades,jdbcType=VARCHAR}, #{specifications,jdbcType=VARCHAR}, #{lengths,jdbcType=DECIMAL}, 
+      #{chemicalStandard,jdbcType=VARCHAR}, #{surfaceStandard,jdbcType=VARCHAR}, #{workprocType,jdbcType=VARCHAR}, 
+      #{iateralArea,jdbcType=VARCHAR}, #{lengthTimesWidth,jdbcType=VARCHAR}, #{transportType,jdbcType=VARCHAR}, 
+      #{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}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    insert into EMS_GM_PC_JH
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="jhTime != null">
+        JH_TIME,
+      </if>
+      <if test="state != null">
+        STATE,
+      </if>
+      <if test="grades != null">
+        GRADES,
+      </if>
+      <if test="specifications != null">
+        SPECIFICATIONS,
+      </if>
+      <if test="lengths != null">
+        LENGTHS,
+      </if>
+      <if test="chemicalStandard != null">
+        CHEMICAL_STANDARD,
+      </if>
+      <if test="surfaceStandard != null">
+        SURFACE_STANDARD,
+      </if>
+      <if test="workprocType != null">
+        WORKPROC_TYPE,
+      </if>
+      <if test="iateralArea != null">
+        IATERAL_AREA,
+      </if>
+      <if test="lengthTimesWidth != null">
+        LENGTH_TIMES_WIDTH,
+      </if>
+      <if test="transportType != null">
+        TRANSPORT_TYPE,
+      </if>
+      <if test="receiveTime != null">
+        RECEIVE_TIME,
+      </if>
+      <if test="createMan != null">
+        CREATE_MAN,
+      </if>
+      <if test="createTime != null">
+        CREATE_TIME,
+      </if>
+      <if test="updateMan != null">
+        UPDATE_MAN,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="memo != null">
+        MEMO,
+      </if>
+      <if test="purpose != null">
+        PURPOSE,
+      </if>
+      <if test="unitid != null">
+        UNITID,
+      </if>
+      <if test="dimension != null">
+        DIMENSION,
+      </if>
+      <if test="kxfWeight != null">
+        KXF_WEIGHT,
+      </if>
+      <if test="yxfWeight != null">
+        YXF_WEIGHT,
+      </if>
+      <if test="planWeight != null">
+        PLAN_WEIGHT,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="jhTime != null">
+        #{jhTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=VARCHAR},
+      </if>
+      <if test="grades != null">
+        #{grades,jdbcType=VARCHAR},
+      </if>
+      <if test="specifications != null">
+        #{specifications,jdbcType=VARCHAR},
+      </if>
+      <if test="lengths != null">
+        #{lengths,jdbcType=DECIMAL},
+      </if>
+      <if test="chemicalStandard != null">
+        #{chemicalStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="surfaceStandard != null">
+        #{surfaceStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocType != null">
+        #{workprocType,jdbcType=VARCHAR},
+      </if>
+      <if test="iateralArea != null">
+        #{iateralArea,jdbcType=VARCHAR},
+      </if>
+      <if test="lengthTimesWidth != null">
+        #{lengthTimesWidth,jdbcType=VARCHAR},
+      </if>
+      <if test="transportType != null">
+        #{transportType,jdbcType=VARCHAR},
+      </if>
+      <if test="receiveTime != null">
+        #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createMan != null">
+        #{createMan,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateMan != null">
+        #{updateMan,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memo != null">
+        #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="purpose != null">
+        #{purpose,jdbcType=VARCHAR},
+      </if>
+      <if test="unitid != null">
+        #{unitid,jdbcType=VARCHAR},
+      </if>
+      <if test="dimension != null">
+        #{dimension,jdbcType=VARCHAR},
+      </if>
+      <if test="kxfWeight != null">
+        #{kxfWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="yxfWeight != null">
+        #{yxfWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="planWeight != null">
+        #{planWeight,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    update EMS_GM_PC_JH
+    set JH_TIME = #{jhTime,jdbcType=TIMESTAMP},
+      STATE = #{state,jdbcType=VARCHAR},
+      GRADES = #{grades,jdbcType=VARCHAR},
+      SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
+      LENGTHS = #{lengths,jdbcType=DECIMAL},
+      CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
+      SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
+      WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR},
+      IATERAL_AREA = #{iateralArea,jdbcType=VARCHAR},
+      LENGTH_TIMES_WIDTH = #{lengthTimesWidth,jdbcType=VARCHAR},
+      TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
+      RECEIVE_TIME = #{receiveTime,jdbcType=TIMESTAMP},
+      CREATE_MAN = #{createMan,jdbcType=VARCHAR},
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      UPDATE_MAN = #{updateMan,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      MEMO = #{memo,jdbcType=VARCHAR},
+      PURPOSE = #{purpose,jdbcType=VARCHAR},
+      UNITID = #{unitid,jdbcType=VARCHAR},
+      DIMENSION = #{dimension,jdbcType=VARCHAR},
+      KXF_WEIGHT = #{kxfWeight,jdbcType=DECIMAL},
+      YXF_WEIGHT = #{yxfWeight,jdbcType=DECIMAL},
+      PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    update EMS_GM_PC_JH
+    <set>
+      <if test="jhTime != null">
+        JH_TIME = #{jhTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="state != null">
+        STATE = #{state,jdbcType=VARCHAR},
+      </if>
+      <if test="grades != null">
+        GRADES = #{grades,jdbcType=VARCHAR},
+      </if>
+      <if test="specifications != null">
+        SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
+      </if>
+      <if test="lengths != null">
+        LENGTHS = #{lengths,jdbcType=DECIMAL},
+      </if>
+      <if test="chemicalStandard != null">
+        CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="surfaceStandard != null">
+        SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocType != null">
+        WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR},
+      </if>
+      <if test="iateralArea != null">
+        IATERAL_AREA = #{iateralArea,jdbcType=VARCHAR},
+      </if>
+      <if test="lengthTimesWidth != null">
+        LENGTH_TIMES_WIDTH = #{lengthTimesWidth,jdbcType=VARCHAR},
+      </if>
+      <if test="transportType != null">
+        TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
+      </if>
+      <if test="receiveTime != null">
+        RECEIVE_TIME = #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createMan != null">
+        CREATE_MAN = #{createMan,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateMan != null">
+        UPDATE_MAN = #{updateMan,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memo != null">
+        MEMO = #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="purpose != null">
+        PURPOSE = #{purpose,jdbcType=VARCHAR},
+      </if>
+      <if test="unitid != null">
+        UNITID = #{unitid,jdbcType=VARCHAR},
+      </if>
+      <if test="dimension != null">
+        DIMENSION = #{dimension,jdbcType=VARCHAR},
+      </if>
+      <if test="kxfWeight != null">
+        KXF_WEIGHT = #{kxfWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="yxfWeight != null">
+        YXF_WEIGHT = #{yxfWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="planWeight != null">
+        PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      </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_GM_PC_JH 
+      (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, 
+      YXF_WEIGHT, PLAN_WEIGHT)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.id,jdbcType=VARCHAR}, 
+      #{item.jhTime,jdbcType=TIMESTAMP}, #{item.state,jdbcType=VARCHAR}, #{item.grades,jdbcType=VARCHAR}, 
+      #{item.specifications,jdbcType=VARCHAR}, #{item.lengths,jdbcType=DECIMAL}, #{item.chemicalStandard,jdbcType=VARCHAR}, 
+      #{item.surfaceStandard,jdbcType=VARCHAR}, #{item.workprocType,jdbcType=VARCHAR}, 
+      #{item.iateralArea,jdbcType=VARCHAR}, #{item.lengthTimesWidth,jdbcType=VARCHAR}, 
+      #{item.transportType,jdbcType=VARCHAR}, #{item.receiveTime,jdbcType=TIMESTAMP}, 
+      #{item.createMan,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateMan,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR}, #{item.purpose,jdbcType=VARCHAR}, 
+      #{item.unitid,jdbcType=VARCHAR}, #{item.dimension,jdbcType=VARCHAR}, #{item.kxfWeight,jdbcType=DECIMAL}, 
+      #{item.yxfWeight,jdbcType=DECIMAL}, #{item.planWeight,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update EMS_GM_PC_JH
+     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>
+       ,JH_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.jhTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,STATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.state,jdbcType=VARCHAR}
+       </foreach>
+       ,GRADES=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.grades,jdbcType=VARCHAR}
+       </foreach>
+       ,SPECIFICATIONS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.specifications,jdbcType=VARCHAR}
+       </foreach>
+       ,LENGTHS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.lengths,jdbcType=DECIMAL}
+       </foreach>
+       ,CHEMICAL_STANDARD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.chemicalStandard,jdbcType=VARCHAR}
+       </foreach>
+       ,SURFACE_STANDARD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.surfaceStandard,jdbcType=VARCHAR}
+       </foreach>
+       ,WORKPROC_TYPE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.workprocType,jdbcType=VARCHAR}
+       </foreach>
+       ,IATERAL_AREA=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.iateralArea,jdbcType=VARCHAR}
+       </foreach>
+       ,LENGTH_TIMES_WIDTH=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.lengthTimesWidth,jdbcType=VARCHAR}
+       </foreach>
+       ,TRANSPORT_TYPE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.transportType,jdbcType=VARCHAR}
+       </foreach>
+       ,RECEIVE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.receiveTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,CREATE_MAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createMan,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_MAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updateMan,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,MEMO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+       </foreach>
+       ,PURPOSE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.purpose,jdbcType=VARCHAR}
+       </foreach>
+       ,UNITID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.unitid,jdbcType=VARCHAR}
+       </foreach>
+       ,DIMENSION=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.dimension,jdbcType=VARCHAR}
+       </foreach>
+       ,KXF_WEIGHT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.kxfWeight,jdbcType=DECIMAL}
+       </foreach>
+       ,YXF_WEIGHT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.yxfWeight,jdbcType=DECIMAL}
+       </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>
+     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_GM_PC_JH
+    where ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <select id="getMaxid" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh" resultType="java.lang.String">
+ select #{type} || #{startTime} || '-' ||
+       to_char(nvl(max(substr(ID, 15, 2) + 1), 1), 'fm00') as ID
+  from ems_gm_pc_jh
+ where WORKPROC_TYPE = #{workprocType}
+   and ID like '%' || #{type} || '%'
+   and JH_TIME = #{jhTime}
+  </select>
+  <update id="updateState" parameterType="com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh">
+    update ems_gm_pc_jh
+    <set>
+      <if test="state != null and state != ''">
+        STATE = #{state}
+      </if>
+    </set>
+    <where>
+      <if test="workprocType != null and workprocType!= ''">
+        and WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="id != null and id !=''">
+        and  ID = #{id}
+      </if>
+    </where>
+  </update>
+  <!--轮次计划页面查询-->
+  <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
+    FROM
+    EMS_GM_PC_JH
+    <where>
+      <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">
+        and  JH_TIME between to_date(#{startTime},'yyyy-mm-dd')  and to_date(#{endTime},'yyyy-mm-dd')
+      </if>
+      <if test="workprocType != null and workprocType!= '' ">
+        and WORKPROC_TYPE in (${workprocType})
+      </if>
+      <if test="id !=null and id != ''">
+       and ID= #{id}
+      </if>
+      and state in ('1','2')
+      order by jhTime,ID
+    </where>
+  </select>
+  
+</mapper>

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

@@ -0,0 +1,417 @@
+package com.steerinfo.ems.emsgmpcjh.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="国贸排产计划表")
+public class EmsGmPcJh implements IBasePO<String> {
+    /**
+     * 主键(ID,VARCHAR,100)
+     */
+    @ApiModelProperty(value="主键",required=true)
+    private String id;
+
+    /**
+     * 计划时间(JH_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="计划时间",required=false)
+    @JSONField(format = "yyyy-MM-dd")
+    private Date jhTime;
+
+    /**
+     * 状态(0已编辑1已下发2已接收)(STATE,VARCHAR,1)
+     */
+    @ApiModelProperty(value="状态(0已编辑1已下发2已接收)",required=false)
+    private String state;
+
+    /**
+     * 钢种(GRADES,VARCHAR,100)
+     */
+    @ApiModelProperty(value="钢种",required=false)
+    private String grades;
+
+    /**
+     * 规格(SPECIFICATIONS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="规格",required=false)
+    private String specifications;
+
+    /**
+     * 长度(LENGTHS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="长度",required=false)
+    private BigDecimal lengths;
+
+    /**
+     * 化学成分标准(CHEMICAL_STANDARD,VARCHAR,100)
+     */
+    @ApiModelProperty(value="化学成分标准",required=false)
+    private String chemicalStandard;
+
+    /**
+     * 表面成分标准(SURFACE_STANDARD,VARCHAR,100)
+     */
+    @ApiModelProperty(value="表面成分标准",required=false)
+        private String surfaceStandard;
+
+    /**
+     * 工序类型(WORKPROC_TYPE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="工序类型",required=false)
+    private String workprocType;
+
+    /**
+     * 断面(IATERAL_AREA,VARCHAR,100)
+     */
+    @ApiModelProperty(value="断面",required=false)
+    private String iateralArea;
+
+    /**
+     * 长度*宽度(LENGTH_TIMES_WIDTH,VARCHAR,100)
+     */
+    @ApiModelProperty(value="长度*宽度",required=false)
+    private String lengthTimesWidth;
+
+    /**
+     * 运输方式(TRANSPORT_TYPE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="运输方式",required=false)
+    private String transportType;
+
+    /**
+     * 接收时间(RECEIVE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="接收时间",required=false)
+    private Date receiveTime;
+
+    /**
+     * 创建人(CREATE_MAN,VARCHAR,100)
+     */
+    @ApiModelProperty(value="创建人",required=false)
+    private String createMan;
+
+    /**
+     * 创建时间(CREATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="创建时间",required=false)
+    private Date createTime;
+
+    /**
+     * 修改人(UPDATE_MAN,VARCHAR,100)
+     */
+    @ApiModelProperty(value="修改人",required=false)
+    private String updateMan;
+
+    /**
+     * 修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 备注(MEMO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String memo;
+
+    /**
+     * 用途(PURPOSE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="用途",required=false)
+    private String purpose;
+
+    /**
+     * 单位id(UNITID,VARCHAR,20)
+     */
+    @ApiModelProperty(value="单位id",required=false)
+    private String unitid;
+
+    /**
+     * 截面尺寸(DIMENSION,VARCHAR,100)
+     */
+    @ApiModelProperty(value="截面尺寸",required=false)
+    private String dimension;
+
+    /**
+     * 可下发量(KXF_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="可下发量",required=false)
+    private BigDecimal kxfWeight;
+
+    /**
+     * 已下发量(YXF_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="已下发量",required=false)
+    private BigDecimal yxfWeight;
+
+    /**
+     * 计划量(PLAN_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计划量",required=false)
+    private BigDecimal planWeight;
+
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public Date getJhTime() {
+        return jhTime;
+    }
+
+    public void setJhTime(Date jhTime) {
+        this.jhTime = jhTime;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state == null ? null : state.trim();
+    }
+
+    public String getGrades() {
+        return grades;
+    }
+
+    public void setGrades(String grades) {
+        this.grades = grades == null ? null : grades.trim();
+    }
+
+    public String getSpecifications() {
+        return specifications;
+    }
+
+    public void setSpecifications(String specifications) {
+        this.specifications = specifications == null ? null : specifications.trim();
+    }
+
+    public BigDecimal getLengths() {
+        return lengths;
+    }
+
+    public void setLengths(BigDecimal lengths) {
+        this.lengths = lengths;
+    }
+
+    public String getChemicalStandard() {
+        return chemicalStandard;
+    }
+
+    public void setChemicalStandard(String chemicalStandard) {
+        this.chemicalStandard = chemicalStandard == null ? null : chemicalStandard.trim();
+    }
+
+    public String getSurfaceStandard() {
+        return surfaceStandard;
+    }
+
+    public void setSurfaceStandard(String surfaceStandard) {
+        this.surfaceStandard = surfaceStandard == null ? null : surfaceStandard.trim();
+    }
+
+    public String getWorkprocType() {
+        return workprocType;
+    }
+
+    public void setWorkprocType(String workprocType) {
+        this.workprocType = workprocType == null ? null : workprocType.trim();
+    }
+
+    public String getIateralArea() {
+        return iateralArea;
+    }
+
+    public void setIateralArea(String iateralArea) {
+        this.iateralArea = iateralArea == null ? null : iateralArea.trim();
+    }
+
+    public String getLengthTimesWidth() {
+        return lengthTimesWidth;
+    }
+
+    public void setLengthTimesWidth(String lengthTimesWidth) {
+        this.lengthTimesWidth = lengthTimesWidth == null ? null : lengthTimesWidth.trim();
+    }
+
+    public String getTransportType() {
+        return transportType;
+    }
+
+    public void setTransportType(String transportType) {
+        this.transportType = transportType == null ? null : transportType.trim();
+    }
+
+    public Date getReceiveTime() {
+        return receiveTime;
+    }
+
+    public void setReceiveTime(Date receiveTime) {
+        this.receiveTime = receiveTime;
+    }
+
+    public String getCreateMan() {
+        return createMan;
+    }
+
+    public void setCreateMan(String createMan) {
+        this.createMan = createMan == null ? null : createMan.trim();
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateMan() {
+        return updateMan;
+    }
+
+    public void setUpdateMan(String updateMan) {
+        this.updateMan = updateMan == null ? null : updateMan.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo == null ? null : memo.trim();
+    }
+
+    public String getPurpose() {
+        return purpose;
+    }
+
+    public void setPurpose(String purpose) {
+        this.purpose = purpose == null ? null : purpose.trim();
+    }
+
+    public String getUnitid() {
+        return unitid;
+    }
+
+    public void setUnitid(String unitid) {
+        this.unitid = unitid == null ? null : unitid.trim();
+    }
+
+    public String getDimension() {
+        return dimension;
+    }
+
+    public void setDimension(String dimension) {
+        this.dimension = dimension == null ? null : dimension.trim();
+    }
+
+    public BigDecimal getKxfWeight() {
+        return kxfWeight;
+    }
+
+    public void setKxfWeight(BigDecimal kxfWeight) {
+        this.kxfWeight = kxfWeight;
+    }
+
+    public BigDecimal getYxfWeight() {
+        return yxfWeight;
+    }
+
+    public void setYxfWeight(BigDecimal yxfWeight) {
+        this.yxfWeight = yxfWeight;
+    }
+
+    public BigDecimal getPlanWeight() {
+        return planWeight;
+    }
+
+    public void setPlanWeight(BigDecimal planWeight) {
+        this.planWeight = planWeight;
+    }
+    private String startTime;
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    private String endTime;
+
+    @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(", jhTime=").append(jhTime);
+        sb.append(", state=").append(state);
+        sb.append(", grades=").append(grades);
+        sb.append(", specifications=").append(specifications);
+        sb.append(", lengths=").append(lengths);
+        sb.append(", chemicalStandard=").append(chemicalStandard);
+        sb.append(", surfaceStandard=").append(surfaceStandard);
+        sb.append(", workprocType=").append(workprocType);
+        sb.append(", iateralArea=").append(iateralArea);
+        sb.append(", lengthTimesWidth=").append(lengthTimesWidth);
+        sb.append(", transportType=").append(transportType);
+        sb.append(", receiveTime=").append(receiveTime);
+        sb.append(", createMan=").append(createMan);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateMan=").append(updateMan);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", memo=").append(memo);
+        sb.append(", purpose=").append(purpose);
+        sb.append(", unitid=").append(unitid);
+        sb.append(", dimension=").append(dimension);
+        sb.append(", kxfWeight=").append(kxfWeight);
+        sb.append(", yxfWeight=").append(yxfWeight);
+        sb.append(", planWeight=").append(planWeight);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,32 @@
+package com.steerinfo.ems.emsgmpcjh.service;
+
+import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.framework.service.pagehelper.PageList;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * EmsGmPcJh服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-11 03:49
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-11
+ * 作者:generator
+ * 参考:
+ * 描述:EmsGmPcJh服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IEmsGmPcJhService extends IBaseService<EmsGmPcJh, String>{
+    //获取国贸标号
+    String getMaxid(EmsGmPcJh emsGmPcJh);
+    //下发与取消下发
+    int  updateState(EmsGmPcJh emsGmPcJh);
+    //轮次计划查询
+    PageList<Map<String, Object>>  getGmPcJhDataForPage(HashMap<String, Object> parmas, Integer pageNum,
+                                                         Integer pageSize);
+
+}

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

@@ -0,0 +1,59 @@
+package com.steerinfo.ems.emsgmpcjh.service.impl;
+
+import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
+import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
+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.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * EmsGmPcJh服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-11 03:49
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-11
+ * 作者:generator
+ * 参考:
+ * 描述:EmsGmPcJh服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsGmPcJhService")
+public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> implements IEmsGmPcJhService {
+
+    @Autowired
+    private EmsGmPcJhMapper emsGmPcJhMapper;
+
+    @Override
+    protected IBaseMapper<EmsGmPcJh, String> getMapper() {
+        return emsGmPcJhMapper;
+    }
+
+    @Override
+    public String getMaxid(EmsGmPcJh emsGmPcJh) {
+        return emsGmPcJhMapper.getMaxid(emsGmPcJh);
+    }
+
+    @Override
+    public int updateState(EmsGmPcJh emsGmPcJh) {
+        return emsGmPcJhMapper.updateState(emsGmPcJh);
+    }
+
+    @Override
+    public PageList<Map<String, Object>> getGmPcJhDataForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String, Object>> gmPcJhData = emsGmPcJhMapper.getGmPcJhData(parmas);
+        PageList<Map<String,Object>> plist = new PageList<Map<String,Object>>(gmPcJhData);
+        return plist;
+    }
+
+}

+ 2 - 2
src/main/java/com/steerinfo/ems/emsprodplanmonth/mapper/EmsProdplanMonthMapper.xml

@@ -73,8 +73,8 @@
       <if test="state != null and state != ''">
         and STATE = #{state}
       </if>
-      <if test="may !=null">
-       and  trunc(MAY) = to_date(#{may},'yyyy-mm')
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
+       and  MAY  between  to_date(#{startTime},'yyyy-mm') and to_date(#{endTime},'yyyy-mm')
       </if>
     </where>
     ORDER  BY SQNO

+ 85 - 41
src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java

@@ -1,6 +1,8 @@
 package com.steerinfo.ems.emsprodplanround.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.emsprodplanmonth.mapper.EmsProdplanMonthMapper;
 import com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth;
 import com.steerinfo.ems.emsprodplanmonth.service.IEmsProdplanMonthService;
@@ -14,8 +16,10 @@ import com.steerinfo.ems.emsprodplanround.service.IEmsProdplanRoundService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import lombok.val;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.tools.ant.taskdefs.Get;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -44,7 +48,7 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
     @Autowired
     IEmsProdplanRoundService emsProdplanRoundService;
     @Autowired
-    EmsProdplanMonthMapper emsProdplanMonthMapper;
+    EmsGmPcJhMapper emsGmPcJhMapper;
     @Autowired
     EmsProdplanRoundMapper emsProdplanRoundMapper;
     @Autowired
@@ -76,35 +80,35 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
     @ApiOperation(value="创建", notes="根据EmsProdplanRound对象创建")
     @ApiImplicitParam(name = "emsProdplanRound", value = "详细实体emsProdplanRound", required = true, dataType = "EmsProdplanRound")
     @PostMapping(value = "/")
-    public RESTfulResult add(@RequestBody EmsProdplanRound model){
+    public RESTfulResult add(@RequestBody EmsProdplanRound [] models){
         String userId = JwtUtil.getUseridByToken();
-        if(model.getWorkprocType() == null||model.getWorkprocType().equals("") || model.getMay() == null || model.getMay().equals("")){
-            return  failed(null,"工序或者时间为空");
-        }
-        HashMap<String,Object> map =  new HashMap();
-        String strDateFormat = "yyyy-MM";
-        SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
-        map.put("workprocid",model.getWorkprocType());
-        map.put("may",sdf.format(model.getMay()));
-        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthMapper.getBymayAndWorkprocid(map);
-        if(emsProdplanMonth == null){
-            return  failed(null,"该工序无法找到"+sdf.format(model.getMay())+"月数据");
-        }
-        map.put("parentid",emsProdplanMonth.getId());
-        EmsProdplanRound getbeyondWeight = emsProdplanRoundService.getbeyondWeight(map);
-        model.setParentid(emsProdplanMonth.getId());
-        model.setSqno(emsProdplanMonth.getSqno());
-        model.setPlanWeight(model.getPlanWeight());
-        model.setMsgFlag("I");
-        model.setReadFlag("N");
-        model.setPlanWeight(model.getPlanWeight());
-        model.setState("0");
-        model.setCreatetime(new Date());
-        model.setCreateman(userId);
-        model.setWorkprocType(map.get("workprocid").toString());
-        EmsProdplanRound emsProdplanRound = emsProdplanRoundService.add(model);
-        if(getbeyondWeight.getPlanWeight().compareTo(emsProdplanMonth.getWeightMonth()) == 1){
-            return success(null,"新增成功,但是轮次计划重量已超出!!!");
+        String maxid = null;
+        for (EmsProdplanRound model : models) {
+            EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(model.getParentid());
+            if(emsGmPcJh.getState().equals("0")){
+                return failed("排产计划编号为"+emsGmPcJh.getId()+"做了取消下发操作,无法做新增操作");
+            }
+            if(model.getWorkprocType() == null || model.getWorkprocType().equals("")){
+                return  failed(null,"工序或者时间为空");
+            }
+            if (model.getParentid().substring(0,1).equals("G")){
+                maxid = emsProdplanRoundService.getMaxidAsGm(model);
+            }
+            else {
+                maxid = emsProdplanRoundService.getMaxidAsSC(model);
+            }
+            model.setId(maxid);
+            model.setPlanWeight(model.getPlanWeight());
+            model.setMsgFlag("I");
+            model.setReadFlag("N");
+            model.setState("0");
+            model.setCreatetime(new Date());
+            model.setCreateman(userId);
+            model.setWorkprocType(model.getWorkprocType());
+            emsProdplanRoundService.add(model);
+            emsGmPcJh.setState("2");
+            emsGmPcJh.setReceiveTime(new Date());
+            emsGmPcJhMapper.updateByPrimaryKeySelective(emsGmPcJh);
         }
         return success();
     }
@@ -150,8 +154,8 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
     })
     //@RequiresPermissions("emsprodplanround:update")
 
-    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult update(@PathVariable String id, @RequestBody EmsProdplanRound[] models){
+    @PutMapping(value = "batchUpdate", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@RequestBody EmsProdplanRound[] models){
         String userId = JwtUtil.getUseridByToken();
         for (int i = 0; i < models.length; i++) {
             EmsProdplanRound  model = models[i];
@@ -196,10 +200,10 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             emsProdplanRoundMapper.updateByPrimaryKey(model);
         }
         EmsProdplanRound sumPlanWeight = emsProdplanRoundService.getSumPlanWeight(id);
-        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthMapper.selectByPrimaryKey(monthid);
-        emsProdplanMonth.setKxf_weight(emsProdplanMonth.getWeightMonth().subtract(emsProdplanMonth.getYxf_weight().add(sumPlanWeight.getPlanWeight())));
-        emsProdplanMonth.setYxf_weight(emsProdplanMonth.getYxf_weight().add(sumPlanWeight.getPlanWeight()));
-        emsProdplanMonthMapper.updateByPrimaryKey(emsProdplanMonth);
+        EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(monthid);
+        emsGmPcJh.setKxfWeight(emsGmPcJh.getPlanWeight().subtract(emsGmPcJh.getYxfWeight().add(sumPlanWeight.getPlanWeight())));
+        emsGmPcJh.setYxfWeight(emsGmPcJh.getYxfWeight().add(sumPlanWeight.getPlanWeight()));
+        emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
         return  success();
     }
     @ApiOperation(value="取消下发", notes="根据models修改对象")
@@ -226,11 +230,11 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
             emsProdplanRoundMapper.updateByPrimaryKey(model);
         }
         EmsProdplanRound sumPlanWeight = emsProdplanRoundService.getSumPlanWeight(id);
-        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthMapper.selectByPrimaryKey(monthid);
+        EmsGmPcJh emsGmPcJh = emsGmPcJhMapper.selectByPrimaryKey(monthid);
         // 取消下发操作
-        emsProdplanMonth.setKxf_weight(emsProdplanMonth.getKxf_weight().add(sumPlanWeight.getPlanWeight()));
-        emsProdplanMonth.setYxf_weight(emsProdplanMonth.getYxf_weight().subtract(sumPlanWeight.getPlanWeight()));
-        emsProdplanMonthMapper.updateByPrimaryKey(emsProdplanMonth);
+        emsGmPcJh.setKxfWeight(emsGmPcJh.getKxfWeight().add(sumPlanWeight.getPlanWeight()));
+        emsGmPcJh.setYxfWeight(emsGmPcJh.getYxfWeight().subtract(sumPlanWeight.getPlanWeight()));
+        emsGmPcJhMapper.updateByPrimaryKey(emsGmPcJh);
         return  success();
     }
 
@@ -240,14 +244,54 @@ public class EmsProdplanRoundController extends BaseRESTfulController {
     public RESTfulResult delete(@RequestBody EmsProdplanRound [] models){
         for (int i = 0; i < models.length; i++) {
             EmsProdplanRound model = models[i];
-            if(model.getState().equals("1") || model.getState().equals("2")){
-                return  failed(null,"数据已下发或者被接收,无法删除");
+            if (model.getState().equals("1") || model.getState().equals("2")) {
+                return failed(null, "数据已下发或者被接收,无法删除");
             }
             emsProdplanRoundMapper.deleteByPrimaryKey(model.getId());
+            deleteNbjh(model);
         }
         return  success();
     }
 
+    @ApiOperation(value="获取详细信息", notes="根据url获取长度*宽度")
+    @GetMapping(value = "getlengthTimesWidth")
+    public RESTfulResult getlengthTimesWidth(){
+        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getlengthTimesWidth();
+        return success(emsProdplanRounds);
+    }
 
+    @ApiOperation(value="获取详细信息", notes="根据url获取断面")
+    @GetMapping(value = "getiateralArea")
+    public RESTfulResult getiateralArea(){
+        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getiateralArea();
+        return success(emsProdplanRounds);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url获取截取面积")
+    @GetMapping(value = "getdimension")
+    public RESTfulResult getdimension(){
+        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getdimension();
+        return success(emsProdplanRounds);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url获取断面")
+    @GetMapping(value = "getsurfaceStandard")
+    public RESTfulResult getsurfaceStandard(){
+        List<EmsProdplanRound> emsProdplanRounds = emsProdplanRoundService.getsurfaceStandard();
+        return success(emsProdplanRounds);
+    }
 
+    //如果是内部计划 则判断有没有轮次计划 做删除操作
+    public void deleteNbjh(EmsProdplanRound emsProdplanRound) {
+        if (emsProdplanRound.getId().substring(0,1).equals("N")) {
+            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) {
+                    emsGmPcJhMapper.deleteByPrimaryKey(emsProdplanRound.getParentid());
+                }
+            }
+        }
+    }
 }

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

@@ -2,7 +2,7 @@ package com.steerinfo.ems.emsprodplanround.mapper;
 
 import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
 import com.steerinfo.framework.mapper.IBaseMapper;
-import java.math.*;
+
 import java.util.HashMap;
 import java.util.List;
 
@@ -12,6 +12,17 @@ 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);
+    //获取编号
+    String getMaxidAsSC(EmsProdplanRound emsProdplanRound);
+    //获取宽度*长度
+    List<EmsProdplanRound> getlengthTimesWidth();
+    //获取断面
+    List<EmsProdplanRound> getiateralArea();
+    //获取断面
+    List<EmsProdplanRound> getdimension();
+    //获取表面质量标准
+    List<EmsProdplanRound> getsurfaceStandard();
 }

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

@@ -57,7 +57,7 @@
         and ID = #{id}
       </if>
       <if test="may != null">
-        and  trunc(MAY) = to_date(#{may},'yyyy-mm')
+        and  trunc(MAY) = to_date(#{may},'yyyy-mm-dd')
       </if>
       <if test="sqno != null and sqno != ''">
         and SQNO = #{sqno}
@@ -125,6 +125,7 @@
       <if test="parentid != null and parentid != '' ">
         and PARENTID = #{parentid}
       </if>
+      ORDER BY CREATETIME DESC
     </where>
   </sql>
   <sql id="whereLike">
@@ -701,7 +702,7 @@
         and t.parentid = #{parentid}
        </if>
        <if test="may != null ">
-         and   trunc(t.may) = to_date(#{may},'yyyy-mm')
+         and   trunc(t.may) = to_date(#{may},'yyyy-mm-dd')
        </if>
      </where>
   </select>
@@ -711,4 +712,40 @@
        #{id}
      </foreach>
   </select>
+  <select id="getMaxidAsGm" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="java.lang.String">
+      select #{parentid} || '-' || to_char(nvl(max(substr(ID, 18, 2) + 1), 1),'fm00') as id
+      from ems_prodplan_round
+      where
+      parentid = #{parentid}
+      AND ID like
+      '%'||(SELECT  'G-' || substr(#{parentid}, 3) FROM dual)||'%'
+  </select>
+  <select id="getMaxidAsSC" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="java.lang.String">
+    SELECT 'N-' || substr(#{parentid}, 3) ||'-'||
+         to_char(nvl(max(substr(ID, 18, 2) + 1), 1),'fm00') AS ID
+    FROM ems_prodplan_round
+    where
+    ID LIKE
+    '%'||(SELECT  'N-' || substr(#{parentid}, 3) FROM dual )||'%'
+  </select>
+  <select id="getlengthTimesWidth" resultMap="BaseResultMap">
+       select distinct LENGTH_TIMES_WIDTH from ems_prodplan_round
+           where LENGTH_TIMES_WIDTH not like '%null%'
+  </select>
+  <!---->
+  <select id="getiateralArea" resultMap="BaseResultMap">
+    select distinct IATERAL_AREA from ems_prodplan_round
+           where IATERAL_AREA not like '%null%'
+  </select>
+  <!---->
+  <select id="getdimension" resultMap="BaseResultMap">
+    select distinct dimension from ems_prodplan_round
+           where dimension not like '%null%'
+  </select>
+  <!---->
+  <select id="getsurfaceStandard" resultMap="BaseResultMap">
+    select distinct SURFACE_STANDARD
+             from ems_prodplan_round
+            where SURFACE_STANDARD not like '%null%'
+  </select>
 </mapper>

+ 12 - 3
src/main/java/com/steerinfo/ems/emsprodplanround/model/EmsProdplanRound.java

@@ -20,7 +20,7 @@ public class EmsProdplanRound implements IBasePO<String> {
      * 月份(MAY,TIMESTAMP,7)
      */
     @ApiModelProperty(value="月份",required=false)
-    @JSONField(format = "yyyy-MM")
+    @JSONField(format = "yyyy-MM-dd")
     private Date may;
 
     /**
@@ -143,6 +143,15 @@ public class EmsProdplanRound implements IBasePO<String> {
     @ApiModelProperty(value="I:Insert;U:Update;D:Delete ",required=true)
     private String msgFlag;
 
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    private String type;
     /**
      * N:未读;Y已读(READ_FLAG,VARCHAR,20)
      */
@@ -155,10 +164,10 @@ public class EmsProdplanRound implements IBasePO<String> {
     public String getParentid() {
         return parentid;
     }
-    @ApiModelProperty(value = "高度乘以宽度",required = true)
+    @ApiModelProperty(value = "断面",required = true)
 
     private String iateralArea;
-    @ApiModelProperty(value = "断面",required = true)
+    @ApiModelProperty(value = "长度*宽度",required = true)
 
     private String lengthTimesWidth;
     @ApiModelProperty(value = "截面尺寸",required = true)

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

@@ -24,4 +24,17 @@ public interface IEmsProdplanRoundService extends IBaseService<EmsProdplanRound,
     EmsProdplanRound getbeyondWeight(HashMap<String,Object> parmas);
 
     EmsProdplanRound getSumPlanWeight(List ids);
+
+    //获取编号
+    String getMaxidAsGm(EmsProdplanRound emsProdplanRound);
+    //获取编号
+    String getMaxidAsSC(EmsProdplanRound emsProdplanRound);
+    //获取宽度*长度
+    List<EmsProdplanRound> getlengthTimesWidth();
+    //获取断面
+    List<EmsProdplanRound> getiateralArea();
+    //获取断面
+    List<EmsProdplanRound> getdimension();
+    //获取表面质量标准
+    List<EmsProdplanRound>getsurfaceStandard();
 }

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

@@ -45,4 +45,34 @@ public class EmsProdplanRoundServiceImpl extends BaseServiceImpl<EmsProdplanRoun
     public EmsProdplanRound getSumPlanWeight(List ids) {
         return emsProdplanRoundMapper.getSumPlanWeight(ids);
     }
+
+    @Override
+    public String getMaxidAsGm(EmsProdplanRound emsProdplanRound) {
+        return emsProdplanRoundMapper.getMaxidAsGm(emsProdplanRound);
+    }
+
+    @Override
+    public String getMaxidAsSC(EmsProdplanRound emsProdplanRound) {
+        return emsProdplanRoundMapper.getMaxidAsSC(emsProdplanRound);
+    }
+
+    @Override
+    public List<EmsProdplanRound> getlengthTimesWidth() {
+        return emsProdplanRoundMapper.getlengthTimesWidth();
+    }
+
+    @Override
+    public List<EmsProdplanRound> getiateralArea() {
+        return emsProdplanRoundMapper.getiateralArea();
+    }
+
+    @Override
+    public List<EmsProdplanRound> getdimension() {
+        return emsProdplanRoundMapper.getdimension();
+    }
+
+    @Override
+    public List<EmsProdplanRound> getsurfaceStandard() {
+        return emsProdplanRoundMapper.getsurfaceStandard();
+    }
 }

+ 1 - 1
src/main/java/com/steerinfo/ems/tcm0325/controller/TCm0325Controller.java

@@ -97,7 +97,7 @@ public class TCm0325Controller extends BaseRESTfulController {
     @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("trmunit:delete")
-    @DeleteMapping(produces  = "application/json;charset=UTF-8")
+    @DeleteMapping( produces  = "application/json;charset=UTF-8")//String
     public RESTfulResult delete(@RequestBody TCm0325[] models){
         for (TCm0325 model : models) {
             tCm0325Mapper.deleteByPrimaryKey(model.getPowercode());

+ 0 - 1
src/main/java/com/steerinfo/feigen/model/LgWeight.java

@@ -10,7 +10,6 @@ public class LgWeight {
     public String getId() {
         return id;
     }
-
     public void setId(String id) {
         this.id = id == null ? null : id.trim();
     }

+ 1 - 1
src/main/java/com/steerinfo/feigen/service/BfhydFeigenService.java

@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 
 import java.util.List;
 
-@FeignClient(value = "xt-ems-datasource")
+@FeignClient("xt-ems-datasource")
 @Component
 public interface BfhydFeigenService {
     @GetMapping("v1/bfhyds/getAll")

+ 1 - 3
src/main/java/com/steerinfo/feigen/service/LgWeightFeigenService.java

@@ -12,10 +12,8 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
-@FeignClient(value = "xt-ems-datasource")
-@Component
+@FeignClient("xt-ems-datasource")
 public interface LgWeightFeigenService {
-
     @GetMapping("v1/lgweight/queryWeightByTime")
     public List<LgWeight> QueryWeightByTime();
 

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -26,7 +26,7 @@ server:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://root:root@${EUREKA_HOST:localhost}:${EUREKA_PORT:8009}/eureka/
+      defaultZone: http://root:root@${EUREKA_HOST:localhost}:${EUREKA_PORT:8019}/eureka/
     metadata-map:
       cluster: ribbon
   instance: