wcs跟Mes交互的接口

highway
zhaoxiaolin 1 year ago
parent 495255e9a5
commit 91c07021ae

@ -0,0 +1,107 @@
package com.op.system.api.domain.dto;
import java.util.Date;
import java.util.List;
public class WCSDTO {
private String reqCode;
private Date reqTime;
private String planNo;
private String code;
private String message;
private String factory;
private String sku;
private String loadNo;
private List<WCSDataDTO> data;
private List<WCSDataItemsDTO> loadItems;
public String getLoadNo() {
return loadNo;
}
public void setLoadNo(String loadNo) {
this.loadNo = loadNo;
}
public List<WCSDataItemsDTO> getLoadItems() {
return loadItems;
}
public void setLoadItems(List<WCSDataItemsDTO> loadItems) {
this.loadItems = loadItems;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getFactory() {
return factory;
}
public void setFactory(String factory) {
this.factory = factory;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getReqCode() {
return reqCode;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public Date getReqTime() {
return reqTime;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public String getPlanNo() {
return planNo;
}
public void setPlanNo(String planNo) {
this.planNo = planNo;
}
public List<WCSDataDTO> getData() {
return data;
}
public void setData(List<WCSDataDTO> data) {
this.data = data;
}
}

@ -0,0 +1,37 @@
package com.op.system.api.domain.dto;
import java.util.List;
public class WCSDataDTO {
private String sku;
private String loadNo;
private List<WCSDataItemsDTO> unLoadItems;
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getLoadNo() {
return loadNo;
}
public void setLoadNo(String loadNo) {
this.loadNo = loadNo;
}
public List<WCSDataItemsDTO> getUnLoadItems() {
return unLoadItems;
}
public void setUnLoadItems(List<WCSDataItemsDTO> unLoadItems) {
this.unLoadItems = unLoadItems;
}
}

@ -0,0 +1,25 @@
package com.op.system.api.domain.dto;
public class WCSDataItemsDTO {
private String unloadNo;
private String loadNo;
public String getLoadNo() {
return loadNo;
}
public void setLoadNo(String loadNo) {
this.loadNo = loadNo;
}
public String getUnloadNo() {
return unloadNo;
}
public void setUnloadNo(String unloadNo) {
this.unloadNo = unloadNo;
}
}

@ -60,4 +60,12 @@ public enum BusinessType {
* SAP * SAP
*/ */
SAP, SAP,
/**
* WCS
*/
WCS_requestMaterialLoadNo,
/**
* WCS
*/
WCS
} }

@ -0,0 +1,73 @@
package com.op.mes.controller;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.mes.service.IWCSInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Controller
*
* @author sf
* @date 2023-05-18
*/
@RestController
@RequestMapping
public class WCSInterfaceController extends BaseController {
@Autowired
private IWCSInterfaceService WCInterfaceService;
/**
*
* @param
* @return
*/
@Log(title = "请求接料", businessType = BusinessType.WCS_requestMaterialLoadNo)
@PostMapping("/requestMaterialLoadNo")
public WCSDTO requestMaterialLoadNo(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.requestMaterialLoadNo(wcsdto);
}
/**
*
* @param
* @return
*/
@Log(title = "接料完成", businessType = BusinessType.WCS)
@PostMapping("/loadMaterialCompleted")
public WCSDTO loadMaterialCompleted(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.loadMaterialCompleted(wcsdto);
}
/**
* RGV
* @param
* @return
*/
@Log(title = "请求送料", businessType = BusinessType.WCS)
@PostMapping("/requestMaterialUnLoadNo")
public WCSDTO requestMaterialUnLoadNo(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.requestMaterialUnLoadNo(wcsdto);
}
}

@ -0,0 +1,20 @@
package com.op.mes.mapper;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-13
*/
@Mapper
public interface MesMapper {
List<WCSDataItemsDTO> getWetPlanDetail(WCSDTO wcsdto);
}

@ -0,0 +1,21 @@
package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.domain.dto.WCSDTO;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-07-13
*/
public interface IWCSInterfaceService {
WCSDTO requestMaterialLoadNo(WCSDTO wcsdto);
WCSDTO loadMaterialCompleted(WCSDTO wcsdto);
WCSDTO requestMaterialUnLoadNo(WCSDTO wcsdto);
}

@ -0,0 +1,109 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.mes.mapper.MesMapper;
import com.op.mes.service.IWCSInterfaceService;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-07-13
*/
@Service
public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Value("${wcs.url2}")
public String requestMaterialLoadNoUrl;
@Autowired
private MesMapper mesMapper;
/**
* RGV
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "reqTime": "2023-06-30 21:24:04", //请求时间
* "sku": "sku01" //物料编码
* factory:"工厂编码"
* }
*
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求编号
* "code": 0, //返回代码
* "message": "OK", //返回信息
* "loadItems": [
* {
* "loadNo": "A1" //上料机台,上料罐
* },
* {
* "loadNo": "A2" //上料机台,上料罐
* }
* ]
* }
* @param wcsdto
* @return
*/
@Override
public WCSDTO requestMaterialLoadNo(WCSDTO wcsdto) {
DynamicDataSourceContextHolder.push(wcsdto.getFactory());
//获取湿料计划
List<WCSDataItemsDTO> loadItems = mesMapper.getWetPlanDetail(wcsdto);
WCSDTO dto = new WCSDTO();
dto.setLoadItems(loadItems);
dto.setReqCode(wcsdto.getReqCode());
dto.setCode("0");
dto.setMessage("OK");
return dto;
}
/** RGV
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0",//请求ID
* "reqTime": "2023-06-30 21:24:04",//请求时间
* "loadNo": "A1"//接料
* "factory":
* }
*
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0",//请求ID
* "code": 0,//返回代码
* "message": "OK"//返回信息
* }
*/
@Override
public WCSDTO loadMaterialCompleted(WCSDTO wcsdto) {
return null;
}
/**RGV
{
"reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
"reqTime": "2023-06-30 21:24:04", //请求时间
"sku": "sku01" //对应的湿料的物料编码
}
JSON
{
"reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0",//请求ID
"code": 0,//返回代码
"message": "OK",//返回信息
"unLoadItems": [
{
"unloadNo": "B1"//送料机台,成型机
},
{
"unloadNo": "B2"//送料机台,成型机
}
]
}
**/
@Override
public WCSDTO requestMaterialUnLoadNo(WCSDTO wcsdto) {
return null;
}
}

@ -0,0 +1,13 @@
<?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.op.mes.mapper.MesMapper">
<select id="getWetPlanDetail" resultType="com.op.system.api.domain.dto.WCSDataItemsDTO">
select
bucket_code loadNo
from pro_wet_material_plan_detail
where material_code = #{sku} and CONVERT(varchar(10),plan_time, 120) = CONVERT(varchar(10),#{reqTime}, 120)
</select>
</mapper>

@ -186,12 +186,9 @@ public class ProWetMaterialPlanController extends BaseController {
* @return * @return
*/ */
@Log(title = "湿料计划同步", businessType = BusinessType.EXPORT) @Log(title = "湿料计划同步", businessType = BusinessType.EXPORT)
@PostMapping("/syncWCS") @GetMapping("/syncWCS/{id}")
@RequiresPermissions("mes:plan:add") @RequiresPermissions("mes:plan:add")
public AjaxResult syncWCS(@PathVariable String[] ids) { public AjaxResult syncWCS(@PathVariable String id) {
if(ids==null||ids.length==0){ return proWetMaterialPlanService.syncWCS(id);
return error("没有获取到湿料计划");
}
return proWetMaterialPlanService.syncWCS(ids);
} }
} }

@ -15,6 +15,8 @@ public class WCSDTO {
private String message; private String message;
private List<WCSDataDTO> data;
public String getCode() { public String getCode() {
return code; return code;
} }
@ -31,8 +33,6 @@ public class WCSDTO {
this.message = message; this.message = message;
} }
private List<WCSDataDTO> data;
public String getReqCode() { public String getReqCode() {
return reqCode; return reqCode;
} }

@ -3,6 +3,7 @@ package com.op.plan.mapper;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.plan.domain.ProOrderWorkorder; import com.op.plan.domain.ProOrderWorkorder;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -96,14 +97,13 @@ public interface ProOrderWorkorderMapper {
String selectEndWorkOrder(String id); String selectEndWorkOrder(String id);
ProOrderWorkorder selectWorkOrderByCode(String workorderCode); ProOrderWorkorder selectWorkOrderByCode(String workorderCode);
/**下发生产订单**/
/**
*
**/
public int downProOrderWorkorderByWorkorderIds(String[] workorderIds); public int downProOrderWorkorderByWorkorderIds(String[] workorderIds);
public List<ProOrderWorkorder> getWorkOrderByIds(String[] workorderIds); public List<ProOrderWorkorder> getWorkOrderByIds(String[] workorderIds);
String getBucketCodeByWorkId(@Param("workorderId") String workorderId);
/** /**
* Codelist * Codelist
* *

@ -3,10 +3,12 @@ package com.op.plan.mapper;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.plan.domain.BMS; import com.op.plan.domain.BMS;
import com.op.plan.domain.Bucket; import com.op.plan.domain.Bucket;
import com.op.plan.domain.ProWetMaterialPlan; import com.op.plan.domain.ProWetMaterialPlan;
import com.op.plan.domain.Product; import com.op.plan.domain.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@ -15,6 +17,7 @@ import org.apache.ibatis.annotations.Param;
* @author Open Platform * @author Open Platform
* @date 2023-07-24 * @date 2023-07-24
*/ */
@Mapper
public interface ProWetMaterialPlanMapper { public interface ProWetMaterialPlanMapper {
/** /**
* 湿 * 湿
@ -119,4 +122,5 @@ public interface ProWetMaterialPlanMapper {
* @return * @return
*/ */
String selectBucketNameById(String bucketId); String selectBucketNameById(String bucketId);
} }

@ -126,5 +126,5 @@ public interface IProWetMaterialPlanService {
*/ */
AjaxResult checkChangePlan(String id); AjaxResult checkChangePlan(String id);
AjaxResult syncWCS(@PathVariable String[] ids); AjaxResult syncWCS(@PathVariable String id);
} }

@ -255,7 +255,8 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrder = new ProOrder(); proOrder = new ProOrder();
BeanUtils.copyProperties(sapProOrder, proOrder); BeanUtils.copyProperties(sapProOrder, proOrder);
//pro_order_workorder //pro_order_workorder
List<ProOrder> orderExit = proOrderMapper.selectProOrderList(proOrder);
List<ProOrderWorkorder> orderExit = proOrderWorkorderMapper.selectWorkOrderByOrderCode(proOrder.getOrderCode());
if (CollectionUtils.isEmpty(orderExit)) {//不存在就插入 if (CollectionUtils.isEmpty(orderExit)) {//不存在就插入
proOrderMapper.insertProOrder(proOrder); proOrderMapper.insertProOrder(proOrder);
} else if ("w0".equals(orderExit.get(0).getStatus())) { } else if ("w0".equals(orderExit.get(0).getStatus())) {

@ -1,9 +1,9 @@
package com.op.plan.service.impl; package com.op.plan.service.impl;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
@ -12,9 +12,11 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.domain.AjaxResult;
import com.op.plan.domain.*; import com.op.plan.domain.*;
import com.op.plan.domain.dto.WCSDTO; import com.op.plan.domain.dto.WCSDTO;
import com.op.plan.domain.dto.WCSDataDTO;
import com.op.plan.domain.dto.WCSDataItemsDTO;
import com.op.plan.mapper.ProOrderWorkorderMapper; import com.op.plan.mapper.ProOrderWorkorderMapper;
import com.op.plan.mapper.ProWetMaterialPlanDetailMapper; import com.op.plan.mapper.ProWetMaterialPlanDetailMapper;
import com.op.system.api.RemoteSapService; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -33,7 +35,7 @@ import static com.op.common.core.web.domain.AjaxResult.success;
/** /**
* 湿Service * 湿Service
* *
* @author Open Platform * @author zxl
* @date 2023-07-24 * @date 2023-07-24
*/ */
@Service @Service
@ -46,7 +48,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper; private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper;
@Value("${wcs.url1}") @Value("${wcs.url1}")
public String requestMaterialLoadNoUrl; public String materialPlanSyncUrl;
/** /**
* 湿 * 湿
* *
@ -305,21 +307,63 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
* } * }
*/ */
@Override @Override
@DS("#header.poolName")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult syncWCS(@PathVariable String[] ids) { public AjaxResult syncWCS(@PathVariable String id) {
String successid = "";
for(String id:ids){
//获取湿料计划 //获取湿料计划
WCSDTO wcsdto = new WCSDTO(); WCSDTO wcsdto = new WCSDTO();
wcsdto.setReqCode(id);//主计划id wcsdto.setReqCode(id);//主计划id
wcsdto.setReqTime(DateUtils.getNowDate()); wcsdto.setReqTime(DateUtils.getNowDate());
List<ProWetMaterialPlanDetail> planDetails = proWetMaterialPlanDetailMapper.selectDetailListById(id); List<ProWetMaterialPlanDetail> planDetails = proWetMaterialPlanDetailMapper.selectDetailListById(id);
//罐
List<String> gList = planDetails.stream().map(ProWetMaterialPlanDetail::getBucketCode)
.distinct().collect(Collectors.toList());
//罐-料
Map<String, String> glMap = planDetails.stream()
.collect(Collectors.toMap(ProWetMaterialPlanDetail::getBucketCode,
ProWetMaterialPlanDetail::getMaterialCode, (k1, k2) -> k1));
String sendResult = HttpUtils.sendPost(requestMaterialLoadNoUrl, JSON.toJSONString(wcsdto)); List<WCSDataDTO> data = new ArrayList<>();
WCSDTO resultdto = JSON.parseObject(sendResult,WCSDTO.class); WCSDataDTO wCSDataDTO = null;
} for (String g : gList) {
return success(successid+"同步成功"); wCSDataDTO = new WCSDataDTO();
wCSDataDTO.setSku(glMap.get(g));//罐
wCSDataDTO.setLoadNo(g);//料
List<WCSDataItemsDTO> unLoadItems = new ArrayList<>();//上位机集合
//罐-工单
List<ProWetMaterialPlanDetail> ggList = planDetails.stream()
.filter(plan -> plan.getBucketCode().equals(g))
.collect(Collectors.toList());
WCSDataItemsDTO wCSDataItemsDTO = null;
for (ProWetMaterialPlanDetail gg : ggList) {
//根据工单查收坯机编码
String bucketCode = proOrderWorkorderMapper.getBucketCodeByWorkId(gg.getWorkorderId());
if (StringUtils.isNotBlank(bucketCode)) {
wCSDataItemsDTO = new WCSDataItemsDTO();
wCSDataItemsDTO.setUnloadNo(bucketCode);
unLoadItems.add(wCSDataItemsDTO);
}
}
wCSDataDTO.setUnLoadItems(unLoadItems);
}
wcsdto.setData(data);
try {
String sendResult = HttpUtils.sendPost(materialPlanSyncUrl, JSON.toJSONString(wcsdto));
WCSDTO resultdto = JSON.parseObject(sendResult, WCSDTO.class);
if ("1".equals(resultdto.getCode())) {
return error(resultdto.getMessage());
}
}catch (Exception e){
return error("调用接口异常");
}
ProWetMaterialPlan detail = new ProWetMaterialPlan();
detail.setId(id);
detail.setSyncFlag("Y");//已经同步的标识
proWetMaterialPlanMapper.updateProWetMaterialPlan(detail);
return success();
} }
/** /**
@ -411,9 +455,28 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
} }
public static void main(String args[]){ public static void main(String args[]){
String s2="{\"reqTime\":\"2022-07-10 19:39:07.377\",\"reqCode\":\"dbee4f0c-ced7-463f-b19b-c83234cbd5b0\"}"; List<ProWetMaterialPlanDetail> planDetails = new ArrayList<>();
WCSDTO ps2= JSON.parseObject(s2,WCSDTO.class); ProWetMaterialPlanDetail d1=new ProWetMaterialPlanDetail();
System.out.println(ps2); d1.setBucketCode("LG1");
d1.setMaterialCode("WL00001");
planDetails.add(d1);
ProWetMaterialPlanDetail d2=new ProWetMaterialPlanDetail();
d2.setBucketCode("LG2");
d2.setMaterialCode("WL00002");
planDetails.add(d2);
ProWetMaterialPlanDetail d3=new ProWetMaterialPlanDetail();
d3.setBucketCode("LG1");
d3.setMaterialCode("WL00001");
planDetails.add(d3);
//罐
// List<String> gList = planDetails.stream().map(ProWetMaterialPlanDetail::getBucketCode).distinct().collect(Collectors.toList());
//
// List<ProWetMaterialPlanDetail> glList = planDetails.stream()
// .map(e -> new ProWetPlanDetailDTO(e.getBucketCode(), e.getMaterialCode()))
// .collect(Collectors.toList());
//罐-料
Map<String, String> mapStream = planDetails.stream()
.collect(Collectors.toMap(ProWetMaterialPlanDetail::getBucketCode,ProWetMaterialPlanDetail::getMaterialCode, (k1, k2) -> k1));
System.out.println(mapStream);
} }
} }

@ -39,7 +39,11 @@
</resultMap> </resultMap>
<sql id="selectProOrderWorkorderVo"> <sql id="selectProOrderWorkorderVo">
select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name, product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date, shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code , is_end from pro_order_workorder select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name,
product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date,
shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time, prod_type, factory_code , is_end
from pro_order_workorder
</sql> </sql>
<select id="selectProOrderWorkorderList" parameterType="ProOrderWorkorder" resultMap="ProOrderWorkorderResult"> <select id="selectProOrderWorkorderList" parameterType="ProOrderWorkorder" resultMap="ProOrderWorkorderResult">
@ -115,6 +119,11 @@
#{workorderCode} #{workorderCode}
</foreach> </foreach>
</select> </select>
<select id="getBucketCodeByWorkId" resultType="java.lang.String">
select prod_line_code
from pro_order_workorder
where workorder_id = #{workorderId}
</select>
<select id="selectWorkOrderByOrderCode" resultMap="ProOrderWorkorderResult"> <select id="selectWorkOrderByOrderCode" resultMap="ProOrderWorkorderResult">
<include refid="selectProOrderWorkorderVo"/> <include refid="selectProOrderWorkorderVo"/>

@ -33,7 +33,11 @@
</resultMap> </resultMap>
<sql id="selectProWetMaterialPlanDetailVo"> <sql id="selectProWetMaterialPlanDetailVo">
select id, factory_code, wet_material_plan_id, workorder_id, atrr1, atrr2, atrr3, status, create_by, create_time, update_by, update_time, bucket_id, bucket_code, material_code, material_id, material_name, product_name, shift_id, shift_code, shift_desc, plan_time from pro_wet_material_plan_detail select id, factory_code, wet_material_plan_id, workorder_id, atrr1, atrr2, atrr3, status,
create_by, create_time, update_by, update_time, bucket_id, bucket_code,
material_code, material_id, material_name, product_name, shift_id,
shift_code, shift_desc, plan_time
from pro_wet_material_plan_detail
</sql> </sql>
<select id="selectProWetMaterialPlanDetailList" parameterType="ProWetMaterialPlanDetail" resultMap="ProWetMaterialPlanDetailResult"> <select id="selectProWetMaterialPlanDetailList" parameterType="ProWetMaterialPlanDetail" resultMap="ProWetMaterialPlanDetailResult">
@ -82,8 +86,13 @@
<include refid="selectProWetMaterialPlanDetailVo"/> <include refid="selectProWetMaterialPlanDetailVo"/>
where wet_material_plan_id = #{id} and status = 'Y' where wet_material_plan_id = #{id} and status = 'Y'
</select> </select>
<select id="selectDetailListById" resultType="com.op.plan.domain.ProWetMaterialPlanDetail"> <select id="selectDetailListById" resultMap="ProWetMaterialPlanDetailResult">
where wet_material_plan_id = #{id} and status = 'Y' select id, factory_code, wet_material_plan_id, workorder_id, atrr1, atrr2, atrr3, status,
create_by, create_time, update_by, update_time, bucket_id, bucket_code,
material_code, material_id, material_name, product_name, shift_id,
shift_code, shift_desc, plan_time
from pro_wet_material_plan_detail
where wet_material_plan_id = #{id}
</select> </select>
<insert id="insertProWetMaterialPlanDetail" parameterType="ProWetMaterialPlanDetail"> <insert id="insertProWetMaterialPlanDetail" parameterType="ProWetMaterialPlanDetail">

@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteProWetMaterialPlanById" parameterType="String"> <delete id="deleteProWetMaterialPlanById" parameterType="String">
delete from pro_wet_material_plan where id = #{id} delete from pro_wet_material_plan where id = #{id}
</delete> </delete>

Loading…
Cancel
Save