领料单提交

highway
zhaoxiaolin 2 years ago
parent 432a1c761c
commit 7dc31d221a

@ -0,0 +1,253 @@
package com.op.system.api.domain.mes;
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;
/**
* rfid pro_rfid_process_detail
*
* @author Open Platform
* @date 2023-08-18
*/
public class ProRfidProcessDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
private String recordId;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** rfid号 */
@Excel(name = "rfid号")
private String rfid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String factoryCode;
/** 机台编码 */
@Excel(name = "机台编码")
private String machineCode;
/** 当前步 */
@Excel(name = "当前步")
private String nowProcessId;
/** 下一步 */
@Excel(name = "下一步")
private String nextProcessId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long orderNum;
/** 入时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inTime;
/** 出时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date outTime;
/** 状态0待办1完成 */
@Excel(name = "状态0待办1完成")
private String status;
/** 预留字段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 workBatchCode;
/** 1绑点 */
@Excel(name = "1绑点")
private String bindStatus;
private String productCode;
private String productModel;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductModel() {
return productModel;
}
public void setProductModel(String productModel) {
this.productModel = productModel;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
public String getRfid() {
return rfid;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getMachineCode() {
return machineCode;
}
public void setNowProcessId(String nowProcessId) {
this.nowProcessId = nowProcessId;
}
public String getNowProcessId() {
return nowProcessId;
}
public void setNextProcessId(String nextProcessId) {
this.nextProcessId = nextProcessId;
}
public String getNextProcessId() {
return nextProcessId;
}
public void setOrderNum(Long orderNum) {
this.orderNum = orderNum;
}
public Long getOrderNum() {
return orderNum;
}
public void setInTime(Date inTime) {
this.inTime = inTime;
}
public Date getInTime() {
return inTime;
}
public void setOutTime(Date outTime) {
this.outTime = outTime;
}
public Date getOutTime() {
return outTime;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
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 setWorkBatchCode(String workBatchCode) {
this.workBatchCode = workBatchCode;
}
public String getWorkBatchCode() {
return workBatchCode;
}
public void setBindStatus(String bindStatus) {
this.bindStatus = bindStatus;
}
public String getBindStatus() {
return bindStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("workorderCode", getWorkorderCode())
.append("rfid", getRfid())
.append("factoryCode", getFactoryCode())
.append("machineCode", getMachineCode())
.append("nowProcessId", getNowProcessId())
.append("nextProcessId", getNextProcessId())
.append("orderNum", getOrderNum())
.append("inTime", getInTime())
.append("outTime", getOutTime())
.append("status", getStatus())
.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("workBatchCode", getWorkBatchCode())
.append("bindStatus", getBindStatus())
.toString();
}
}

@ -0,0 +1,125 @@
package com.op.system.api.domain.sap;
public class SapMaterialPreparation {
//订单号
private String AUFNR;
//预留/相关需求的项目编号
private String RSPOS;
//物料号
private String MATNR;
//物料描述(短文本)
private String MAKTX;
//工厂
private String WERKS;
//库存地点
private String LGORT;
//组件的需求日期
private String BDTER;
//需求量
private String BDMNG;
//欠料数量
private String ZQLSL;
//基本计量单位
private String MEINS;
//标识:反冲
private String RGEKZ;
//直接采购标识
private String DBSKZ;
public String getAUFNR() {
return AUFNR;
}
public void setAUFNR(String AUFNR) {
this.AUFNR = AUFNR;
}
public String getRSPOS() {
return RSPOS;
}
public void setRSPOS(String RSPOS) {
this.RSPOS = RSPOS;
}
public String getMATNR() {
return MATNR;
}
public void setMATNR(String MATNR) {
this.MATNR = MATNR;
}
public String getMAKTX() {
return MAKTX;
}
public void setMAKTX(String MAKTX) {
this.MAKTX = MAKTX;
}
public String getWERKS() {
return WERKS;
}
public void setWERKS(String WERKS) {
this.WERKS = WERKS;
}
public String getLGORT() {
return LGORT;
}
public void setLGORT(String LGORT) {
this.LGORT = LGORT;
}
public String getBDTER() {
return BDTER;
}
public void setBDTER(String BDTER) {
this.BDTER = BDTER;
}
public String getBDMNG() {
return BDMNG;
}
public void setBDMNG(String BDMNG) {
this.BDMNG = BDMNG;
}
public String getZQLSL() {
return ZQLSL;
}
public void setZQLSL(String ZQLSL) {
this.ZQLSL = ZQLSL;
}
public String getMEINS() {
return MEINS;
}
public void setMEINS(String MEINS) {
this.MEINS = MEINS;
}
public String getRGEKZ() {
return RGEKZ;
}
public void setRGEKZ(String RGEKZ) {
this.RGEKZ = RGEKZ;
}
public String getDBSKZ() {
return DBSKZ;
}
public void setDBSKZ(String DBSKZ) {
this.DBSKZ = DBSKZ;
}
}

@ -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.system.api.domain.mes.ProRfidProcessDetail;
import com.op.mes.service.IProRfidProcessDetailService;
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;
/**
* rfidController
*
* @author Open Platform
* @date 2023-08-18
*/
@RestController
@RequestMapping("/detail")
public class ProRfidProcessDetailController extends BaseController {
@Autowired
private IProRfidProcessDetailService proRfidProcessDetailService;
/**
* rfid
*/
@RequiresPermissions("system:detail:list")
@GetMapping("/list")
public TableDataInfo list(ProRfidProcessDetail proRfidProcessDetail) {
startPage();
List<ProRfidProcessDetail> list = proRfidProcessDetailService.selectProRfidProcessDetailList(proRfidProcessDetail);
return getDataTable(list);
}
/**
* rfid
*/
@RequiresPermissions("system:detail:export")
@Log(title = "生产rfid流程", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProRfidProcessDetail proRfidProcessDetail) {
List<ProRfidProcessDetail> list = proRfidProcessDetailService.selectProRfidProcessDetailList(proRfidProcessDetail);
ExcelUtil<ProRfidProcessDetail> util = new ExcelUtil<ProRfidProcessDetail>(ProRfidProcessDetail.class);
util.exportExcel(response, list, "生产rfid流程数据");
}
/**
* rfid
*/
@RequiresPermissions("system:detail:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(proRfidProcessDetailService.selectProRfidProcessDetailByRecordId(recordId));
}
/**
* rfid
*/
@RequiresPermissions("system:detail:add")
@Log(title = "生产rfid流程", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProRfidProcessDetail proRfidProcessDetail) {
return toAjax(proRfidProcessDetailService.insertProRfidProcessDetail(proRfidProcessDetail));
}
/**
* rfid
*/
@RequiresPermissions("system:detail:edit")
@Log(title = "生产rfid流程", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProRfidProcessDetail proRfidProcessDetail) {
return toAjax(proRfidProcessDetailService.updateProRfidProcessDetail(proRfidProcessDetail));
}
/**
* rfid
*/
@RequiresPermissions("system:detail:remove")
@Log(title = "生产rfid流程", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(proRfidProcessDetailService.deleteProRfidProcessDetailByRecordIds(recordIds));
}
}

@ -0,0 +1,67 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import org.apache.ibatis.annotations.Mapper;
/**
* rfidMapper
*
* @author Open Platform
* @date 2023-08-18
*/
@Mapper
public interface ProRfidProcessDetailMapper {
/**
* rfid
*
* @param recordId rfid
* @return rfid
*/
public ProRfidProcessDetail selectProRfidProcessDetailByRecordId(String recordId);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return rfid
*/
public List<ProRfidProcessDetail> selectProRfidProcessDetailList(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
public int insertProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
public int updateProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param recordId rfid
* @return
*/
public int deleteProRfidProcessDetailByRecordId(String recordId);
/**
* rfid
*
* @param recordIds
* @return
*/
public int deleteProRfidProcessDetailByRecordIds(String[] recordIds);
public ProRfidProcessDetail getRfidInfo(String rfidNo);
public String getStationType(String equipmentCode);
}

@ -0,0 +1,60 @@
package com.op.mes.service;
import java.util.List;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
/**
* rfidService
*
* @author Open Platform
* @date 2023-08-18
*/
public interface IProRfidProcessDetailService {
/**
* rfid
*
* @param recordId rfid
* @return rfid
*/
public ProRfidProcessDetail selectProRfidProcessDetailByRecordId(String recordId);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return rfid
*/
public List<ProRfidProcessDetail> selectProRfidProcessDetailList(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
public int insertProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
public int updateProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail);
/**
* rfid
*
* @param recordIds rfid
* @return
*/
public int deleteProRfidProcessDetailByRecordIds(String[] recordIds);
/**
* rfid
*
* @param recordId rfid
* @return
*/
public int deleteProRfidProcessDetailByRecordId(String recordId);
}

@ -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.ProRfidProcessDetailMapper;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.mes.service.IProRfidProcessDetailService;
/**
* rfidService
*
* @author Open Platform
* @date 2023-08-18
*/
@Service
public class ProRfidProcessDetailServiceImpl implements IProRfidProcessDetailService {
@Autowired
private ProRfidProcessDetailMapper proRfidProcessDetailMapper;
/**
* rfid
*
* @param recordId rfid
* @return rfid
*/
@Override
public ProRfidProcessDetail selectProRfidProcessDetailByRecordId(String recordId) {
return proRfidProcessDetailMapper.selectProRfidProcessDetailByRecordId(recordId);
}
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return rfid
*/
@Override
public List<ProRfidProcessDetail> selectProRfidProcessDetailList(ProRfidProcessDetail proRfidProcessDetail) {
return proRfidProcessDetailMapper.selectProRfidProcessDetailList(proRfidProcessDetail);
}
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
@Override
public int insertProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail) {
proRfidProcessDetail.setCreateTime(DateUtils.getNowDate());
return proRfidProcessDetailMapper.insertProRfidProcessDetail(proRfidProcessDetail);
}
/**
* rfid
*
* @param proRfidProcessDetail rfid
* @return
*/
@Override
public int updateProRfidProcessDetail(ProRfidProcessDetail proRfidProcessDetail) {
proRfidProcessDetail.setUpdateTime(DateUtils.getNowDate());
return proRfidProcessDetailMapper.updateProRfidProcessDetail(proRfidProcessDetail);
}
/**
* rfid
*
* @param recordIds rfid
* @return
*/
@Override
public int deleteProRfidProcessDetailByRecordIds(String[] recordIds) {
return proRfidProcessDetailMapper.deleteProRfidProcessDetailByRecordIds(recordIds);
}
/**
* rfid
*
* @param recordId rfid
* @return
*/
@Override
public int deleteProRfidProcessDetailByRecordId(String recordId) {
return proRfidProcessDetailMapper.deleteProRfidProcessDetailByRecordId(recordId);
}
}

@ -0,0 +1,179 @@
<?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.ProRfidProcessDetailMapper">
<resultMap type="ProRfidProcessDetail" id="ProRfidProcessDetailResult">
<result property="recordId" column="record_id" />
<result property="workorderCode" column="workorder_code" />
<result property="rfid" column="rfid" />
<result property="factoryCode" column="factory_code" />
<result property="machineCode" column="machine_code" />
<result property="nowProcessId" column="now_process_id" />
<result property="nextProcessId" column="next_process_id" />
<result property="orderNum" column="order_num" />
<result property="inTime" column="in_time" />
<result property="outTime" column="out_time" />
<result property="status" column="status" />
<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="workBatchCode" column="work_batch_code" />
<result property="bindStatus" column="bind_status" />
</resultMap>
<sql id="selectProRfidProcessDetailVo">
select record_id, workorder_code, rfid, factory_code, machine_code, now_process_id,
next_process_id, order_num, in_time, out_time, status, remark, attr1, attr2,
attr3, attr4, create_by, create_time, update_by, update_time, work_batch_code, bind_status
from pro_rfid_process_detail
</sql>
<select id="selectProRfidProcessDetailList" parameterType="ProRfidProcessDetail" resultMap="ProRfidProcessDetailResult">
<include refid="selectProRfidProcessDetailVo"/>
<where>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="rfid != null and rfid != ''"> and rfid = #{rfid}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="nowProcessId != null and nowProcessId != ''"> and now_process_id = #{nowProcessId}</if>
<if test="nextProcessId != null and nextProcessId != ''"> and next_process_id = #{nextProcessId}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="inTime != null "> and in_time = #{inTime}</if>
<if test="outTime != null "> and out_time = #{outTime}</if>
<if test="status != null and status != ''"> and status = #{status}</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="workBatchCode != null and workBatchCode != ''"> and work_batch_code = #{workBatchCode}</if>
<if test="bindStatus != null and bindStatus != ''"> and bind_status = #{bindStatus}</if>
</where>
</select>
<select id="selectProRfidProcessDetailByRecordId" parameterType="String" resultMap="ProRfidProcessDetailResult">
<include refid="selectProRfidProcessDetailVo"/>
where record_id = #{recordId}
</select>
<!--获取在邦rfid 工单的信息-->
<select id="getRfidInfo" resultType="com.op.system.api.domain.mes.ProRfidProcessDetail">
select
rfid.workorder_code workorderCode,
rfid.now_process_id nowProcessId,
rfid.next_process_id nextProcessId,
p.equipment machineCode,
bp.product_code productCode,
bp.product_model productModel
from pro_rfid_process_detail rfid
left join pro_process p on p.process_id = rfid.next_process_id
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code
where rfid.bind_status = '1'
</select>
<select id="getStationType" resultType="java.lang.String">
select
case when equipment_type_code ='equ_type_spj' then '3'
when equipment_type_code ='equ_type_hf' then '2'
else '' end
from base_equipment
where equipment_code = #{equipmentCode}
</select>
<insert id="insertProRfidProcessDetail" parameterType="ProRfidProcessDetail">
insert into pro_rfid_process_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="rfid != null and rfid != ''">rfid,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="machineCode != null">machine_code,</if>
<if test="nowProcessId != null">now_process_id,</if>
<if test="nextProcessId != null">next_process_id,</if>
<if test="orderNum != null">order_num,</if>
<if test="inTime != null">in_time,</if>
<if test="outTime != null">out_time,</if>
<if test="status != null">status,</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="workBatchCode != null">work_batch_code,</if>
<if test="bindStatus != null">bind_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="rfid != null and rfid != ''">#{rfid},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="machineCode != null">#{machineCode},</if>
<if test="nowProcessId != null">#{nowProcessId},</if>
<if test="nextProcessId != null">#{nextProcessId},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="inTime != null">#{inTime},</if>
<if test="outTime != null">#{outTime},</if>
<if test="status != null">#{status},</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="workBatchCode != null">#{workBatchCode},</if>
<if test="bindStatus != null">#{bindStatus},</if>
</trim>
</insert>
<update id="updateProRfidProcessDetail" parameterType="ProRfidProcessDetail">
update pro_rfid_process_detail
<trim prefix="SET" suffixOverrides=",">
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="rfid != null and rfid != ''">rfid = #{rfid},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="machineCode != null">machine_code = #{machineCode},</if>
<if test="nowProcessId != null">now_process_id = #{nowProcessId},</if>
<if test="nextProcessId != null">next_process_id = #{nextProcessId},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="inTime != null">in_time = #{inTime},</if>
<if test="outTime != null">out_time = #{outTime},</if>
<if test="status != null">status = #{status},</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="workBatchCode != null">work_batch_code = #{workBatchCode},</if>
<if test="bindStatus != null">bind_status = #{bindStatus},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteProRfidProcessDetailByRecordId" parameterType="String">
delete from pro_rfid_process_detail where record_id = #{recordId}
</delete>
<delete id="deleteProRfidProcessDetailByRecordIds" parameterType="String">
delete from pro_rfid_process_detail where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,51 @@
package com.op.quality.config;
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
import com.op.common.core.domain.R;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
*
*
* @ClassName: DynamicDatasource
* @Description: TODO
* @author shichangzhou
* @date 2023419 1:01:30
*/
@Component
public class DynamicDatasource {
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Autowired
private RemoteUserService remoteUserService;
@PostConstruct
public void init() {
// 加载sf-cloud库的sys_datasource
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
for (Map<String, String> dateSource : dateSources) {
DataSourceProperty sdp = new DataSourceProperty();
sdp.setUrl(dateSource.get("url"));
sdp.setUsername(dateSource.get("userName"));
sdp.setPassword(dateSource.get("password"));
sdp.setDriverClassName(dateSource.get("driveClassName"));
sdp.setPoolName(dateSource.get("poolName"));// 这是数据源的key
sdp.setLazy(false);
dynamicDatasourceCreator.createDynamicDataSource(sdp);
}
}
}

@ -0,0 +1,78 @@
package com.op.quality.Controller;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.domain.R;
import com.op.common.core.utils.uuid.UUID;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcProCheck;
import com.op.quality.service.QcProCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @ClassName : quaController
* @Description :
* @Author :
* @Date: 2023-08-17 10:28
*/
@RestController
public class QuaController {
@Autowired
private QcProCheckService qcProCheckService;
@PostMapping("/saveQcProCheck")
public R<Boolean> saveQcProCheck(@RequestBody Map<QcProCheck,BaseFile> map) {
// System.out.println(qcProCheck);
// System.out.println(baseFile);
QcProCheck qcProCheck = map.keySet().iterator().next();
BaseFile baseFile = map.values().iterator().next();
if (!qcProCheck.getFactoryId().isEmpty()){
if (baseFile==null){
baseFile = new BaseFile();
qcProCheckService.saveQcProCheck(qcProCheck,baseFile);
}
if (qcProCheck.getIsqua()=="1"){
System.out.println("调用下一个接口");
return R.ok();
}
else{
return R.ok();
}
}
return R.fail();
}
@PostMapping("/test")
public R<Boolean> test() {
// System.out.println(qcProCheck);
// System.out.println(baseFile);
// QcProCheck qcProCheck = map.keySet().iterator().next();
// BaseFile baseFile = map.values().iterator().next();
QcProCheck qcProCheck = new QcProCheck();
BaseFile baseFile = new BaseFile();
qcProCheck.setId("1232132132121321");
qcProCheck.setFactoryId("qewqewqewq");
qcProCheck.setIsqua("1");
baseFile.setFileAddress("qwewqewqewqewqewqq");
if (!qcProCheck.getFactoryId().isEmpty()){
if (baseFile==null){
baseFile = new BaseFile();
qcProCheckService.saveQcProCheck(qcProCheck,baseFile);
}
if (qcProCheck.getIsqua()=="1"){
System.out.println("调用下一个接口");
return R.ok();
}
else{
return R.ok();
}
}
return R.fail();
}
}

@ -0,0 +1,123 @@
package com.op.quality.domain;
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;
/**
* base_file
*
* @author Open Platform
* @date 2023-07-10
*/
public class BaseFile extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 附件ID */
private String fileId;
/** 附件名称 */
@Excel(name = "附件名称")
private String fileName;
/** 附件地址 */
@Excel(name = "附件地址")
private String fileAddress;
/** 数据来源 */
@Excel(name = "数据来源")
private String sourceId;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileId() {
return fileId;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return fileName;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
public String getFileAddress() {
return fileAddress;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceId() {
return sourceId;
}
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(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fileId", getFileId())
.append("fileName", getFileName())
.append("fileAddress", getFileAddress())
.append("sourceId", getSourceId())
.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())
.toString();
}
}

@ -0,0 +1,333 @@
package com.op.quality.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.Date;
/**
* @ClassName : qua
* @Description :
* @Author :
* @Date: 2023-08-17 10:18
*/
public class QcProCheck extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "id")
private String id;
@Excel(name = "rfid")
private String rfid;
@Excel(name = "工厂id")
private String factoryId;
@Excel(name = "工厂编码")
private String factoryCode;
@Excel(name = "工单id")
private String workorderId;
@Excel(name = "工厂编码")
private String workorderCode;
@Excel(name = "工厂名称")
private String workorderName;
@Excel(name = "订单id")
private String orderId;
@Excel(name = "订单编码")
private String orderCode;
@Excel(name = "机台id")
private String machineId;
@Excel(name = "机台编码")
private String machineCode;
@Excel(name = "不良描述")
private String badMeg;
@Excel(name = "产品id")
private String productId;
private String productCode;
@Excel(name = "是否合格")
private String isqua;
@Excel(name = "附件")
private String fileId;
@Excel(name = "创建者")
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Excel(name = "更新者")
private String updateBy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
public String getFactoryId() {
return factoryId;
}
public void setFactoryId(String factoryId) {
this.factoryId = factoryId;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRfid() {
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
public String getWorkorderId() {
return workorderId;
}
public void setWorkorderId(String workorderId) {
this.workorderId = workorderId;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderName() {
return workorderName;
}
public void setWorkorderName(String workorderName) {
this.workorderName = workorderName;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getMachineId() {
return machineId;
}
public void setMachineId(String machineId) {
this.machineId = machineId;
}
public String getMachineCode() {
return machineCode;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getBadMeg() {
return badMeg;
}
public void setBadMeg(String badMeg) {
this.badMeg = badMeg;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getIsqua() {
return isqua;
}
public void setIsqua(String isqua) {
this.isqua = isqua;
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
@Override
public String getCreateBy() {
return createBy;
}
@Override
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String getUpdateBy() {
return updateBy;
}
@Override
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
@Override
public Date getUpdateTime() {
return updateTime;
}
@Override
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr4() {
return attr4;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public QcProCheck(String id, String rfid, String factoryId, String factoryCode, String workorderId, String workorderCode, String workorderName, String orderId, String orderCode, String machineId, String machineCode, String badMeg, String productId, String productCode, String isqua, String fileId, String createBy, Date createTime, String updateBy, Date updateTime, String attr1, String attr2, String attr3, String attr4) {
this.id = id;
this.rfid = rfid;
this.factoryId = factoryId;
this.factoryCode = factoryCode;
this.workorderId = workorderId;
this.workorderCode = workorderCode;
this.workorderName = workorderName;
this.orderId = orderId;
this.orderCode = orderCode;
this.machineId = machineId;
this.machineCode = machineCode;
this.badMeg = badMeg;
this.productId = productId;
this.productCode = productCode;
this.isqua = isqua;
this.fileId = fileId;
this.createBy = createBy;
this.createTime = createTime;
this.updateBy = updateBy;
this.updateTime = updateTime;
this.attr1 = attr1;
this.attr2 = attr2;
this.attr3 = attr3;
this.attr4 = attr4;
}
public QcProCheck() {
}
@Override
public String toString() {
return "QcProCheck{" +
"id='" + id + '\'' +
", rfid='" + rfid + '\'' +
", factoryId='" + factoryId + '\'' +
", factoryCode='" + factoryCode + '\'' +
", workorderId='" + workorderId + '\'' +
", workorderCode='" + workorderCode + '\'' +
", workorderName='" + workorderName + '\'' +
", orderId='" + orderId + '\'' +
", orderCode='" + orderCode + '\'' +
", machineId='" + machineId + '\'' +
", machineCode='" + machineCode + '\'' +
", badMeg='" + badMeg + '\'' +
", productId='" + productId + '\'' +
", productCode='" + productCode + '\'' +
", isqua='" + isqua + '\'' +
", fileId='" + fileId + '\'' +
", createBy='" + createBy + '\'' +
", createTime=" + createTime +
", updateBy='" + updateBy + '\'' +
", updateTime=" + updateTime +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +
", attr4='" + attr4 + '\'' +
'}';
}
}

@ -0,0 +1,71 @@
package com.op.quality.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.quality.domain.BaseFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-10
*/
@Mapper
public interface BaseFileMapper {
/**
*
*
* @param fileId
* @return
*/
public BaseFile selectBaseFileByFileId(String fileId);
/**
*
*
* @param baseFile
* @return
*/
public List<BaseFile> selectBaseFileList(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int insertBaseFile(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int updateBaseFile(BaseFile baseFile);
/**
*
*
* @param fileId
* @return
*/
public int deleteBaseFileByFileId(String fileId);
/**
*
*
* @param fileIds
* @return
*/
public int deleteBaseFileByFileIds(String[] fileIds);
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
List<BaseFile> getBaseFileBatch(String processId);
void deleteBaseFileBySourceId(String processId);
}

@ -0,0 +1,31 @@
package com.op.quality.mapper;
import com.op.common.core.domain.R;
import com.op.quality.domain.QcProCheck;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @ClassName : QuaMapper
* @Description :
* @Author :
* @Date: 2023-08-17 10:40
*/
@Mapper
public interface QcProCheckMapper {
List<QcProCheck> selectQcProCheckList();
int insertQcProCheck(QcProCheck qcProCheck);
int updateQcProCheckById(String rfid);
int deleteQcProCheckById(String rfid);
}

@ -0,0 +1,25 @@
package com.op.quality.service;
import com.op.common.core.domain.R;
//import com.op.quality.domain.BaseFile;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcProCheck;
import java.util.List;
/**
* @ClassName : quaService
* @Description :
* @Author :
* @Date: 2023-08-17 10:29
*/
public interface QcProCheckService {
List<QcProCheck> selectQcProCheck();
R<Boolean> saveQcProCheck(QcProCheck qcProCheck, BaseFile baseFile);
int updateQcProCheck(String rfid);
int deleteQcProCheck(String rfid);
}

@ -0,0 +1,89 @@
package com.op.quality.service.serviceImpl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcProCheck;
import com.op.quality.mapper.BaseFileMapper;
import com.op.quality.mapper.QcProCheckMapper;
import com.op.quality.service.QcProCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @ClassName : quaServiceImpl
* @Description :
* @Author :
* @Date: 2023-08-17 10:28
*/
@Service
public class QcProCheckServiceImpl implements QcProCheckService {
@Autowired
private QcProCheckMapper qcProCheckMapper;
@Autowired
private BaseFileMapper baseFileMapper;
@Override
// @DS("#header.poolName")
public List<QcProCheck> selectQcProCheck() {
return qcProCheckMapper.selectQcProCheckList();
}
@Override
// @DS("#header.poolName")
public R<Boolean> saveQcProCheck(QcProCheck qcProCheck, BaseFile baseFile) {
DynamicDataSourceContextHolder.push("op_xiaolan");
qcProCheck.setId(UUID.randomUUID().toString().replace("-", ""));
if (baseFile.getFileAddress()==null){
qcProCheckMapper.insertQcProCheck(qcProCheck);
}
else {
baseFile.setFileId(UUID.randomUUID().toString().replace("-", ""));
qcProCheck.setFileId(baseFile.getFileId());
qcProCheckMapper.insertQcProCheck(qcProCheck);
baseFileMapper.insertBaseFile(baseFile);
}
return R.ok(true);
}
@Override
// @DS("#header.poolName")
public int updateQcProCheck(String id) {
return qcProCheckMapper.updateQcProCheckById(id);
}
@Override
// @DS("#header.poolName")
public int deleteQcProCheck(String id) {
return qcProCheckMapper.deleteQcProCheckById(id);
}
// public static void main(String[] args)throws JCoException{
// QcProCheck qcProCheck = new QcProCheck();
// qcProCheck.setId("1111");
// qcProCheck.setMachineId("2222");
// BaseFile baseFile = new BaseFile();
// baseFile.setFileId("11112");
// Map<QcProCheck,BaseFile> map = new HashMap<QcProCheck,BaseFile>();
//// map.put(qcProCheck,baseFile);
// QcProCheck qc2 = new QcProCheck();
// BaseFile b2 = new BaseFile();
//// qc2 = map.keySet().iterator().next();
//// b2 = map.get(qc2);
// map.put(qc2,null);
// System.out.println(map);
//
//
// }
}

@ -0,0 +1,49 @@
package com.op.sap.config;
import com.sap.conn.jco.ext.DataProviderException;
import com.sap.conn.jco.ext.DestinationDataEventListener;
import com.sap.conn.jco.ext.DestinationDataProvider;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
public class DestinationDataProviderImpl implements DestinationDataProvider {
/**
* DestinationDataProvider is of type interface.
* We define DestinationDataProviderImpl class to implements this interface
* so that we can define the SAP connection parameters more flexibly,
* not just in xxx.jcodestionation file.
*
* The point is that we override getDestinationProperties() method.
* Afterwards, instance of DestinationDataProvider should be registered
* using Environment.registerDestinationDataProvider() method to take effect
*/
private Map provider = new HashMap();
@Override
public Properties getDestinationProperties(String destName) throws DataProviderException {
if (destName == null){
throw new NullPointerException("Destination name is empty.");
}
if (provider.size() == 0){
throw new IllegalStateException("Data provider is empty.");
}
return (Properties) provider.get(destName);
}
@Override
public boolean supportsEvents() {
return false;
}
@Override
public void setDestinationDataEventListener(DestinationDataEventListener destinationDataEventListener) {
throw new UnsupportedOperationException();
}
public void addDestinationProps(String destName, Properties props){
provider.put(destName, props);
}
}

@ -0,0 +1,73 @@
package com.op.sap.config;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoDestinationManager;
import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.ext.DestinationDataProvider;
import com.sap.conn.jco.ext.Environment;
import org.springframework.beans.factory.annotation.Value;
import java.util.Properties;
public class DestinationManager {
@Value("${sap.ashost}")
public static String ashost;
@Value("${sap.sysnr}")
public static String sysnr;
@Value("${sap.client}")
public static String client;
@Value("${sap.user}")
public static String user;
@Value("${sap.passwd}")
public static String passwd;
@Value("${sap.lang}")
public static String lang;
@Value("${sap.pool_capacity}")
public static String pool_capacity;
@Value("${sap.peak_limit}")
public static String peak_limit;
@Value("${sap.saprouter}")
public static String saprouter;
private static Properties setProperties(String destName)
{
// SAP connection parameters and other properties
Properties props = new Properties();
if (destName == "SAP_AS") {
props.setProperty(DestinationDataProvider.JCO_ASHOST, ashost);
props.setProperty(DestinationDataProvider.JCO_SYSNR, sysnr);
props.setProperty(DestinationDataProvider.JCO_USER, user);
props.setProperty(DestinationDataProvider.JCO_PASSWD, passwd);
props.setProperty(DestinationDataProvider.JCO_CLIENT, client);
props.setProperty(DestinationDataProvider.JCO_LANG, lang);
props.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,peak_limit);
props.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY,pool_capacity);
props.setProperty(DestinationDataProvider.JCO_SAPROUTER,saprouter);
}
return props;
}
public static JCoDestination getDestination (String destName) throws JCoException {
Properties props = setProperties(destName);
DestinationDataProviderImpl providerImpl = new DestinationDataProviderImpl();
providerImpl.addDestinationProps(destName, props);
Environment.registerDestinationDataProvider(providerImpl);
JCoDestination dest = JCoDestinationManager.getDestination(destName);
return dest;
}
}

@ -0,0 +1,51 @@
package com.op.sap.config;
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
import com.op.common.core.domain.R;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
*
*
* @ClassName: DynamicDatasource
* @Description: TODO
* @author shichangzhou
* @date 2023419 1:01:30
*/
@Component
public class DynamicDatasource {
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Autowired
private RemoteUserService remoteUserService;
@PostConstruct
public void init() {
// 加载sf-cloud库的sys_datasource
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
for (Map<String, String> dateSource : dateSources) {
DataSourceProperty sdp = new DataSourceProperty();
sdp.setUrl(dateSource.get("url"));
sdp.setUsername(dateSource.get("userName"));
sdp.setPassword(dateSource.get("password"));
sdp.setDriverClassName(dateSource.get("driveClassName"));
sdp.setPoolName(dateSource.get("poolName"));// 这是数据源的key
sdp.setLazy(false);
dynamicDatasourceCreator.createDynamicDataSource(sdp);
}
}
}

@ -0,0 +1,374 @@
package com.op.sap.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import com.op.common.core.web.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class SapBom extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 生产版本 */
@Excel(name = "生产版本")
private String productionVersion;
/** BOM单号 */
@Excel(name = "BOM单号")
private String bomCode;
/** 可选BOM */
@Excel(name = "可选BOM")
private String optionalBom;
/** 可选BOM文本 */
@Excel(name = "可选BOM文本")
private String optionalBomText;
/** 生产版本有效期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产版本有效期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pvvd;
/** 生产版本截止日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产版本截止日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pved;
/** BOM计算数量 */
@Excel(name = "BOM计算数量")
private BigDecimal bomCalculateNumber;
/** BOM计算单位 */
@Excel(name = "BOM计算单位")
private String bomCalculateUnit;
/** BOM基本数量 */
@Excel(name = "BOM基本数量")
private BigDecimal bomBaseNumber;
/** BOM基本单位 */
@Excel(name = "BOM基本单位")
private String bomBaseUnit;
/** 组件数量单位 */
@Excel(name = "组件数量单位")
private String componentUnit;
/** 组件采购标志 */
@Excel(name = "组件采购标志")
private String componentProFlag;
/** 物料供应标识 */
@Excel(name = "物料供应标识")
private String msi;
/** 成本核算标识相关 */
@Excel(name = "成本核算标识相关")
private String sanka;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 是否在用 */
@Excel(name = "是否在用")
private String currentVersion;
/** 物料编码 */
@Excel(name = "物料编码")
private String productCode;
/** 组件上层物料编码 */
@Excel(name = "组件上层物料编码")
private String cumc;
/** 组件编码 */
@Excel(name = "组件编码")
private String component;
/** BOM层次 */
@Excel(name = "BOM层次")
private String bomHierarchy;
/** 项目编号 */
@Excel(name = "项目编号")
private String projectNo;
/** 标准用量 */
@Excel(name = "标准用量")
private Long standardDosage;
/** 损耗率 */
@Excel(name = "损耗率")
private Long lossRate;
/** 损耗额 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "损耗额", width = 30, dateFormat = "yyyy-MM-dd")
private BigDecimal lossAmount;
/** 含损耗用量 */
@Excel(name = "含损耗用量")
private BigDecimal cilosses;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getCumc() {
return cumc;
}
public void setCumc(String cumc) {
this.cumc = cumc;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getBomHierarchy() {
return bomHierarchy;
}
public void setBomHierarchy(String bomHierarchy) {
this.bomHierarchy = bomHierarchy;
}
public String getProjectNo() {
return projectNo;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
public Long getStandardDosage() {
return standardDosage;
}
public void setStandardDosage(Long standardDosage) {
this.standardDosage = standardDosage;
}
public Long getLossRate() {
return lossRate;
}
public void setLossRate(Long lossRate) {
this.lossRate = lossRate;
}
public BigDecimal getLossAmount() {
return lossAmount;
}
public void setLossAmount(BigDecimal lossAmount) {
this.lossAmount = lossAmount;
}
public BigDecimal getCilosses() {
return cilosses;
}
public void setCilosses(BigDecimal cilosses) {
this.cilosses = cilosses;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setProductionVersion(String productionVersion) {
this.productionVersion = productionVersion;
}
public String getProductionVersion() {
return productionVersion;
}
public void setBomCode(String bomCode) {
this.bomCode = bomCode;
}
public String getBomCode() {
return bomCode;
}
public void setOptionalBom(String optionalBom) {
this.optionalBom = optionalBom;
}
public String getOptionalBom() {
return optionalBom;
}
public void setOptionalBomText(String optionalBomText) {
this.optionalBomText = optionalBomText;
}
public String getOptionalBomText() {
return optionalBomText;
}
public void setPvvd(Date pvvd) {
this.pvvd = pvvd;
}
public Date getPvvd() {
return pvvd;
}
public void setPved(Date pved) {
this.pved = pved;
}
public Date getPved() {
return pved;
}
public void setBomCalculateNumber(BigDecimal bomCalculateNumber) {
this.bomCalculateNumber = bomCalculateNumber;
}
public BigDecimal getBomCalculateNumber() {
return bomCalculateNumber;
}
public void setBomCalculateUnit(String bomCalculateUnit) {
this.bomCalculateUnit = bomCalculateUnit;
}
public String getBomCalculateUnit() {
return bomCalculateUnit;
}
public void setBomBaseNumber(BigDecimal bomBaseNumber) {
this.bomBaseNumber = bomBaseNumber;
}
public BigDecimal getBomBaseNumber() {
return bomBaseNumber;
}
public void setBomBaseUnit(String bomBaseUnit) {
this.bomBaseUnit = bomBaseUnit;
}
public String getBomBaseUnit() {
return bomBaseUnit;
}
public void setComponentUnit(String componentUnit) {
this.componentUnit = componentUnit;
}
public String getComponentUnit() {
return componentUnit;
}
public void setComponentProFlag(String componentProFlag) {
this.componentProFlag = componentProFlag;
}
public String getComponentProFlag() {
return componentProFlag;
}
public void setMsi(String msi) {
this.msi = msi;
}
public String getMsi() {
return msi;
}
public void setSanka(String sanka) {
this.sanka = sanka;
}
public String getSanka() {
return sanka;
}
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 setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}
public String getCurrentVersion() {
return currentVersion;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("factoryCode", getFactoryCode())
.append("productionVersion", getProductionVersion())
.append("bomCode", getBomCode())
.append("optionalBom", getOptionalBom())
.append("optionalBomText", getOptionalBomText())
.append("pvvd", getPvvd())
.append("pved", getPved())
.append("bomCalculateNumber", getBomCalculateNumber())
.append("bomCalculateUnit", getBomCalculateUnit())
.append("bomBaseNumber", getBomBaseNumber())
.append("bomBaseUnit", getBomBaseUnit())
.append("componentUnit", getComponentUnit())
.append("componentProFlag", getComponentProFlag())
.append("msi", getMsi())
.append("sanka", getSanka())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("currentVersion", getCurrentVersion())
.toString();
}
}

@ -0,0 +1,252 @@
package com.op.sap.domain;
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.math.BigDecimal;
import java.util.Date;
public class SapBomComponent extends BaseEntity {
/** 主键 */
private Long id;
/** BOM单号 */
@Excel(name = "BOM单号")
private String bomCode;
/** 工厂/站点 */
@Excel(name = "工厂/站点")
private String site;
/** 物料编码 */
@Excel(name = "物料编码")
private String productCode;
/** 组件上层物料编码 */
@Excel(name = "组件上层物料编码")
private String cumc;
/** 组件编码 */
@Excel(name = "组件编码")
private String component;
/** BOM层次 */
@Excel(name = "BOM层次")
private String bomHierarchy;
/** 项目编号 */
@Excel(name = "项目编号")
private String projectNo;
/** 标准用量 */
@Excel(name = "标准用量")
private BigDecimal standardDosage;
/** 损耗率 */
@Excel(name = "损耗率")
private BigDecimal lossRate;
/** 损耗额 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "损耗额", width = 30, dateFormat = "yyyy-MM-dd")
private BigDecimal lossAmount;
/** 含损耗用量 */
@Excel(name = "含损耗用量")
private BigDecimal cilosses;
/** 组件数量单位 */
@Excel(name = "组件数量单位")
private String componentUnit;
/** 组件采购标志 */
@Excel(name = "组件采购标志")
private String componentProFlag;
/** 物料供应标识 */
@Excel(name = "物料供应标识")
private String msi;
/** 成本核算标识相关 */
@Excel(name = "成本核算标识相关")
private String sanka;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setBomCode(String bomCode) {
this.bomCode = bomCode;
}
public String getBomCode() {
return bomCode;
}
public void setSite(String site) {
this.site = site;
}
public String getSite() {
return site;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setCumc(String cumc) {
this.cumc = cumc;
}
public String getCumc() {
return cumc;
}
public void setComponent(String component) {
this.component = component;
}
public String getComponent() {
return component;
}
public void setBomHierarchy(String bomHierarchy) {
this.bomHierarchy = bomHierarchy;
}
public String getBomHierarchy() {
return bomHierarchy;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
public String getProjectNo() {
return projectNo;
}
public void setStandardDosage(BigDecimal standardDosage) {
this.standardDosage = standardDosage;
}
public BigDecimal getStandardDosage() {
return standardDosage;
}
public void setLossRate(BigDecimal lossRate) {
this.lossRate = lossRate;
}
public BigDecimal getLossRate() {
return lossRate;
}
public void setLossAmount(BigDecimal lossAmount) {
this.lossAmount = lossAmount;
}
public BigDecimal getLossAmount() {
return lossAmount;
}
public void setCilosses(BigDecimal cilosses) {
this.cilosses = cilosses;
}
public BigDecimal getCilosses() {
return cilosses;
}
public void setComponentUnit(String componentUnit) {
this.componentUnit = componentUnit;
}
public String getComponentUnit() {
return componentUnit;
}
public void setComponentProFlag(String componentProFlag) {
this.componentProFlag = componentProFlag;
}
public String getComponentProFlag() {
return componentProFlag;
}
public void setMsi(String msi) {
this.msi = msi;
}
public String getMsi() {
return msi;
}
public void setSanka(String sanka) {
this.sanka = sanka;
}
public String getSanka() {
return sanka;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("bomCode", getBomCode())
.append("site", getSite())
.append("productCode", getProductCode())
.append("cumc", getCumc())
.append("component", getComponent())
.append("bomHierarchy", getBomHierarchy())
.append("projectNo", getProjectNo())
.append("standardDosage", getStandardDosage())
.append("lossRate", getLossRate())
.append("lossAmount", getLossAmount())
.append("cilosses", getCilosses())
.append("componentUnit", getComponentUnit())
.append("componentProFlag", getComponentProFlag())
.append("msi", getMsi())
.append("sanka", getSanka())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,125 @@
package com.op.sap.domain;
public class SapMaterialPreparation {
//订单号
private String AUFNR;
//预留/相关需求的项目编号
private String RSPOS;
//物料号
private String MATNR;
//物料描述(短文本)
private String MAKTX;
//工厂
private String WERKS;
//库存地点
private String LGORT;
//组件的需求日期
private String BDTER;
//需求量
private String BDMNG;
//欠料数量
private String ZQLSL;
//基本计量单位
private String MEINS;
//标识:反冲
private String RGEKZ;
//直接采购标识
private String DBSKZ;
public String getAUFNR() {
return AUFNR;
}
public void setAUFNR(String AUFNR) {
this.AUFNR = AUFNR;
}
public String getRSPOS() {
return RSPOS;
}
public void setRSPOS(String RSPOS) {
this.RSPOS = RSPOS;
}
public String getMATNR() {
return MATNR;
}
public void setMATNR(String MATNR) {
this.MATNR = MATNR;
}
public String getMAKTX() {
return MAKTX;
}
public void setMAKTX(String MAKTX) {
this.MAKTX = MAKTX;
}
public String getWERKS() {
return WERKS;
}
public void setWERKS(String WERKS) {
this.WERKS = WERKS;
}
public String getLGORT() {
return LGORT;
}
public void setLGORT(String LGORT) {
this.LGORT = LGORT;
}
public String getBDTER() {
return BDTER;
}
public void setBDTER(String BDTER) {
this.BDTER = BDTER;
}
public String getBDMNG() {
return BDMNG;
}
public void setBDMNG(String BDMNG) {
this.BDMNG = BDMNG;
}
public String getZQLSL() {
return ZQLSL;
}
public void setZQLSL(String ZQLSL) {
this.ZQLSL = ZQLSL;
}
public String getMEINS() {
return MEINS;
}
public void setMEINS(String MEINS) {
this.MEINS = MEINS;
}
public String getRGEKZ() {
return RGEKZ;
}
public void setRGEKZ(String RGEKZ) {
this.RGEKZ = RGEKZ;
}
public String getDBSKZ() {
return DBSKZ;
}
public void setDBSKZ(String DBSKZ) {
this.DBSKZ = DBSKZ;
}
}

@ -0,0 +1,27 @@
package com.op.sap.mapper;
import com.op.sap.domain.SapBom;
import com.op.sap.domain.SapBomComponent;
import java.util.List;
/**
* BOMMapper
*
* @author Open Platform
* @date 2023-08-04
*/
public interface SapBomComponentMapper {
/**
* BOM
*
* @param sapBomComponent BOM
* @return
*/
public int insertSapBomComponent(SapBomComponent sapBomComponent);
}

@ -0,0 +1,19 @@
package com.op.sap.mapper;
import com.op.sap.domain.SapBom;
import com.op.sap.domain.SapBomComponent;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SapBomMapper {
/**
* BOM
*
* @param sapBom BOM
* @return
*/
public int insertBaseBom(SapBom sapBom);
public int insertBasetBomComponent(SapBomComponent sapBomComponent);
}

@ -0,0 +1,8 @@
package com.op.sap.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SapMaterialPreparationMapper {
}

@ -0,0 +1,10 @@
package com.op.sap.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.sap.domain.SapBom;
import java.util.List;
public interface SapBomService {
public AjaxResult bomSync();
}

@ -0,0 +1,8 @@
package com.op.sap.service;
import com.op.common.core.web.domain.AjaxResult;
public interface SapMaterialPreparationService {
AjaxResult MaterialPreparation(String shopOrder);
}

@ -0,0 +1,12 @@
package com.op.sap.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.sap.domain.SapBom;
import com.op.system.api.model.SapProOrder;
import java.util.List;
public interface SapOrderService {
AjaxResult shopOrderSync(SapProOrder sapProOrder);
}

@ -0,0 +1,169 @@
package com.op.sap.service.impl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.constant.Constants;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.sap.domain.SapBom;
import com.op.sap.domain.SapBomComponent;
import com.op.sap.domain.SapConn;
import com.op.sap.mapper.SapBomComponentMapper;
import com.op.sap.mapper.SapBomMapper;
import com.op.sap.service.SapBomService;
import com.op.sap.util.SAPConnUtils;
import com.op.system.api.model.SapProOrder;
import com.sap.conn.jco.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
@Service
public class SapBomServiceImpl implements SapBomService {
@Autowired
private SapBomMapper sapBomMapper;
@Autowired
private SapBomComponentMapper sapBomComponentMapper;
@Override
public AjaxResult bomSync() {
try {
// 获取调用 RFC 函数对象
//获取连接
JCoDestination dest = SAPConnUtils.connect();
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_BOM");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
// 配置传入参数
// JCoTable jCoTable = func.getTableParameterList().getTable("S_STLNR");
// jCoTable.appendRow();
// jCoTable.setValue(Constants.SIGN, "I");
// jCoTable.setValue(Constants.OPTION, "EQ");
// jCoTable.setValue(Constants.LOW, "00012222");
JCoTable jCoTables = func.getTableParameterList().getTable("S_MATNR");
jCoTables.appendRow();
jCoTables.setValue(Constants.SIGN, "I");
jCoTables.setValue(Constants.OPTION, "EQ");
jCoTables.setValue(Constants.LOW, "000000010101000115");
// 获取调用 RFC 函数对象
func.execute(dest);
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_BOM");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
SapBom sapBom = new SapBom();
SapBomComponent sapBomComponent=new SapBomComponent();
DynamicDataSourceContextHolder.push("op_xiaolan");
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String STLNR = maraTable.getString("STLNR");
if (STLNR == null || STLNR.equals("")){
throw new ServiceException("组件清单码为空");
}
String MATNR = maraTable.getString("MATNR");
String MAKTX = maraTable.getString("MAKTX");
String WERKS = maraTable.getString("WERKS");
String VERID = maraTable.getString("VERID");
String STLAL = maraTable.getString("STLAL");
String ANDAT = maraTable.getString("ANDAT");
String ANNAM = maraTable.getString("ANNAM");
String AEDAT = maraTable.getString("AEDAT");
String AENAM = maraTable.getString("AENAM");
String ADATU = maraTable.getString("ADATU");
String BDATU = maraTable.getString("BDATU");
String LOSGR = maraTable.getString("LOSGR");
String MEINS = maraTable.getString("MEINS");
String BMENG = maraTable.getString("BMENG");
String BMEIN = maraTable.getString("BMEIN");
String STUFE = maraTable.getString("STUFE");
String WEGXX = maraTable.getString("WEGXX");
String OJTXB = maraTable.getString("OJTXB");
String PMATNR = maraTable.getString("PMATNR");
String PMENGE = maraTable.getString("PMENGE");
String PMAKTX = maraTable.getString("PMAKTX");
// String PMENGE = maraTable.getString("PMENGE");
String PAUSCH = maraTable.getString("PAUSCH");
String PXHLCE = maraTable.getString("PXHLCE");
String PMNGKO = maraTable.getString("PMNGKO");
String PMEINS = maraTable.getString("PMEINS");
String PBESKZ = maraTable.getString("PBESKZ");
String BEIKZ = maraTable.getString("BEIKZ");
String BEIKZ_NM = maraTable.getString("BEIKZ_NM");
String SANKA = maraTable.getString("SANKA");
System.out.println("物料编码:" + MATNR +
" - 物料名称:" + MAKTX + " - 工厂:" + WERKS +
" - 生产版本:" + VERID + " - BOM单号" + STLNR
+ " - 可选BOM" + STLAL + " - 创建日期:" + ANDAT + " - 创建者:" + ANNAM +
" - 修改日期:" + AEDAT + " - 修改者:" + AENAM
+ " - 生产版本有效期:" + ADATU + " - 生产版本截止日期:" + BDATU + " - BOM计算数量" + LOSGR +
" - BOM计算单位" + MEINS +
" - BOM基本数量" + BMENG + " - BOM基本单位" + BMEIN + " - BOM层次" + STUFE + " - 项目编号:" + WEGXX
+ " - 组件编码:" + PMATNR + " - 组件上层物料编码:" + OJTXB + " - 组件名称:" + PMAKTX
+ " - 标准用量:" + PMENGE + " - 损耗率:" + PAUSCH + " - 损耗额:" + PXHLCE + " - 含损耗用量:" + PMNGKO
+ " - 组件数量单位:" + PMEINS + " - 组件采购标志:" + PBESKZ + " - 物料供应标识:" + BEIKZ + " - 物料供应标识:" + BEIKZ_NM
+ " - 成本核算标识相关:" + SANKA);
// sapBom.setFactoryCode(WERKS);
// sapBom.setProductionVersion(VERID);
// sapBom.setBomCode(STLNR);
// sapBom.setOptionalBom(STLAL);
// sapBom.setPvvd(DateUtils.dateTime("yyyy-MM-dd", ADATU));
// sapBom.setPved(DateUtils.dateTime("yyyy-MM-dd", BDATU));
// sapBom.setBomCalculateNumber(new BigDecimal(LOSGR));
// sapBom.setBomCalculateUnit(MEINS);
// sapBom.setBomBaseNumber(new BigDecimal(BMENG));
// sapBom.setBomBaseUnit(BMEIN);
// sapBom.setComponentUnit(PMEINS);
// sapBom.setComponentProFlag(PBESKZ);
// sapBom.setCreateBy(ANNAM);
// // sapBom.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
// sapBom.setUpdateBy(AENAM);
// // sapBom.setUpdateTime(DateUtils.dateTime("yyyy-MM-dd", AEDAT));
sapBomComponent.setBomCode(STLNR);
sapBomComponent.setSite(WERKS);
sapBomComponent.setMsi(BEIKZ);
sapBomComponent.setSanka(SANKA);
sapBomComponent.setProductCode(MATNR);
sapBomComponent.setCumc(OJTXB);
sapBomComponent.setBomHierarchy(STUFE);
sapBomComponent.setProjectNo(WEGXX);
sapBomComponent.setStandardDosage(new BigDecimal(PMENGE));
sapBomComponent.setLossRate(new BigDecimal(PAUSCH));
sapBomComponent.setLossAmount(new BigDecimal(PXHLCE));
sapBomComponent.setCilosses(new BigDecimal(PMNGKO));
sapBomComponent.setCreateBy(ANNAM);
// sapBomComponent.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
sapBomComponent.setUpdateBy(AENAM);
// sapBomComponent.setUpdateTime(DateUtils.dateTime("yyyy-MM-dd", AEDAT));
// sapBomList.add(sapBom);
// sapBomComponentMapper.insertSapBomComponent(sapBomComponent);
}
// inserBaseBom(sapBomList);
return AjaxResult.success();
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
public void inserBaseBom(List<SapBom> sapBomList){
sapBomList = sapBomList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(SapBom::getBomCode))), ArrayList::new));
for (SapBom sapBom:sapBomList) {
sapBomMapper.insertBaseBom(sapBom);
}
}
}

@ -0,0 +1,95 @@
package com.op.sap.service.impl;
import com.op.common.core.web.domain.AjaxResult;
import com.op.sap.domain.SapMaterialPreparation;
import com.op.sap.mapper.SapMaterialPreparationMapper;
import com.op.sap.service.SapMaterialPreparationService;
import com.op.sap.util.SAPConnUtils;
import com.sap.conn.jco.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class SapMaterialPreparationServiceImpl implements SapMaterialPreparationService {
@Autowired
SapMaterialPreparationMapper sapMaterialPreparationMapper;
@Override
public AjaxResult MaterialPreparation(String shopOrder) {
// 连接
try {
// 获取调用 RFC 函数对象
//获取连接
JCoDestination dest = SAPConnUtils.connect();
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_MATERIAL_PREPARATION");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
// 配置传入参数
JCoTable jCoTable = func.getTableParameterList().getTable("S_AUFNR");
jCoTable.appendRow();
jCoTable.setValue("SIGN", "I");
jCoTable.setValue("OPTION", "EQ");
jCoTable.setValue("LOW", shopOrder);
func.execute(dest);//执行调用函数
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_MAPRE");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
List<SapMaterialPreparation> sapMaterialPreparationList =new ArrayList<>();
// 循环输出 Table 数据
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String AUFNR = maraTable.getString("AUFNR");
String RSPOS = maraTable.getString("RSPOS");
String MATNR = maraTable.getString("MATNR");
String MAKTX = maraTable.getString("MAKTX");
String WERKS = maraTable.getString("WERKS");
String LGORT = maraTable.getString("LGORT");
String BDTER = maraTable.getString("BDTER");
String BDMNG = maraTable.getString("BDMNG");
String ZQLSL = maraTable.getString("ZQLSL");
String MEINS = maraTable.getString("MEINS");
String RGEKZ = maraTable.getString("RGEKZ");
String DBSKZ = maraTable.getString("DBSKZ");
System.out.println("订单号:" + AUFNR
+ " - 预留/相关需求的项目编号:" + RSPOS +
" - 物料号:" + MATNR +
" - 物料描述(短文本):" + MAKTX +
" - 工厂:" + WERKS +
" - 库存地点:" + LGORT +
" - 组件的需求日期 " + BDTER +
" - 需求量:" + BDMNG +
" - 欠料数量:" + ZQLSL +
" - 基本计量单位:" + MEINS +
" - 标识:反冲:" + RGEKZ +
" - 直接采购标识:" + DBSKZ );
SapMaterialPreparation sapMaterialPreparation = new SapMaterialPreparation();
sapMaterialPreparation.setAUFNR(AUFNR);
sapMaterialPreparation.setBDMNG(BDMNG);
sapMaterialPreparation.setBDTER(BDTER);
sapMaterialPreparation.setDBSKZ(DBSKZ);
sapMaterialPreparation.setLGORT(LGORT);
sapMaterialPreparation.setMAKTX(MAKTX);
sapMaterialPreparation.setMATNR(MATNR);
sapMaterialPreparation.setMEINS(MEINS);
sapMaterialPreparation.setRGEKZ(RGEKZ);
sapMaterialPreparation.setRSPOS(RSPOS);
sapMaterialPreparation.setWERKS(WERKS);
sapMaterialPreparation.setZQLSL(ZQLSL);
sapMaterialPreparationList.add(sapMaterialPreparation);
}
return AjaxResult.success(sapMaterialPreparationList);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
}

@ -0,0 +1,118 @@
package com.op.sap.service.impl;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.sap.domain.SapConn;
import com.op.sap.service.SapOrderService;
import com.op.sap.util.JCoUtils;
import com.op.sap.util.SAPConnUtils;
import com.op.system.api.RemotePlanService;
import com.op.sap.domain.SapBom;
import com.op.system.api.model.SapProOrder;
import com.sap.conn.jco.*;
import org.jcp.xml.dsig.internal.dom.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Service
public class SapOrderServiceImpl implements SapOrderService {
@Autowired
private RemotePlanService remotePlanService;
@Override
public AjaxResult shopOrderSync(SapProOrder sapProOrder) {
// 连接
try {
// 获取调用 RFC 函数对象
//获取连接
JCoDestination dest = SAPConnUtils.connect();
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZPPR_MES_PRO_TO");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
// 配置传入参数
JCoTable jCoTable = func.getTableParameterList().getTable("S_ERDAT");
jCoTable.appendRow();
jCoTable.setValue("SIGN", "I");
jCoTable.setValue("OPTION", "EQ");
jCoTable.setValue("LOW", DateUtils.parseDateToStr("yyyyMMdd", sapProOrder.getCreateTime()));
func.execute(dest);//执行调用函数
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
SapProOrder proOrder = new SapProOrder();
List<SapProOrder> proOrderList = new ArrayList<>();
// 循环输出 Table 数据
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String AUFNR = maraTable.getString("AUFNR");
String AUART = maraTable.getString("AUART");
String MAUFNR = maraTable.getString("MAUFNR");
String PLNBEZ = maraTable.getString("PLNBEZ");
String MAKTX = maraTable.getString("MAKTX");
String PWERK = maraTable.getString("PWERK");
String GAMNG = maraTable.getString("GAMNG");
String GMEIN = maraTable.getString("GMEIN");
String PLNNR = maraTable.getString("PLNNR");
String GSTRP = maraTable.getString("GSTRP");
String GLTRP = maraTable.getString("GLTRP");
String ERNAM = maraTable.getString("ERNAM");
String ERDAT = maraTable.getString("ERDAT");
String STTXT = maraTable.getString("STTXT");
System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
+ " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP
+ " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT);
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setPlanFactoryCode(PWERK);
proOrder.setOrderCode(AUFNR);
proOrder.setOrderType(AUART);
proOrder.setProdCode(PLNBEZ);
proOrder.setProdDesc(MAKTX);
proOrder.setQuantity(Long.parseLong(GAMNG.substring(0, GAMNG.indexOf("."))));
proOrder.setUnit(GMEIN);
proOrder.setWorkerOrder(PLNNR);
proOrder.setPlanProDate(DateUtils.dateTime("yyyy-MM-dd", GSTRP));
proOrder.setPlanComplete(DateUtils.dateTime("yyyy-MM-dd", GLTRP));
proOrder.setParentOrder(MAUFNR);
proOrder.setCreateBy(ERNAM);
proOrder.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ERDAT));
proOrder.setUpdateBy(ERNAM);
proOrder.setUpdateTime(DateUtils.dateTime("yyyy-MM-dd", ERDAT));
proOrder.setStatus("0");
proOrderList.add(proOrder);
// remotePlanService.sapAddOrder(proOrder);
// remoteMesService.sapAddOrder(proOrder);
}
return AjaxResult.success(proOrderList);
} catch (Exception e) {
return null;
}
}
}

@ -0,0 +1,35 @@
package com.op.sap.util;
import com.sap.conn.jco.JCoField;
import com.sap.conn.jco.JCoRecordMetaData;
import com.sap.conn.jco.JCoTable;
public class JCoUtils {
public static void printJCoTable(JCoTable jcoTable)
{
// header
// JCoRecordMeataData is the meta data of either a structure or a table.
// Each element describes a field of the structure or table.
JCoRecordMetaData tableMeta = jcoTable.getRecordMetaData();
for(int i = 0; i < tableMeta.getFieldCount(); i++){
System.out.print(String.format("%s\t", tableMeta.getName(i)));
}
System.out.println(); // new line
// line items
for(int i = 0; i < jcoTable.getNumRows(); i++){
// Sets the row pointer to the specified position(beginning from zero)
jcoTable.setRow(i);
// Each line is of type JCoStructure
for(JCoField fld : jcoTable){
System.out.print(String.format("%s\t", fld.getValue()));
}
System.out.println();
}
}
}

@ -0,0 +1,163 @@
<?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.sap.mapper.SapBomComponentMapper">
<resultMap type="com.op.sap.domain.SapBomComponent" id="BaseBomComponentResult">
<result property="id" column="id" />
<result property="bomCode" column="bom_code" />
<result property="site" column="site" />
<result property="productCode" column="product_code" />
<result property="cumc" column="cumc" />
<result property="component" column="component" />
<result property="bomHierarchy" column="bom_hierarchy" />
<result property="projectNo" column="project_no" />
<result property="standardDosage" column="standard_dosage" />
<result property="lossRate" column="loss_rate" />
<result property="lossAmount" column="loss_amount" />
<result property="cilosses" column="cilosses" />
<result property="componentUnit" column="component_unit" />
<result property="componentProFlag" column="component_pro_flag" />
<result property="msi" column="msi" />
<result property="sanka" column="sanka" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<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="remark" column="remark" />
</resultMap>
<sql id="selectBaseBomComponentVo">
select id, bom_code, site, product_code, cumc, component, bom_hierarchy, project_no, standard_dosage, loss_rate, loss_amount, cilosses, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark from base_bom_component
</sql>
<select id="selectBaseBomComponentList" parameterType="com.op.sap.domain.SapBomComponent" resultMap="BaseBomComponentResult">
<include refid="selectBaseBomComponentVo"/>
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="site != null and site != ''"> and site = #{site}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="cumc != null and cumc != ''"> and cumc = #{cumc}</if>
<if test="component != null and component != ''"> and component = #{component}</if>
<if test="bomHierarchy != null and bomHierarchy != ''"> and bom_hierarchy = #{bomHierarchy}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="standardDosage != null "> and standard_dosage = #{standardDosage}</if>
<if test="lossRate != null "> and loss_rate = #{lossRate}</if>
<if test="lossAmount != null "> and loss_amount = #{lossAmount}</if>
<if test="cilosses != null "> and cilosses = #{cilosses}</if>
<if test="componentUnit != null and componentUnit != ''"> and component_unit = #{componentUnit}</if>
<if test="componentProFlag != null and componentProFlag != ''"> and component_pro_flag = #{componentProFlag}</if>
<if test="msi != null and msi != ''"> and msi = #{msi}</if>
<if test="sanka != null and sanka != ''"> and sanka = #{sanka}</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>
</where>
</select>
<select id="selectBaseBomComponentById" parameterType="Long" resultMap="BaseBomComponentResult">
<include refid="selectBaseBomComponentVo"/>
where id = #{id}
</select>
<insert id="insertSapBomComponent" parameterType="com.op.sap.domain.SapBomComponent">
insert into base_bom_component
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="bomCode != null and bomCode != ''">bom_code,</if>
<if test="site != null">site,</if>
<if test="productCode != null">product_code,</if>
<if test="cumc != null">cumc,</if>
<if test="component != null">component,</if>
<if test="bomHierarchy != null">bom_hierarchy,</if>
<if test="projectNo != null">project_no,</if>
<if test="standardDosage != null">standard_dosage,</if>
<if test="lossRate != null">loss_rate,</if>
<if test="lossAmount != null">loss_amount,</if>
<if test="cilosses != null">cilosses,</if>
<if test="componentUnit != null">component_unit,</if>
<if test="componentProFlag != null">component_pro_flag,</if>
<if test="msi != null">msi,</if>
<if test="sanka != null">sanka,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</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="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="bomCode != null and bomCode != ''">#{bomCode},</if>
<if test="site != null">#{site},</if>
<if test="productCode != null">#{productCode},</if>
<if test="cumc != null">#{cumc},</if>
<if test="component != null">#{component},</if>
<if test="bomHierarchy != null">#{bomHierarchy},</if>
<if test="projectNo != null">#{projectNo},</if>
<if test="standardDosage != null">#{standardDosage},</if>
<if test="lossRate != null">#{lossRate},</if>
<if test="lossAmount != null">#{lossAmount},</if>
<if test="cilosses != null">#{cilosses},</if>
<if test="componentUnit != null">#{componentUnit},</if>
<if test="componentProFlag != null">#{componentProFlag},</if>
<if test="msi != null">#{msi},</if>
<if test="sanka != null">#{sanka},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</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="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBaseBomComponent" parameterType="com.op.sap.domain.SapBomComponent">
update base_bom_component
<trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if>
<if test="site != null">site = #{site},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="cumc != null">cumc = #{cumc},</if>
<if test="component != null">component = #{component},</if>
<if test="bomHierarchy != null">bom_hierarchy = #{bomHierarchy},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="standardDosage != null">standard_dosage = #{standardDosage},</if>
<if test="lossRate != null">loss_rate = #{lossRate},</if>
<if test="lossAmount != null">loss_amount = #{lossAmount},</if>
<if test="cilosses != null">cilosses = #{cilosses},</if>
<if test="componentUnit != null">component_unit = #{componentUnit},</if>
<if test="componentProFlag != null">component_pro_flag = #{componentProFlag},</if>
<if test="msi != null">msi = #{msi},</if>
<if test="sanka != null">sanka = #{sanka},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</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="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseBomComponentById" parameterType="Long">
delete from base_bom_component where id = #{id}
</delete>
<delete id="deleteBaseBomComponentByIds" parameterType="String">
delete from base_bom_component where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,164 @@
<?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.sap.mapper.SapBomMapper">
<resultMap type="com.op.sap.domain.SapBom" id="BaseBomResult">
<result property="factoryCode" column="factory_code" />
<result property="productionVersion" column="production_version" />
<result property="bomCode" column="bom_code" />
<result property="optionalBom" column="optional_bom" />
<result property="optionalBomText" column="optional_bom_text" />
<result property="pvvd" column="pvvd" />
<result property="pved" column="pved" />
<result property="bomCalculateNumber" column="bom_calculate_number" />
<result property="bomCalculateUnit" column="bom_calculate_unit" />
<result property="bomBaseNumber" column="bom_base_number" />
<result property="bomBaseUnit" column="bom_base_unit" />
<result property="componentUnit" column="component_unit" />
<result property="componentProFlag" column="component_pro_flag" />
<result property="msi" column="msi" />
<result property="sanka" column="sanka" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<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="remark" column="remark" />
<result property="currentVersion" column="current_version" />
</resultMap>
<sql id="selectBaseBomVo">
select factory_code, production_version, bom_code, optional_bom, optional_bom_text, pvvd, pved, bom_calculate_number, bom_calculate_unit, bom_base_number, bom_base_unit, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark, current_version from base_bom
</sql>
<select id="selectBaseBomList" parameterType="com.op.sap.domain.SapBom" resultMap="BaseBomResult">
<include refid="selectBaseBomVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="productionVersion != null and productionVersion != ''"> and production_version = #{productionVersion}</if>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="optionalBom != null and optionalBom != ''"> and optional_bom = #{optionalBom}</if>
<if test="optionalBomText != null and optionalBomText != ''"> and optional_bom_text = #{optionalBomText}</if>
<if test="pvvd != null "> and pvvd = #{pvvd}</if>
<if test="pved != null "> and pved = #{pved}</if>
<if test="bomCalculateNumber != null "> and bom_calculate_number = #{bomCalculateNumber}</if>
<if test="bomCalculateUnit != null and bomCalculateUnit != ''"> and bom_calculate_unit = #{bomCalculateUnit}</if>
<if test="bomBaseNumber != null "> and bom_base_number = #{bomBaseNumber}</if>
<if test="bomBaseUnit != null and bomBaseUnit != ''"> and bom_base_unit = #{bomBaseUnit}</if>
<if test="componentUnit != null and componentUnit != ''"> and component_unit = #{componentUnit}</if>
<if test="componentProFlag != null and componentProFlag != ''"> and component_pro_flag = #{componentProFlag}</if>
<if test="msi != null and msi != ''"> and msi = #{msi}</if>
<if test="sanka != null and sanka != ''"> and sanka = #{sanka}</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="currentVersion != null and currentVersion != ''"> and current_version = #{currentVersion}</if>
</where>
</select>
<select id="selectBaseBomByFactoryCode" parameterType="String" resultMap="BaseBomResult">
<include refid="selectBaseBomVo"/>
where factory_code = #{factoryCode}
</select>
<insert id="insertBaseBom" parameterType="com.op.sap.domain.SapBom">
insert into base_bom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="factoryCode != null">factory_code,</if>
<if test="productionVersion != null">production_version,</if>
<if test="bomCode != null">bom_code,</if>
<if test="optionalBom != null">optional_bom,</if>
<if test="optionalBomText != null">optional_bom_text,</if>
<if test="pvvd != null">pvvd,</if>
<if test="pved != null">pved,</if>
<if test="bomCalculateNumber != null">bom_calculate_number,</if>
<if test="bomCalculateUnit != null">bom_calculate_unit,</if>
<if test="bomBaseNumber != null">bom_base_number,</if>
<if test="bomBaseUnit != null">bom_base_unit,</if>
<if test="componentUnit != null">component_unit,</if>
<if test="componentProFlag != null">component_pro_flag,</if>
<if test="msi != null">msi,</if>
<if test="sanka != null">sanka,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</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="remark != null">remark,</if>
<if test="currentVersion != null">current_version,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="factoryCode != null">#{factoryCode},</if>
<if test="productionVersion != null">#{productionVersion},</if>
<if test="bomCode != null">#{bomCode},</if>
<if test="optionalBom != null">#{optionalBom},</if>
<if test="optionalBomText != null">#{optionalBomText},</if>
<if test="pvvd != null">#{pvvd},</if>
<if test="pved != null">#{pved},</if>
<if test="bomCalculateNumber != null">#{bomCalculateNumber},</if>
<if test="bomCalculateUnit != null">#{bomCalculateUnit},</if>
<if test="bomBaseNumber != null">#{bomBaseNumber},</if>
<if test="bomBaseUnit != null">#{bomBaseUnit},</if>
<if test="componentUnit != null">#{componentUnit},</if>
<if test="componentProFlag != null">#{componentProFlag},</if>
<if test="msi != null">#{msi},</if>
<if test="sanka != null">#{sanka},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</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="remark != null">#{remark},</if>
<if test="currentVersion != null">#{currentVersion},</if>
</trim>
</insert>
<update id="updateBaseBom" parameterType="com.op.sap.domain.SapBom">
update base_bom
<trim prefix="SET" suffixOverrides=",">
<if test="productionVersion != null">production_version = #{productionVersion},</if>
<if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="optionalBom != null">optional_bom = #{optionalBom},</if>
<if test="optionalBomText != null">optional_bom_text = #{optionalBomText},</if>
<if test="pvvd != null">pvvd = #{pvvd},</if>
<if test="pved != null">pved = #{pved},</if>
<if test="bomCalculateNumber != null">bom_calculate_number = #{bomCalculateNumber},</if>
<if test="bomCalculateUnit != null">bom_calculate_unit = #{bomCalculateUnit},</if>
<if test="bomBaseNumber != null">bom_base_number = #{bomBaseNumber},</if>
<if test="bomBaseUnit != null">bom_base_unit = #{bomBaseUnit},</if>
<if test="componentUnit != null">component_unit = #{componentUnit},</if>
<if test="componentProFlag != null">component_pro_flag = #{componentProFlag},</if>
<if test="msi != null">msi = #{msi},</if>
<if test="sanka != null">sanka = #{sanka},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</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="remark != null">remark = #{remark},</if>
<if test="currentVersion != null">current_version = #{currentVersion},</if>
</trim>
where factory_code = #{factoryCode}
</update>
<delete id="deleteBaseBomByFactoryCode" parameterType="String">
delete from base_bom where factory_code = #{factoryCode}
</delete>
<delete id="deleteBaseBomByFactoryCodes" parameterType="String">
delete from base_bom where factory_code in
<foreach item="factoryCode" collection="array" open="(" separator="," close=")">
#{factoryCode}
</foreach>
</delete>
</mapper>

@ -0,0 +1,262 @@
package com.op.technology.domain;
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;
/**
* BOM base_bom
*
* @author Open Platform
* @date 2023-08-02
*/
public class Bom extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 生产版本 */
@Excel(name = "生产版本")
private String productionVersion;
/** BOM单号 */
@Excel(name = "BOM单号")
private String bomCode;
/** 可选BOM */
@Excel(name = "可选BOM")
private String optionalBom;
/** 可选BOM文本 */
@Excel(name = "可选BOM文本")
private String optionalBomText;
/** 生产版本有效期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产版本有效期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pvvd;
/** 生产版本截止日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生产版本截止日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date pved;
/** BOM计算数量 */
@Excel(name = "BOM计算数量")
private Long bomCalculateNumber;
/** BOM计算单位 */
@Excel(name = "BOM计算单位")
private String bomCalculateUnit;
/** BOM基本数量 */
@Excel(name = "BOM基本数量")
private Long bomBaseNumber;
/** BOM基本单位 */
@Excel(name = "BOM基本单位")
private String bomBaseUnit;
/** 组件数量单位 */
@Excel(name = "组件数量单位")
private String componentUnit;
/** 组件采购标志 */
@Excel(name = "组件采购标志")
private String componentProFlag;
/** 物料供应标识 */
@Excel(name = "物料供应标识")
private String msi;
/** 成本核算标识相关 */
@Excel(name = "成本核算标识相关")
private String sanka;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 是否在用 */
@Excel(name = "是否在用")
private String currentVersion;
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setProductionVersion(String productionVersion) {
this.productionVersion = productionVersion;
}
public String getProductionVersion() {
return productionVersion;
}
public void setBomCode(String bomCode) {
this.bomCode = bomCode;
}
public String getBomCode() {
return bomCode;
}
public void setOptionalBom(String optionalBom) {
this.optionalBom = optionalBom;
}
public String getOptionalBom() {
return optionalBom;
}
public void setOptionalBomText(String optionalBomText) {
this.optionalBomText = optionalBomText;
}
public String getOptionalBomText() {
return optionalBomText;
}
public void setPvvd(Date pvvd) {
this.pvvd = pvvd;
}
public Date getPvvd() {
return pvvd;
}
public void setPved(Date pved) {
this.pved = pved;
}
public Date getPved() {
return pved;
}
public void setBomCalculateNumber(Long bomCalculateNumber) {
this.bomCalculateNumber = bomCalculateNumber;
}
public Long getBomCalculateNumber() {
return bomCalculateNumber;
}
public void setBomCalculateUnit(String bomCalculateUnit) {
this.bomCalculateUnit = bomCalculateUnit;
}
public String getBomCalculateUnit() {
return bomCalculateUnit;
}
public void setBomBaseNumber(Long bomBaseNumber) {
this.bomBaseNumber = bomBaseNumber;
}
public Long getBomBaseNumber() {
return bomBaseNumber;
}
public void setBomBaseUnit(String bomBaseUnit) {
this.bomBaseUnit = bomBaseUnit;
}
public String getBomBaseUnit() {
return bomBaseUnit;
}
public void setComponentUnit(String componentUnit) {
this.componentUnit = componentUnit;
}
public String getComponentUnit() {
return componentUnit;
}
public void setComponentProFlag(String componentProFlag) {
this.componentProFlag = componentProFlag;
}
public String getComponentProFlag() {
return componentProFlag;
}
public void setMsi(String msi) {
this.msi = msi;
}
public String getMsi() {
return msi;
}
public void setSanka(String sanka) {
this.sanka = sanka;
}
public String getSanka() {
return sanka;
}
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 setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}
public String getCurrentVersion() {
return currentVersion;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("factoryCode", getFactoryCode())
.append("productionVersion", getProductionVersion())
.append("bomCode", getBomCode())
.append("optionalBom", getOptionalBom())
.append("optionalBomText", getOptionalBomText())
.append("pvvd", getPvvd())
.append("pved", getPved())
.append("bomCalculateNumber", getBomCalculateNumber())
.append("bomCalculateUnit", getBomCalculateUnit())
.append("bomBaseNumber", getBomBaseNumber())
.append("bomBaseUnit", getBomBaseUnit())
.append("componentUnit", getComponentUnit())
.append("componentProFlag", getComponentProFlag())
.append("msi", getMsi())
.append("sanka", getSanka())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("currentVersion", getCurrentVersion())
.toString();
}
}

@ -0,0 +1,267 @@
package com.op.technology.domain;
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;
/**
* base_equipment
*
* @author Open Platform
* @date 2023-07-20
*/
public class Equipment extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 设备类型ID */
private Long equipmentId;
/** 设备类型编码 */
@Excel(name = "设备类型编码")
private String equipmentCode;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentName;
/** 品牌 */
@Excel(name = "品牌")
private String equipmentBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String equipmentSpec;
/** 设备类型ID */
@Excel(name = "设备类型ID")
private Long equipmentTypeId;
/** 设备类型编码 */
@Excel(name = "设备类型编码")
private String equipmentTypeCode;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/** 所属车间ID */
@Excel(name = "所属车间ID")
private Long workshopId;
/** 所属车间编码 */
@Excel(name = "所属车间编码")
private String workshopCode;
/** 所属车间名称 */
@Excel(name = "所属车间名称")
private String workshopName;
/** 设备状态 */
@Excel(name = "设备状态")
private String status;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
/** 单台能力工时 */
// @Excel(name = "单台能力工时")
// private String unitWorkingHours;
/** 工段 */
@Excel(name = "工段")
private String workshopSection;
/** 设备位置 */
@Excel(name = "设备位置")
private String equipmentLocation;
/** 工时单价 */
@Excel(name = "工时单价")
private String hourlyUnitPrice;
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentBrand(String equipmentBrand) {
this.equipmentBrand = equipmentBrand;
}
public String getEquipmentBrand() {
return equipmentBrand;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentTypeId(Long equipmentTypeId) {
this.equipmentTypeId = equipmentTypeId;
}
public Long getEquipmentTypeId() {
return equipmentTypeId;
}
public void setEquipmentTypeCode(String equipmentTypeCode) {
this.equipmentTypeCode = equipmentTypeCode;
}
public String getEquipmentTypeCode() {
return equipmentTypeCode;
}
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
public void setWorkshopId(Long workshopId) {
this.workshopId = workshopId;
}
public Long getWorkshopId() {
return workshopId;
}
public void setWorkshopCode(String workshopCode) {
this.workshopCode = workshopCode;
}
public String getWorkshopCode() {
return workshopCode;
}
public void setWorkshopName(String workshopName) {
this.workshopName = workshopName;
}
public String getWorkshopName() {
return workshopName;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
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(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
return attr4;
}
// public void setUnitWorkingHours(String unitWorkingHours) {
// this.unitWorkingHours = unitWorkingHours;
// }
//
// public String getUnitWorkingHours() {
// return unitWorkingHours;
// }
public void setWorkshopSection(String workshopSection) {
this.workshopSection = workshopSection;
}
public String getWorkshopSection() {
return workshopSection;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setHourlyUnitPrice(String hourlyUnitPrice) {
this.hourlyUnitPrice = hourlyUnitPrice;
}
public String getHourlyUnitPrice() {
return hourlyUnitPrice;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("equipmentId", getEquipmentId())
.append("equipmentCode", getEquipmentCode())
.append("equipmentName", getEquipmentName())
.append("equipmentBrand", getEquipmentBrand())
.append("equipmentSpec", getEquipmentSpec())
.append("equipmentTypeId", getEquipmentTypeId())
.append("equipmentTypeCode", getEquipmentTypeCode())
.append("equipmentTypeName", getEquipmentTypeName())
.append("workshopId", getWorkshopId())
.append("workshopCode", getWorkshopCode())
.append("workshopName", getWorkshopName())
.append("status", getStatus())
.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("unitWorkingHours", getUnitWorkingHours())
.append("workshopSection", getWorkshopSection())
.append("equipmentLocation", getEquipmentLocation())
.append("hourlyUnitPrice", getHourlyUnitPrice())
.toString();
}
}

@ -0,0 +1,104 @@
package com.op.wms.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.wms.domain.WmsOdsWhiteEmbryoIn;
import com.op.wms.service.IWmsOdsWhiteEmbryoInService;
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-07-20
*/
@RestController
@RequestMapping("/wmsEmbryoin")
public class WmsOdsWhiteEmbryoInController extends BaseController {
@Autowired
private IWmsOdsWhiteEmbryoInService wmsOdsWhiteEmbryoInService;
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:list")
@GetMapping("/list")
public TableDataInfo list(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
startPage();
List<WmsOdsWhiteEmbryoIn> list = wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:export")
@Log(title = "白胚入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
List<WmsOdsWhiteEmbryoIn> list = wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn);
ExcelUtil<WmsOdsWhiteEmbryoIn> util = new ExcelUtil<WmsOdsWhiteEmbryoIn>(WmsOdsWhiteEmbryoIn.class);
util.exportExcel(response, list, "白胚入库单数据");
}
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:query")
@GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") String ID) {
return success(wmsOdsWhiteEmbryoInService.selectWmsOdsWhiteEmbryoInByID(ID));
}
/**
*
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody List<WmsOdsWhiteEmbryoIn> wmsOdsWhiteEmbryoIns) {
return toAjax(wmsOdsWhiteEmbryoInService.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIns));
}
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:edit")
@Log(title = "白胚入库单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
return toAjax(wmsOdsWhiteEmbryoInService.updateWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn));
}
/**
*
*/
@RequiresPermissions("wms:wmsEmbryoin:remove")
@Log(title = "白胚入库单", businessType = BusinessType.DELETE)
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable String[] IDs) {
return toAjax(wmsOdsWhiteEmbryoInService.deleteWmsOdsWhiteEmbryoInByIDs(IDs));
}
/**
*
*/
@PostMapping("/Warehousing")
public AjaxResult addWarehousing(@RequestBody List<WmsOdsWhiteEmbryoIn> wmsOdsWhiteEmbryoIns) {
return toAjax(wmsOdsWhiteEmbryoInService.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIns));
}
}

@ -0,0 +1,422 @@
package com.op.wms.domain;
import java.math.BigDecimal;
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;
/**
* wms_ods_white_embryo_in
*
* @author Open Platform
* @date 2023-07-20
*/
public class WmsOdsWhiteEmbryoIn extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String siteCode;
/** ID */
private String ID;
/** 入库单号 */
@Excel(name = "入库单号")
private String orderCode;
/** 型号编码 */
@Excel(name = "型号编码")
private String materialCode;
/** 型号名称 */
@Excel(name = "型号名称")
private String materialDesc;
/** 计划日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date planDate;
/** 计划数量 */
@Excel(name = "计划数量")
private BigDecimal planNumber;
/** 单位 */
@Excel(name = "单位")
private String Unit;
/** 已出库数量 */
@Excel(name = "已出库数量")
private BigDecimal realityNumber;
/** 订单状态 */
@Excel(name = "订单状态")
private String orderStatus;
/** 批次号 */
@Excel(name = "批次号")
private String userDefined1;
/** 产线名称 */
@Excel(name = "产线名称")
private String productionLineDesc;
/** 产线编号 */
@Excel(name = "产线编号")
private String productionLineCode;
/** 库位 */
@Excel(name = "库位")
private String locCode;
/** 用户自定义属性2 */
@Excel(name = "用户自定义属性2")
private String userDefined2;
/** 用户自定义属性3 */
@Excel(name = "用户自定义属性3")
private String userDefined3;
/** 用户自定义属性4 */
@Excel(name = "用户自定义属性4")
private String userDefined4;
/** 用户自定义属性5 */
@Excel(name = "用户自定义属性5")
private String userDefined5;
/** 用户自定义属性6 */
@Excel(name = "用户自定义属性6")
private String userDefined6;
/** 用户自定义属性7 */
@Excel(name = "用户自定义属性7")
private String userDefined7;
/** 用户自定义属性8 */
@Excel(name = "用户自定义属性8")
private String userDefined8;
/** 用户自定义属性9 */
@Excel(name = "用户自定义属性9")
private String userDefined9;
/** 用户自定义属性10 */
@Excel(name = "用户自定义属性10")
private String userDefined10;
/** 用户自定义属性11 */
@Excel(name = "用户自定义属性11")
private String userDefined11;
/** 供应商编码 */
@Excel(name = "供应商编码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 最后更新人 */
@Excel(name = "最后更新人")
private String lastUpdateBy;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdateDate;
/** 可用标识 */
@Excel(name = "可用标识")
private String Active;
/** 企业主键 */
@Excel(name = "企业主键")
private String enterpriseId;
private String Remark;
public String getRemark() {
return Remark;
}
public void setRemark(String Remark) {
this.Remark = Remark;
}
/** 企业编码 */
@Excel(name = "企业编码")
private String enterpriseCode;
public void setSiteCode(String siteCode) {
this.siteCode = siteCode;
}
public String getSiteCode() {
return siteCode;
}
public void setID(String ID) {
this.ID = ID;
}
public String getID() {
return ID;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getMaterialDesc() {
return materialDesc;
}
public void setPlanDate(Date planDate) {
this.planDate = planDate;
}
public Date getPlanDate() {
return planDate;
}
public void setPlanNumber(BigDecimal planNumber) {
this.planNumber = planNumber;
}
public BigDecimal getPlanNumber() {
return planNumber;
}
public void setUnit(String Unit) {
this.Unit = Unit;
}
public String getUnit() {
return Unit;
}
public void setRealityNumber(BigDecimal realityNumber) {
this.realityNumber = realityNumber;
}
public BigDecimal getRealityNumber() {
return realityNumber;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public String getOrderStatus() {
return orderStatus;
}
public void setUserDefined1(String userDefined1) {
this.userDefined1 = userDefined1;
}
public String getUserDefined1() {
return userDefined1;
}
public void setProductionLineDesc(String productionLineDesc) {
this.productionLineDesc = productionLineDesc;
}
public String getProductionLineDesc() {
return productionLineDesc;
}
public void setProductionLineCode(String productionLineCode) {
this.productionLineCode = productionLineCode;
}
public String getProductionLineCode() {
return productionLineCode;
}
public void setLocCode(String locCode) {
this.locCode = locCode;
}
public String getLocCode() {
return locCode;
}
public void setUserDefined2(String userDefined2) {
this.userDefined2 = userDefined2;
}
public String getUserDefined2() {
return userDefined2;
}
public void setUserDefined3(String userDefined3) {
this.userDefined3 = userDefined3;
}
public String getUserDefined3() {
return userDefined3;
}
public void setUserDefined4(String userDefined4) {
this.userDefined4 = userDefined4;
}
public String getUserDefined4() {
return userDefined4;
}
public void setUserDefined5(String userDefined5) {
this.userDefined5 = userDefined5;
}
public String getUserDefined5() {
return userDefined5;
}
public void setUserDefined6(String userDefined6) {
this.userDefined6 = userDefined6;
}
public String getUserDefined6() {
return userDefined6;
}
public void setUserDefined7(String userDefined7) {
this.userDefined7 = userDefined7;
}
public String getUserDefined7() {
return userDefined7;
}
public void setUserDefined8(String userDefined8) {
this.userDefined8 = userDefined8;
}
public String getUserDefined8() {
return userDefined8;
}
public void setUserDefined9(String userDefined9) {
this.userDefined9 = userDefined9;
}
public String getUserDefined9() {
return userDefined9;
}
public void setUserDefined10(String userDefined10) {
this.userDefined10 = userDefined10;
}
public String getUserDefined10() {
return userDefined10;
}
public void setUserDefined11(String userDefined11) {
this.userDefined11 = userDefined11;
}
public String getUserDefined11() {
return userDefined11;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getSupplierName() {
return supplierName;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getCreateDate() {
return createDate;
}
public void setLastUpdateBy(String lastUpdateBy) {
this.lastUpdateBy = lastUpdateBy;
}
public String getLastUpdateBy() {
return lastUpdateBy;
}
public void setLastUpdateDate(Date lastUpdateDate) {
this.lastUpdateDate = lastUpdateDate;
}
public Date getLastUpdateDate() {
return lastUpdateDate;
}
public void setActive(String Active) {
this.Active = Active;
}
public String getActive() {
return Active;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseCode(String enterpriseCode) {
this.enterpriseCode = enterpriseCode;
}
public String getEnterpriseCode() {
return enterpriseCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("siteCode", getSiteCode())
.append("ID", getID())
.append("orderCode", getOrderCode())
.append("materialCode", getMaterialCode())
.append("materialDesc", getMaterialDesc())
.append("planDate", getPlanDate())
.append("planNumber", getPlanNumber())
.append("Unit", getUnit())
.append("realityNumber", getRealityNumber())
.append("orderStatus", getOrderStatus())
.append("userDefined1", getUserDefined1())
.append("productionLineDesc", getProductionLineDesc())
.append("productionLineCode", getProductionLineCode())
.append("locCode", getLocCode())
.append("userDefined2", getUserDefined2())
.append("userDefined3", getUserDefined3())
.append("userDefined4", getUserDefined4())
.append("userDefined5", getUserDefined5())
.append("userDefined6", getUserDefined6())
.append("userDefined7", getUserDefined7())
.append("userDefined8", getUserDefined8())
.append("userDefined9", getUserDefined9())
.append("userDefined10", getUserDefined10())
.append("userDefined11", getUserDefined11())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("Remark", getRemark())
.append("createBy", getCreateBy())
.append("createDate", getCreateDate())
.append("lastUpdateBy", getLastUpdateBy())
.append("lastUpdateDate", getLastUpdateDate())
.append("Active", getActive())
.append("enterpriseId", getEnterpriseId())
.append("enterpriseCode", getEnterpriseCode())
.toString();
}
}

@ -0,0 +1,18 @@
package com.op.wms.mapper;
import com.op.wms.domain.PowderChargeOrder;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-10
*/
public interface PowderChargeOrderRecordMapper {
Integer insertPowderChargeOrderRecord(PowderChargeOrder powderChargeOrder);
List<PowderChargeOrder> selectPowderChargeOrderRecordList(PowderChargeOrder powderChargeOrder);
}

@ -0,0 +1,61 @@
package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsOdsWhiteEmbryoIn;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-20
*/
public interface WmsOdsWhiteEmbryoInMapper {
/**
*
*
* @param ID
* @return
*/
public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public List<WmsOdsWhiteEmbryoIn> selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public int insertWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
/**
*
*
* @param ID
* @return
*/
public int deleteWmsOdsWhiteEmbryoInByID(String ID);
/**
*
*
* @param IDs
* @return
*/
public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs);
}

@ -0,0 +1,60 @@
package com.op.wms.service;
import java.util.List;
import com.op.wms.domain.WmsOdsWhiteEmbryoIn;
/**
* Service
*
* @author Open Platform
* @date 2023-07-20
*/
public interface IWmsOdsWhiteEmbryoInService {
/**
*
*
* @param ID
* @return
*/
public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public List<WmsOdsWhiteEmbryoIn> selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public int insertWmsOdsWhiteEmbryoIn(List<WmsOdsWhiteEmbryoIn> wmsOdsWhiteEmbryoIns);
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn);
/**
*
*
* @param IDs
* @return
*/
public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs);
/**
*
*
* @param ID
* @return
*/
public int deleteWmsOdsWhiteEmbryoInByID(String ID);
}

@ -0,0 +1,152 @@
package com.op.wms.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.Purcode;
import com.op.wms.mapper.PurcodeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.WmsOdsWhiteEmbryoInMapper;
import com.op.wms.domain.WmsOdsWhiteEmbryoIn;
import com.op.wms.service.IWmsOdsWhiteEmbryoInService;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author Open Platform
* @date 2023-07-20
*/
@Service
public class WmsOdsWhiteEmbryoInServiceImpl implements IWmsOdsWhiteEmbryoInService {
@Autowired
private WmsOdsWhiteEmbryoInMapper wmsOdsWhiteEmbryoInMapper;
@Autowired
private PurcodeMapper purcodeMapper;
/**
*
*
* @param ID
* @return
*/
@Override
@DS("#header.poolName")
public WmsOdsWhiteEmbryoIn selectWmsOdsWhiteEmbryoInByID(String ID) {
return wmsOdsWhiteEmbryoInMapper.selectWmsOdsWhiteEmbryoInByID(ID);
}
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
@Override
@DS("#header.poolName")
public List<WmsOdsWhiteEmbryoIn> selectWmsOdsWhiteEmbryoInList(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
return wmsOdsWhiteEmbryoInMapper.selectWmsOdsWhiteEmbryoInList(wmsOdsWhiteEmbryoIn);
}
/**
*
*
* @param WmsOdsWhiteEmbryoIn
* @return
*/
@Override
@DS("#header.poolName")
@Transactional
public int insertWmsOdsWhiteEmbryoIn(List<WmsOdsWhiteEmbryoIn> wmsOdsWhiteEmbryoIns) {
String userName = SecurityContextHolder.getUserName();
int tem=0;
for (WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn:
wmsOdsWhiteEmbryoIns) {
String orderCode =getPurcode(null,"RL");
wmsOdsWhiteEmbryoIn.setID(IdUtils.fastSimpleUUID());
wmsOdsWhiteEmbryoIn.setOrderCode(orderCode);
wmsOdsWhiteEmbryoIn.setCreateDate(new Date());
wmsOdsWhiteEmbryoIn.setOrderStatus("0");//0,1
wmsOdsWhiteEmbryoIn.setActive("1");
wmsOdsWhiteEmbryoIn.setCreateBy(userName);
tem= wmsOdsWhiteEmbryoInMapper.insertWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn);
}
return tem;
}
/**
*
*
* @param wmsOdsWhiteEmbryoIn
* @return
*/
@Override
@DS("#header.poolName")
public int updateWmsOdsWhiteEmbryoIn(WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn) {
return wmsOdsWhiteEmbryoInMapper.updateWmsOdsWhiteEmbryoIn(wmsOdsWhiteEmbryoIn);
}
/**
*
*
* @param IDs
* @return
*/
@Override
@DS("#header.poolName")
public int deleteWmsOdsWhiteEmbryoInByIDs(String[] IDs) {
return wmsOdsWhiteEmbryoInMapper.deleteWmsOdsWhiteEmbryoInByIDs(IDs);
}
/**
*
*
* @param ID
* @return
*/
@Override
@DS("#header.poolName")
public int deleteWmsOdsWhiteEmbryoInByID(String ID) {
return wmsOdsWhiteEmbryoInMapper.deleteWmsOdsWhiteEmbryoInByID(ID);
}
@DS("#header.poolName")
private String getPurcode(String factorycode, String orderType) {
String purcode = "";
String curDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
Integer vaule = purcodeMapper.queryCurValue(orderType, curDate);
if (vaule == null) {
Purcode purcodeO = new Purcode();
purcodeO.setCurDate(curDate);
purcodeO.setOrderType(orderType);
purcodeO.setValue(1);
int count = purcodeMapper.insert(purcodeO);
if (count != 1) {
return "";
}
if (factorycode != null && !factorycode.equals("")) {
purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", 1);
} else {
purcode = orderType + curDate.substring(2) + String.format("%04d", 1);
}
} else {
int count = purcodeMapper.updateCurValue(orderType, curDate, vaule);
if (count != 1) {
return "";
}
if (factorycode != null && !factorycode.equals("")) {
purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", vaule + 1);
} else {
purcode = orderType + curDate.substring(2) + String.format("%04d", vaule + 1);
}
}
return purcode;
}
}

@ -0,0 +1,150 @@
<?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.wms.mapper.PowderChargeOrderRecordMapper">
<resultMap type="PowderChargeOrder" id="PowderChargeOrderResult">
<result property="siteCode" column="Site_code" />
<result property="ID" column="ID" />
<result property="orderCode" column="Order_Code" />
<result property="materialCode" column="Material_Code" />
<result property="materialDesc" column="Material_Desc" />
<result property="planDate" column="Plan_Date" />
<result property="planNumber" column="Plan_Number" />
<result property="Unit" column="Unit" />
<result property="realityNumber" column="Reality_Number" />
<result property="orderStatus" column="Order_Status" />
<result property="userDefined1" column="User_Defined1" />
<result property="userDefined2" column="User_Defined2" />
<result property="userDefined3" column="User_Defined3" />
<result property="userDefined4" column="User_Defined4" />
<result property="userDefined5" column="User_Defined5" />
<result property="userDefined6" column="User_Defined6" />
<result property="userDefined7" column="User_Defined7" />
<result property="userDefined8" column="User_Defined8" />
<result property="userDefined9" column="User_Defined9" />
<result property="userDefined10" column="User_Defined10" />
<result property="userDefined11" column="User_Defined11" />
<result property="supplierCode" column="Supplier_Code" />
<result property="supplierName" column="Supplier_Name" />
<result property="Remark" column="Remark" />
<result property="createBy" column="Create_By" />
<result property="createDate" column="Create_Date" />
<result property="lastUpdateBy" column="Last_Update_By" />
<result property="lastUpdateDate" column="Last_Update_Date" />
<result property="Active" column="Active" />
<result property="enterpriseId" column="Enterprise_Id" />
<result property="enterpriseCode" column="Enterprise_Code" />
<result property="wlCode" column="wl_code" />
</resultMap>
<insert id="insertPowderChargeOrderRecord" parameterType="PowderChargeOrder">
insert into powder_charge_order_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,</if>
<if test="ID != null">ID,</if>
<if test="orderCode != null">Order_Code,</if>
<if test="materialCode != null">Material_Code,</if>
<if test="materialDesc != null">Material_Desc,</if>
<if test="planDate != null">Plan_Date,</if>
<if test="planNumber != null">Plan_Number,</if>
<if test="Unit != null">Unit,</if>
<if test="realityNumber != null">Reality_Number,</if>
<if test="orderStatus != null">Order_Status,</if>
<if test="userDefined1 != null">User_Defined1,</if>
<if test="userDefined2 != null">User_Defined2,</if>
<if test="userDefined3 != null">User_Defined3,</if>
<if test="userDefined4 != null">User_Defined4,</if>
<if test="userDefined5 != null">User_Defined5,</if>
<if test="userDefined6 != null">User_Defined6,</if>
<if test="userDefined7 != null">User_Defined7,</if>
<if test="userDefined8 != null">User_Defined8,</if>
<if test="userDefined9 != null">User_Defined9,</if>
<if test="userDefined10 != null">User_Defined10,</if>
<if test="userDefined11 != null">User_Defined11,</if>
<if test="supplierCode != null">Supplier_Code,</if>
<if test="supplierName != null">Supplier_Name,</if>
<if test="Remark != null">Remark,</if>
<if test="createBy != null">Create_By,</if>
<if test="createDate != null">Create_Date,</if>
<if test="lastUpdateBy != null">Last_Update_By,</if>
<if test="lastUpdateDate != null">Last_Update_Date,</if>
<if test="Active != null">Active,</if>
<if test="enterpriseId != null">Enterprise_Id,</if>
<if test="enterpriseCode != null">Enterprise_Code,</if>
<if test="wlCode != null">wl_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},</if>
<if test="ID != null">#{ID},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="planDate != null">#{planDate},</if>
<if test="planNumber != null">#{planNumber},</if>
<if test="Unit != null">#{Unit},</if>
<if test="realityNumber != null">#{realityNumber},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="userDefined6 != null">#{userDefined6},</if>
<if test="userDefined7 != null">#{userDefined7},</if>
<if test="userDefined8 != null">#{userDefined8},</if>
<if test="userDefined9 != null">#{userDefined9},</if>
<if test="userDefined10 != null">#{userDefined10},</if>
<if test="userDefined11 != null">#{userDefined11},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="Remark != null">#{Remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},</if>
<if test="Active != null">#{Active},</if>
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="wlCode != null">#{wlCode},</if>
</trim>
</insert>
<sql id="selectPowderChargeOrderRecordVo">
select Site_code, ID, Order_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, Reality_Number, Order_Status, User_Defined1, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code,wl_code from powder_charge_order_record
</sql>
<select id="selectPowderChargeOrderRecordList">
<include refid="selectPowderChargeOrderRecordVo"/>
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="orderCode != null and orderCode != ''"> and Order_Code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and Material_Desc = #{materialDesc}</if>
<if test="planDate != null "> and Plan_Date = #{planDate}</if>
<if test="planNumber != null "> and Plan_Number = #{planNumber}</if>
<if test="Unit != null and Unit != ''"> and Unit = #{Unit}</if>
<if test="realityNumber != null "> and Reality_Number = #{realityNumber}</if>
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and User_Defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and User_Defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and User_Defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and User_Defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and User_Defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and User_Defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and User_Defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
<if test="Remark != null and Remark != ''"> and Remark = #{Remark}</if>
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
<if test="createDate != null "> and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
<if test="lastUpdateDate != null "> and Last_Update_Date = #{lastUpdateDate}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and Enterprise_Id = #{enterpriseId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
</where></select>
</mapper>

@ -0,0 +1,218 @@
<?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.wms.mapper.WmsOdsWhiteEmbryoInMapper">
<resultMap type="WmsOdsWhiteEmbryoIn" id="WmsOdsWhiteEmbryoInResult">
<result property="siteCode" column="Site_code" />
<result property="ID" column="ID" />
<result property="orderCode" column="Order_Code" />
<result property="materialCode" column="Material_Code" />
<result property="materialDesc" column="Material_Desc" />
<result property="planDate" column="Plan_Date" />
<result property="planNumber" column="Plan_Number" />
<result property="Unit" column="Unit" />
<result property="realityNumber" column="Reality_Number" />
<result property="orderStatus" column="Order_Status" />
<result property="userDefined1" column="User_Defined1" />
<result property="productionLineDesc" column="Production_Line_Desc" />
<result property="productionLineCode" column="Production_Line_Code" />
<result property="locCode" column="Loc_Code" />
<result property="userDefined2" column="User_Defined2" />
<result property="userDefined3" column="User_Defined3" />
<result property="userDefined4" column="User_Defined4" />
<result property="userDefined5" column="User_Defined5" />
<result property="userDefined6" column="User_Defined6" />
<result property="userDefined7" column="User_Defined7" />
<result property="userDefined8" column="User_Defined8" />
<result property="userDefined9" column="User_Defined9" />
<result property="userDefined10" column="User_Defined10" />
<result property="userDefined11" column="User_Defined11" />
<result property="supplierCode" column="Supplier_Code" />
<result property="supplierName" column="Supplier_Name" />
<result property="Remark" column="Remark" />
<result property="createBy" column="Create_By" />
<result property="createDate" column="Create_Date" />
<result property="lastUpdateBy" column="Last_Update_By" />
<result property="lastUpdateDate" column="Last_Update_Date" />
<result property="Active" column="Active" />
<result property="enterpriseId" column="Enterprise_Id" />
<result property="enterpriseCode" column="Enterprise_Code" />
</resultMap>
<sql id="selectWmsOdsWhiteEmbryoInVo">
select Site_code, ID, Order_Code, Material_Code, Material_Desc, Plan_Date, Plan_Number, Unit, Reality_Number, Order_Status, User_Defined1, Production_Line_Desc, Production_Line_Code, Loc_Code, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Supplier_Code, Supplier_Name, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from wms_ods_white_embryo_in
</sql>
<select id="selectWmsOdsWhiteEmbryoInList" parameterType="WmsOdsWhiteEmbryoIn" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
<where>
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
<if test="orderCode != null and orderCode != ''"> and Order_Code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and Material_Desc = #{materialDesc}</if>
<if test="planDate != null "> and Plan_Date = #{planDate}</if>
<if test="planNumber != null "> and Plan_Number = #{planNumber}</if>
<if test="Unit != null and Unit != ''"> and Unit = #{Unit}</if>
<if test="realityNumber != null "> and Reality_Number = #{realityNumber}</if>
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="productionLineDesc != null and productionLineDesc != ''"> and Production_Line_Desc = #{productionLineDesc}</if>
<if test="productionLineCode != null and productionLineCode != ''"> and Production_Line_Code = #{productionLineCode}</if>
<if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and User_Defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and User_Defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and User_Defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and User_Defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and User_Defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and User_Defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and User_Defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
<if test="Remark != null and Remark != ''"> and Remark = #{Remark}</if>
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
<if test="createDate != null "> and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
<if test="lastUpdateDate != null "> and Last_Update_Date = #{lastUpdateDate}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and Enterprise_Id = #{enterpriseId}</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
</where>
</select>
<select id="selectWmsOdsWhiteEmbryoInByID" parameterType="String" resultMap="WmsOdsWhiteEmbryoInResult">
<include refid="selectWmsOdsWhiteEmbryoInVo"/>
where ID = #{ID}
</select>
<insert id="insertWmsOdsWhiteEmbryoIn" parameterType="WmsOdsWhiteEmbryoIn">
insert into wms_ods_white_embryo_in
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,</if>
<if test="ID != null">ID,</if>
<if test="orderCode != null">Order_Code,</if>
<if test="materialCode != null">Material_Code,</if>
<if test="materialDesc != null">Material_Desc,</if>
<if test="planDate != null">Plan_Date,</if>
<if test="planNumber != null">Plan_Number,</if>
<if test="Unit != null">Unit,</if>
<if test="realityNumber != null">Reality_Number,</if>
<if test="orderStatus != null">Order_Status,</if>
<if test="userDefined1 != null">User_Defined1,</if>
<if test="productionLineDesc != null">Production_Line_Desc,</if>
<if test="productionLineCode != null">Production_Line_Code,</if>
<if test="locCode != null">Loc_Code,</if>
<if test="userDefined2 != null">User_Defined2,</if>
<if test="userDefined3 != null">User_Defined3,</if>
<if test="userDefined4 != null">User_Defined4,</if>
<if test="userDefined5 != null">User_Defined5,</if>
<if test="userDefined6 != null">User_Defined6,</if>
<if test="userDefined7 != null">User_Defined7,</if>
<if test="userDefined8 != null">User_Defined8,</if>
<if test="userDefined9 != null">User_Defined9,</if>
<if test="userDefined10 != null">User_Defined10,</if>
<if test="userDefined11 != null">User_Defined11,</if>
<if test="supplierCode != null">Supplier_Code,</if>
<if test="supplierName != null">Supplier_Name,</if>
<if test="Remark != null">Remark,</if>
<if test="createBy != null">Create_By,</if>
<if test="createDate != null">Create_Date,</if>
<if test="lastUpdateBy != null">Last_Update_By,</if>
<if test="lastUpdateDate != null">Last_Update_Date,</if>
<if test="Active != null">Active,</if>
<if test="enterpriseId != null">Enterprise_Id,</if>
<if test="enterpriseCode != null">Enterprise_Code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},</if>
<if test="ID != null">#{ID},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="planDate != null">#{planDate},</if>
<if test="planNumber != null">#{planNumber},</if>
<if test="Unit != null">#{Unit},</if>
<if test="realityNumber != null">#{realityNumber},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="userDefined1 != null">#{userDefined1},</if>
<if test="productionLineDesc != null">#{productionLineDesc},</if>
<if test="productionLineCode != null">#{productionLineCode},</if>
<if test="locCode != null">#{locCode},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="userDefined6 != null">#{userDefined6},</if>
<if test="userDefined7 != null">#{userDefined7},</if>
<if test="userDefined8 != null">#{userDefined8},</if>
<if test="userDefined9 != null">#{userDefined9},</if>
<if test="userDefined10 != null">#{userDefined10},</if>
<if test="userDefined11 != null">#{userDefined11},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="Remark != null">#{Remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},</if>
<if test="Active != null">#{Active},</if>
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
</trim>
</insert>
<update id="updateWmsOdsWhiteEmbryoIn" parameterType="WmsOdsWhiteEmbryoIn">
update wms_ods_white_embryo_in
<trim prefix="SET" suffixOverrides=",">
<if test="siteCode != null">Site_code = #{siteCode},</if>
<if test="orderCode != null">Order_Code = #{orderCode},</if>
<if test="materialCode != null">Material_Code = #{materialCode},</if>
<if test="materialDesc != null">Material_Desc = #{materialDesc},</if>
<if test="planDate != null">Plan_Date = #{planDate},</if>
<if test="planNumber != null">Plan_Number = #{planNumber},</if>
<if test="Unit != null">Unit = #{Unit},</if>
<if test="realityNumber != null">Reality_Number = #{realityNumber},</if>
<if test="orderStatus != null">Order_Status = #{orderStatus},</if>
<if test="userDefined1 != null">User_Defined1 = #{userDefined1},</if>
<if test="productionLineDesc != null">Production_Line_Desc = #{productionLineDesc},</if>
<if test="productionLineCode != null">Production_Line_Code = #{productionLineCode},</if>
<if test="locCode != null">Loc_Code = #{locCode},</if>
<if test="userDefined2 != null">User_Defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">User_Defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">User_Defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">User_Defined5 = #{userDefined5},</if>
<if test="userDefined6 != null">User_Defined6 = #{userDefined6},</if>
<if test="userDefined7 != null">User_Defined7 = #{userDefined7},</if>
<if test="userDefined8 != null">User_Defined8 = #{userDefined8},</if>
<if test="userDefined9 != null">User_Defined9 = #{userDefined9},</if>
<if test="userDefined10 != null">User_Defined10 = #{userDefined10},</if>
<if test="userDefined11 != null">User_Defined11 = #{userDefined11},</if>
<if test="supplierCode != null">Supplier_Code = #{supplierCode},</if>
<if test="supplierName != null">Supplier_Name = #{supplierName},</if>
<if test="Remark != null">Remark = #{Remark},</if>
<if test="createBy != null">Create_By = #{createBy},</if>
<if test="createDate != null">Create_Date = #{createDate},</if>
<if test="lastUpdateBy != null">Last_Update_By = #{lastUpdateBy},</if>
<if test="lastUpdateDate != null">Last_Update_Date = #{lastUpdateDate},</if>
<if test="Active != null">Active = #{Active},</if>
<if test="enterpriseId != null">Enterprise_Id = #{enterpriseId},</if>
<if test="enterpriseCode != null">Enterprise_Code = #{enterpriseCode},</if>
</trim>
where ID = #{ID}
</update>
<delete id="deleteWmsOdsWhiteEmbryoInByID" parameterType="String">
delete from wms_ods_white_embryo_in where ID = #{ID}
</delete>
<delete id="deleteWmsOdsWhiteEmbryoInByIDs" parameterType="String">
delete from wms_ods_white_embryo_in where ID in
<foreach item="ID" collection="array" open="(" separator="," close=")">
#{ID}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save