Browse Source

[fix]

生产管理 生产订单
修改生产订单列表页面,新增创建委外计划按钮及其显示逻辑;
修改生产订单bom实体类,新增委外工序数和已委外数量字段;
修改生产订单bom的mapper,新增字段,新增按生产单号和料号查询方法;
修改生产订单bom查询列表service接口,委外类型物料关联查询工序信息附加;
dev
王晓迪 2 months ago
parent
commit
843ebc1498
  1. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java
  2. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java
  4. 20
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java
  5. 13
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml
  6. 6
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

22
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java

@ -88,6 +88,12 @@ public class SysMakeorderBom extends BaseEntity
@Excel(name = "排序")
private Long sortNo;
// 委外工序数
private int processNum;
// 已委外数量
private int hasOutNum;
public void setId(Long id)
{
this.id = id;
@ -259,6 +265,22 @@ public class SysMakeorderBom extends BaseEntity
this.warehouseDept = warehouseDept;
}
public int getProcessNum() {
return processNum;
}
public void setProcessNum(int processNum) {
this.processNum = processNum;
}
public int getHasOutNum() {
return hasOutNum;
}
public void setHasOutNum(int hasOutNum) {
this.hasOutNum = hasOutNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

3
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java

@ -82,4 +82,7 @@ public interface SysMakeorderBomMapper
* @return 生产订单BOM信息
*/
public List<SysMakeorderBom> selectSysMakeorderBomByMakeNo(String makeNo);
// 按生产订单编号和料号查询生产订单bom信息
public SysMakeorderBom selectSysMakeorderBomByNo(SysMakeorderBom makeorderBom);
}

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java

@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import com.ruoyi.erp.domain.ErpInboundOrder;
import com.ruoyi.system.domain.OutsourcePlan;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.dto.SysMakeorderMaterialDto;
@ -124,4 +125,7 @@ public interface ISysMakeOrderService
* 添加保存创建生产入库和设备履历设置
*/
int addProduceInboundSave(ErpInboundOrder erpInboundOrder);
// 添加保存委外计划单
int addOutsourcePlan(OutsourcePlan outsourcePlan);
}

20
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java

@ -3,6 +3,10 @@ package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.mapper.OutsourceMaterialMapper;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
@ -22,6 +26,9 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService
@Autowired
private SysMakeorderBomMapper sysMakeorderBomMapper;
@Autowired
private OutsourceMaterialMapper outsourceMaterialMapper;
/**
* 查询生产订单BOM信息
*
@ -43,7 +50,18 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService
@Override
public List<SysMakeorderBom> selectSysMakeorderBomList(SysMakeorderBom sysMakeorderBom)
{
return sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom);
List<SysMakeorderBom> makeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom);
for (SysMakeorderBom bom:makeorderBoms) {
if(bom.getProcessMethod().equals("2")){
List<OutsourceMaterial> materials = outsourceMaterialMapper.selectProcessNoByNo(bom.getMaterialNo());
if(StringUtils.isEmpty(materials)){
bom.setProcessNum(0);
}else {
bom.setProcessNum(materials.size());
}
}
}
return makeorderBoms;
}
/**

13
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml

@ -29,13 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="lossRate" column="loss_rate" />
<result property="level" column="level" />
<result property="sortNo" column="sort_no" />
<result property="hasOutNum" column="has_out_num" />
</resultMap>
<sql id="selectSysMakeorderBomVo">
select id, del_flag, create_by, create_time, update_by, update_time,
remark, make_no, sales_order_code, sales_order_material_no,
bom_no, material_no, photoUrl, material_name, material_type, process_method, unit, brand, `describe`,
warehouseDept, use_num, loss_rate, level, sort_no from sys_makeorder_bom
warehouseDept, use_num, loss_rate, level, sort_no, has_out_num from sys_makeorder_bom
</sql>
<select id="selectSysMakeorderBomList" parameterType="SysMakeorderBom" resultMap="SysMakeorderBomResult">
@ -98,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lossRate != null">loss_rate,</if>
<if test="level != null">level,</if>
<if test="sortNo != null">sort_no,</if>
<if test="hasOutNum != null">has_out_num,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="delFlag != null">#{delFlag},</if>
@ -123,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lossRate != null">#{lossRate},</if>
<if test="level != null">#{level},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="hasOutNum != null">#{hasOutNum},</if>
</trim>
</insert>
@ -152,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lossRate != null">loss_rate = #{lossRate},</if>
<if test="level != null">level = #{level},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="hasOutNum != null">has_out_num = #{hasOutNum},</if>
</trim>
where id = #{id}
</update>
@ -175,4 +179,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_makeorder_bom set del_flag = '0' where id = #{id}
</update>
<select id="selectSysMakeorderBomByNo" parameterType="SysMakeorderBom" resultMap="SysMakeorderBomResult">
<include refid="selectSysMakeorderBomVo"/>
<where>
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
</where>
</select>
</mapper>

6
ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

@ -265,6 +265,12 @@
(row.eceiptStatus == '7' || row.eceiptStatus == '8')){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> ');
}
// 委外计划
if((row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5') &&
(row.eceiptStatus == '3' || row.eceiptStatus == '4'|| row.eceiptStatus == '5'|| row.eceiptStatus == '6'|| row.eceiptStatus == '7'
|| row.eceiptStatus == '8')){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加委外计划\',\'' + prefix+"/addOutsourcePlan/"+row.id + '\')">委外计划</a> ');
}
// 委内入库 对应生产中
if(row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建委内入库单\',\'' + prefix+"/addProcessInbound/"+row.id + '\')">委内入库</a> ');

Loading…
Cancel
Save