Browse Source

[fix]

生产管理 生产订单
修改添加生产领料页面,修改表格显示样式,补全表格订单用量显示、本次领料数自动填充,新增可用库存数;
修改生产订单列表页面,添加评审、确认时间、工程评审权限定义;
修改生产订单bom实体类,新增可用库存数、已领料数字段;
修改生产订单bom获取service方法,新增获取已领料数和可用库存数语句;
修改生产订单确认时间、工程评审controller接口,添加权限定义;
dev
王晓迪 1 month ago
parent
commit
29765c15ef
  1. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java
  3. 34
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java
  4. 20
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html
  5. 43
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

3
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -309,6 +309,7 @@ public class SysMakeOrderController extends BaseController
* @param makeorderDeptDto
* @return
*/
@RequiresPermissions("system:makeorder:review")
@PostMapping("/deptReview")
@ResponseBody
public AjaxResult deptReview(SysMakeorderDeptDto makeorderDeptDto){
@ -325,6 +326,7 @@ public class SysMakeOrderController extends BaseController
* @param makeorderDeptDto
* @return
*/
@RequiresPermissions("system:makeorder:confirm")
@PostMapping("/deptLeaderConfirm")
@ResponseBody
public AjaxResult deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto){
@ -342,6 +344,7 @@ public class SysMakeOrderController extends BaseController
* @param sysMakeOrder
* @return
*/
@RequiresPermissions("system:makeorder:engineer")
@PostMapping("/gcReview")
@ResponseBody
public AjaxResult gcReview(SysMakeOrder sysMakeOrder){

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

@ -94,6 +94,12 @@ public class SysMakeorderBom extends BaseEntity
// 已委外数量
private int hasOutNum;
// 可用库存数
private BigDecimal storageNum;
// 已领料数
private int hasPickNum;
public void setId(Long id)
{
this.id = id;
@ -281,6 +287,22 @@ public class SysMakeorderBom extends BaseEntity
this.hasOutNum = hasOutNum;
}
public BigDecimal getStorageNum() {
return storageNum;
}
public void setStorageNum(BigDecimal storageNum) {
this.storageNum = storageNum;
}
public int getHasPickNum() {
return hasPickNum;
}
public void setHasPickNum(int hasPickNum) {
this.hasPickNum = hasPickNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@ -1,11 +1,18 @@
package com.ruoyi.system.service.impl;
import java.math.BigDecimal;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
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.domain.SysMakeorderPickDetail;
import com.ruoyi.system.mapper.OutsourceMaterialMapper;
import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper;
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry;
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,6 +36,12 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService
@Autowired
private OutsourceMaterialMapper outsourceMaterialMapper;
@Autowired
private WarehouseInventoryInquiryMapper inquiryMapper;
@Autowired
private SysMakeorderPickDetailMapper pickDetailMapper;
/**
* 查询生产订单BOM信息
*
@ -52,6 +65,27 @@ public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService
{
List<SysMakeorderBom> makeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom);
for (SysMakeorderBom bom:makeorderBoms) {
// 获取已领料数
SysMakeorderPickDetail tempDetail = new SysMakeorderPickDetail();
tempDetail.setMakeNo(sysMakeorderBom.getMakeNo());
tempDetail.setMaterialNo(bom.getMaterialNo());
List<SysMakeorderPickDetail> pickDetails = pickDetailMapper.selectSysMakeorderPickDetailList(tempDetail);
if(CollectionUtil.isEmpty(pickDetails)){
bom.setHasPickNum(0);
}else{
int pickNum = pickDetails.stream()
.mapToInt(detail -> Math.toIntExact(detail.getPickNum() != null ? Math.toIntExact(detail.getPickNum()) : 0))
.sum();
bom.setHasPickNum(pickNum);
}
// 获取可用库存数
WarehouseInventoryInquiry inquiry = inquiryMapper.selectWarehouseInventoryInquiryByMaterialNo(bom.getMaterialNo());
if(inquiry == null){
bom.setStorageNum(BigDecimal.ZERO);
}else{
bom.setStorageNum(inquiry.getAvailableStockNum());
}
// 处理委外加工类型物料,获取委外工序数
if(bom.getProcessMethod().equals("2")){
List<OutsourceMaterial> materials = outsourceMaterialMapper.selectProcessNoByNo(bom.getMaterialNo());
if(StringUtils.isEmpty(materials)){

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

@ -34,14 +34,21 @@
</select>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="form-group-sm">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</div>
</form>
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-xs-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-1"></table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
@ -294,11 +301,15 @@
title: '损耗率',
},
{
field: 'materialNum',
field: 'orderNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'storageNum',
title: '可用库存数',
},
{
field: 'hasPickNum',
@ -309,7 +320,8 @@
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
var inputValue = parentRow.materialNum * row.useNum;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+inputValue+'">';
}
},
{

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

@ -103,6 +103,9 @@
var cancelFlag = [[${@permission.hasPermi('system:makeorder:cancel')}]];
var detailFlag = [[${@permission.hasPermi('system:makeorder:detail')}]];
var restoreFlag = [[${@permission.hasPermi('system:makeorder:restore')}]];
var reviewFlag = [[${@permission.hasPermi('system:makeorder:review')}]];
var confirmFlag = [[${@permission.hasPermi('system:makeorder:confirm')}]];
var engineerFlag = [[${@permission.hasPermi('system:makeorder:engineer')}]];
var makeStatusDatas = [[${@dict.getType('sys_erp_makeStatus')}]];
var eceiptStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
@ -131,6 +134,14 @@
title: '生产订单id',
visible: false
},
{
field: 'makeNo',
title: '生产订单号'
},
{
field: 'materialSum',
title: '数量合计'
},
{
field: 'makeStatus',
title: '生产状态',
@ -138,6 +149,15 @@
return $.table.selectDictLabel(makeStatusDatas, value);
}
},
{
field: 'finishNum',
title: '已完成数量'
},
{
field: 'eceiptNum',
title: '已入库数量'
},
{
field: 'eceiptStatus',
title: '入库状态',
@ -159,10 +179,7 @@
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
field: 'makeNo',
title: '生产订单号'
},
{
field: 'saleNo',
title: '关联销售订单号'
@ -194,18 +211,6 @@
field: 'material',
title: '物料合计'
},
{
field: 'materialSum',
title: '数量合计'
},
{
field: 'finishNum',
title: '已完成数量'
},
{
field: 'eceiptNum',
title: '已入库数量'
},
{
field: 'noRate',
title: '不含税生产成本(RMB)'
@ -250,15 +255,15 @@
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'详情\',\'' + prefix+"/detail/"+row.id + '\')">详情</a> ');
// 评审
if(row.makeStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
actions.push('<a class="btn btn-success btn-xs ' + reviewFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
}
// 部门主管确认
if(row.deptLeaderConfirmStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> ');
actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> ');
}
// 工程审核
if(row.makeStatus == '2'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> ');
actions.push('<a class="btn btn-success btn-xs ' + engineerFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> ');
}
// 领料
if((row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5') &&

Loading…
Cancel
Save