change - 修改BOM

main
yinq 6 months ago
parent ae102e7f75
commit 6c4b0a9296

@ -61,10 +61,14 @@ public class BaseDeviceLedger extends BaseEntity
@Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date enableDate; private Date enableDate;
/** 所属工位 */ /** 所属工位编号 */
@Excel(name = "所属工位") @Excel(name = "所属工位编号")
private String productLineCode; private String productLineCode;
/** 所属工位名称 */
@Excel(name = "所属工位名称")
private String productLineName;
/** 启用标识 */ /** 启用标识 */
@Excel(name = "启用标识") @Excel(name = "启用标识")
private String isFlag; private String isFlag;
@ -81,6 +85,14 @@ public class BaseDeviceLedger extends BaseEntity
@Excel(name = "资产编号") @Excel(name = "资产编号")
private String assetCode; private String assetCode;
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public void setObjId(Long objId) public void setObjId(Long objId)
{ {
this.objId = objId; this.objId = objId;

@ -117,6 +117,34 @@ public class ProdBomInfo extends BaseEntity {
@Excel(name = "是否标识") @Excel(name = "是否标识")
private String isFlag; private String isFlag;
/**
*
*/
@Excel(name = "物料版本")
private String materialDesc;
/**
* BOM
*/
@Excel(name = "BOM全称")
private String materialAll;
public String getMaterialAll() {
return materialAll;
}
public void setMaterialAll(String materialAll) {
this.materialAll = materialAll;
}
public String getMaterialDesc() {
return materialDesc;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getMaterialUnit() { public String getMaterialUnit() {
return materialUnit; return materialUnit;
} }

@ -76,7 +76,7 @@ public class ProdBomInfoServiceImpl implements IProdBomInfoService {
public int insertProdBomInfo(ProdBomInfo prodBomInfo) { public int insertProdBomInfo(ProdBomInfo prodBomInfo) {
List<ProdBomInfo> baseBomInfos = prodBomInfoMapper.selectProdBomInfoList(prodBomInfo); List<ProdBomInfo> baseBomInfos = prodBomInfoMapper.selectProdBomInfoList(prodBomInfo);
if (baseBomInfos.size() > 0) { if (baseBomInfos.size() > 0) {
throw new BaseException("该物料编号" + prodBomInfo.getMaterialCode() + "已存在!"); throw new BaseException("该物料BOM" + prodBomInfo.getMaterialCode() + "已存在!");
} }
ProdBomInfo info = prodBomInfoMapper.selectProdBomInfoByObjId(prodBomInfo.getParentId()); ProdBomInfo info = prodBomInfoMapper.selectProdBomInfoByObjId(prodBomInfo.getParentId());
if (StringUtils.isNull(info)) { if (StringUtils.isNull(info)) {

@ -1,60 +1,85 @@
<?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.os.mes.base.mapper.BaseDeviceLedgerMapper"> <mapper namespace="com.os.mes.base.mapper.BaseDeviceLedgerMapper">
<resultMap type="BaseDeviceLedger" id="BaseDeviceLedgerResult"> <resultMap type="BaseDeviceLedger" id="BaseDeviceLedgerResult">
<result property="objId" column="obj_id" /> <result property="objId" column="obj_id"/>
<result property="deviceCode" column="device_code" /> <result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name" /> <result property="deviceName" column="device_name"/>
<result property="deviceModel" column="device_model" /> <result property="deviceModel" column="device_model"/>
<result property="deviceType" column="device_type" /> <result property="deviceType" column="device_type"/>
<result property="deviceAddress" column="device_address" /> <result property="deviceAddress" column="device_address"/>
<result property="deviceStatus" column="device_status" /> <result property="deviceStatus" column="device_status"/>
<result property="usedDepartment" column="used_department" /> <result property="usedDepartment" column="used_department"/>
<result property="costCenter" column="cost_center" /> <result property="costCenter" column="cost_center"/>
<result property="manufacturer" column="manufacturer" /> <result property="manufacturer" column="manufacturer"/>
<result property="enableDate" column="enable_date" /> <result property="enableDate" column="enable_date"/>
<result property="productLineCode" column="product_line_code" /> <result property="productLineCode" column="product_line_code"/>
<result property="isFlag" column="is_flag" /> <result property="productLineName" column="product_line_name"/>
<result property="createBy" column="create_by" /> <result property="isFlag" column="is_flag"/>
<result property="createTime" column="create_time" /> <result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by" /> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time" /> <result property="updateBy" column="update_by"/>
<result property="factoryCode" column="factory_code" /> <result property="updateTime" column="update_time"/>
<result property="teamCode" column="team_code" /> <result property="factoryCode" column="factory_code"/>
<result property="assetCode" column="asset_code" /> <result property="teamCode" column="team_code"/>
<result property="assetCode" column="asset_code"/>
</resultMap> </resultMap>
<sql id="selectBaseDeviceLedgerVo"> <sql id="selectBaseDeviceLedgerVo">
select obj_id, device_code, device_name, device_model, device_type, device_address, device_status, used_department, cost_center, manufacturer, enable_date, product_line_code, is_flag, create_by, create_time, update_by, update_time, factory_code, team_code, asset_code from base_device_ledger select bdl.obj_id,
bdl.device_code,
bdl.device_name,
bdl.device_model,
bdl.device_type,
bdl.device_address,
bdl.device_status,
bdl.used_department,
bdl.cost_center,
bdl.manufacturer,
bdl.enable_date,
bdl.product_line_code,
bpl.product_line_name,
bdl.is_flag,
bdl.create_by,
bdl.create_time,
bdl.update_by,
bdl.update_time,
bdl.factory_code,
bdl.team_code,
bdl.asset_code
from base_device_ledger bdl
left join base_product_line bpl on bpl.product_line_code = bdl.product_line_code
</sql> </sql>
<select id="selectBaseDeviceLedgerList" parameterType="BaseDeviceLedger" resultMap="BaseDeviceLedgerResult"> <select id="selectBaseDeviceLedgerList" parameterType="BaseDeviceLedger" resultMap="BaseDeviceLedgerResult">
<include refid="selectBaseDeviceLedgerVo"/> <include refid="selectBaseDeviceLedgerVo"/>
<where> <where>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if> <if test="deviceCode != null and deviceCode != ''">and bdl.device_code = #{deviceCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if> <if test="deviceName != null and deviceName != ''">and bdl.device_name like concat('%', #{deviceName}, '%')
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if> </if>
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if> <if test="deviceModel != null and deviceModel != ''">and bdl.device_model = #{deviceModel}</if>
<if test="deviceAddress != null and deviceAddress != ''"> and device_address = #{deviceAddress}</if> <if test="deviceType != null and deviceType != ''">and bdl.device_type = #{deviceType}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceAddress != null and deviceAddress != ''">and bdl.device_address = #{deviceAddress}</if>
<if test="usedDepartment != null and usedDepartment != ''"> and used_department = #{usedDepartment}</if> <if test="deviceStatus != null and deviceStatus != ''">and bdl.device_status = #{deviceStatus}</if>
<if test="costCenter != null and costCenter != ''"> and cost_center = #{costCenter}</if> <if test="usedDepartment != null and usedDepartment != ''">and bdl.used_department = #{usedDepartment}</if>
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if> <if test="costCenter != null and costCenter != ''">and bdl.cost_center = #{costCenter}</if>
<if test="enableDate != null "> and enable_date = #{enableDate}</if> <if test="manufacturer != null and manufacturer != ''">and bdl.manufacturer = #{manufacturer}</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if> <if test="enableDate != null ">and bdl.enable_date = #{enableDate}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if> <if test="productLineCode != null and productLineCode != ''">and bdl.product_line_code = #{productLineCode}
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> </if>
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if> <if test="isFlag != null and isFlag != ''">and bdl.is_flag = #{isFlag}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if> <if test="factoryCode != null and factoryCode != ''">and bdl.factory_code = #{factoryCode}</if>
<if test="teamCode != null and teamCode != ''">and bdl.team_code = #{teamCode}</if>
<if test="assetCode != null and assetCode != ''">and bdl.asset_code = #{assetCode}</if>
</where> </where>
</select> </select>
<select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult"> <select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult">
<include refid="selectBaseDeviceLedgerVo"/> <include refid="selectBaseDeviceLedgerVo"/>
where obj_id = #{objId} where bdl.obj_id = #{objId}
</select> </select>
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger" useGeneratedKeys="true" keyProperty="objId"> <insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger" useGeneratedKeys="true" keyProperty="objId">
@ -130,7 +155,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long"> <delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
delete from base_device_ledger where obj_id = #{objId} delete
from base_device_ledger
where obj_id = #{objId}
</delete> </delete>
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String"> <delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">

@ -26,6 +26,8 @@
<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"/>
<result property="materialDesc" column="material_desc"/>
<result property="materialAll" column="materialAll"/>
</resultMap> </resultMap>
<sql id="selectProdBomInfoVo"> <sql id="selectProdBomInfoVo">
@ -43,6 +45,8 @@
pbi.vbeln, pbi.vbeln,
pbi.vbpos, pbi.vbpos,
pbi.ancestors, pbi.ancestors,
pbi.material_desc,
pbi.material_name + ',' + pbi.material_desc materialAll,
pbi.is_flag, pbi.is_flag,
pbi.create_by, pbi.create_by,
pbi.create_time, pbi.create_time,
@ -63,6 +67,7 @@
'%') '%')
</if> </if>
<if test="materialType != null and materialType != ''">and pbi.material_type = #{materialType}</if> <if test="materialType != null and materialType != ''">and pbi.material_type = #{materialType}</if>
<if test="materialDesc != null and materialDesc != ''">and pbi.material_desc = #{materialDesc}</if>
<if test="standardAmount != null ">and pbi.standard_amount = #{standardAmount}</if> <if test="standardAmount != null ">and pbi.standard_amount = #{standardAmount}</if>
<if test="parentId != null and parentId != ''">and pbi.parent_id = #{parentId}</if> <if test="parentId != null and parentId != ''">and pbi.parent_id = #{parentId}</if>
<if test="parentName != null and parentName != ''">and pbi.parent_name like concat('%', #{parentName}, '%') <if test="parentName != null and parentName != ''">and pbi.parent_name like concat('%', #{parentName}, '%')
@ -90,6 +95,7 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bomCode != null">bom_code,</if> <if test="bomCode != null">bom_code,</if>
<if test="materialCode != null and materialCode != ''">material_code,</if> <if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="materialDesc != null and materialDesc != ''">material_desc,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if> <if test="materialType != null">material_type,</if>
<if test="standardAmount != null">standard_amount,</if> <if test="standardAmount != null">standard_amount,</if>
@ -109,6 +115,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bomCode != null">#{bomCode},</if> <if test="bomCode != null">#{bomCode},</if>
<if test="materialCode != null and materialCode != ''">#{materialCode},</if> <if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="materialDesc != null and materialDesc != ''">#{materialDesc},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if> <if test="materialType != null">#{materialType},</if>
<if test="standardAmount != null">#{standardAmount},</if> <if test="standardAmount != null">#{standardAmount},</if>
@ -132,6 +139,7 @@
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null">bom_code = #{bomCode},</if> <if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if> <if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="materialDesc != null and materialDesc != ''">material_desc = #{materialDesc},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
<if test="standardAmount != null">standard_amount = #{standardAmount},</if> <if test="standardAmount != null">standard_amount = #{standardAmount},</if>

Loading…
Cancel
Save