wcs接口开发转移

highway
zhaoxiaolin 1 year ago
parent 2d43cbf1f8
commit 67ef0ac298

@ -1,4 +1,4 @@
package com.op.plan.domain.dto;
package com.op.system.api.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
@ -18,7 +18,7 @@ public class BaseBomComponentDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
private String id;
/** BOM单号 */
@Excel(name = "BOM单号")
@ -31,7 +31,11 @@ public class BaseBomComponentDTO extends BaseEntity {
/** 物料编码 */
@Excel(name = "物料编码")
private String productCode;
private String productDesc;
private String productModel;
private Integer bomCalculateNumber;
private Integer bomBaseNumber;
private String prepareId;
/** 组件上层物料编码 */
@Excel(name = "组件上层物料编码")
private String cumc;
@ -93,11 +97,53 @@ public class BaseBomComponentDTO extends BaseEntity {
@Excel(name = "预留字段3")
private String attr3;
public void setId(Long id) {
private String bomBo;
public Integer getBomBaseNumber() {
return bomBaseNumber;
}
public void setBomBaseNumber(Integer bomBaseNumber) {
this.bomBaseNumber = bomBaseNumber;
}
public Integer getBomCalculateNumber() {
return bomCalculateNumber;
}
public void setBomCalculateNumber(Integer bomCalculateNumber) {
this.bomCalculateNumber = bomCalculateNumber;
}
public String getProductDesc() {
return productDesc;
}
public void setProductDesc(String productDesc) {
this.productDesc = productDesc;
}
public String getProductModel() {
return productModel;
}
public void setProductModel(String productModel) {
this.productModel = productModel;
}
public String getBomBo() {
return bomBo;
}
public void setBomBo(String bomBo) {
this.bomBo = bomBo;
}
public void setId(String id) {
this.id = id;
}
public Long getId() {
public String getId() {
return id;
}
public void setBomCode(String bomCode) {

@ -1,4 +1,4 @@
package com.op.plan.domain.dto;
package com.op.system.api.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
@ -7,6 +7,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* BOM base_bom
@ -95,6 +96,16 @@ public class BaseBomDTO extends BaseEntity {
@Excel(name = "是否在用")
private String currentVersion;
private List<BaseBomComponentDTO> children;
public List<BaseBomComponentDTO> getChildren() {
return children;
}
public void setChildren(List<BaseBomComponentDTO> children) {
this.children = children;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}

@ -21,6 +21,43 @@ public class WCSDTO {
private String loadNo;
private String stationType;
private String stationNo;
private String rfidNo;
private String spec;
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getStationType() {
return stationType;
}
public void setStationType(String stationType) {
this.stationType = stationType;
}
public String getStationNo() {
return stationNo;
}
public void setStationNo(String stationNo) {
this.stationNo = stationNo;
}
public String getRfidNo() {
return rfidNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
private List<WCSDataDTO> data;
private List<WCSDataItemsDTO> loadItems;

@ -0,0 +1,211 @@
package com.op.system.api.domain.mes;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* mes_station_arrive
*
* @author Open Platform
* @date 2023-08-08
*/
public class MesStationArriveDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String recordId;
/** 请求id */
@Excel(name = "请求id")
private String reqCode;
/** 请求时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "请求时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date reqTime;
/** 机台类型: */
@Excel(name = "机台类型:")
private String stationType;
/** 机台编号 */
@Excel(name = "机台编号")
private String stationNo;
/** rfid编号,条码能够区分是白坯料框还是筛盘车 */
@Excel(name = "rfid编号,条码能够区分是白坯料框还是筛盘车")
private String rfidNo;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 批次编码 */
@Excel(name = "批次编码")
private String batchCode;
/** 物料编码 */
@Excel(name = "物料编码")
private String cku;
/** 规格 */
@Excel(name = "规格")
private String spec;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public String getReqCode() {
return reqCode;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public Date getReqTime() {
return reqTime;
}
public void setStationType(String stationType) {
this.stationType = stationType;
}
public String getStationType() {
return stationType;
}
public void setStationNo(String stationNo) {
this.stationNo = stationNo;
}
public String getStationNo() {
return stationNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
public String getRfidNo() {
return rfidNo;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getBatchCode() {
return batchCode;
}
public void setCku(String cku) {
this.cku = cku;
}
public String getCku() {
return cku;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpec() {
return spec;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("reqCode", getReqCode())
.append("reqTime", getReqTime())
.append("stationType", getStationType())
.append("stationNo", getStationNo())
.append("rfidNo", getRfidNo())
.append("workorderCode", getWorkorderCode())
.append("batchCode", getBatchCode())
.append("cku", getCku())
.append("spec", getSpec())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -7,6 +7,7 @@
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots />
</configuration>
</facet>
</component>
@ -124,4 +125,4 @@
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcutil-jdk15on:1.69" level="project" />
</component>
</module>
</module>

@ -0,0 +1,97 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesStationArrive;
import com.op.mes.service.IMesStationArriveService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-08-08
*/
@RestController
@RequestMapping("/arrive")
public class MesStationArriveController extends BaseController {
@Autowired
private IMesStationArriveService mesStationArriveService;
/**
*
*/
@RequiresPermissions("system:arrive:list")
@GetMapping("/list")
public TableDataInfo list(MesStationArrive mesStationArrive) {
startPage();
List<MesStationArrive> list = mesStationArriveService.selectMesStationArriveList(mesStationArrive);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:arrive:export")
@Log(title = "晒盘车到位记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesStationArrive mesStationArrive) {
List<MesStationArrive> list = mesStationArriveService.selectMesStationArriveList(mesStationArrive);
ExcelUtil<MesStationArrive> util = new ExcelUtil<MesStationArrive>(MesStationArrive.class);
util.exportExcel(response, list, "晒盘车到位记录数据");
}
/**
*
*/
@RequiresPermissions("system:arrive:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(mesStationArriveService.selectMesStationArriveByRecordId(recordId));
}
/**
*
*/
@RequiresPermissions("system:arrive:add")
@Log(title = "晒盘车到位记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesStationArrive mesStationArrive) {
return toAjax(mesStationArriveService.insertMesStationArrive(mesStationArrive));
}
/**
*
*/
@RequiresPermissions("system:arrive:edit")
@Log(title = "晒盘车到位记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesStationArrive mesStationArrive) {
return toAjax(mesStationArriveService.updateMesStationArrive(mesStationArrive));
}
/**
*
*/
@RequiresPermissions("system:arrive:remove")
@Log(title = "晒盘车到位记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(mesStationArriveService.deleteMesStationArriveByRecordIds(recordIds));
}
}

@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
* @date 2023-05-18
*/
@RestController
@RequestMapping
@RequestMapping("/wcsInterface")
public class WCSInterfaceController extends BaseController {
@Autowired
@ -60,6 +60,7 @@ public class WCSInterfaceController extends BaseController {
* @param
* @return
*/
//TODO;
@Log(title = "请求送料", businessType = BusinessType.WCS)
@PostMapping("/requestMaterialUnLoadNo")
public WCSDTO requestMaterialUnLoadNo(@RequestBody WCSDTO wcsdto) {
@ -70,4 +71,53 @@ public class WCSInterfaceController extends BaseController {
}
return WCInterfaceService.requestMaterialUnLoadNo(wcsdto);
}
/**
* RGV
* @param
* @return
*/
//TODO;
@Log(title = "送料完成", businessType = BusinessType.WCS)
@PostMapping("/unLoadMaterialCompleted")
public WCSDTO unLoadMaterialCompleted(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.requestMaterialUnLoadNo(wcsdto);
}
/**
*
*
* @param
* @return
*/
@Log(title = "生产机台到位信号", businessType = BusinessType.WCS)
@PostMapping("/stationArrive")
public WCSDTO stationArrive(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.stationArrive(wcsdto);
}
/**
*
* WCS MES
* AGV
* @param
* @return
*/
@Log(title = "下一工序机台集合获取", businessType = BusinessType.WCS)
@PostMapping("/requestDestinationStations")
public WCSDTO requestDestinationStations(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return WCInterfaceService.requestDestinationStations(wcsdto);
}
}

@ -0,0 +1,221 @@
package com.op.mes.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_station_arrive
*
* @author Open Platform
* @date 2023-08-08
*/
public class MesStationArrive extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String recordId;
/** 请求id */
@Excel(name = "请求id")
private String reqCode;
/** 请求时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "请求时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date reqTime;
/** 机台类型: */
@Excel(name = "机台类型:")
private String stationType;
/** 机台编号 */
@Excel(name = "机台编号")
private String stationNo;
/** rfid编号,条码能够区分是白坯料框还是筛盘车 */
@Excel(name = "rfid编号,条码能够区分是白坯料框还是筛盘车")
private String rfidNo;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 批次编码 */
@Excel(name = "批次编码")
private String batchCode;
/** 物料编码 */
@Excel(name = "物料编码")
private String cku;
/** 规格 */
@Excel(name = "规格")
private String spec;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
@Excel(name = "状态")
private String status;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public String getReqCode() {
return reqCode;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public Date getReqTime() {
return reqTime;
}
public void setStationType(String stationType) {
this.stationType = stationType;
}
public String getStationType() {
return stationType;
}
public void setStationNo(String stationNo) {
this.stationNo = stationNo;
}
public String getStationNo() {
return stationNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
public String getRfidNo() {
return rfidNo;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getBatchCode() {
return batchCode;
}
public void setCku(String cku) {
this.cku = cku;
}
public String getCku() {
return cku;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpec() {
return spec;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("reqCode", getReqCode())
.append("reqTime", getReqTime())
.append("stationType", getStationType())
.append("stationNo", getStationNo())
.append("rfidNo", getRfidNo())
.append("workorderCode", getWorkorderCode())
.append("batchCode", getBatchCode())
.append("cku", getCku())
.append("spec", getSpec())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -17,4 +17,6 @@ public interface MesMapper {
List<WCSDataItemsDTO> getWetPlanDetail(WCSDTO wcsdto);
void getSaveStationArrive(WCSDTO wcsdto);
}

@ -0,0 +1,63 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesStationArrive;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author Open Platform
* @date 2023-08-08
*/
@Mapper
public interface MesStationArriveMapper {
/**
*
*
* @param recordId
* @return
*/
public MesStationArrive selectMesStationArriveByRecordId(String recordId);
/**
*
*
* @param mesStationArrive
* @return
*/
public List<MesStationArrive> selectMesStationArriveList(MesStationArrive mesStationArrive);
/**
*
*
* @param mesStationArrive
* @return
*/
public int insertMesStationArrive(MesStationArrive mesStationArrive);
/**
*
*
* @param mesStationArrive
* @return
*/
public int updateMesStationArrive(MesStationArrive mesStationArrive);
/**
*
*
* @param recordId
* @return
*/
public int deleteMesStationArriveByRecordId(String recordId);
/**
*
*
* @param recordIds
* @return
*/
public int deleteMesStationArriveByRecordIds(String[] recordIds);
}

@ -0,0 +1,60 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesStationArrive;
/**
* Service
*
* @author Open Platform
* @date 2023-08-08
*/
public interface IMesStationArriveService {
/**
*
*
* @param recordId
* @return
*/
public MesStationArrive selectMesStationArriveByRecordId(String recordId);
/**
*
*
* @param mesStationArrive
* @return
*/
public List<MesStationArrive> selectMesStationArriveList(MesStationArrive mesStationArrive);
/**
*
*
* @param mesStationArrive
* @return
*/
public int insertMesStationArrive(MesStationArrive mesStationArrive);
/**
*
*
* @param mesStationArrive
* @return
*/
public int updateMesStationArrive(MesStationArrive mesStationArrive);
/**
*
*
* @param recordIds
* @return
*/
public int deleteMesStationArriveByRecordIds(String[] recordIds);
/**
*
*
* @param recordId
* @return
*/
public int deleteMesStationArriveByRecordId(String recordId);
}

@ -18,4 +18,8 @@ public interface IWCSInterfaceService {
WCSDTO loadMaterialCompleted(WCSDTO wcsdto);
WCSDTO requestMaterialUnLoadNo(WCSDTO wcsdto);
WCSDTO stationArrive(WCSDTO wcsdto);
WCSDTO requestDestinationStations(WCSDTO wcsdto);
}

@ -1,7 +1,13 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesStationArrive;
import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesStationArriveMapper;
import com.op.mes.service.IWCSInterfaceService;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
@ -12,7 +18,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
* wcs
*
* @author Open Platform
* @date 2023-07-13
@ -22,28 +28,32 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Autowired
private MesMapper mesMapper;
@Autowired
private MesStationArriveMapper mesStationArriveMapper;
/**
* RGV
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "reqTime": "2023-06-30 21:24:04", //请求时间
* "sku": "sku01" //物料编码
* factory:"工厂编码"
* "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" //上料机台,上料罐
* }
* ]
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求编号
* "code": 0, //返回代码
* "message": "OK", //返回信息
* "loadItems": [
* {
* "loadNo": "A1" //上料机台,上料罐
* },
* {
* "loadNo": "A2" //上料机台,上料罐
* }
* ]
* }
*
* @param wcsdto
* @return
*/
@ -59,48 +69,142 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
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"//返回信息
* }
/**
* 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"//送料机台,成型机
}
]
}
**/
/**
* RGV
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "reqTime": "2023-06-30 21:24:04", //请求时间
* "sku": "sku01" //对应的湿料的物料编码
* }
* <p>
* JSON
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0",//请求ID
* "code": 0,//返回代码
* "message": "OK",//返回信息
* "unLoadItems": [
* {
* "unloadNo": "B1"//送料机台,成型机
* },
* {
* "unloadNo": "B2"//送料机台,成型机
* }
* ]
* }
**/
@Override
public WCSDTO requestMaterialUnLoadNo(WCSDTO wcsdto) {
//TODO;
return null;
}
/**
*
* JSON
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "reqTime": "2023-06-30 21:24:04", //请求时间
* "stationType": "1", //机台类型: 1.成型机、2.烘房、3收坯机、4.收坯码垛
* "stationNo": "S1", //机台编号
* "rfidNo": "r12345" //rfid编号,条码能够区分是白坯料框还是筛盘车
* }
* <p>
* JSON
* {
* <p>
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "code": 0, //返回代码
* "message": "OK", //返回信息
* "sku": "sku01", //托盘到位信号
* "spec": "150", //规格
* }
*
* @param wcsdto
* @return
*/
@Override
public WCSDTO stationArrive(WCSDTO wcsdto) {
DynamicDataSourceContextHolder.push(wcsdto.getFactory());
MesStationArrive sa = new MesStationArrive();
BeanUtils.copyBeanProp(sa, wcsdto);
sa.setRecordId(IdUtils.fastSimpleUUID());
sa.setCreateTime(DateUtils.getNowDate());
sa.setCreateBy(SecurityUtils.getUsername());
sa.setStatus("0");//初始到达
//保存筛盘车到达记录//mes_station_arrive(设备跟机台绑定)
mesStationArriveMapper.insertMesStationArrive(sa);
WCSDTO dto = new WCSDTO();
BeanUtils.copyBeanProp(dto, wcsdto);
dto.setSku("");//TODO;
dto.setSpec("");//TODO;
dto.setCode("0");
dto.setMessage("OK");
return dto;
}
/**
* JSON
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "reqTime": "2023-06-30 21:24:04", //请求时间,
* "rfidNo": "r12345" //rfid编号
* }
*
* JSON
* {
* "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID
* "code": 0, //返回代码
* "message": "OK", //返回信息
* "stationType": "2", //目的机台类型 2烘房 3收坯机
* "sku": "sku01", //物料编码
* "spec": "150", //规格
* "productionState": "K01", //当前工艺状态
* "stationNos": [
* {
* "stationNo": "F1", //目的站台编号
* "qty": 2 //针对于烘房前面的当前筛盘车的数量如果数量大于2就不会往改烘房分配
* },
* {
* "stationNo": "F3", //目的站台编号
* "qty": 2 //针对于烘房前面的当前筛盘车的数量如果数量大于2就不会往改烘房分配
* },
* {
* "stationNo": "F3", //目的站台编号
* "qty": 2 //针对于烘房前面的当前筛盘车的数量如果数量大于2就不会往改烘房分配
* }
* ],
* }
* @param wcsdto
* @return
*/
@Override
public WCSDTO requestDestinationStations(WCSDTO wcsdto) {
DynamicDataSourceContextHolder.push(wcsdto.getFactory());
//mes_station_arrive(设备跟机台绑定)
//MesStationArrive msa = mesStationArriveMapper.getInfoByRecordId(wcsdto.getRfidNo());
return null;
}

@ -0,0 +1,89 @@
package com.op.mes.service.impl;
import java.util.List;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesStationArriveMapper;
import com.op.mes.domain.MesStationArrive;
import com.op.mes.service.IMesStationArriveService;
/**
* Service
*
* @author Open Platform
* @date 2023-08-08
*/
@Service
public class MesStationArriveServiceImpl implements IMesStationArriveService {
@Autowired
private MesStationArriveMapper mesStationArriveMapper;
/**
*
*
* @param recordId
* @return
*/
@Override
public MesStationArrive selectMesStationArriveByRecordId(String recordId) {
return mesStationArriveMapper.selectMesStationArriveByRecordId(recordId);
}
/**
*
*
* @param mesStationArrive
* @return
*/
@Override
public List<MesStationArrive> selectMesStationArriveList(MesStationArrive mesStationArrive) {
return mesStationArriveMapper.selectMesStationArriveList(mesStationArrive);
}
/**
*
*
* @param mesStationArrive
* @return
*/
@Override
public int insertMesStationArrive(MesStationArrive mesStationArrive) {
mesStationArrive.setCreateTime(DateUtils.getNowDate());
return mesStationArriveMapper.insertMesStationArrive(mesStationArrive);
}
/**
*
*
* @param mesStationArrive
* @return
*/
@Override
public int updateMesStationArrive(MesStationArrive mesStationArrive) {
mesStationArrive.setUpdateTime(DateUtils.getNowDate());
return mesStationArriveMapper.updateMesStationArrive(mesStationArrive);
}
/**
*
*
* @param recordIds
* @return
*/
@Override
public int deleteMesStationArriveByRecordIds(String[] recordIds) {
return mesStationArriveMapper.deleteMesStationArriveByRecordIds(recordIds);
}
/**
*
*
* @param recordId
* @return
*/
@Override
public int deleteMesStationArriveByRecordId(String recordId) {
return mesStationArriveMapper.deleteMesStationArriveByRecordId(recordId);
}
}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesPrepareDetailMapper">
<resultMap type="MesPrepareDetail" id="MesPrepareDetailResult">
<result property="recordId" column="record_id" />
<result property="prepareId" column="prepare_id" />
@ -29,12 +29,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesPrepareDetailVo">
select record_id, prepare_id, material_code, materail_name, materail_spc, unit, quantity, product_date, shift_id, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from mes_prepare_detail
select record_id, prepare_id, material_code, materail_name, materail_spc, unit,
quantity, product_date, shift_id, status, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time, prod_type, factory_code
from mes_prepare_detail
</sql>
<select id="selectMesPrepareDetailList" parameterType="MesPrepareDetail" resultMap="MesPrepareDetailResult">
<include refid="selectMesPrepareDetailVo"/>
<where>
<where>
<if test="prepareId != null and prepareId != ''"> and prepare_id = #{prepareId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materailName != null and materailName != ''"> and materail_name like concat('%', #{materailName}, '%')</if>
@ -52,12 +55,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectMesPrepareDetailByRecordId" parameterType="String" resultMap="MesPrepareDetailResult">
<include refid="selectMesPrepareDetailVo"/>
where record_id = #{recordId}
</select>
<insert id="insertMesPrepareDetail" parameterType="MesPrepareDetail">
insert into mes_prepare_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -140,9 +143,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteMesPrepareDetailByRecordIds" parameterType="String">
delete from mes_prepare_detail where record_id in
delete from mes_prepare_detail where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>
</mapper>

@ -10,4 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from pro_wet_material_plan_detail
where material_code = #{sku} and CONVERT(varchar(10),plan_time, 120) = CONVERT(varchar(10),#{reqTime}, 120)
</select>
<select id="getSaveStationArrive">
</select>
</mapper>

@ -0,0 +1,145 @@
<?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.MesStationArriveMapper">
<resultMap type="MesStationArrive" id="MesStationArriveResult">
<result property="recordId" column="record_id" />
<result property="reqCode" column="reqCode" />
<result property="reqTime" column="reqTime" />
<result property="stationType" column="stationType" />
<result property="stationNo" column="stationNo" />
<result property="rfidNo" column="rfidNo" />
<result property="workorderCode" column="workorder_code" />
<result property="batchCode" column="batch_code" />
<result property="cku" column="cku" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectMesStationArriveVo">
select record_id, reqCode, reqTime, stationType, stationNo, rfidNo, workorder_code, batch_code, cku, spec, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code from mes_station_arrive
</sql>
<select id="selectMesStationArriveList" parameterType="MesStationArrive" resultMap="MesStationArriveResult">
<include refid="selectMesStationArriveVo"/>
<where>
<if test="reqCode != null and reqCode != ''"> and reqCode = #{reqCode}</if>
<if test="reqTime != null "> and reqTime = #{reqTime}</if>
<if test="stationType != null and stationType != ''"> and stationType = #{stationType}</if>
<if test="stationNo != null and stationNo != ''"> and stationNo = #{stationNo}</if>
<if test="rfidNo != null and rfidNo != ''"> and rfidNo = #{rfidNo}</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="cku != null and cku != ''"> and cku = #{cku}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectMesStationArriveByRecordId" parameterType="String" resultMap="MesStationArriveResult">
<include refid="selectMesStationArriveVo"/>
where record_id = #{recordId}
</select>
<insert id="insertMesStationArrive" parameterType="MesStationArrive">
insert into mes_station_arrive
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
<if test="reqCode != null and reqCode != ''">reqCode,</if>
<if test="reqTime != null">reqTime,</if>
<if test="stationType != null">stationType,</if>
<if test="stationNo != null">stationNo,</if>
<if test="rfidNo != null">rfidNo,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="batchCode != null and batchCode != ''">batch_code,</if>
<if test="cku != null">cku,</if>
<if test="spec != null">spec,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
<if test="reqCode != null and reqCode != ''">#{reqCode},</if>
<if test="reqTime != null">#{reqTime},</if>
<if test="stationType != null">#{stationType},</if>
<if test="stationNo != null">#{stationNo},</if>
<if test="rfidNo != null">#{rfidNo},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="batchCode != null and batchCode != ''">#{batchCode},</if>
<if test="cku != null">#{cku},</if>
<if test="spec != null">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateMesStationArrive" parameterType="MesStationArrive">
update mes_station_arrive
<trim prefix="SET" suffixOverrides=",">
<if test="reqCode != null and reqCode != ''">reqCode = #{reqCode},</if>
<if test="reqTime != null">reqTime = #{reqTime},</if>
<if test="stationType != null">stationType = #{stationType},</if>
<if test="stationNo != null">stationNo = #{stationNo},</if>
<if test="rfidNo != null">rfidNo = #{rfidNo},</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if>
<if test="cku != null">cku = #{cku},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteMesStationArriveByRecordId" parameterType="String">
delete from mes_station_arrive where record_id = #{recordId}
</delete>
<delete id="deleteMesStationArriveByRecordIds" parameterType="String">
delete from mes_station_arrive where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

@ -57,6 +57,16 @@ public class ProOrder extends TreeEntity {
/** 任务清单 */
private String workerOrder;
private String bomBo;
public String getBomBo() {
return bomBo;
}
public void setBomBo(String bomBo) {
this.bomBo = bomBo;
}
public Long getQuantitySplit() {
return quantitySplit;
}

@ -138,6 +138,16 @@ public class ProOrderWorkorder extends TreeEntity {
// 料罐名称(湿料计划模块使用)
private String bucketName;
private String prepareId;
public String getPrepareId() {
return prepareId;
}
public void setPrepareId(String prepareId) {
this.prepareId = prepareId;
}
public String getBucketName() {
return bucketName;
}

@ -122,6 +122,14 @@ public interface ProOrderWorkorderMapper {
void createPrepare(MesPrepare mesPrepare);
ProOrder getOrderCodeById(String workorderId);
ProOrder getOrderCodeBySonCode(String parentOrder);
List<BaseBomComponentDTO> getBomComponents(@Param("order") ProOrder order,@Param("list") List<BaseBomComponentDTO> cumsDtos);
void createPrepareDetails(@Param("list") List<BaseBomComponentDTO> allChildren,@Param("wo") ProOrderWorkorder wo);
List<ProOrderWorkorder> selectProOrderWorkerderByWorkerIds(String[] ids);
}

@ -8,11 +8,12 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.plan.domain.*;
import com.op.plan.domain.dto.BaseBomDTO;
import com.op.plan.domain.dto.ProOrderDTO;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.mapper.*;
import com.op.plan.service.IProOrderWorkorderService;
import com.op.system.api.domain.dto.BaseBomComponentDTO;
import com.op.system.api.domain.dto.BaseBomDTO;
import com.op.system.api.domain.dto.MesPrepare;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
@ -167,6 +169,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
/**
*
* (sap)
* @param workorderIds
* @return
*/
@ -193,24 +196,85 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
}
}
}
//生成备料单
for(String workorderId:workorderIds){
ProOrderWorkorder orderWorkorder = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(workorderId);
//备(领)料主单
MesPrepare mesPrepare = new MesPrepare();
BeanUtils.copyBeanProp(mesPrepare,orderWorkorder);
mesPrepare.setPrepareId(orderWorkorder.getWorkorderCode()+"L");//领料单号
mesPrepare.setWorkorderCode(orderWorkorder.getWorkorderCode());
mesPrepare.setCreateBy(SecurityUtils.getUsername());
mesPrepare.setCreateTime(DateUtils.getNowDate());
mesPrepare.setStatus("L0");//待确认
proOrderWorkorderMapper.createPrepare(mesPrepare);
//备(领)料明细-获取bom
}
// //生成备料单
// for(String workorderId:workorderIds){
// ProOrderWorkorder orderWorkorder = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(workorderId);
// //备(领)料主单
// MesPrepare mesPrepare = new MesPrepare();
// BeanUtils.copyBeanProp(mesPrepare,orderWorkorder);
// mesPrepare.setPrepareId(orderWorkorder.getWorkorderCode()+"L");//领料单号
// mesPrepare.setWorkorderCode(orderWorkorder.getWorkorderCode());
// mesPrepare.setCreateBy(SecurityUtils.getUsername());
// mesPrepare.setCreateTime(DateUtils.getNowDate());
// mesPrepare.setStatus("L0");//待确认
// proOrderWorkorderMapper.createPrepare(mesPrepare);
// //备(领)料明细
// orderWorkorder.setPrepareId(mesPrepare.getPrepareId());
// List<BaseBomComponentDTO> boms = this.getBomDtos(workorderId);
// List<BaseBomComponentDTO> allChildren = new ArrayList<>();
// BaseBomComponentDTO bc = new BaseBomComponentDTO();
// bc.setComponent(orderWorkorder.getProductCode());
// getLastChildren(boms, allChildren, bc);
// allChildren.forEach((entity) ->{
// entity.setCreateTime(DateUtils.getNowDate());
// entity.setCreateBy(SecurityUtils.getUsername());
// entity.setId(IdUtils.fastSimpleUUID());
//
// });
// proOrderWorkorderMapper.createPrepareDetails(allChildren,orderWorkorder);
//
// }
//下达工单
return proOrderWorkorderMapper.downProOrderWorkorderByWorkorderIds(workorderIds);
}
// //获取最低级材料
// private void getLastChildren(List<BaseBomComponentDTO> all, List<BaseBomComponentDTO> allChildren , BaseBomComponentDTO bc) {
// List<BaseBomComponentDTO> cList = all.stream().filter(item -> item.getCumc().equals(bc.getComponent()))
// .collect(Collectors.toList());
// if(CollectionUtils.isEmpty(cList)){
// allChildren.add(bc);
// }else{
// for(BaseBomComponentDTO bcc : cList){
// getLastChildren(all, allChildren ,bcc);
// }
// }
// }
// //获取顶级定单的bom组成
// private List<BaseBomComponentDTO> getBomDtos(String workorderId){
// List<BaseBomComponentDTO> bomdtoAdds = new ArrayList<>();//所有数据
//
// List<BaseBomComponentDTO> cumsDtos = new ArrayList<>();
// BaseBomComponentDTO cumsDto = new BaseBomComponentDTO();
// ProOrder order = this.getTopOrder(workorderId);
// cumsDto.setCumc(order.getProdCode());
// cumsDtos.add(cumsDto);
// List<BaseBomComponentDTO> bomdtos = proOrderWorkorderMapper.getBomComponents(order,cumsDtos);//最新版本的第一层子
// bomdtoAdds.addAll(bomdtos);
// Boolean isTrue = true;
// while(isTrue){
// List<BaseBomComponentDTO> bomdtoTop = new ArrayList<>();
// bomdtos.forEach(e->e.setCumc(e.getComponent()));
// bomdtoTop.addAll(bomdtos);
// List<BaseBomComponentDTO> bomdtoSon = proOrderWorkorderMapper.getBomComponents(order,bomdtoTop);
// if(CollectionUtils.isEmpty(bomdtoSon)){
// isTrue = false;
// }else{
// bomdtos = bomdtoSon;
// bomdtoAdds.addAll(bomdtoSon);
// }
// }
//
// return bomdtos;
// }
// //根据工单子单获取最顶级订单的母单
// private ProOrder getTopOrder(String workorderId){
// ProOrder topOrder = proOrderWorkorderMapper.getOrderCodeById(workorderId);
// while(!"0".equals(topOrder.getParentOrder())&& com.op.common.core.utils.StringUtils.isNotEmpty(topOrder.getParentOrder())){
// topOrder = proOrderWorkorderMapper.getOrderCodeBySonCode(topOrder.getParentOrder());
// }
// return topOrder;
// }
/**
*

@ -139,6 +139,17 @@
#{ids}
</foreach>
</select>
<select id="getOrderCodeById" resultType="com.op.plan.domain.ProOrder">
select order_code orderCode,
bom_bo bomBo
from pro_order_workorder where workorder_id = #{workorderId}
</select>
<select id="getOrderCodeBySonCode" resultType="com.op.plan.domain.ProOrder">
select parent_order parentOrder,
order_code orderCode,
bom_bo bomBo
from pro_order where order_code = #{orderCode}
</select>
<insert id="insertProOrderWorkorder" parameterType="ProOrderWorkorder">
insert into pro_order_workorder
@ -278,6 +289,47 @@
<if test="quantity != null">#{quantity},</if>
</trim>
</insert>
<select id="getBomComponents" resultType="com.op.system.api.domain.dto.BaseBomComponentDTO">
select po.order_code orderCode,
po.bom_bo bomBo,
po.factory_code factoryCode,
po.prod_type prodType,
bbc.cumc,
bbc.component,
bbc.standard_dosage standardDosage,
bbc.loss_rate lossRate,
bbc.loss_amount lossAmount,
bbc.cilosses,
bbc.component_unit componentUnit,
bb.bom_base_number bomBaseNumber,
bb.bom_calculate_number bomCalculateNumber,
bp.product_code productCode,
bp.product_desc_zh productDesc,
bp.product_model productModel
from base_bom_component bbc
left join base_bom bb on bbc.bom_code = bbc.bom_code
left join pro_order po on bbc.bom_bo = po.bom_bo
left join base_product bp on bp.product_code = bbc.bom_code
where bbc.bom_bo = #{order.bomBo} and po.order_code = #{order.orderCode} and bbc.cumc in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item.cumc}
</foreach>
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail
(
record_id, prepare_id, material_code, materail_name, materail_spc, unit,
quantity, product_date, shift_id,
create_by,create_time, prod_type, factory_code
)values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},#{wo.prepareId},#{wo.productCode},#{wo.productDesc},#{wo.productModel},#{item.componentUnit},
#{item.quantity},#{wo.productDate},#{wo.shiftId},
#{item.createBy},#{item.createTime},#{wo.prodType},#{wo.factoryCode}
)
</foreach>
</insert>
<update id="updateProOrderWorkorder" parameterType="ProOrderWorkorder">
update pro_order_workorder

Loading…
Cancel
Save