change - 修改BOM

main
yinq 5 months ago
parent ae102e7f75
commit 6c4b0a9296

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

@ -117,6 +117,34 @@ public class ProdBomInfo extends BaseEntity {
@Excel(name = "是否标识")
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() {
return materialUnit;
}

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

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

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

Loading…
Cancel
Save