增加对大小料箱的支持

This commit is contained in:
刘名喜 2024-12-18 10:26:59 +08:00
parent d5b4647a12
commit f14fd39c5c
2 changed files with 264 additions and 144 deletions

View File

@ -1,112 +1,116 @@
package com.ktg.mes.wm.domain;
import com.ktg.mes.md.domain.BaseKnife;
import com.ktg.mes.md.domain.MbbProduBom;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import com.ktg.mes.md.domain.BaseKnife;
import java.util.List;
/**
* 料箱管理对象 UCM_CT_BASE
*
*
* @author yinjinlu
* @date 2024-10-31
*/
public class UcmCtBase extends BaseEntity
{
public class UcmCtBase extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 料箱id */
/**
* 料箱id
*/
private String ctBaseId;
/** 料箱编码 */
/**
* 料箱编码
*/
@Excel(name = "料箱编码")
private String code;
/** 料箱状态0-正常1-绑定2-解绑 */
/**
* 料箱状态0-正常1-绑定2-解绑
*/
@Excel(name = "料箱状态0-正常1-绑定2-解绑")
private String type;
/** 预留字段1 */
/**
* 预留字段1
*/
private String attr1;
/** 预留字段2 */
/**
* 预留字段2
*/
private String attr2;
/** 预留字段3为空或者0表示普通料箱为1表示大号料箱 */
private String attr3;
/**
* 预留字段3为空或者0表示普通料箱为1表示大号料箱
*/
private Integer attr3;
/** 预留字段4 */
private String attr4;
/**
* 预留字段4
*/
private Integer attr4;
/** BOM物料信息 */
/**
* BOM物料信息
*/
private List<BaseKnife> baseKnifeList;
public void setCtBaseId(String ctBaseId)
{
public void setCtBaseId(String ctBaseId) {
this.ctBaseId = ctBaseId;
}
public String getCtBaseId()
{
public String getCtBaseId() {
return ctBaseId;
}
public void setCode(String code)
{
public void setCode(String code) {
this.code = code;
}
public String getCode()
{
public String getCode() {
return code;
}
public void setType(String type)
{
public void setType(String type) {
this.type = type;
}
public String getType()
{
public String getType() {
return type;
}
public void setAttr1(String attr1)
{
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1()
{
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2)
{
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2()
{
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3)
{
public Integer getAttr3() {
return attr3;
}
public void setAttr3(Integer attr3) {
this.attr3 = attr3;
}
public String getAttr3()
{
return attr3;
}
public void setAttr4(String attr4)
{
this.attr4 = attr4;
public Integer getAttr4() {
return attr4;
}
public String getAttr4()
{
return attr4;
public void setAttr4(Integer attr4) {
this.attr4 = attr4;
}
public List<BaseKnife> getBaseKnifeList() {
@ -119,19 +123,15 @@ public class UcmCtBase extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("ctBaseId", getCtBaseId())
.append("code", getCode())
.append("type", getType())
.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();
return "UcmCtBase{" +
"ctBaseId='" + ctBaseId + '\'' +
", code='" + code + '\'' +
", type='" + type + '\'' +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3=" + attr3 +
", attr4=" + attr4 +
", baseKnifeList=" + baseKnifeList +
'}';
}
}

View File

@ -1,67 +1,116 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.UcmCtBaseMapper">
<resultMap type="UcmCtBase" id="UcmCtBaseResult">
<result property="ctBaseId" column="CT_BASE_ID" />
<result property="code" column="CODE" />
<result property="type" column="TYPE" />
<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="ctBaseId" column="CT_BASE_ID"/>
<result property="code" column="CODE"/>
<result property="type" column="TYPE"/>
<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"/>
</resultMap>
<resultMap id="UcmCtBaseBaseKnifeResult" type="UcmCtBase" extends="UcmCtBaseResult">
<collection property="baseKnifeList" notNullColumn="base_knife_id" javaType="java.util.List" resultMap="BaseKnifeList" />
<collection property="baseKnifeList" notNullColumn="base_knife_id" javaType="java.util.List"
resultMap="BaseKnifeList"/>
</resultMap>
<resultMap type="BaseKnife" id="BaseKnifeList">
<result property="baseKnifeId" column="base_knife_id" />
<result property="knifeCode" column="knife_code" />
<result property="knifeName" column="knife_name" />
<result property="knifeUnit" column="knife_unit" />
<result property="baseKnifeId" column="base_knife_id"/>
<result property="knifeCode" column="knife_code"/>
<result property="knifeName" column="knife_name"/>
<result property="knifeUnit" column="knife_unit"/>
</resultMap>
<sql id="selectUcmCtBaseVo">
select CT_BASE_ID, CODE, TYPE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from UCM_CT_BASE
select CT_BASE_ID,
CODE,
TYPE,
REMARK,
ATTR1,
ATTR2,
ATTR3,
ATTR4,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME
from UCM_CT_BASE
</sql>
<select id="selectUcmCtBaseList" parameterType="UcmCtBase" resultMap="UcmCtBaseResult">
<include refid="selectUcmCtBaseVo"/>
<where>
<if test="code != null and code != ''"> and CODE = #{code}</if>
<if test="type != null and type != ''"> and TYPE = #{type}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
<where>
<if test="code != null and code != ''">
and CODE = #{code}
</if>
<if test="type != null and type != ''">
and TYPE = #{type}
</if>
<if test="attr3 != null">
and ATTR3 = #{attr3}
</if>
<if test="createBy != null and createBy != ''">
and CREATE_BY = #{createBy}
</if>
<if test="createTime != null and createTime != ''">
and CREATE_TIME = #{createTime}
</if>
<if test="updateBy != null and updateBy != ''">
and UPDATE_BY = #{updateBy}
</if>
<if test="updateTime != null and updateTime != ''">
and UPDATE_TIME = #{updateTime}
</if>
</where>
</select>
<select id="selectUcmCtBaseByCode" parameterType="String" resultMap="UcmCtBaseBaseKnifeResult">
select ucb.CT_BASE_ID, ucb.CODE, ucb.TYPE, ucb.REMARK, ucb.CREATE_BY, ucb.CREATE_TIME, ucb.UPDATE_BY, ucb.UPDATE_TIME,
bk.base_knife_id, mi.item_name as knife_name, mi.item_code as knife_code, mi.unit_name as knife_unit
select ucb.CT_BASE_ID,
ucb.CODE,
ucb.TYPE,
ucb.REMARK,
ucb.ATTR3,
ucb.CREATE_BY,
ucb.CREATE_TIME,
ucb.UPDATE_BY,
ucb.UPDATE_TIME,
bk.base_knife_id,
mi.item_name as knife_name,
mi.item_code as knife_code,
mi.unit_name as knife_unit
from UCM_CT_BASE ucb
left join ucm_ct_material ucm
on ucb.ct_base_id = ucm.ct_base_id
left join base_knife bk
on ucm.base_knife_id = bk.base_knife_id
left join md_item mi
on bk.mbb_bd_mrl_id = mi.item_id
left join ucm_ct_material ucm
on ucb.ct_base_id = ucm.ct_base_id
left join base_knife bk
on ucm.base_knife_id = bk.base_knife_id
left join md_item mi
on bk.mbb_bd_mrl_id = mi.item_id
where ucb.CODE = #{code}
</select>
<select id="selectUcmCtBaseByCtBaseId" parameterType="String" resultMap="UcmCtBaseBaseKnifeResult">
select ucb.CT_BASE_ID, ucb.CODE, ucb.TYPE, ucb.REMARK, ucb.CREATE_BY, ucb.CREATE_TIME, ucb.UPDATE_BY, ucb.UPDATE_TIME,
bk.base_knife_id, mi.item_name as knife_name, mi.item_code as knife_code, mi.unit_name as knife_unit
select ucb.CT_BASE_ID,
ucb.CODE,
ucb.TYPE,
ucb.REMARK,
ucb.ATTR3,
ucb.CREATE_BY,
ucb.CREATE_TIME,
ucb.UPDATE_BY,
ucb.UPDATE_TIME,
bk.base_knife_id,
mi.item_name as knife_name,
mi.item_code as knife_code,
mi.unit_name as knife_unit
from UCM_CT_BASE ucb
left join ucm_ct_material ucm
on ucb.ct_base_id = ucm.ct_base_id
@ -71,72 +120,143 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
on bk.mbb_bd_mrl_id = mi.item_id
where ucb.CT_BASE_ID = #{ctBaseId}
</select>
<insert id="insertUcmCtBase" parameterType="UcmCtBase" useGeneratedKeys="true" keyProperty="ctBaseId">
insert into UCM_CT_BASE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">CODE,</if>
<if test="type != null">TYPE,</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>
</trim>
<if test="code != null">
CODE,
</if>
<if test="type != null">
TYPE,
</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">#{code},</if>
<if test="type != null">#{type},</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>
</trim>
<if test="code != null">
#{code},
</if>
<if test="type != null">
#{type},
</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>
</trim>
</insert>
<update id="updateUcmCtBase" parameterType="UcmCtBase">
update UCM_CT_BASE
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">CODE = #{code},</if>
<if test="type != null">TYPE = #{type},</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="code != null">
CODE = #{code},
</if>
<if test="type != null">
TYPE = #{type},
</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>
</trim>
where CT_BASE_ID = #{ctBaseId}
</update>
<delete id="deleteUcmCtBaseByCtBaseId" parameterType="String">
delete from UCM_CT_BASE where CT_BASE_ID = #{ctBaseId}
delete
from UCM_CT_BASE
where CT_BASE_ID = #{ctBaseId}
</delete>
<delete id="deleteUcmCtBaseByCtBaseIds" parameterType="String">
delete from UCM_CT_BASE where CT_BASE_ID in
delete
from UCM_CT_BASE where CT_BASE_ID in
<foreach item="ctBaseId" collection="array" open="(" separator="," close=")">
#{ctBaseId}
</foreach>
</delete>
<delete id="deleteUcmCtMaterialByCtBaseId">
delete from UCM_CT_MATERIAL where ct_base_id = #{ctBaseId}
delete
from UCM_CT_MATERIAL
where ct_base_id = #{ctBaseId}
</delete>
<insert id="insertUcmCtMaterial">
insert into ucm_ct_material( ct_base_id, base_knife_id, CREATE_BY, CREATE_TIME) values
( #{ctBaseId}, #{baseKnifeId}, #{createBy}, #{createTime})
insert into ucm_ct_material(ct_base_id, base_knife_id, CREATE_BY, CREATE_TIME)
values (#{ctBaseId}, #{baseKnifeId}, #{createBy}, #{createTime})
</insert>
</mapper>
</mapper>