change - 订单BOM加实体类列

master
yinq 1 year ago
parent 0358650d0d
commit 6842982f9a

@ -3,6 +3,7 @@ package com.aucma.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,9 +40,10 @@ public class OrderBomInfoController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('base:orderBomInfo:list')")
@GetMapping("/list")
public AjaxResult list(OrderBomInfo orderBomInfo) {
public TableDataInfo list(OrderBomInfo orderBomInfo) {
startPage();
List<OrderBomInfo> list = orderBomInfoService.selectOrderBomInfoList(orderBomInfo);
return success(list);
return getDataTable(list);
}
/**

@ -64,12 +64,24 @@ public class BaseBomInfo extends TreeStringEntity {
@Excel(name = "工厂编号")
private String plantCode;
/**
*
*/
@Excel(name = "工厂名称")
private String plantName;
/**
* 线/
*/
@Excel(name = "产线/工位")
@Excel(name = "产线/工位编号")
private String productLineCode;
/**
* 线/
*/
@Excel(name = "产线/工位名称")
private String productLineName;
/**
*
*/
@ -102,6 +114,21 @@ public class BaseBomInfo extends TreeStringEntity {
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getPlantName() {
return plantName;
}
public void setPlantName(String plantName) {
this.plantName = plantName;
}
public String getProductLineName() {
return productLineName;
}
public void setProductLineName(String productLineName) {
this.productLineName = productLineName;
}
public void setObjId(Long objId) {
this.objId = objId;

@ -3,6 +3,7 @@ package com.aucma.production.service.impl;
import java.util.List;
import com.aucma.common.core.domain.entity.SysDept;
import com.aucma.common.exception.base.BaseException;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -55,11 +56,15 @@ public class BaseBomInfoServiceImpl implements IBaseBomInfoService
@Override
public int insertBaseBomInfo(BaseBomInfo baseBomInfo)
{
BaseBomInfo bomInfo = baseBomInfoMapper.selectBaseBomInfoByMaterialCode(baseBomInfo.getMaterialCode());
if (StringUtils.isNotNull(bomInfo)){
throw new BaseException("该物料编号:" + baseBomInfo.getMaterialCode() + "已存在!");
}
if (StringUtils.isNotNull(baseBomInfo.getParentId())){
BaseBomInfo info = baseBomInfoMapper.selectBaseBomInfoByMaterialCode(baseBomInfo.getParentId());
if (StringUtils.isNull(info)){
baseBomInfo.setAncestors(baseBomInfo.getMaterialCode());
}else {
baseBomInfo.setAncestors(info.getAncestors() + "," + baseBomInfo.getMaterialCode());
}else {
baseBomInfo.setAncestors(baseBomInfo.getMaterialCode());
}
return baseBomInfoMapper.insertBaseBomInfo(baseBomInfo);
}

@ -14,46 +14,67 @@
<result property="parentId" column="parent_id" />
<result property="plantCode" column="plant_code" />
<result property="productLineCode" column="product_line_code" />
<result property="productLineName" column="product_line_name" />
<result property="isFlag" column="is_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="ancestors" column="ancestors" />
<result property="plantName" column="factory_name" />
</resultMap>
<sql id="selectBaseBomInfoVo">
select obj_id, bom_code, material_code, material_name, material_type, standard_amount, parent_id,
plant_code, product_line_code, is_flag, created_by, created_time, updated_by, updated_time, ancestors from base_bominfo
select bb.obj_id,
bb.bom_code,
bb.material_code,
bb.material_name,
bb.material_type,
bb.standard_amount,
bb.parent_id,
bb.plant_code,
bb.product_line_code,
bb.is_flag,
bb.created_by,
bb.created_time,
bb.updated_by,
bb.updated_time,
bb.ancestors,
bf.factory_name,
bpl.PRODUCT_LINE_NAME
from base_bominfo bb
left join base_factory bf on bf.factory_code = plant_code
left join BASE_PRODUCTLINE bpl on bpl.PRODUCT_LINE_CODE = bb.product_line_code
</sql>
<select id="selectBaseBomInfoList" parameterType="BaseBomInfo" resultMap="BaseBomInfoResult">
<include refid="selectBaseBomInfoVo"/>
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat(concat('%', #{materialName}), '%')</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors like concat(concat('%', #{ancestors}), '%')</if>
<if test="bomCode != null and bomCode != ''"> and bb.bom_code = #{bomCode}</if>
<if test="materialCode != null and materialCode != ''"> and bb.material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and bb.material_name like concat(concat('%', #{materialName}), '%')</if>
<if test="materialType != null and materialType != ''"> and bb.material_type = #{materialType}</if>
<if test="standardAmount != null "> and bb.standard_amount = #{standardAmount}</if>
<if test="parentId != null and parentId != ''"> and bb.parent_id = #{parentId}</if>
<if test="plantCode != null and plantCode != ''"> and bb.plant_code = #{plantCode}</if>
<if test="productLineCode != null and productLineCode != ''"> and bb.product_line_code = #{productLineCode}</if>
<if test="isFlag != null "> and bb.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and bb.created_by = #{createdBy}</if>
<if test="createdTime != null "> and bb.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and bb.updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and bb.updated_time = #{updatedTime}</if>
<if test="ancestors != null and ancestors != ''"> and bb.ancestors like concat(concat('%', #{ancestors}), '%')</if>
</where>
order by bb.created_time desc
</select>
<select id="selectBaseBomInfoByObjId" parameterType="Long" resultMap="BaseBomInfoResult">
<include refid="selectBaseBomInfoVo"/>
where obj_id = #{objId}
where bb.obj_id = #{objId}
</select>
<select id="selectBaseBomInfoByMaterialCode" resultMap="BaseBomInfoResult">
<include refid="selectBaseBomInfoVo"/>
where material_code = #{materialCode}
where bb.material_code = #{materialCode}
</select>
<select id="selectChildrenBomById" parameterType="String" resultMap="BaseBomInfoResult">
select * from BASE_BOMINFO where FIND_IN_SET(#{materialCode}, ancestors) <![CDATA[ <> ]]> 0

Loading…
Cancel
Save