lirl há 3 anos atrás
pai
commit
9ac8f7d525

+ 17 - 108
src/main/java/com/steerinfo/ems/ifmesemsswapfile/controller/IfMesEmsSwapfileController.java

@@ -1,22 +1,30 @@
 package com.steerinfo.ems.ifmesemsswapfile.controller;
 
-import com.steerinfo.auth.utils.JwtUtil;
-import com.steerinfo.ems.Utils.DateUtils;
+import java.util.Arrays;
+import java.util.HashMap;
+
 import com.steerinfo.ems.ifmesemsswapfile.model.IfMesEmsSwapfile;
 import com.steerinfo.ems.ifmesemsswapfile.service.IIfMesEmsSwapfileService;
-import com.steerinfo.ems.trmworkprocmaterialvalue.service.ITRmWorkprocMaterialValueService;
-import com.steerinfo.ems.trmworkprocproductvalue.service.ITRmWorkprocProductValueService;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.HashMap;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/${api.version}/ifmesemsswapfile")
@@ -63,103 +71,4 @@ public class IfMesEmsSwapfileController extends BaseRESTfulController {
         return success();
     }
 
-    @ApiOperation(value="获取列表", notes="分页模糊查询")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
-    })
-    //@RequiresPermissions("tpmcaseact:view")
-    @GetMapping(value = "/queryList/")
-    public RESTfulResult queryList(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
-        if(parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())){
-            PageList<Map<String, Object>> list = ifMesEmsSwapfileService.getQueryList(parmas, pageNum, pageSize);
-            return success(list);
-        }
-        return failed(null, "菜单工序id为空,请联系管理员");
-    }
-
-    @ApiOperation(value="获取列表", notes="分页模糊查询")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
-    })
-    @GetMapping(value = "/queryProductAndMaterial/")
-    public RESTfulResult queryProductAndMaterial(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
-        if(parmas.containsKey("workprocid") && parmas.get("workprocid") != null && !"".equals(parmas.get("workprocid").toString())){
-            if(parmas.containsKey("type") && parmas.get("type") != null && !"".equals(parmas.get("type").toString())) {
-                Object type = parmas.get("type");
-                if ("1".equals(type)) {
-                    parmas.put("table_name","T_RM_WORKPROC_MATERIAL");
-                    parmas.put("table_name2","T_RM_WORKPROC_MATERIAL_VALUE");
-                    parmas.put("listing","MATERIALID");
-                } else if ("2".equals(type)) {
-                    parmas.put("table_name","T_RM_WORKPROC_PRODUCT");
-                    parmas.put("table_name2","T_RM_WORKPROC_PRODUCT_VALUE");
-                    parmas.put("listing","PRODUCTID");
-                } else {
-                    return failed(null, "数据类型有误");
-                }
-                PageList<Map<String, Object>> list = ifMesEmsSwapfileService.queryProductAndMaterial(parmas, pageNum, pageSize);
-                return success(list);
-            }
-            return failed(null,"请选择数据类型");
-        }
-        return failed(null, "菜单工序id为空,请联系管理员");
-    }
-
-    @ApiOperation(value="批量更新详细信息", notes="根据传过来的parmas数组信息来更新详细信息")
-    @ApiImplicitParam(name = "parmas", value = "详细实体usageData", required = true, dataType = "usageData")
-    @PutMapping(value = "/updateProductAndMaterial", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult updateProductAndMaterial(@RequestBody HashMap[] parmas) {
-
-        for (int i = 0; i < parmas.length; i++) {
-            HashMap parma = parmas[i];
-            Object type = parma.get("type");
-            if (parma.containsKey("type") && parma.get("type") != null && !"".equals(parma.get("type").toString())) {
-                if ("1".equals(type)) {
-                    parma.put("table_name", "T_RM_WORKPROC_MATERIAL_VALUE");
-                } else if ("2".equals(type)) {
-                    parma.put("table_name", "T_RM_WORKPROC_PRODUCT_VALUE");
-                } else {
-                    return failed(null, "数据类型有误");
-                }
-                if (!parma.containsKey("itemid") || parma.get("itemid") == null || "".equals(parma.get("itemid").toString())) {
-                    return failed(null, "缺少参数itemid");
-                }
-                if (!parma.containsKey("clock") || parma.get("clock") == null || "".equals(parma.get("clock").toString())) {
-                    return failed(null, "缺少参数clock");
-                }
-                if (!parma.containsKey("timegranid") || parma.get("timegranid") == null || "".equals(parma.get("timegranid").toString())) {
-                    return failed(null, "缺少参数timegranid");
-                }
-                if (!parma.containsKey("actualvalue") || parma.get("actualvalue") == null || "".equals(parma.get("actualvalue").toString())) {
-                    return failed(null, "缺少参数actualvalue");
-                }
-                if (!parma.containsKey("correctvalue") || parma.get("correctvalue") == null || "".equals(parma.get("correctvalue").toString())) {
-                    return failed(null, "缺少参数correctvalue");
-                }
-                if (!parma.containsKey("apportvalue") || parma.get("apportvalue") == null || "".equals(parma.get("apportvalue").toString())) {
-                    return failed(null, "缺少参数apportvalue");
-                }
-                parma.put("upman", JwtUtil.getUseridByToken());
-                parma.put("uptime", DateUtils.getCurrentTimetoDate("yyyy-MM-dd HH:mm:ss"));
-                ifMesEmsSwapfileService.updateProductAndMaterial(parma);
-            }
-        }
-        return success();
-    }
-    @Autowired
-    ITRmWorkprocProductValueService tRmWorkprocProductValueService;
-
-    @Autowired
-    ITRmWorkprocMaterialValueService tRmWorkprocMaterialValueService;
-
-    @ApiOperation(value="从T_RM_PRODUCT,T_RM_MATERIAL生成模板数据", notes="从生成投入产出数据模板")
-    @GetMapping(value = "/generateProductAndMaterial")
-    public RESTfulResult generateProductAndMaterial(@ModelAttribute IfMesEmsSwapfile model){
-        String s = ifMesEmsSwapfileService.generateProductAndMaterial();
-        tRmWorkprocProductValueService.synchronousData();
-        tRmWorkprocMaterialValueService.synchronousData();
-        return success(s);
-    }
 }

+ 6 - 14
src/main/java/com/steerinfo/ems/ifmesemsswapfile/mapper/IfMesEmsSwapfileMapper.java

@@ -1,27 +1,19 @@
 package com.steerinfo.ems.ifmesemsswapfile.mapper;
 
-import com.steerinfo.ems.ifmesemsswapfile.model.IfMesEmsSwapfile;
-import com.steerinfo.framework.mapper.IBaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+import java.util.Set;
+
+import com.steerinfo.ems.ifmesemsswapfile.model.IfMesEmsSwapfile;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface IfMesEmsSwapfileMapper extends IBaseMapper<IfMesEmsSwapfile, String> {
     int insert(IfMesEmsSwapfile model);
-
     int updateStatus(HashMap<String, Object> model);
-
     List<IfMesEmsSwapfile> selectNewMaterial(HashMap<String, Object> model);
-
     BigDecimal getSUM(HashMap<String, Object> model);
-
-    List<Map<String, Object>> getQueryList(HashMap<String, Object> parmas);
-
-    List<Map<String, Object>> queryProductAndMaterial(HashMap<String, Object> parmas);
-
-    int updateProductAndMaterial(HashMap<String, Object> parmas);
 }

+ 4 - 81
src/main/java/com/steerinfo/ems/ifmesemsswapfile/mapper/IfMesEmsSwapfileMapper.xml

@@ -15,10 +15,9 @@
     <result column="CREATETIME" jdbcType="DATE" property="createtime" />
     <result column="STATUS" jdbcType="VARCHAR" property="status" />
     <result column="SENDTIME" jdbcType="DATE" property="sendtime" />
-    <result column="MEMO" jdbcType="DATE" property="memo" />
   </resultMap>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME,MEMO
+    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME
     from IF_MES_EMS_SWAPFILE
     where FID = #{id,jdbcType=VARCHAR}
   </select>
@@ -68,7 +67,7 @@
   </delete>
   
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME,MEMO
+    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME
       from IF_MES_EMS_SWAPFILE
     <where>
         <if test="fid != null and fid != ''">
@@ -114,7 +113,7 @@
   </select>
 
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME,MEMO
+    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME
       from IF_MES_EMS_SWAPFILE
     <where>
         <if test="fid != null and fid != ''">
@@ -160,7 +159,7 @@
   </select>
 
   <select id="selectNewMaterial" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME,MEMO
+    select FID, TYPE, WORKS, PRODLINE, PRODATE, ORDERNO, MATERIALCODE, MATERIALNAME, UNIT, QTY, CREATETIME, STATUS, SENDTIME
       from IF_MES_EMS_SWAPFILE
       where TYPE = #{type,jdbcType=VARCHAR}
         and STATUS in ('0','9')
@@ -294,80 +293,4 @@
     </trim>
   </insert>
 
-  <select id="getQueryList" parameterType="java.util.HashMap" resultType = "Map">
-      SELECT s.FID, s.TYPE, s.WORKS, s.PRODLINE, CASE WHEN s.TYPE = 1 THEN m.WORKPROCID WHEN s.TYPE = 2 THEN p.WORKPROCID END AS WORKPROCID, s.PRODATE, s.ORDERNO, s.MATERIALCODE, s.MATERIALNAME, s.UNIT, s.QTY, s.CREATETIME, s.STATUS, s.SENDTIME, s.MEMO
-      FROM IF_MES_EMS_SWAPFILE s
-      LEFT JOIN T_RM_WORKPROC_PRODUCT p ON s.MATERIALCODE = p.MES_MATERIALCODE
-      LEFT JOIN T_RM_WORKPROC_MATERIAL m ON s.MATERIALCODE = m.MES_MATERIALCODE
-      WHERE (m.WORKPROCID IN (${workProcids}) OR p.WORKPROCID IN (${workProcids}))
-      <if test="prodate != null and prodate != ''">
-      AND s.PRODATE >= to_date(#{prodate}, 'yyyy-mm-dd')
-      </if>
-      <if test="prodate2 != null and prodate2 != ''">
-          AND s.PRODATE &lt;= to_date(#{prodate2}, 'yyyy-mm-dd')
-      </if>
-      <if test="workproc != null and workproc != ''">
-          AND (p.WORKPROCID LIKE '%${workproc}%' OR m.WORKPROCID LIKE '%${workproc}%')
-      </if>
-      <if test="materialname != null and materialname != ''">
-          AND s.MATERIALNAME LIKE '%${materialname}%'
-      </if>
-      <if test="materialcode != null and materialcode != ''">
-          AND s.MATERIALCODE LIKE '%${materialcode}%'
-      </if>
-      <if test="prodline != null and prodline != ''">
-          AND s.PRODLINE LIKE '%${prodline}%'
-      </if>
-      <if test="type != null and type != ''">
-          AND s.TYPE LIKE '%${type}%'
-      </if>
-      ORDER BY s.PRODATE
-  </select>
-
-    <select id="queryProductAndMaterial" parameterType="java.util.HashMap" resultType = "Map">
-        SELECT A.ITEMID, A.CLOCK, A.TIMEGRANID, A.ACTUALVALUE, A.CORRECTVALUE
-             , A.APPORTVALUE, A.BZ, A.USERID, A.UPDATETIME, A.UPMAN
-             , A.UPTIME, B.WORKPROCID, B.MES_MATERIALCODE, B.UNITID, B.${listing} AS MATERIALNAME
-        FROM ${table_name2} A
-        LEFT JOIN ${table_name} B ON A.ITEMID = B.ITEMID
-        WHERE B.WORKPROCID IN (${workProcids})
-        <if test="clock != null and clock != ''">
-            AND A.CLOCK >= #{clock}
-        </if>
-        <if test="clock2 != null and clock2 != ''">
-            AND A.CLOCK &lt;= #{clock2}
-        </if>
-        AND B.ITEMTYPE = 'R'
-        AND B.USEFLAG = '1'
-        AND B.ISFINANCEDATA = '1'
-        <if test="workproc != null and workproc != ''">
-            AND B.WORKPROCID IN (${workProcs})
-        </if>
-        <if test="materialcode != null and materialcode != ''">
-            AND B.MES_MATERIALCODE LIKE '%${materialcode}%'
-        </if>
-        <if test="itemid != null and itemid != ''">
-            AND A.ITEMID LIKE '%${itemid}%'
-        </if>
-        <if test="itemtype !=null and itemtype!='' ">
-            AND B.ITEMTYPE = #{itemtype}
-        </if>
-        <if test="materialname !=null and materialname!='' ">
-           AND B.${listing} = #{materialname}
-        </if>
-        ORDER BY A.CLOCK,B.SEQNO
-    </select>
-
-    <update id="updateProductAndMaterial" parameterType="java.util.HashMap">
-        UPDATE ${table_name}
-        SET APPORTVALUE = #{apportvalue},
-        CORRECTVALUE = #{correctvalue},
-        BZ = #{bz},
-        UPMAN = #{upman},
-        UPTIME = #{uptime}
-        WHERE ITEMID = #{itemid}
-        AND CLOCK = #{clock}
-        AND TIMEGRANID = #{timegranid}
-        AND ACTUALVALUE = #{actualvalue}
-    </update>
 </mapper>

+ 6 - 17
src/main/java/com/steerinfo/ems/ifmesemsswapfile/model/IfMesEmsSwapfile.java

@@ -1,11 +1,14 @@
 package com.steerinfo.ems.ifmesemsswapfile.model;
 
-import com.alibaba.fastjson.JSONObject;
-import com.steerinfo.ems.Utils.DateUtils;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+
 import com.steerinfo.framework.model.IBasePO;
+
 import io.swagger.annotations.ApiModelProperty;
 
-import java.math.BigDecimal;
+import com.alibaba.fastjson.JSONObject;
+import com.steerinfo.ems.Utils.DateUtils;
 
 public class IfMesEmsSwapfile implements IBasePO<String> {
 
@@ -89,12 +92,6 @@ public class IfMesEmsSwapfile implements IBasePO<String> {
     @ApiModelProperty(value="读取时间",required=false)
     private String sendtime;
 
-    /**
-     * 读取时间(SENDTIME,DATE,7)
-     */
-    @ApiModelProperty(value="备注",required=false)
-    private String memo;
-
     public String getFid() {
         return fid;
     }
@@ -186,13 +183,6 @@ public class IfMesEmsSwapfile implements IBasePO<String> {
         this.sendtime = sendtime == null ? null : sendtime;
     }
 
-    public String getMemo() {
-        return memo;
-    }
-    public void setMemo(String memo) {
-        this.memo = memo == null ? null : memo;
-    }
-
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -212,7 +202,6 @@ public class IfMesEmsSwapfile implements IBasePO<String> {
         sb.append(", createtime=").append(createtime);
         sb.append(", status=").append(status);
         sb.append(", sendtime=").append(sendtime);
-        sb.append(", memo=").append(memo);
         sb.append("]");
         return sb.toString();
     }