增加对大小料箱的支持

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; 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.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity; import com.ktg.common.core.domain.BaseEntity;
import com.ktg.mes.md.domain.BaseKnife;
import java.util.List; import java.util.List;
/** /**
* 料箱管理对象 UCM_CT_BASE * 料箱管理对象 UCM_CT_BASE
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
public class UcmCtBase extends BaseEntity public class UcmCtBase extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 料箱id */ /**
* 料箱id
*/
private String ctBaseId; private String ctBaseId;
/** 料箱编码 */ /**
* 料箱编码
*/
@Excel(name = "料箱编码") @Excel(name = "料箱编码")
private String code; private String code;
/** 料箱状态0-正常1-绑定2-解绑 */ /**
* 料箱状态0-正常1-绑定2-解绑
*/
@Excel(name = "料箱状态0-正常1-绑定2-解绑") @Excel(name = "料箱状态0-正常1-绑定2-解绑")
private String type; private String type;
/** 预留字段1 */ /**
* 预留字段1
*/
private String attr1; private String attr1;
/** 预留字段2 */ /**
* 预留字段2
*/
private String attr2; 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; private List<BaseKnife> baseKnifeList;
public void setCtBaseId(String ctBaseId) public void setCtBaseId(String ctBaseId) {
{
this.ctBaseId = ctBaseId; this.ctBaseId = ctBaseId;
} }
public String getCtBaseId() public String getCtBaseId() {
{
return ctBaseId; return ctBaseId;
} }
public void setCode(String code)
{ public void setCode(String code) {
this.code = code; this.code = code;
} }
public String getCode() public String getCode() {
{
return code; return code;
} }
public void setType(String type)
{ public void setType(String type) {
this.type = type; this.type = type;
} }
public String getType() public String getType() {
{
return type; return type;
} }
public void setAttr1(String attr1)
{ public void setAttr1(String attr1) {
this.attr1 = attr1; this.attr1 = attr1;
} }
public String getAttr1() public String getAttr1() {
{
return attr1; return attr1;
} }
public void setAttr2(String attr2)
{ public void setAttr2(String attr2) {
this.attr2 = attr2; this.attr2 = attr2;
} }
public String getAttr2() public String getAttr2() {
{
return attr2; return attr2;
} }
public void setAttr3(String attr3)
{ public Integer getAttr3() {
return attr3;
}
public void setAttr3(Integer attr3) {
this.attr3 = attr3; this.attr3 = attr3;
} }
public String getAttr3() public Integer getAttr4() {
{ return attr4;
return attr3;
}
public void setAttr4(String attr4)
{
this.attr4 = attr4;
} }
public String getAttr4() public void setAttr4(Integer attr4) {
{ this.attr4 = attr4;
return attr4;
} }
public List<BaseKnife> getBaseKnifeList() { public List<BaseKnife> getBaseKnifeList() {
@ -119,19 +123,15 @@ public class UcmCtBase extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "UcmCtBase{" +
.append("ctBaseId", getCtBaseId()) "ctBaseId='" + ctBaseId + '\'' +
.append("code", getCode()) ", code='" + code + '\'' +
.append("type", getType()) ", type='" + type + '\'' +
.append("remark", getRemark()) ", attr1='" + attr1 + '\'' +
.append("attr1", getAttr1()) ", attr2='" + attr2 + '\'' +
.append("attr2", getAttr2()) ", attr3=" + attr3 +
.append("attr3", getAttr3()) ", attr4=" + attr4 +
.append("attr4", getAttr4()) ", baseKnifeList=" + baseKnifeList +
.append("createBy", getCreateBy()) '}';
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
} }
} }

View File

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