lirl 3 سال پیش
والد
کامیت
6574d7d6a2
18فایلهای تغییر یافته به همراه3669 افزوده شده و 0 حذف شده
  1. 235 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/controller/EmsProdplanMonthController.java
  2. 27 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/mapper/EmsProdplanMonthMapper.java
  3. 482 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/mapper/EmsProdplanMonthMapper.xml
  4. 294 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/model/EmsProdplanMonth.java
  5. 37 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/service/IEmsProdplanMonthService.java
  6. 66 0
      src/main/java/com/steerinfo/ems/emsprodplanmonth/service/impl/EmsProdplanMonthServiceImpl.java
  7. 231 0
      src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java
  8. 17 0
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.java
  9. 693 0
      src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.xml
  10. 392 0
      src/main/java/com/steerinfo/ems/emsprodplanround/model/EmsProdplanRound.java
  11. 27 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/IEmsProdplanRoundService.java
  12. 48 0
      src/main/java/com/steerinfo/ems/emsprodplanround/service/impl/EmsProdplanRoundServiceImpl.java
  13. 235 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/controller/EmsProdplanYearController.java
  14. 24 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/mapper/EmsProdplanYearMapper.java
  15. 449 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/mapper/EmsProdplanYearMapper.xml
  16. 308 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/model/EmsProdplanYear.java
  17. 43 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/service/IEmsProdplanYearService.java
  18. 61 0
      src/main/java/com/steerinfo/ems/emsprodplanyear/service/impl/EmsProdplanYearServiceImpl.java

+ 235 - 0
src/main/java/com/steerinfo/ems/emsprodplanmonth/controller/EmsProdplanMonthController.java

@@ -0,0 +1,235 @@
+package com.steerinfo.ems.emsprodplanmonth.controller;
+
+import com.steerinfo.auth.utils.JwtUtil;
+import com.steerinfo.ems.emsprodplanmonth.mapper.EmsProdplanMonthMapper;
+import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
+import com.steerinfo.ems.emsprodplanround.service.IEmsProdplanRoundService;
+import com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear;
+import com.steerinfo.ems.trmworkproc.mapper.TRmWorkprocMapper;
+import com.steerinfo.ems.trmworkproc.model.TRmWorkproc;
+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.emsprodplanmonth.model.EmsProdplanMonth;
+import com.steerinfo.ems.emsprodplanmonth.service.IEmsProdplanMonthService;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanMonth RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-02 11:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-02
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanMonth RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/emsprodplanmonths")
+public class EmsProdplanMonthController extends BaseRESTfulController {
+
+    @Autowired
+    private   IEmsProdplanMonthService emsProdplanMonthService;
+
+    @Autowired
+    private EmsProdplanMonthMapper emsProdplanMonthMapper;
+
+    @Autowired
+    private TRmWorkprocMapper tRmWorkprocMapper;
+
+    @Autowired
+    private IEmsProdplanRoundService emsProdplanRoundService;
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsprodplanmonth:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanMonth> list = emsProdplanMonthService.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("emsprodplanmonth:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanMonth> list = emsProdplanMonthService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据EmsProdplanMonth对象创建")
+    @ApiImplicitParam(name = "emsProdplanMonth", value = "详细实体emsProdplanMonth", required = true, dataType = "EmsProdplanMonth")
+    //@RequiresPermissions("emsprodplanmonth:create")
+    @PostMapping(value = "/", produces  = "application/json;charset=UTF-8")
+    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()));
+            map.put("workprocid",model.getWorkprocid());
+            map.put("productid",model.getProductid());
+            List list = emsProdplanMonthMapper.selectByParameters(map);
+            if(list.size()>0){
+                return failed(null,"该月时间段数据已生成,无法再次生成");
+            }
+            EmsProdplanMonth maxSqno = emsProdplanMonthService.getMaxSqno();
+            model.setSqno(maxSqno.getSqno());
+            EmsProdplanMonth emsProdplanMonth = emsProdplanMonthService.add(model);
+        }
+        return success();
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanmonth:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthService.getById(id);
+        return success(emsProdplanMonth);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanMonth信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "emsProdplanMonth", value = "详细实体emsProdplanMonth", required = true, dataType = "EmsProdplanMonth")
+    })
+    //@RequiresPermissions("emsprodplanmonth:update")
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody EmsProdplanMonth model){
+        model.setId(id);
+        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthService.modify(model);
+        return success(emsProdplanMonth);
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanmonth: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);
+			  emsProdplanMonthService.delete(ids);
+    	}
+      return success();
+    }
+
+    //月计划 获取编辑页面
+    @ApiOperation(value = "查询",notes = "根据时间来生成数据")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    @GetMapping(value = "/getDateEditForPage")
+    public RESTfulResult getDateEditForPage(@RequestParam HashMap<String, Object> parmas,Integer pageNum, Integer pageSize){
+        if(parmas.get("may")==null){
+            return failed(null, "请选择生成时间");
+        }
+        else {
+            String  may = (String) parmas.get("may");
+            may = may.substring(0,7);
+            may+="-01";
+            parmas.put("may",may);
+        }
+        PageList<Map<String, Object>> list = emsProdplanMonthService.getDateEditForPage(parmas, pageNum, pageSize);
+        if(list == null) {
+            return failed(null, "日期格式有误");
+        }
+        return success(list);
+    }
+
+    @PutMapping(value = "/batchupdate", produces  = "application/json;charset=UTF-8")
+    public  RESTfulResult batchupdate(@RequestBody EmsProdplanMonth [] models ){
+        String userId = JwtUtil.getUseridByToken();
+        for (int i = 0; i< models.length; i++) {
+            EmsProdplanMonth  model = models[i];
+                if(model.getWeightDay() == null || model.getWeightMonth() == null){
+                    return failed(null, "ID为‘"+model.getId()+"行年目标计划量或者日目标计划量为空");
+                }
+                if(model.getJxdays() == null ){
+                    return  failed(null,"ID为‘"+model.getId()+"行请填写检修天数");
+                }
+                    model.setUpdatetime(new Date());
+                    model.setUpdateman(userId);
+                    emsProdplanMonthMapper.updateByPrimaryKey(model);
+        }
+                    return success();
+    }
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanyear:delete")
+    @DeleteMapping(value = "/delete", produces  = "application/json;charset=UTF-8")//String
+    public RESTfulResult delete(@RequestBody EmsProdplanMonth[] models){
+        if(models.length >= 1) {
+            for (int i = 0; i < models.length; i++) {
+                EmsProdplanMonth m = models[i];
+                if(m==null || m.getId() ==null || m.getId().isEmpty()){
+                    return failed(null, "请传入数据ID");
+                }
+                Map map = new HashMap();
+                map.put("parentid",m.getId());
+                List query = emsProdplanRoundService.query(map);
+                if(query.size()>0){
+                    return  failed(null,"该工序在当前月已有轮次计划,无法删除"+m.getId());
+                }
+
+                EmsProdplanMonth tv = emsProdplanMonthService.getById(m.getId());
+                if (tv == null){
+                    return failed(null, "数据已经删除,请重新查询数据");
+                }
+
+            }
+        } else {
+            return failed(null, "请输入要删除的数据");
+        }
+        for (int i = 0; i< models.length; i++) {
+            emsProdplanMonthService.delete(models[i].getId());
+        }
+        return success();
+    }
+        @ApiOperation(value="查询", notes="获取指定工序列表")
+        @GetMapping(value = "/getWorkprocs")
+        public RESTfulResult getWorkprocs (){
+            List<TRmWorkproc> tRmWorkprocs = tRmWorkprocMapper.queryPlanMoth();
+            return success(tRmWorkprocs);
+        }
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    @GetMapping(value = "/getDates")
+    public RESTfulResult getDates(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+         if(parmas.get("workprocid") != null && parmas.get("workprocid") != ""){
+             parmas.put("type","");
+         }
+        PageList dateLc = emsProdplanMonthService.getDateLc(parmas, pageNum, pageSize);
+        return success(dateLc);
+    }
+
+}

+ 27 - 0
src/main/java/com/steerinfo/ems/emsprodplanmonth/mapper/EmsProdplanMonthMapper.java

@@ -0,0 +1,27 @@
+package com.steerinfo.ems.emsprodplanmonth.mapper;
+
+import com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth;
+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 EmsProdplanMonthMapper extends IBaseMapper<EmsProdplanMonth, String> {
+
+    //获取编辑页面
+    List<Map<String, Object>> getDateEdit(HashMap<String, Object> parmas);
+
+    List<Map<String, Object>> getDateLc(HashMap<String,Object> parmas);
+
+    EmsProdplanMonth getBymayAndWorkprocid(HashMap<String,Object> parmas);
+
+    /**
+     * 获取最大的序列号
+     * @return
+     */
+    EmsProdplanMonth getMaxSqno();
+
+}

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

@@ -0,0 +1,482 @@
+<?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.emsprodplanmonth.mapper.EmsProdplanMonthMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
+    <id column="ID" jdbcType="VARCHAR" property="id" />
+    <result column="PRODUCTID" jdbcType="VARCHAR" property="productid" />
+    <result column="WORKPROCID" jdbcType="VARCHAR" property="workprocid" />
+    <result column="MAY" jdbcType="DATE" property="may" />
+    <result column="WEIGHT_MONTH" jdbcType="DECIMAL" property="weightMonth" />
+    <result column="WEIGHT_DAY" jdbcType="DECIMAL" property="weightDay" />
+    <result column="UNIT" jdbcType="VARCHAR" property="unit" />
+    <result column="JXDAYS" jdbcType="VARCHAR" property="jxdays" />
+    <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
+    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
+    <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
+    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
+    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="STATE" jdbcType="VARCHAR" property="state" />
+    <result column="YXF_WEIGHT" jdbcType="DECIMAL" property="yxf_weight" />
+    <result column="KXF_WEIGHT" jdbcType="DECIMAL" property="kxf_weight" />
+    <result column="SQNO" jdbcType="DECIMAL" property="sqno" />
+  </resultMap>
+  <sql id="columns">
+    ID, PRODUCTID, WORKPROCID, MAY, WEIGHT_MONTH, WEIGHT_DAY, UNIT, JXDAYS, CREATETIME, 
+    CREATEMAN, UPDATETIME, UPDATEMAN, MEMO,STATE,YXF_WEIGHT,KXF_WEIGHT,SQNO
+  </sql>
+  <sql id="columns_alias">
+    t.ID, t.PRODUCTID, t.WORKPROCID, t.MAY, t.WEIGHT_MONTH, t.WEIGHT_DAY, t.UNIT, t.JXDAYS, 
+    t.CREATETIME, t.CREATEMAN, t.UPDATETIME, t.UPDATEMAN, t.MEMO,T.STATE
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM EMS_PRODPLAN_MONTH
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_MONTH t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID = #{id}
+      </if>
+      <if test="productid != null and productid != ''">
+        and PRODUCTID = #{productid}
+      </if>
+
+      <if test="workprocid != null and workprocid != ''">
+        and WORKPROCID in  (#{workprocid})
+      </if>
+      <if test="weightMonth != null">
+        and WEIGHT_MONTH = #{weightMonth}
+      </if>
+      <if test="weightDay != null">
+        and WEIGHT_DAY = #{weightDay}
+      </if>
+      <if test="unit != null and unit != ''">
+        and UNIT = #{unit}
+      </if>
+      <if test="jxdays != null and jxdays != ''">
+        and JXDAYS = #{jxdays}
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN = #{createman}
+      </if>
+      <if test="updatetime != null">
+        and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN = #{updateman}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO = #{memo}
+      </if>
+      <if test="state != null and state != ''">
+        and STATE = #{state}
+      </if>
+      <if test="may !=null">
+       and  trunc(MAY) = to_date(#{may},'yyyy-mm')
+      </if>
+    </where>
+    ORDER  BY WORKPROCID
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID LIKE '%${id}%'
+      </if>
+      <if test="productid != null and productid != ''">
+        and PRODUCTID LIKE '%${productid}%'
+      </if>
+      <if test="workprocid != null and workprocid != ''">
+        and WORKPROCID LIKE '%${workprocid}%'
+      </if>
+      <if test="may != null">
+        and TO_CHAR(MAY,'yyyy-MM-dd') = #{may}
+      </if>
+      <if test="weightMonth != null">
+        and WEIGHT_MONTH = #{weightMonth}
+      </if>
+      <if test="weightDay != null">
+        and WEIGHT_DAY = #{weightDay}
+      </if>
+      <if test="unit != null and unit != ''">
+        and UNIT LIKE '%${unit}%'
+      </if>
+      <if test="jxdays != null and jxdays != ''">
+        and JXDAYS LIKE '%${jxdays}%'
+      </if>
+      <if test="createtime != null">
+        and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN LIKE '%${createman}%'
+      </if>
+      <if test="updatetime != null">
+        and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN LIKE '%${updateman}%'
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from EMS_PRODPLAN_MONTH
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from EMS_PRODPLAN_MONTH
+    where 1!=1 
+      <if test="productid != null and productid != ''">
+        or PRODUCTID = #{productid}
+      </if>
+      <if test="workprocid != null and workprocid != ''">
+        or WORKPROCID = #{workprocid}
+      </if>
+      <if test="may != null">
+        or TO_CHAR(MAY,'yyyy-MM-dd') = '#{may}'
+      </if>
+      <if test="weightMonth != null">
+        or WEIGHT_MONTH = #{weightMonth}
+      </if>
+      <if test="weightDay != null">
+        or WEIGHT_DAY = #{weightDay}
+      </if>
+      <if test="unit != null and unit != ''">
+        or UNIT = #{unit}
+      </if>
+      <if test="jxdays != null and jxdays != ''">
+        or JXDAYS = #{jxdays}
+      </if>
+      <if test="createtime != null">
+        or TO_CHAR(CREATETIME,'yyyy-MM-dd') = '#{createtime}'
+      </if>
+      <if test="createman != null and createman != ''">
+        or CREATEMAN = #{createman}
+      </if>
+      <if test="updatetime != null">
+        or TO_CHAR(UPDATETIME,'yyyy-MM-dd') = '#{updatetime}'
+      </if>
+      <if test="updateman != null and updateman != ''">
+        or UPDATEMAN = #{updateman}
+      </if>
+      <if test="memo != null and memo != ''">
+        or MEMO = #{memo}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
+    insert into EMS_PRODPLAN_MONTH (ID, PRODUCTID, WORKPROCID, 
+      MAY, WEIGHT_MONTH, WEIGHT_DAY, 
+      UNIT, JXDAYS, CREATETIME, 
+      CREATEMAN, UPDATETIME, UPDATEMAN, STATE,
+      MEMO,YXF_WEIGHT,KXF_WEIGHT,SQNO)
+    values (#{id,jdbcType=VARCHAR}, #{productid,jdbcType=VARCHAR}, #{workprocid,jdbcType=VARCHAR}, 
+      #{may,jdbcType=TIMESTAMP}, #{weightMonth,jdbcType=DECIMAL}, #{weightDay,jdbcType=DECIMAL}, 
+      #{unit,jdbcType=VARCHAR}, #{jxdays,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, 
+      #{createman,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{updateman,jdbcType=VARCHAR}, 
+     #{state,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},#{yxf_weight,jdbcType=DECIMAL},#{kxf_weight,jdbcType=DECIMAL},#{sqno,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
+    insert into EMS_PRODPLAN_MONTH
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="productid != null">
+        PRODUCTID,
+      </if>
+      <if test="workprocid != null">
+        WORKPROCID,
+      </if>
+      <if test="may != null">
+        MAY,
+      </if>
+      <if test="weightMonth != null">
+        WEIGHT_MONTH,
+      </if>
+      <if test="weightDay != null">
+        WEIGHT_DAY,
+      </if>
+      <if test="unit != null">
+        UNIT,
+      </if>
+      <if test="jxdays != null">
+        JXDAYS,
+      </if>
+      <if test="createtime != null">
+        CREATETIME,
+      </if>
+      <if test="createman != null">
+        CREATEMAN,
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME,
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN,
+      </if>
+      <if test="memo != null">
+        MEMO,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="productid != null">
+        #{productid,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocid != null">
+        #{workprocid,jdbcType=VARCHAR},
+      </if>
+      <if test="may != null">
+        #{may,jdbcType=TIMESTAMP},
+      </if>
+      <if test="weightMonth != null">
+        #{weightMonth,jdbcType=DECIMAL},
+      </if>
+      <if test="weightDay != null">
+        #{weightDay,jdbcType=DECIMAL},
+      </if>
+      <if test="unit != null">
+        #{unit,jdbcType=VARCHAR},
+      </if>
+      <if test="jxdays != null">
+        #{jxdays,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createman != null">
+        #{createman,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateman != null">
+        #{updateman,jdbcType=VARCHAR},
+      </if>
+      <if test="memo != null">
+        #{memo,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
+    update EMS_PRODPLAN_MONTH
+    set PRODUCTID = #{productid,jdbcType=VARCHAR},
+      WORKPROCID = #{workprocid,jdbcType=VARCHAR},
+      MAY = #{may,jdbcType=TIMESTAMP},
+      WEIGHT_MONTH = #{weightMonth,jdbcType=DECIMAL},
+      WEIGHT_DAY = #{weightDay,jdbcType=DECIMAL},
+      UNIT = #{unit,jdbcType=VARCHAR},
+      JXDAYS = #{jxdays,jdbcType=VARCHAR},
+      CREATETIME = #{createtime,jdbcType=TIMESTAMP},
+      CREATEMAN = #{createman,jdbcType=VARCHAR},
+      UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
+      UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      MEMO = #{memo,jdbcType=VARCHAR},
+      YXF_WEIGHT = #{yxf_weight,jdbcType=DECIMAL},
+      KXF_WEIGHT = #{kxf_weight,jdbcType=DECIMAL}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
+    update EMS_PRODPLAN_MONTH
+    <set>
+      <if test="productid != null">
+        PRODUCTID = #{productid,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocid != null">
+        WORKPROCID = #{workprocid,jdbcType=VARCHAR},
+      </if>
+      <if test="may != null">
+        MAY = #{may,jdbcType=TIMESTAMP},
+      </if>
+      <if test="weightMonth != null">
+        WEIGHT_MONTH = #{weightMonth,jdbcType=DECIMAL},
+      </if>
+      <if test="weightDay != null">
+        WEIGHT_DAY = #{weightDay,jdbcType=DECIMAL},
+      </if>
+      <if test="unit != null">
+        UNIT = #{unit,jdbcType=VARCHAR},
+      </if>
+      <if test="jxdays != null">
+        JXDAYS = #{jxdays,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        CREATETIME = #{createtime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createman != null">
+        CREATEMAN = #{createman,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      </if>
+      <if test="memo != null">
+        MEMO = #{memo,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_MONTH 
+      (ID, 
+      PRODUCTID, WORKPROCID, MAY, 
+      WEIGHT_MONTH, WEIGHT_DAY, UNIT, 
+      JXDAYS, CREATETIME, CREATEMAN, 
+      UPDATETIME, UPDATEMAN, MEMO,STATE
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.id,jdbcType=VARCHAR}, 
+      #{item.productid,jdbcType=VARCHAR}, #{item.workprocid,jdbcType=VARCHAR}, #{item.may,jdbcType=TIMESTAMP}, 
+      #{item.weightMonth,jdbcType=DECIMAL}, #{item.weightDay,jdbcType=DECIMAL}, #{item.unit,jdbcType=VARCHAR}, 
+      #{item.jxdays,jdbcType=VARCHAR}, #{item.createtime,jdbcType=TIMESTAMP}, #{item.createman,jdbcType=VARCHAR}, 
+      #{item.updatetime,jdbcType=TIMESTAMP}, #{item.updateman,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR},
+      #{item.state,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update EMS_PRODPLAN_MONTH
+     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>
+       ,PRODUCTID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.productid,jdbcType=VARCHAR}
+       </foreach>
+       ,WORKPROCID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.workprocid,jdbcType=VARCHAR}
+       </foreach>
+       ,MAY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.may,jdbcType=TIMESTAMP}
+       </foreach>
+       ,WEIGHT_MONTH=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.weightMonth,jdbcType=DECIMAL}
+       </foreach>
+       ,WEIGHT_DAY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.weightDay,jdbcType=DECIMAL}
+       </foreach>
+       ,UNIT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.unit,jdbcType=VARCHAR}
+       </foreach>
+       ,JXDAYS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.jxdays,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,CREATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
+       </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>
+        ,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>
+     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_MONTH
+    where ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+   <!--获取编辑页面-->
+  <select id="getDateEdit" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+      select to_date(#{may},'yyyy-mm-dd') as may, c.productid ,c.workprocid, '0' state , c.unit from (
+      select a.*,
+          row_number() over(PARTITION BY a.WORKPROCID order by a.WORKPROCID ) as row_flg
+          from EMS_PRODPLAN_MONTH a
+          left join T_RM_WORKPROC b
+          on a.workprocid = b.id
+          where a.workprocid  not in  (select t.workprocid  from  EMS_PRODPLAN_MONTH t  where t.may = to_date(#{may},'yyyy-MM-dd'))
+          ) c
+  </select>
+
+  <select id="getDateLc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select t.id,t.may,t.workprocid,t.weight_month,t.unit,t.kxf_weight,t.yxf_weight,t.sqno from  EMS_PRODPLAN_MONTH t
+    <where>
+      <if test="type != null and type != ''">
+        <if test="type=='gx'">
+        and   t.workprocid in ('AT2005','AT2006')
+        </if>
+        <if test="type =='lg'">
+         and  t.workprocid = 'AT2004'
+        </if>
+        <if test="type == 'xg'">
+         and  t.workprocid ='AT2007'
+        </if>
+      </if>
+      <if test="may != null">
+        and   trunc(t.may) = to_date(#{may},'yyyy-mm')
+      </if>
+      <if test="workprocid != null and workprocid != '' ">
+        and  t.workprocid = #{workprocid}
+      </if>
+    </where>
+  </select>
+  <select id="getBymayAndWorkprocid" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select t.* from EMS_PRODPLAN_MONTH t
+    <where>
+      <if test="may != null and may != '' " >
+        and   trunc(t.may) = to_date(#{may},'yyyy-mm')
+      </if>
+      <if test="workprocid != null and workprocid != '' " >
+        and t.workprocid = #{workprocid}
+      </if>
+      <if test="id != null and id != '' " >
+        and t.id = #{id}
+      </if>
+    </where>
+  </select>
+  
+  <select id="getMaxSqno"  resultMap="BaseResultMap">
+     select nvl(max(t.sqno+1),0) sqno from ems_prodplan_month t
+  </select>
+</mapper>

+ 294 - 0
src/main/java/com/steerinfo/ems/emsprodplanmonth/model/EmsProdplanMonth.java

@@ -0,0 +1,294 @@
+package com.steerinfo.ems.emsprodplanmonth.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value="月计划编制表")
+public class EmsProdplanMonth implements IBasePO<String> {
+    /**
+     * 主键ID(ID,VARCHAR,32)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private String id;
+
+    /**
+     * 产品ID(PRODUCTID,VARCHAR,100)
+     */
+    @ApiModelProperty(value="产品ID",required=false)
+    private String productid;
+
+    /**
+     * 工序ID(WORKPROCID,VARCHAR,20)
+     */
+    @ApiModelProperty(value="工序ID",required=false)
+    private String workprocid;
+
+    /**
+     * 月份(MAY,TIMESTAMP,7)
+     */
+    @JSONField(format = "yyyy-MM")
+    @ApiModelProperty(value="月份",required=false)
+    private Date may;
+
+    /**
+     * 目标计划量(月)(WEIGHT_MONTH,DECIMAL,0)
+     */
+    @ApiModelProperty(value="目标计划量(月)",required=false)
+    private Long weightMonth;
+
+    /**
+     * 目标计划量(日)(WEIGHT_DAY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="目标计划量(日)",required=false)
+    private Long weightDay;
+
+    /**
+     * 单位名称(UNIT,VARCHAR,10)
+     */
+    @ApiModelProperty(value="单位名称",required=false)
+    private String unit;
+
+    /**
+     * 检修天数(JXDAYS,VARCHAR,20)
+     */
+    @ApiModelProperty(value="检修天数",required=false)
+    private String jxdays;
+
+    /**
+     * 创建时间(CREATETIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="创建时间",required=false)
+    private Date createtime;
+
+    /**
+     * 创建人(CREATEMAN,VARCHAR,20)
+     */
+    @ApiModelProperty(value="创建人",required=false)
+    private String createman;
+
+    /**
+     * 修改时间(UPDATETIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间",required=false)
+    private Date updatetime;
+
+    /**
+     * 修改人(UPDATEMAN,VARCHAR,20)
+     */
+    @ApiModelProperty(value="修改人",required=false)
+    private String updateman;
+
+    /**
+     * 备注(MEMO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String memo;
+
+    @ApiModelProperty(value = "状态",required = false)
+    private String state;
+
+    @ApiModelProperty(value = "已下发量",required = false)
+    private Long yxf_weight;
+    @ApiModelProperty(value = "可下发量",required = false)
+    private Long kxf_weight;
+    @ApiModelProperty(value = "序号",required = false)
+    private Long sqno;
+
+    public Long getSqno() {
+        return sqno;
+    }
+
+    public void setSqno(Long sqno) {
+        this.sqno = sqno;
+    }
+
+    public Long getYxf_weight() {
+        return yxf_weight;
+    }
+
+    public void setYxf_weight(Long yxf_weight) {
+        this.yxf_weight = yxf_weight;
+    }
+
+    public Long getKxf_weight() {
+        return kxf_weight;
+    }
+
+    public void setKxf_weight(Long kxf_weight) {
+        this.kxf_weight = kxf_weight;
+    }
+
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    private String startTime;
+    private String endTime;
+
+    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 static final long serialVersionUID = 1L;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public String getProductid() {
+        return productid;
+    }
+
+    public void setProductid(String productid) {
+        this.productid = productid == null ? null : productid.trim();
+    }
+
+    public String getWorkprocid() {
+        return workprocid;
+    }
+
+    public void setWorkprocid(String workprocid) {
+        this.workprocid = workprocid == null ? null : workprocid.trim();
+    }
+
+    public Date getMay() {
+        return may;
+    }
+
+    public void setMay(Date may) {
+        this.may = may;
+    }
+
+    public Long getWeightMonth() {
+        return weightMonth;
+    }
+
+    public void setWeightMonth(Long weightMonth) {
+        this.weightMonth = weightMonth;
+    }
+
+    public Long getWeightDay() {
+        return weightDay;
+    }
+
+    public void setWeightDay(Long weightDay) {
+        this.weightDay = weightDay;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit == null ? null : unit.trim();
+    }
+
+    public String getJxdays() {
+        return jxdays;
+    }
+
+    public void setJxdays(String jxdays) {
+        this.jxdays = jxdays == null ? null : jxdays.trim();
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public String getCreateman() {
+        return createman;
+    }
+
+    public void setCreateman(String createman) {
+        this.createman = createman == null ? null : createman.trim();
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public String getUpdateman() {
+        return updateman;
+    }
+
+    public void setUpdateman(String updateman) {
+        this.updateman = updateman == null ? null : updateman.trim();
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo == null ? null : memo.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(", productid=").append(productid);
+        sb.append(", workprocid=").append(workprocid);
+        sb.append(", may=").append(may);
+        sb.append(", weightMonth=").append(weightMonth);
+        sb.append(", weightDay=").append(weightDay);
+        sb.append(", unit=").append(unit);
+        sb.append(", jxdays=").append(jxdays);
+        sb.append(", createtime=").append(createtime);
+        sb.append(", createman=").append(createman);
+        sb.append(", updatetime=").append(updatetime);
+        sb.append(", updateman=").append(updateman);
+        sb.append(", memo=").append(memo);
+        sb.append(", state=").append(state);
+        sb.append(", startTime=").append(startTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 37 - 0
src/main/java/com/steerinfo/ems/emsprodplanmonth/service/IEmsProdplanMonthService.java

@@ -0,0 +1,37 @@
+package com.steerinfo.ems.emsprodplanmonth.service;
+
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth;
+import com.steerinfo.framework.service.pagehelper.PageList;
+
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * EmsProdplanMonth服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-02 11:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-02
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanMonth服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IEmsProdplanMonthService extends IBaseService<EmsProdplanMonth, String>{
+
+    public PageList<Map<String, Object>> getDateEditForPage(HashMap<String, Object> parmas, Integer pageNum,
+                                                            Integer pageSize);
+    public PageList<Map<String, Object>> getDateLc(HashMap<String, Object> parmas, Integer pageNum,
+                                                            Integer pageSize);
+
+    /**
+     * 获取最大的序列号
+     * @return
+     */
+     public EmsProdplanMonth getMaxSqno();
+}

+ 66 - 0
src/main/java/com/steerinfo/ems/emsprodplanmonth/service/impl/EmsProdplanMonthServiceImpl.java

@@ -0,0 +1,66 @@
+package com.steerinfo.ems.emsprodplanmonth.service.impl;
+
+import com.github.pagehelper.Page;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth;
+import com.steerinfo.ems.emsprodplanmonth.mapper.EmsProdplanMonthMapper;
+import com.steerinfo.ems.emsprodplanmonth.service.IEmsProdplanMonthService;
+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;
+
+/**
+ * EmsProdplanMonth服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-02 11:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-02
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanMonth服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsProdplanMonthService")
+public class EmsProdplanMonthServiceImpl extends BaseServiceImpl<EmsProdplanMonth, String> implements IEmsProdplanMonthService {
+
+    @Autowired
+    private EmsProdplanMonthMapper emsProdplanMonthMapper;
+
+    @Override
+    protected IBaseMapper<EmsProdplanMonth, String> getMapper() {
+        return emsProdplanMonthMapper;
+    }
+
+
+    public PageList<Map<String, Object>> getDateEditForPage(HashMap<String, Object> parmas, Integer pageNum,
+                                                            Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String, Object>> rows = emsProdplanMonthMapper.getDateEdit(parmas);
+        PageList<Map<String, Object>> pageInfo = new PageList<Map<String, Object>>(rows);
+        return pageInfo;
+    }
+
+    @Override
+    public PageList<Map<String, Object>> getDateLc(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> dateLc = emsProdplanMonthMapper.getDateLc(parmas);
+        PageList<Map<String, Object>> pageInfo = new PageList<Map<String, Object>>(dateLc);
+        return pageInfo;
+    }
+
+    @Override
+    public EmsProdplanMonth getMaxSqno() {
+        return emsProdplanMonthMapper.getMaxSqno();
+    }
+
+
+}

+ 231 - 0
src/main/java/com/steerinfo/ems/emsprodplanround/controller/EmsProdplanRoundController.java

@@ -0,0 +1,231 @@
+package com.steerinfo.ems.emsprodplanround.controller;
+
+import com.steerinfo.auth.utils.JwtUtil;
+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.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.emsprodplanround.model.EmsProdplanRound;
+import com.steerinfo.ems.emsprodplanround.service.IEmsProdplanRoundService;
+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.text.SimpleDateFormat;
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanRound RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-06 03:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-06
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanRound RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/emsprodplanrounds")
+public class EmsProdplanRoundController extends BaseRESTfulController {
+
+    @Autowired
+    IEmsProdplanRoundService emsProdplanRoundService;
+    @Autowired
+    EmsProdplanMonthMapper emsProdplanMonthMapper;
+    @Autowired
+    EmsProdplanRoundMapper emsProdplanRoundMapper;
+    @Autowired
+    IEmsProdplanMonthService emsProdplanMonthService;
+    @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 = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanRound> list = emsProdplanRoundService.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("emsprodplanround:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanRound> list = emsProdplanRoundService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据EmsProdplanRound对象创建")
+    @ApiImplicitParam(name = "emsProdplanRound", value = "详细实体emsProdplanRound", required = true, dataType = "EmsProdplanRound")
+    @PostMapping(value = "/")
+    public RESTfulResult add(@RequestBody EmsProdplanRound model){
+        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()>emsProdplanMonth.getWeightMonth()){
+            return success(emsProdplanRound,"新增成功,但是轮次计划重量已超出!!!");
+        }
+        return success();
+    }
+//    @PutMapping(value = "/batchupdate", produces  = "application/json;charset=UTF-8")
+//    public  RESTfulResult batchupdate(@RequestBody EmsProdplanRound [] models ){
+//        String userId = JwtUtil.getUseridByToken();
+//        for (int i = 0; i < models.length; i++) {
+//            EmsProdplanRound  model = models[i];
+//            HashMap<String,Object> map =  new HashMap();
+//            String strDateFormat = "yyyy-MM";
+//            SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
+//            map.put("id",model.getParentid());
+//            map.put("may",sdf.format(model.getMay()));
+//            EmsProdplanMonth emsProdplanMonth = emsProdplanMonthMapper.getBymayAndWorkprocid(map);
+//            Long weightMonth = emsProdplanMonth.getWeightMonth();
+//            Long kxf_weight = emsProdplanMonth.getKxf_weight();
+//            Long yxf_weight = emsProdplanMonth.getYxf_weight();
+//            yxf_weight = model.getPlanWeight()+yxf_weight;
+//            kxf_weight = weightMonth-yxf_weight;
+//            if(yxf_weight>weightMonth){
+//                return  failed(null,"可下发重量不足");
+//            }
+//            emsProdplanMonth.setKxf_weight(kxf_weight);
+//            emsProdplanMonth.setYxf_weight(yxf_weight);
+//            emsProdplanMonthMapper.updateByPrimaryKey(emsProdplanMonth);
+//            emsProdplanRoundMapper.updateByPrimaryKey(model);
+//        }
+//        return  success();
+//    }
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanround:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        EmsProdplanRound emsProdplanRound = emsProdplanRoundService.getById(id);
+        return success(emsProdplanRound);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanRound信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "emsProdplanRound", value = "详细实体emsProdplanRound", required = true, dataType = "EmsProdplanRound")
+    })
+    //@RequiresPermissions("emsprodplanround:update")
+
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody EmsProdplanRound[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (int i = 0; i < models.length; i++) {
+            EmsProdplanRound  model = models[i];
+            if(model.getState().equals("1") || model.getState().equals("2")){
+                return failed(null,"存在已经下发或者审核的计划,无法做修改");
+            }
+            model.setUpdateman(userId);
+            model.setUpdatetime(new Date());
+            emsProdplanRoundMapper.updateByPrimaryKey(model);
+         }
+        return  success();
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanround:delete")
+    @DeleteMapping(value = "/{id}")
+    public RESTfulResult delete(@PathVariable String id ,@RequestBody EmsProdplanRound[] models){
+    	List<String> list = Arrays.asList(id.split(","));
+    	if(ListUtils.isNotEmpty(list)) {
+	    	List<String> ids = ListUtils.convertList(list);
+			  emsProdplanRoundService.delete(ids);
+    	}
+      return success();
+    }
+    @ApiOperation(value="修改", notes="根据models修改对象")
+    @ApiImplicitParam(name = "emsProdplanRounds", value = "", required = true, dataType = "EmsProdplanRounds")
+    @PostMapping(value = "/issue")
+    public RESTfulResult issue(@RequestBody EmsProdplanRound [] models){
+        List id = new ArrayList();
+        String monthid = "";
+        String state  ="";
+        for (int i = 0; i < models.length; i++) {
+            EmsProdplanRound model = models[i];
+            id.add(model.getId());
+            monthid = model.getParentid();
+            model.setIssuedTime(new Date());
+            model.getIsxf() ;
+            if(model.getIsxf().equals("1")){
+                model.setState("1");
+            }
+            state = model.getIsxf();
+            if(model.getState().equals("0")){
+                return  failed(null,"没有下发过的轮次计划无法做取消下发操作");
+            }
+            if(model.getIsxf().equals("0")){
+                model.setState("0");
+            }
+            emsProdplanRoundMapper.updateByPrimaryKey(model);
+        }
+        EmsProdplanRound sumPlanWeight = emsProdplanRoundService.getSumPlanWeight(id);
+        EmsProdplanMonth emsProdplanMonth = emsProdplanMonthMapper.selectByPrimaryKey(monthid);
+        if(state.equals("1")){
+            emsProdplanMonth.setKxf_weight(emsProdplanMonth.getWeightMonth()-(emsProdplanMonth.getYxf_weight()+sumPlanWeight.getPlanWeight()));
+            emsProdplanMonth.setYxf_weight(emsProdplanMonth.getYxf_weight()+sumPlanWeight.getPlanWeight());
+        }
+        else {
+            emsProdplanMonth.setKxf_weight(emsProdplanMonth.getKxf_weight()+sumPlanWeight.getPlanWeight());
+            emsProdplanMonth.setYxf_weight(emsProdplanMonth.getYxf_weight()-sumPlanWeight.getPlanWeight());
+        }
+            emsProdplanMonthMapper.updateByPrimaryKey(emsProdplanMonth);
+            return  success();
+    }
+
+    @ApiOperation(value="删除", notes="根据models删除对象")
+    @ApiImplicitParam(name = "emsProdplanRounds", value = "", required = true, dataType = "EmsProdplanRounds")
+    @PostMapping(value = "/delete")
+    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,"数据已下发或者被接收,无法删除");
+            }
+            emsProdplanRoundMapper.deleteByPrimaryKey(model.getId());
+        }
+        return  success();
+    }
+}

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

@@ -0,0 +1,17 @@
+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;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EmsProdplanRoundMapper extends IBaseMapper<EmsProdplanRound, String> {
+
+    EmsProdplanRound getbeyondWeight(HashMap<String,Object> parmas);
+
+    EmsProdplanRound getSumPlanWeight(List ids);
+}

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

@@ -0,0 +1,693 @@
+<?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.emsprodplanround.mapper.EmsProdplanRoundMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
+    <id column="ID" jdbcType="VARCHAR" property="id" />
+    <result column="MAY" jdbcType="DATE" property="may" />
+    <result column="SQNO" jdbcType="DECIMAL" property="sqno" />
+    <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
+    <result column="DESCRIBE" jdbcType="VARCHAR" property="describe" />
+    <result column="STATE" jdbcType="VARCHAR" property="state" />
+    <result column="GRADES" jdbcType="VARCHAR" property="grades" />
+    <result column="PLAN_WEIGHT" jdbcType="DECIMAL" property="planWeight" />
+    <result column="SPECIFICATIONS" jdbcType="VARCHAR" property="specifications" />
+    <result column="LENGTHS" jdbcType="VARCHAR" property="lengths" />
+    <result column="CHEMICAL_STANDARD" jdbcType="VARCHAR" property="chemicalStandard" />
+    <result column="SURFACE_STANDARD" jdbcType="VARCHAR" property="surfaceStandard" />
+    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="ISSUED_TIME" jdbcType="TIMESTAMP" property="issuedTime" />
+    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
+    <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
+    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
+    <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
+    <result column="TRANSPORT_TYPE" jdbcType="VARCHAR" property="transportType" />
+    <result column="PURPOSE" jdbcType="VARCHAR" property="purpose" />
+    <result column="WORKPROC_TYPE" jdbcType="VARCHAR" property="workprocType" />
+    <result column="MSG_FLAG" jdbcType="VARCHAR" property="msgFlag" />
+    <result column="READ_FLAG" jdbcType="VARCHAR" property="readFlag" />
+    <result column="PARENTID" jdbcType="VARCHAR" property="parentid"/>
+  </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
+  </sql>
+  <sql id="columns_alias">
+    t.ID, t.MAY, t.SQNO, t.UNITID, t.DESCRIBE, t.STATE, t.GRADES, t.PLAN_WEIGHT, t.SPECIFICATIONS, 
+    t.LENGTHS, t.CHEMICAL_STANDARD, t.SURFACE_STANDARD, t.MEMO, t.ISSUED_TIME, t.CREATEMAN, 
+    t.CREATETIME, t.UPDATEMAN, t.UPDATETIME, t.TRANSPORT_TYPE, t.PURPOSE, t.WORKPROC_TYPE, 
+    t.MSG_FLAG, t.READ_FLAG,t.PARENTID
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM EMS_PRODPLAN_ROUND
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_ROUND t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID = #{id}
+      </if>
+      <if test="may != null">
+        and  trunc(MAY) = to_date(#{may},'yyyy-mm')
+      </if>
+      <if test="sqno != null and sqno != ''">
+        and SQNO = #{sqno}
+      </if>
+      <if test="unitid != null and unitid != ''">
+        and UNITID = #{unitid}
+      </if>
+      <if test="describe != null and describe != ''">
+        and DESCRIBE = #{describe}
+      </if>
+      <if test="state != null and state != ''">
+        and STATE = #{state}
+      </if>
+      <if test="grades != null and grades != ''">
+        and GRADES = #{grades}
+      </if>
+      <if test="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="specifications != null and specifications != ''">
+        and SPECIFICATIONS = #{specifications}
+      </if>
+      <if test="lengths != null and lengths != ''">
+        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="memo != null and memo != ''">
+        and MEMO = #{memo}
+      </if>
+      <if test="issuedTime != null">
+        and TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = #{issuedTime}
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN = #{createman}
+      </if>
+      <if test="createtime != null">
+        and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN = #{updateman}
+      </if>
+      <if test="updatetime != null">
+        and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
+      </if>
+      <if test="transportType != null and transportType != ''">
+        and TRANSPORT_TYPE = #{transportType}
+      </if>
+      <if test="purpose != null and purpose != ''">
+        and PURPOSE = #{purpose}
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        and WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="msgFlag != null and msgFlag != ''">
+        and MSG_FLAG = #{msgFlag}
+      </if>
+      <if test="readFlag != null and readFlag != ''">
+        and READ_FLAG = #{readFlag}
+      </if>
+      <if test="parentid != null and parentid != '' ">
+        and PARENTID = #{parentid}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="id != null and id != ''">
+        and ID LIKE '%${id}%'
+      </if>
+      <if test="may != null">
+        and TO_CHAR(MAY,'yyyy-MM-dd') = #{may}
+      </if>
+      <if test="sqno != null and sqno != ''">
+        and SQNO LIKE '%${sqno}%'
+      </if>
+      <if test="unitid != null and unitid != ''">
+        and UNITID LIKE '%${unitid}%'
+      </if>
+      <if test="describe != null and describe != ''">
+        and DESCRIBE LIKE '%${describe}%'
+      </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="planWeight != null">
+        and PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="specifications != null and specifications != ''">
+        and SPECIFICATIONS LIKE '%${specifications}%'
+      </if>
+      <if test="lengths != null and lengths != ''">
+        and LENGTHS LIKE '%${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="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </if>
+      <if test="issuedTime != null">
+        and TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = #{issuedTime}
+      </if>
+      <if test="createman != null and createman != ''">
+        and CREATEMAN LIKE '%${createman}%'
+      </if>
+      <if test="createtime != null">
+        and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
+      </if>
+      <if test="updateman != null and updateman != ''">
+        and UPDATEMAN LIKE '%${updateman}%'
+      </if>
+      <if test="updatetime != null">
+        and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
+      </if>
+      <if test="transportType != null and transportType != ''">
+        and TRANSPORT_TYPE LIKE '%${transportType}%'
+      </if>
+      <if test="purpose != null and purpose != ''">
+        and PURPOSE LIKE '%${purpose}%'
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        and WORKPROC_TYPE LIKE '%${workprocType}%'
+      </if>
+      <if test="msgFlag != null and msgFlag != ''">
+        and MSG_FLAG LIKE '%${msgFlag}%'
+      </if>
+      <if test="readFlag != null and readFlag != ''">
+        and READ_FLAG LIKE '%${readFlag}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from EMS_PRODPLAN_ROUND
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from EMS_PRODPLAN_ROUND
+    where 1!=1 
+      <if test="may != null">
+        or TO_CHAR(MAY,'yyyy-MM-dd') = '#{may}'
+      </if>
+      <if test="sqno != null and sqno != ''">
+        or SQNO = #{sqno}
+      </if>
+      <if test="unitid != null and unitid != ''">
+        or UNITID = #{unitid}
+      </if>
+      <if test="describe != null and describe != ''">
+        or DESCRIBE = #{describe}
+      </if>
+      <if test="state != null and state != ''">
+        or STATE = #{state}
+      </if>
+      <if test="grades != null and grades != ''">
+        or GRADES = #{grades}
+      </if>
+      <if test="planWeight != null">
+        or PLAN_WEIGHT = #{planWeight}
+      </if>
+      <if test="specifications != null and specifications != ''">
+        or SPECIFICATIONS = #{specifications}
+      </if>
+      <if test="lengths != null and lengths != ''">
+        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="memo != null and memo != ''">
+        or MEMO = #{memo}
+      </if>
+      <if test="issuedTime != null">
+        or TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = '#{issuedTime}'
+      </if>
+      <if test="createman != null and createman != ''">
+        or CREATEMAN = #{createman}
+      </if>
+      <if test="createtime != null">
+        or TO_CHAR(CREATETIME,'yyyy-MM-dd') = '#{createtime}'
+      </if>
+      <if test="updateman != null and updateman != ''">
+        or UPDATEMAN = #{updateman}
+      </if>
+      <if test="updatetime != null">
+        or TO_CHAR(UPDATETIME,'yyyy-MM-dd') = '#{updatetime}'
+      </if>
+      <if test="transportType != null and transportType != ''">
+        or TRANSPORT_TYPE = #{transportType}
+      </if>
+      <if test="purpose != null and purpose != ''">
+        or PURPOSE = #{purpose}
+      </if>
+      <if test="workprocType != null and workprocType != ''">
+        or WORKPROC_TYPE = #{workprocType}
+      </if>
+      <if test="msgFlag != null and msgFlag != ''">
+        or MSG_FLAG = #{msgFlag}
+      </if>
+      <if test="readFlag != null and readFlag != ''">
+        or READ_FLAG = #{readFlag}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
+    insert into EMS_PRODPLAN_ROUND (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)
+    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}, 
+      #{lengths,jdbcType=VARCHAR}, #{chemicalStandard,jdbcType=VARCHAR}, #{surfaceStandard,jdbcType=VARCHAR}, 
+      #{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})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
+    insert into EMS_PRODPLAN_ROUND
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="may != null">
+        MAY,
+      </if>
+      <if test="sqno != null">
+        SQNO,
+      </if>
+      <if test="unitid != null">
+        UNITID,
+      </if>
+      <if test="describe != null">
+        DESCRIBE,
+      </if>
+      <if test="state != null">
+        STATE,
+      </if>
+      <if test="grades != null">
+        GRADES,
+      </if>
+      <if test="planWeight != null">
+        PLAN_WEIGHT,
+      </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="memo != null">
+        MEMO,
+      </if>
+      <if test="issuedTime != null">
+        ISSUED_TIME,
+      </if>
+      <if test="createman != null">
+        CREATEMAN,
+      </if>
+      <if test="createtime != null">
+        CREATETIME,
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN,
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME,
+      </if>
+      <if test="transportType != null">
+        TRANSPORT_TYPE,
+      </if>
+      <if test="purpose != null">
+        PURPOSE,
+      </if>
+      <if test="workprocType != null">
+        WORKPROC_TYPE,
+      </if>
+      <if test="msgFlag != null">
+        MSG_FLAG,
+      </if>
+      <if test="readFlag != null">
+        READ_FLAG,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="may != null">
+        #{may,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sqno != null">
+        #{sqno,jdbcType=DECIMAL},
+      </if>
+      <if test="unitid != null">
+        #{unitid,jdbcType=VARCHAR},
+      </if>
+      <if test="describe != null">
+        #{describe,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=VARCHAR},
+      </if>
+      <if test="grades != null">
+        #{grades,jdbcType=VARCHAR},
+      </if>
+      <if test="planWeight != null">
+        #{planWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="specifications != null">
+        #{specifications,jdbcType=VARCHAR},
+      </if>
+      <if test="lengths != null">
+        #{lengths,jdbcType=VARCHAR},
+      </if>
+      <if test="chemicalStandard != null">
+        #{chemicalStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="surfaceStandard != null">
+        #{surfaceStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="memo != null">
+        #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="issuedTime != null">
+        #{issuedTime,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="transportType != null">
+        #{transportType,jdbcType=VARCHAR},
+      </if>
+      <if test="purpose != null">
+        #{purpose,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocType != null">
+        #{workprocType,jdbcType=VARCHAR},
+      </if>
+      <if test="msgFlag != null">
+        #{msgFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="readFlag != null">
+        #{readFlag,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
+    update EMS_PRODPLAN_ROUND
+    set MAY = #{may,jdbcType=TIMESTAMP},
+      SQNO = #{sqno,jdbcType=DECIMAL},
+      UNITID = #{unitid,jdbcType=VARCHAR},
+      DESCRIBE = #{describe,jdbcType=VARCHAR},
+      STATE = #{state,jdbcType=VARCHAR},
+      GRADES = #{grades,jdbcType=VARCHAR},
+      PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
+      LENGTHS = #{lengths,jdbcType=VARCHAR},
+      CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
+      SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
+      MEMO = #{memo,jdbcType=VARCHAR},
+      ISSUED_TIME = #{issuedTime,jdbcType=TIMESTAMP},
+      CREATEMAN = #{createman,jdbcType=VARCHAR},
+      CREATETIME = #{createtime,jdbcType=TIMESTAMP},
+      UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
+      TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
+      PURPOSE = #{purpose,jdbcType=VARCHAR},
+      WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
+    update EMS_PRODPLAN_ROUND
+    <set>
+      <if test="may != null">
+        MAY = #{may,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sqno != null">
+        SQNO = #{sqno,jdbcType=DECIMAL},
+      </if>
+      <if test="unitid != null">
+        UNITID = #{unitid,jdbcType=VARCHAR},
+      </if>
+      <if test="describe != null">
+        DESCRIBE = #{describe,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        STATE = #{state,jdbcType=VARCHAR},
+      </if>
+      <if test="grades != null">
+        GRADES = #{grades,jdbcType=VARCHAR},
+      </if>
+      <if test="planWeight != null">
+        PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="specifications != null">
+        SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
+      </if>
+      <if test="lengths != null">
+        LENGTHS = #{lengths,jdbcType=VARCHAR},
+      </if>
+      <if test="chemicalStandard != null">
+        CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="surfaceStandard != null">
+        SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
+      </if>
+      <if test="memo != null">
+        MEMO = #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="issuedTime != null">
+        ISSUED_TIME = #{issuedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createman != null">
+        CREATEMAN = #{createman,jdbcType=VARCHAR},
+      </if>
+      <if test="createtime != null">
+        CREATETIME = #{createtime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateman != null">
+        UPDATEMAN = #{updateman,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null">
+        UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="transportType != null">
+        TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
+      </if>
+      <if test="purpose != null">
+        PURPOSE = #{purpose,jdbcType=VARCHAR},
+      </if>
+      <if test="workprocType != null">
+        WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR},
+      </if>
+      <if test="msgFlag != null">
+        MSG_FLAG = #{msgFlag,jdbcType=VARCHAR},
+      </if>
+      <if test="readFlag != null">
+        READ_FLAG = #{readFlag,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_ROUND 
+      (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)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.id,jdbcType=VARCHAR}, 
+      #{item.may,jdbcType=TIMESTAMP}, #{item.sqno,jdbcType=DECIMAL}, #{item.unitid,jdbcType=VARCHAR},
+      #{item.describe,jdbcType=VARCHAR}, #{item.state,jdbcType=VARCHAR}, #{item.grades,jdbcType=VARCHAR}, 
+      #{item.planWeight,jdbcType=DECIMAL}, #{item.specifications,jdbcType=VARCHAR}, #{item.lengths,jdbcType=VARCHAR}, 
+      #{item.chemicalStandard,jdbcType=VARCHAR}, #{item.surfaceStandard,jdbcType=VARCHAR}, 
+      #{item.memo,jdbcType=VARCHAR}, #{item.issuedTime,jdbcType=TIMESTAMP}, #{item.createman,jdbcType=VARCHAR}, 
+      #{item.createtime,jdbcType=TIMESTAMP}, #{item.updateman,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=TIMESTAMP}, 
+      #{item.transportType,jdbcType=VARCHAR}, #{item.purpose,jdbcType=VARCHAR}, #{item.workprocType,jdbcType=VARCHAR}, 
+      #{item.msgFlag,jdbcType=VARCHAR}, #{item.readFlag,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update EMS_PRODPLAN_ROUND
+     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>
+       ,MAY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.may,jdbcType=TIMESTAMP}
+       </foreach>
+       ,SQNO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.sqno,jdbcType=DECIMAL}
+       </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>
+       ,DESCRIBE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.describe,jdbcType=VARCHAR}
+       </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>
+       ,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>
+       ,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=VARCHAR}
+       </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>
+       ,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>
+       ,ISSUED_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.issuedTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,CREATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
+       </foreach>
+       ,CREATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATEMAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATETIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=TIMESTAMP}
+       </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>
+       ,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>
+       ,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>
+       ,MSG_FLAG=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.msgFlag,jdbcType=VARCHAR}
+       </foreach>
+       ,READ_FLAG=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.readFlag,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_ROUND
+    where ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!--获取超出重量-->
+  <!--获取超出重量-->
+  <select id="getbeyondWeight" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select  nvl(sum(t.plan_weight),0) plan_weight from EMS_PRODPLAN_ROUND t
+     <where>
+       <if test="parentid != null and parentid !='' ">
+        and t.parentid = #{parentid}
+       </if>
+       <if test="may != null ">
+         and   trunc(t.may) = to_date(#{may},'yyyy-mm')
+       </if>
+     </where>
+  </select>
+  <select id="getSumPlanWeight" parameterType="java.util.List"  resultMap="BaseResultMap">
+    select  nvl(sum(t.plan_weight),0) plan_weight from EMS_PRODPLAN_ROUND t  where t.id in
+     <foreach collection="list" item="id" open="(" close=")" separator=",">
+       #{id}
+     </foreach>
+  </select>
+</mapper>

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

@@ -0,0 +1,392 @@
+package com.steerinfo.ems.emsprodplanround.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value="轮次计划表")
+public class EmsProdplanRound implements IBasePO<String> {
+    /**
+     * 主键(ID,VARCHAR,100)
+     */
+    @ApiModelProperty(value="主键",required=true)
+    private String id;
+
+    /**
+     * 月份(MAY,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="月份",required=false)
+    @JSONField(format = "yyyy-MM")
+    private Date may;
+
+    /**
+     * 序号(SQNO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="序号",required=false)
+    private Long sqno;
+
+    /**
+     * 单位ID(UNITID,VARCHAR,20)
+     */
+    @ApiModelProperty(value="单位ID",required=false)
+    private String unitid;
+
+    /**
+     * 描述(DESCRIBE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="描述",required=false)
+    private String describe;
+
+    /**
+     * 状态(STATE,VARCHAR,10)
+     */
+    @ApiModelProperty(value="状态",required=false)
+    private String state;
+
+    /**
+     * 钢种(GRADES,VARCHAR,100)
+     */
+    @ApiModelProperty(value="钢种",required=false)
+    private String grades;
+
+    /**
+     * 计划量(PLAN_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计划量",required=false)
+    private Long planWeight;
+
+    /**
+     * 规格(SPECIFICATIONS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="规格",required=false)
+    private String specifications;
+
+    /**
+     * 长度(LENGTHS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="长度",required=false)
+    private String lengths;
+
+    /**
+     * 化学成分执行标准(CHEMICAL_STANDARD,VARCHAR,100)
+     */
+    @ApiModelProperty(value="化学成分执行标准",required=false)
+    private String chemicalStandard;
+
+    /**
+     * 表面成分执行标准(SURFACE_STANDARD,VARCHAR,100)
+     */
+    @ApiModelProperty(value="表面成分执行标准",required=false)
+    private String surfaceStandard;
+
+    /**
+     * 备注(MEMO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String memo;
+
+    /**
+     * 下发时间(ISSUED_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="下发时间",required=false)
+    private Date issuedTime;
+
+    /**
+     * 创建人(CREATEMAN,VARCHAR,100)
+     */
+    @ApiModelProperty(value="创建人",required=false)
+    private String createman;
+
+    /**
+     * 创建时间(CREATETIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="创建时间",required=false)
+    private Date createtime;
+
+    /**
+     * 修改时间(UPDATEMAN,VARCHAR,100)
+     */
+    @ApiModelProperty(value="修改人",required=false)
+    private String updateman;
+
+    /**
+     * 修改时间(UPDATETIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间",required=false)
+    private Date updatetime;
+
+    /**
+     * 运输方式(TRANSPORT_TYPE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="运输方式",required=false)
+    private String transportType;
+
+    /**
+     * 用途(PURPOSE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="用途",required=false)
+    private String purpose;
+
+    /**
+     * 工序类别(WORKPROC_TYPE,VARCHAR,100)
+     */
+    @ApiModelProperty(value="工序类别",required=false)
+    private String workprocType;
+
+    /**
+     * I:Insert;U:Update;D:Delete (MSG_FLAG,VARCHAR,20)
+     */
+    @ApiModelProperty(value="I:Insert;U:Update;D:Delete ",required=true)
+    private String msgFlag;
+
+    /**
+     * N:未读;Y已读(READ_FLAG,VARCHAR,20)
+     */
+    @ApiModelProperty(value="N:未读;Y已读",required=true)
+    private String readFlag;
+
+    @ApiModelProperty(value="父级id",required=true)
+    private String parentid;
+
+    public String getParentid() {
+        return parentid;
+    }
+
+    public void setParentid(String parentid) {
+        this.parentid = parentid;
+    }
+
+    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 getMay() {
+        return may;
+    }
+
+    public void setMay(Date may) {
+        this.may = may;
+    }
+
+    public Long getSqno() {
+        return sqno;
+    }
+
+    public void setSqno(Long sqno) {
+        this.sqno = sqno;
+    }
+
+    public String getUnitid() {
+        return unitid;
+    }
+
+    public void setUnitid(String unitid) {
+        this.unitid = unitid == null ? null : unitid.trim();
+    }
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe == null ? null : describe.trim();
+    }
+
+    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 Long getPlanWeight() {
+        return planWeight;
+    }
+
+    public void setPlanWeight(Long planWeight) {
+        this.planWeight = planWeight;
+    }
+
+    public String getSpecifications() {
+        return specifications;
+    }
+
+    public void setSpecifications(String specifications) {
+        this.specifications = specifications == null ? null : specifications.trim();
+    }
+
+    public String getLengths() {
+        return lengths;
+    }
+
+    public void setLengths(String lengths) {
+        this.lengths = lengths == null ? null : lengths.trim();
+    }
+
+    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 getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo == null ? null : memo.trim();
+    }
+
+    public Date getIssuedTime() {
+        return issuedTime;
+    }
+
+    public void setIssuedTime(Date issuedTime) {
+        this.issuedTime = issuedTime;
+    }
+
+    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 getTransportType() {
+        return transportType;
+    }
+
+    public void setTransportType(String transportType) {
+        this.transportType = transportType == null ? null : transportType.trim();
+    }
+
+    //下发和取消下发的标志
+    public String isxf;
+
+    public String getIsxf() {
+        return isxf;
+    }
+
+    public void setIsxf(String isxf) {
+        this.isxf = isxf;
+    }
+
+    public String getPurpose() {
+        return purpose;
+    }
+
+    public void setPurpose(String purpose) {
+        this.purpose = purpose == null ? null : purpose.trim();
+    }
+
+    public String getWorkprocType() {
+        return workprocType;
+    }
+
+    public void setWorkprocType(String workprocType) {
+        this.workprocType = workprocType == null ? null : workprocType.trim();
+    }
+
+    public String getMsgFlag() {
+        return msgFlag;
+    }
+
+    public void setMsgFlag(String msgFlag) {
+        this.msgFlag = msgFlag == null ? null : msgFlag.trim();
+    }
+
+    public String getReadFlag() {
+        return readFlag;
+    }
+
+    public void setReadFlag(String readFlag) {
+        this.readFlag = readFlag == null ? null : readFlag.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(", may=").append(may);
+        sb.append(", sqno=").append(sqno);
+        sb.append(", unitid=").append(unitid);
+        sb.append(", describe=").append(describe);
+        sb.append(", state=").append(state);
+        sb.append(", grades=").append(grades);
+        sb.append(", planWeight=").append(planWeight);
+        sb.append(", specifications=").append(specifications);
+        sb.append(", lengths=").append(lengths);
+        sb.append(", chemicalStandard=").append(chemicalStandard);
+        sb.append(", surfaceStandard=").append(surfaceStandard);
+        sb.append(", memo=").append(memo);
+        sb.append(", issuedTime=").append(issuedTime);
+        sb.append(", createman=").append(createman);
+        sb.append(", createtime=").append(createtime);
+        sb.append(", updateman=").append(updateman);
+        sb.append(", updatetime=").append(updatetime);
+        sb.append(", transportType=").append(transportType);
+        sb.append(", purpose=").append(purpose);
+        sb.append(", workprocType=").append(workprocType);
+        sb.append(", msgFlag=").append(msgFlag);
+        sb.append(", readFlag=").append(readFlag);
+        sb.append(",parentid=").append(parentid);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,27 @@
+package com.steerinfo.ems.emsprodplanround.service;
+
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * EmsProdplanRound服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-06 03:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-06
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanRound服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IEmsProdplanRoundService extends IBaseService<EmsProdplanRound, String>{
+    EmsProdplanRound getbeyondWeight(HashMap<String,Object> parmas);
+
+    EmsProdplanRound getSumPlanWeight(List ids);
+}

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

@@ -0,0 +1,48 @@
+package com.steerinfo.ems.emsprodplanround.service.impl;
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+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 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;
+
+/**
+ * EmsProdplanRound服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-07-06 03:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-07-06
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanRound服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsProdplanRoundService")
+public class EmsProdplanRoundServiceImpl extends BaseServiceImpl<EmsProdplanRound, String> implements IEmsProdplanRoundService {
+
+    @Autowired
+    private EmsProdplanRoundMapper emsProdplanRoundMapper;
+
+    @Override
+    protected IBaseMapper<EmsProdplanRound, String> getMapper() {
+        return emsProdplanRoundMapper;
+    }
+
+    @Override
+    public EmsProdplanRound getbeyondWeight(HashMap<String,Object> parmas) {
+        return emsProdplanRoundMapper.getbeyondWeight(parmas);
+    }
+
+    @Override
+    public EmsProdplanRound getSumPlanWeight(List ids) {
+        return emsProdplanRoundMapper.getSumPlanWeight(ids);
+    }
+}

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

@@ -0,0 +1,235 @@
+package com.steerinfo.ems.emsprodplanyear.controller;
+
+import com.steerinfo.auth.utils.JwtUtil;
+import com.steerinfo.ems.emsprodplanyear.mapper.EmsProdplanYearMapper;
+import com.steerinfo.ems.trmtransfereactvalue.model.TRmTransfereActValue;
+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.emsprodplanyear.model.EmsProdplanYear;
+import com.steerinfo.ems.emsprodplanyear.service.IEmsProdplanYearService;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.math.BigDecimal;
+
+/**
+ * EmsProdplanYear RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-06-26 08:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-06-26
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanYear RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/emsprodplanyears")
+public class EmsProdplanYearController extends BaseRESTfulController {
+
+    @Autowired
+    IEmsProdplanYearService emsProdplanYearService;
+
+    @Autowired
+   private  EmsProdplanYearMapper emsProdplanYearMapper;
+
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("emsprodplanyear:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanYear> list = emsProdplanYearService.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("emsprodplanyear:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<EmsProdplanYear> list = emsProdplanYearService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据EmsProdplanYear对象创建")
+    @ApiImplicitParam(name = "emsProdplanYear", value = "详细实体emsProdplanYear", required = true, dataType = "EmsProdplanYear")
+    @PostMapping(value = "/", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult add(@RequestBody EmsProdplanYear[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (int i = 0; i < models.length; i++) {
+            EmsProdplanYear model = models[i];
+            if(model.getLine() == null || model.getLine().equals("")){
+                return  failed(null,"工序为空");
+            }
+            if(model.getUnit() == null || model.getUnit().equals("")){
+                return  failed(null,"计量单位为空");
+            }
+            if(model.getYearmonth() == null){
+                return  failed(null,"请选择时间");
+            }
+            Map map = new HashMap();
+            map.put("line",model.getLine());
+            map.put("yearmonth",new SimpleDateFormat("yyyy-MM").format(model.getYearmonth()));
+            map.put("productid",model.getProductid());
+            List list = emsProdplanYearService.getDateForProduct((HashMap<String, Object>) map);
+            if (list.size()>0){
+                return  failed(null,"该月时间段数据已生成,无法再次生成");
+            }
+
+            model.setCjr(userId);
+            model.setCjsj(new Date());
+            EmsProdplanYear emsProdplanYear = emsProdplanYearService.add(model);
+        }
+        return success();
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanyear:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        EmsProdplanYear emsProdplanYear = emsProdplanYearService.getById(id);
+        return success(emsProdplanYear);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsProdplanYear信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "emsProdplanYear", value = "详细实体emsProdplanYear", required = true, dataType = "EmsProdplanYear")
+    })
+    //@RequiresPermissions("emsprodplanyear:update")
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody EmsProdplanYear model){
+        model.setId(id);
+        EmsProdplanYear emsProdplanYear = emsProdplanYearService.modify(model);
+        return success(emsProdplanYear);
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("emsprodplanyear:delete")
+    @DeleteMapping(value = "/delete", produces  = "application/json;charset=UTF-8")//String
+    public RESTfulResult delete(@RequestBody EmsProdplanYear[] models){
+        if(models.length >= 1) {
+            for (int i = 0; i < models.length; i++) {
+                EmsProdplanYear m = models[i];
+                if(m==null || m.getNo() ==null || m.getNo().isEmpty()){
+                    return failed(null, "请传入数据ID");
+                }
+                EmsProdplanYear tv = emsProdplanYearService.getById(m.getNo());
+                if (tv == null){
+                    return failed(null, "数据已经删除,请重新查询数据");
+                }
+            }
+        } else {
+            return failed(null, "请输入要删除的数据");
+        }
+        for (int i = 0; i< models.length; i++) {
+            emsProdplanYearService.delete(models[i].getId());
+        }
+        return success();
+    }
+//   //年计划 炼钢厂获取编辑页面
+//    @ApiOperation(value = "查询",notes = "根据时间来生成数据")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+//            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+//    })
+//    @GetMapping(value = "/getDateEditForPage")
+//    public RESTfulResult getDateEditForPage(@RequestParam HashMap<String, Object> parmas,Integer pageNum, Integer pageSize){
+//            if(parmas.get("parentid") == null){
+//            return failed(null, "请选择工序站所");
+//        }
+//        if(parmas.get("yearmonth")==null || parmas.get("yearmonth")==null){
+//            return failed(null, "请选择生成时间");
+//        }
+//        try {
+//            Date end = new SimpleDateFormat("yyyy-MM-dd").parse(parmas.get("jzsj").toString());
+//            Date start = new SimpleDateFormat("yyyy-MM-dd").parse(parmas.get("cjsj").toString());
+//            if ((end.getTime()-start.getTime()) / (24 * 60 * 60 * 1000) > 366){
+//                return failed(null, "生成时间跨度不得超过1年");
+//            }
+//        } catch (ParseException e) {
+//            return failed(null, "时间格式错误");
+//        }
+//        PageList<Map<String, Object>> list = emsProdplanYearService.getDateEditForPage(parmas, pageNum, pageSize);
+//        if(list == null) {
+//            return failed(null, "日期格式有误");
+//        }
+//        return success(list);
+//    }
+
+    @PutMapping(value = "/batchupdate", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@RequestBody EmsProdplanYear[] models){
+        String userId = JwtUtil.getUseridByToken();
+        for (int i = 0; i< models.length; i++) {
+            EmsProdplanYear model = models[i];
+            if(model.getNo() == null || model.getNo().equals("")) {
+                return  failed(null,"id为空");
+            }
+            if(model.getParentid() == null || model.getNo().equals("")){
+                return  failed(null,"parentid为空");
+            }
+            model.setXgr(userId);
+            model.setXgsj(new Date());
+            emsProdplanYearMapper.updateByPrimaryKey(model);
+        }
+//        if(!failmsg.isEmpty()){
+//            return failed(null, "序号 [" + failmsg.substring(0, failmsg.length()-1) + "] 已审核,不允许修改");
+//        }
+//        for (int i = 0; i< models.length; i++) {
+//            EmsProdplanYear model = models[i];
+//            if(model.getCjsj() == null || model.getJzsj() == null){
+//                return failed(null, "数据请传入时间");
+//            }
+//            if(model.getLine() == null || model.getLine().isEmpty()){
+//                return failed(null, "数据请传入位置");
+//            }
+//            if(model.getWeight() == null || model.getWeight() == null){
+//                return failed(null, "请填写完整数据");
+//            }
+//                String strDateFormat = "yyyy-MM-dd";
+//                SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
+//                Map map =  new HashMap();
+//                map.put("line",model.getLine());
+//                map.put("cjsj",sdf.format(model.getCjsj()));
+//                map.put("jzsj",sdf.format(model.getJzsj()));
+//                EmsProdplanYear byId = emsProdplanYearService.getByParams(map);
+//            if(model.getNo() != null && !model.getNo().equals("")){
+//                model.setXgr(userId);
+//                model.setXgsj(new Date());
+//                emsProdplanYearMapper.updateByPrimaryKey(model);
+//            }
+//            else if(byId != null && byId.getZt().equals("1")){
+//                return failed(null, ""+byId.getLine()+"在该期间数据已经生成,无法再次生成");
+//            }
+//            else  {
+//                model.setCjr(userId);
+//                model.setCjsj(new Date());
+//                model.setZt("1");
+//                model.setCjr(userId);
+//                emsProdplanYearService.add(model);
+//            }
+//        }
+        return success();
+    }
+}

+ 24 - 0
src/main/java/com/steerinfo/ems/emsprodplanyear/mapper/EmsProdplanYearMapper.java

@@ -0,0 +1,24 @@
+package com.steerinfo.ems.emsprodplanyear.mapper;
+
+import com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EmsProdplanYearMapper extends IBaseMapper<EmsProdplanYear, String> {
+
+    /**
+     * 生成表数据
+     * @param parmas
+     * @return
+     */
+    List<Map<String, Object>> getDateForProduct(HashMap<String, Object> parmas);
+
+
+
+}

+ 449 - 0
src/main/java/com/steerinfo/ems/emsprodplanyear/mapper/EmsProdplanYearMapper.xml

@@ -0,0 +1,449 @@
+<?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.emsprodplanyear.mapper.EmsProdplanYearMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear">
+    <id column="NO" jdbcType="VARCHAR" property="no" />
+    <result column="LINE" jdbcType="VARCHAR" property="line" />
+    <result column="YEARMONTH" jdbcType="DATE" property="yearmonth" />
+    <result column="UNIT" jdbcType="VARCHAR" property="unit" />
+    <result column="WEIGHT" jdbcType="DECIMAL" property="weight" />
+    <result column="CJR" jdbcType="VARCHAR" property="cjr" />
+    <result column="CJSJ" jdbcType="TIMESTAMP" property="cjsj" />
+    <result column="JZSJ" jdbcType="TIMESTAMP" property="jzsj" />
+    <result column="XGR" jdbcType="VARCHAR" property="xgr" />
+    <result column="XGSJ" jdbcType="TIMESTAMP" property="xgsj" />
+    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <result column="CP" jdbcType="VARCHAR" property="cp" />
+    <result column="SYSL" jdbcType="DECIMAL" property="sysl" />
+    <result column="WXSY" jdbcType="DECIMAL" property="wxsy" />
+    <result column="ZT" jdbcType="VARCHAR" property="zt" />
+    <result column="PARENTID" jdbcType="VARCHAR" property="parentid"/>
+    <result column="PRODUCTID" jdbcType="VARCHAR" property="productid"/>
+  </resultMap>
+  <sql id="columns">
+    NO, LINE, YEARMONTH, UNIT, WEIGHT, CJR, CJSJ, XGR, XGSJ, MEMO, CP, SYSL, WXSY,JZSJ,PARENTID,PRODUCTID
+  </sql>
+  <sql id="columns_alias">
+    t.NO, t.LINE, t.YEARMONTH, t.UNIT, t.WEIGHT, t.CJR, t.CJSJ, t.XGR, t.XGSJ, t.MEMO, 
+    t.CP, t.SYSL, t.WXSY,t.JZSJ,t.ZT,t.PARENTID
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM EMS_PRODPLAN_YEAR
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_YEAR t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="no != null and no != ''">
+        and NO = #{no}
+      </if>
+      <if test="line != null and line != ''">
+        and LINE  in (#{line})
+      </if>
+      <if test="unit != null and unit != ''">
+        and UNIT = #{unit}
+      </if>
+      <if test="weight != null">
+        and WEIGHT = #{weight}
+      </if>
+      <if test=" yearmonth != null and yearmonth != ''">
+       and  to_char(YEARMONTH,'yyyy')  = #{yearmonth}
+      </if>
+      <if test="cjr != null and cjr != '' ">
+        and CJR = #{cjr}
+      </if>
+      <if test="xgr != null and xgr != ''">
+        and XGR = #{xgr}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO = #{memo}
+      </if>
+      <if test="cp != null and cp != ''">
+        and CP = #{cp}
+      </if>
+      <if test="sysl != null">
+        and SYSL = #{sysl}
+      </if>
+      <if test="wxsy != null">
+        and WXSY = #{wxsy}
+      </if>
+      <if test="zt != null">
+        and ZT = #{zt}
+      </if>
+      <if test=" parentid!= null">
+        and PARENTID = #{parentid}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="no != null and no != ''">
+        and NO LIKE '%${no}%'
+      </if>
+      <if test="line != null and line != ''">
+        and LINE LIKE '%${line}%'
+      </if>
+      <if test="yearmonth != null and yearmonth != ''">
+        and YEARMONTH LIKE '%${yearmonth}%'
+      </if>
+      <if test="unit != null and unit != ''">
+        and UNIT LIKE '%${unit}%'
+      </if>
+      <if test="weight != null">
+        and WEIGHT = #{weight}
+      </if>
+      <if test="cjr != null and cjr != ''">
+        and CJR LIKE '%${cjr}%'
+      </if>
+      <if test="cjsj != null">
+        and TO_CHAR(CJSJ,'yyyy-MM-dd') = #{cjsj}
+      </if>
+      <if test="xgr != null and xgr != ''">
+        and XGR LIKE '%${xgr}%'
+      </if>
+      <if test="xgsj != null">
+        and TO_CHAR(XGSJ,'yyyy-MM-dd') = #{xgsj}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </if>
+      <if test="cp != null and cp != ''">
+        and CP LIKE '%${cp}%'
+      </if>
+      <if test="sysl != null">
+        and SYSL = #{sysl}
+      </if>
+      <if test="wxsy != null">
+        and WXSY = #{wxsy}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from EMS_PRODPLAN_YEAR
+    where NO = #{no,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from EMS_PRODPLAN_YEAR
+    where 1!=1 
+      <if test="line != null and line != ''">
+        or LINE = #{line}
+      </if>
+      <if test="yearmonth != null and yearmonth != ''">
+        or YEARMONTH = #{yearmonth}
+      </if>
+      <if test="unit != null and unit != ''">
+        or UNIT = #{unit}
+      </if>
+      <if test="weight != null">
+        or WEIGHT = #{weight}
+      </if>
+      <if test="cjr != null and cjr != ''">
+        or CJR = #{cjr}
+      </if>
+      <if test="cjsj != null">
+        or TO_CHAR(CJSJ,'yyyy-MM-dd') = '#{cjsj}'
+      </if>
+      <if test="xgr != null and xgr != ''">
+        or XGR = #{xgr}
+      </if>
+      <if test="xgsj != null">
+        or TO_CHAR(XGSJ,'yyyy-MM-dd hh24:mi:ss') = '#{xgsj}'
+      </if>
+      <if test="memo != null and memo != ''">
+        or MEMO = #{memo}
+      </if>
+      <if test="cp != null and cp != ''">
+        or CP = #{cp}
+      </if>
+      <if test="sysl != null">
+        or SYSL = #{sysl}
+      </if>
+      <if test="wxsy != null">
+        or WXSY = #{wxsy}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear">
+    insert into EMS_PRODPLAN_YEAR (NO, LINE, YEARMONTH, 
+      UNIT, WEIGHT, CJR, 
+      CJSJ, XGR, XGSJ, 
+      MEMO, CP, SYSL, WXSY,JZSJ,ZT,PARENTID,PRODUCTID
+      )
+    values (#{no,jdbcType=VARCHAR}, #{line,jdbcType=VARCHAR}, #{yearmonth,jdbcType=VARCHAR}, 
+      #{unit,jdbcType=VARCHAR}, #{weight,jdbcType=DECIMAL}, #{cjr,jdbcType=VARCHAR}, 
+      #{cjsj,jdbcType=TIMESTAMP}, #{xgr,jdbcType=VARCHAR}, #{xgsj,jdbcType=TIMESTAMP}, 
+      #{memo,jdbcType=VARCHAR}, #{cp,jdbcType=VARCHAR}, #{sysl,jdbcType=DECIMAL}, #{wxsy,jdbcType=DECIMAL},
+      #{jzsj,jdbcType=TIMESTAMP},#{zt,jdbcType=VARCHAR},#{parentid,jdbcType=VARCHAR},#{productid,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear">
+    insert into EMS_PRODPLAN_YEAR
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="no != null">
+        NO,
+      </if>
+      <if test="line != null">
+        LINE,
+      </if>
+      <if test="yearmonth != null">
+        YEARMONTH,
+      </if>
+      <if test="unit != null">
+        UNIT,
+      </if>
+      <if test="weight != null">
+        WEIGHT,
+      </if>
+      <if test="cjr != null">
+        CJR,
+      </if>
+      <if test="cjsj != null">
+        CJSJ,
+      </if>
+      <if test="xgr != null">
+        XGR,
+      </if>
+      <if test="xgsj != null">
+        XGSJ,
+      </if>
+      <if test="memo != null">
+        MEMO,
+      </if>
+      <if test="cp != null">
+        CP,
+      </if>
+      <if test="sysl != null">
+        SYSL,
+      </if>
+      <if test="wxsy != null">
+        WXSY,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="no != null">
+        #{no,jdbcType=VARCHAR},
+      </if>
+      <if test="line != null">
+        #{line,jdbcType=VARCHAR},
+      </if>
+      <if test="yearmonth != null">
+        #{yearmonth,jdbcType=VARCHAR},
+      </if>
+      <if test="unit != null">
+        #{unit,jdbcType=VARCHAR},
+      </if>
+      <if test="weight != null">
+        #{weight,jdbcType=DECIMAL},
+      </if>
+      <if test="cjr != null">
+        #{cjr,jdbcType=VARCHAR},
+      </if>
+      <if test="cjsj != null">
+        #{cjsj,jdbcType=TIMESTAMP},
+      </if>
+      <if test="xgr != null">
+        #{xgr,jdbcType=VARCHAR},
+      </if>
+      <if test="xgsj != null">
+        #{xgsj,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memo != null">
+        #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="cp != null">
+        #{cp,jdbcType=VARCHAR},
+      </if>
+      <if test="sysl != null">
+        #{sysl,jdbcType=DECIMAL},
+      </if>
+      <if test="wxsy != null">
+        #{wxsy,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear">
+    update EMS_PRODPLAN_YEAR
+    set LINE = #{line,jdbcType=VARCHAR},
+      YEARMONTH = #{yearmonth,jdbcType=VARCHAR},
+      UNIT = #{unit,jdbcType=VARCHAR},
+      WEIGHT = #{weight,jdbcType=DECIMAL},
+      CJR = #{cjr,jdbcType=VARCHAR},
+      CJSJ = #{cjsj,jdbcType=TIMESTAMP},
+      XGR = #{xgr,jdbcType=VARCHAR},
+      XGSJ = #{xgsj,jdbcType=TIMESTAMP},
+      MEMO = #{memo,jdbcType=VARCHAR},
+      CP = #{cp,jdbcType=VARCHAR},
+      SYSL = #{sysl,jdbcType=DECIMAL},
+      WXSY = #{wxsy,jdbcType=DECIMAL}
+    where NO = #{no,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear">
+    update EMS_PRODPLAN_YEAR
+    <set>
+      <if test="line != null">
+        LINE = #{line,jdbcType=VARCHAR},
+      </if>
+      <if test="yearmonth != null">
+        YEARMONTH = #{yearmonth,jdbcType=VARCHAR},
+      </if>
+      <if test="unit != null">
+        UNIT = #{unit,jdbcType=VARCHAR},
+      </if>
+      <if test="weight != null">
+        WEIGHT = #{weight,jdbcType=DECIMAL},
+      </if>
+      <if test="cjr != null">
+        CJR = #{cjr,jdbcType=VARCHAR},
+      </if>
+      <if test="cjsj != null">
+        CJSJ = #{cjsj,jdbcType=TIMESTAMP},
+      </if>
+      <if test="xgr != null">
+        XGR = #{xgr,jdbcType=VARCHAR},
+      </if>
+      <if test="xgsj != null">
+        XGSJ = #{xgsj,jdbcType=TIMESTAMP},
+      </if>
+      <if test="memo != null">
+        MEMO = #{memo,jdbcType=VARCHAR},
+      </if>
+      <if test="cp != null">
+        CP = #{cp,jdbcType=VARCHAR},
+      </if>
+      <if test="sysl != null">
+        SYSL = #{sysl,jdbcType=DECIMAL},
+      </if>
+      <if test="wxsy != null">
+        WXSY = #{wxsy,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where NO = #{no,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where NO = #{no,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_YEAR 
+      (NO, 
+      LINE, YEARMONTH, UNIT, 
+      WEIGHT, CJR, CJSJ, 
+      XGR, XGSJ, MEMO, 
+      CP, SYSL, WXSY
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.no,jdbcType=VARCHAR}, 
+      #{item.line,jdbcType=VARCHAR}, #{item.yearmonth,jdbcType=VARCHAR}, #{item.unit,jdbcType=VARCHAR}, 
+      #{item.weight,jdbcType=DECIMAL}, #{item.cjr,jdbcType=VARCHAR}, #{item.cjsj,jdbcType=TIMESTAMP}, 
+      #{item.xgr,jdbcType=VARCHAR}, #{item.xgsj,jdbcType=TIMESTAMP}, #{item.memo,jdbcType=VARCHAR}, 
+      #{item.cp,jdbcType=VARCHAR}, #{item.sysl,jdbcType=DECIMAL}, #{item.wxsy,jdbcType=DECIMAL}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update EMS_PRODPLAN_YEAR
+     set
+       NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.no,jdbcType=VARCHAR}
+       </foreach>
+       ,LINE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.line,jdbcType=VARCHAR}
+       </foreach>
+       ,YEARMONTH=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.yearmonth,jdbcType=VARCHAR}
+       </foreach>
+       ,UNIT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.unit,jdbcType=VARCHAR}
+       </foreach>
+       ,WEIGHT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.weight,jdbcType=DECIMAL}
+       </foreach>
+       ,CJR=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.cjr,jdbcType=VARCHAR}
+       </foreach>
+       ,CJSJ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.cjsj,jdbcType=TIMESTAMP}
+       </foreach>
+       ,XGR=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.xgr,jdbcType=VARCHAR}
+       </foreach>
+       ,XGSJ=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.xgsj,jdbcType=TIMESTAMP}
+       </foreach>
+       ,MEMO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+       </foreach>
+       ,CP=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.cp,jdbcType=VARCHAR}
+       </foreach>
+       ,SYSL=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.sysl,jdbcType=DECIMAL}
+       </foreach>
+       ,WXSY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case NO" close="end">
+          when #{item.no,jdbcType=VARCHAR} then #{item.wxsy,jdbcType=DECIMAL}
+       </foreach>
+     where NO in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.no,jdbcType=VARCHAR}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from EMS_PRODPLAN_YEAR
+    where NO in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+<!--    &lt;!&ndash;生成表数据&ndash;&gt;-->
+<!--  <select id="getDateForProduct" parameterType="java.util.HashMap" resultMap="BaseResultMap">-->
+<!--    select  #{cjsj}  cjsj ,#{yearmonth} yearmonth, '0' zt,t.line,t.unit,t.cjr,-->
+<!--    t.memo,t.cp-->
+<!--    from (select t.*,-->
+<!--    row_number() over(PARTITION BY t.   line order by t.yearmonth ) as row_flg-->
+<!--    from EMS_PRODPLAN_YEAR t-->
+<!--    where t.parentid in (#{parentid})) t-->
+<!--    where t.row_flg  = '1'-->
+<!--    ORDER BY t.line-->
+<!--  </select>-->
+  <select id="getDateForProduct" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    select t.* from EMS_PRODPLAN_YEAR t
+    <where>
+      <if test=" yearmonth != null and yearmonth != ''">
+        and  to_char(t.YEARMONTH,'yyyy-mm')  = #{yearmonth}
+      </if>
+      <if test=" productid != null and productid != ''">
+        and  t.PRODUCTID  = #{productid}
+      </if>
+      <if test="line != null and line != ''">
+        and t.LINE = #{line}
+      </if>
+    </where>
+  </select>
+
+
+</mapper>

+ 308 - 0
src/main/java/com/steerinfo/ems/emsprodplanyear/model/EmsProdplanYear.java

@@ -0,0 +1,308 @@
+package com.steerinfo.ems.emsprodplanyear.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 lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="生产计划表(年)")
+public class EmsProdplanYear implements IBasePO<String> {
+    /**
+     * ID(NO,VARCHAR,10)
+     */
+    @ApiModelProperty(value="ID",required=true)
+    private String no;
+
+    /**
+     * 工序/产线(LINE,VARCHAR,10)
+     */
+    @ApiModelProperty(value="工序/产线",required=false)
+    private String line;
+
+    /**
+     * 年月YYYYMM(YEARMONTH,VARCHAR,10)
+     */
+    @ApiModelProperty(value="年月YYYYMM",required=false)
+    @JSONField(format = "yyyy-MM")
+    private Date yearmonth;
+
+    /**
+     * 单位(UNIT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="单位",required=false)
+    private String unit;
+
+    /**
+     * 年度计划量(WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="年度计划量",required=false)
+    private BigDecimal weight;
+
+    /**
+     * 创建人(CJR,VARCHAR,10)
+     */
+    @ApiModelProperty(value="创建人",required=false)
+    private String cjr;
+
+    /**
+     * 创建时间(CJSJ,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="创建时间",required=false)
+    @JSONField(format = "yyyy-MM-dd")
+    private Date cjsj;
+
+    /**
+     * 截止时间
+     */
+
+    @ApiModelProperty(value="截止时间",required=false)
+    @JSONField(format = "yyyy-MM-dd")
+    private Date jzsj;
+
+    public Date getJzsj() {
+        return jzsj;
+    }
+
+    public void setJzsj(Date jzsj) {
+        this.jzsj = jzsj;
+    }
+
+    /**
+     * 修改人(XGR,VARCHAR,10)
+     */
+    @ApiModelProperty(value="修改人",required=false)
+    private String xgr;
+
+    /**
+     * 修改时间(XGSJ,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="修改时间",required=false)
+    private Date xgsj;
+
+    /**
+     * 备注(MEMO,VARCHAR,500)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String memo;
+
+    /**
+     * 产品名称(CP,VARCHAR,10)
+     */
+    @ApiModelProperty(value="产品名称",required=false)
+    private String cp;
+
+    /**
+     * 使用数量(SYSL,DECIMAL,0)
+     */
+    @ApiModelProperty(value="使用数量",required=false)
+    private Long sysl;
+
+    /**
+     * 外销数量(WXSY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="外销数量",required=false)
+    private Long wxsy;
+
+    @ApiModelProperty(value = "父级id",required = false)
+    private String  parentid;
+
+    @ApiModelProperty(value = "产品id",required = false)
+    private String productid;
+    public String getProductid() {
+        return productid;
+    }
+
+    public void setProductid(String productid) {
+        this.productid = productid;
+    }
+
+    /**
+     * 状态
+     */
+    @ApiModelProperty(value = "状态",required = false)
+    private String  zt;
+    private String startTime;
+    private String endTime;
+
+    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;
+    }
+
+    public String getZt() {
+        return zt;
+    }
+
+    public void setZt(String zt) {
+        this.zt = zt;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public String getId() {
+        return this.no;
+    }
+
+    @Override
+    public void setId(String no) {
+        this.no = no == null ? null : no.trim();
+    }
+
+    public String getNo() {
+        return no;
+    }
+
+    public void setNo(String no) {
+        this.no = no == null ? null : no.trim();
+    }
+
+    public String getLine() {
+        return line;
+    }
+
+    public void setLine(String line) {
+        this.line = line == null ? null : line.trim();
+    }
+
+    public Date getYearmonth() {
+        return yearmonth;
+    }
+
+    public void setYearmonth(Date yearmonth) {
+        this.yearmonth = yearmonth;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit == null ? null : unit.trim();
+    }
+
+    public BigDecimal getWeight() {
+        return weight;
+    }
+
+    public void setWeight(BigDecimal weight) {
+        this.weight = weight;
+    }
+
+    public String getCjr() {
+        return cjr;
+    }
+
+    public void setCjr(String cjr) {
+        this.cjr = cjr == null ? null : cjr.trim();
+    }
+
+    public Date getCjsj() {
+        return cjsj;
+    }
+
+    public void setCjsj(Date cjsj) {
+        this.cjsj = cjsj;
+    }
+
+    public String getXgr() {
+        return xgr;
+    }
+
+    public void setXgr(String xgr) {
+        this.xgr = xgr == null ? null : xgr.trim();
+    }
+
+    public Date getXgsj() {
+        return xgsj;
+    }
+
+    public void setXgsj(Date xgsj) {
+        this.xgsj = xgsj;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo == null ? null : memo.trim();
+    }
+
+    public String getCp() {
+        return cp;
+    }
+
+    public void setCp(String cp) {
+        this.cp = cp == null ? null : cp.trim();
+    }
+
+    public Long getSysl() {
+        return sysl;
+    }
+
+    public void setSysl(Long sysl) {
+        this.sysl = sysl;
+    }
+
+    public Long getWxsy() {
+        return wxsy;
+    }
+
+    public void setWxsy(Long wxsy) {
+        this.wxsy = wxsy;
+    }
+
+    public String getParentid() {
+        return parentid;
+    }
+
+    public void setParentid(String parentid) {
+        this.parentid = parentid;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", no=").append(no);
+        sb.append(", line=").append(line);
+        sb.append(", yearmonth=").append(yearmonth);
+        sb.append(", unit=").append(unit);
+        sb.append(", weight=").append(weight);
+        sb.append(", cjr=").append(cjr);
+        sb.append(", cjsj=").append(cjsj);
+        sb.append(", jzsj=").append(jzsj);
+        sb.append(", xgr=").append(xgr);
+        sb.append(", xgsj=").append(xgsj);
+        sb.append(", memo=").append(memo);
+        sb.append(", cp=").append(cp);
+        sb.append(", sysl=").append(sysl);
+        sb.append(", wxsy=").append(wxsy);
+        sb.append(",parentid=").append(parentid);
+        sb.append(",zt=").append(zt);
+        sb.append("startTime=").append(startTime);
+        sb.append("endTime=").append(endTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 43 - 0
src/main/java/com/steerinfo/ems/emsprodplanyear/service/IEmsProdplanYearService.java

@@ -0,0 +1,43 @@
+package com.steerinfo.ems.emsprodplanyear.service;
+
+import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear;
+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;
+
+/**
+ * EmsProdplanYear服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-06-26 08:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-06-26
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanYear服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IEmsProdplanYearService extends IBaseService<EmsProdplanYear, String>{
+
+//    /**
+//     * 数据生成
+//     * @param parmas
+//     * @return
+//     */
+//    public PageList<Map<String, Object>> getDateEditForPage(HashMap<String, Object> parmas, Integer pageNum,
+//                                                            Integer pageSize);
+
+    /**
+     * 生成表数据
+     * @param parmas
+     * @return
+     */
+    List<Map<String, Object>> getDateForProduct(HashMap<String, Object> parmas);
+
+}

+ 61 - 0
src/main/java/com/steerinfo/ems/emsprodplanyear/service/impl/EmsProdplanYearServiceImpl.java

@@ -0,0 +1,61 @@
+package com.steerinfo.ems.emsprodplanyear.service.impl;
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.ems.emsprodplanyear.model.EmsProdplanYear;
+import com.steerinfo.ems.emsprodplanyear.mapper.EmsProdplanYearMapper;
+import com.steerinfo.ems.emsprodplanyear.service.IEmsProdplanYearService;
+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;
+
+/**
+ * EmsProdplanYear服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-06-26 08:40
+ * 类描述
+ * 修订历史:
+ * 日期:2021-06-26
+ * 作者:generator
+ * 参考:
+ * 描述:EmsProdplanYear服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "emsProdplanYearService")
+public class EmsProdplanYearServiceImpl extends BaseServiceImpl<EmsProdplanYear, String> implements IEmsProdplanYearService {
+
+    @Autowired
+    private EmsProdplanYearMapper emsProdplanYearMapper;
+
+    @Override
+    protected IBaseMapper<EmsProdplanYear, String> getMapper() {
+        return emsProdplanYearMapper;
+    }
+
+//    @Override
+//    public PageList<Map<String, Object>> getDateEditForPage(HashMap<String, Object> parmas, Integer pageNum,
+//                                                            Integer pageSize) {
+//        PageHelper.startPage(pageNum, pageSize);
+//        List<Map<String, Object>> rows = emsProdplanYearMapper.getDateEdit(parmas);
+//        PageList<Map<String, Object>> pageInfo = new PageList<Map<String, Object>>(rows);
+//        return pageInfo;
+//    }
+
+//    @Override
+//    public PageList<Map<String, Object>> getDateEditForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
+//        return null;
+//    }
+
+    @Override
+    public List<Map<String, Object>> getDateForProduct(HashMap<String, Object> parmas) {
+        return emsProdplanYearMapper.getDateForProduct(parmas);
+    }
+
+}