Browse Source

[fix] 生产管理

新增委内加工入库单 展示列表页面
新增 委内加工入库单导出接口
dev
liuxiaoxu 4 months ago
parent
commit
5b4d01ab58
  1. 65
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  2. 155
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

65
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java

@ -1,11 +1,16 @@
package com.ruoyi.erp.controller; package com.ruoyi.erp.controller;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.quality.domain.QualityOrder;
import com.ruoyi.quality.service.IQualityOrderService;
import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.dto.SysEquipMaterialDto; import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.service.ISysSalesOrderChildService; import com.ruoyi.system.service.ISysSalesOrderChildService;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.service.IWarehouseStorageOrderService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -36,6 +41,8 @@ public class ErpInboundOrderController extends BaseController
@Autowired @Autowired
private IErpInboundOrderService erpInboundOrderService; private IErpInboundOrderService erpInboundOrderService;
@Autowired
private IQualityOrderService qualityOrderService;
@Autowired @Autowired
private ISysSalesOrderChildService salesOrderChildService; private ISysSalesOrderChildService salesOrderChildService;
@ -52,11 +59,12 @@ public class ErpInboundOrderController extends BaseController
@RequiresPermissions("erp:inboundOrder:list") @RequiresPermissions("erp:inboundOrder:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(ErpInboundOrder erpInboundOrder) public TableDataInfo list(QualityOrder qualityOrder)
{ {
startPage(); startPage();
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder); List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
return getDataTable(list); List<QualityOrder> qualityOrderList = list.stream().filter(q -> q.getQualityStorageStatus().equals("1") || q.getQualityStorageStatus().equals("4")).collect(Collectors.toList());
return getDataTable(qualityOrderList);
} }
/** /**
@ -66,11 +74,12 @@ public class ErpInboundOrderController extends BaseController
@Log(title = "入库单", businessType = BusinessType.EXPORT) @Log(title = "入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(ErpInboundOrder erpInboundOrder) public AjaxResult export(QualityOrder qualityOrder)
{ {
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder); List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
ExcelUtil<ErpInboundOrder> util = new ExcelUtil<ErpInboundOrder>(ErpInboundOrder.class); ExcelUtil<QualityOrder> util = new ExcelUtil<QualityOrder>(QualityOrder.class);
return util.exportExcel(list, "入库单数据"); List<QualityOrder> qualityOrderList = list.stream().filter(q -> q.getQualityStorageStatus().equals("1") || q.getQualityStorageStatus().equals("4")).collect(Collectors.toList());
return util.exportExcel(qualityOrderList, "入库单数据");
} }
/** /**
@ -117,40 +126,18 @@ public class ErpInboundOrderController extends BaseController
return toAjax(erpInboundOrderService.updateErpInboundOrder(erpInboundOrder)); return toAjax(erpInboundOrderService.updateErpInboundOrder(erpInboundOrder));
} }
/**
* 删除入库单
*/
@RequiresPermissions("erp:inboundOrder:remove")
@Log(title = "入库单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(erpInboundOrderService.deleteErpInboundOrderByIds(ids));
}
/** // /**
* 作废入库单 // * 委内入库单详情页面
*/ // */
@RequiresPermissions("erp:inboundOrder:cancel") // @GetMapping("/detail/{qualityOrderId}")
@Log(title = "入库单", businessType = BusinessType.CANCEL) // public String detail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
@GetMapping( "/cancel/{id}") // {
@ResponseBody // QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
public AjaxResult cancel(@PathVariable("id") Long id){ // mmap.put("qualityOrder", qualityOrder);
return toAjax(erpInboundOrderService.cancelErpInboundOrderById(id)); // return prefix + "/edit";
} // }
/**
* 恢复入库单
*/
@RequiresPermissions("erp:inboundOrder:restore")
@Log(title = "入库单", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(erpInboundOrderService.restoreErpInboundOrderById(id));
}
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap) public String detail(@PathVariable("id") Long id, ModelMap mmap)

155
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -11,48 +11,27 @@
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<label>生产订单号:</label> <label>品质单号:</label>
<input type="text" name="makeNo"/> <input type="text" name="qualityOrderCode"/>
</li>
<li>
<label>品质状态:</label>
<select name="qualityStatus" th:with="type=${@dict.getType('warehouse_quality_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li> </li>
<li> <li>
<label>入库单号:</label> <label>入库单号:</label>
<input type="text" name="inboundOrderNo"/> <input type="text" name="inStorageCode"/>
</li>
<li>
<label>入库状态:</label>
<select name="inboundStatus" th:with="type=${@dict.getType('erp_inbound_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li> </li>
<li> <li>
<label>入库类型:</label> <label>品质状态:</label>
<select name="inboundType" th:with="type=${@dict.getType('erp_inbound_type')}"> <select name="qualityStatus" th:with="type=${@dict.getType('qualityStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>生产订单类型:</label>
<select name="orderType" th:with="type=${@dict.getType('sys_order_type')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</li> </li>
<li> <li>
<label>客户Id</label> <label>关联订单号:</label>
<input type="text" name="customerId"/> <input type="text" name="relatedOrderCode"/>
</li> </li>
<li> <li>
<label>客户名称</label> <label>品质员</label>
<input type="text" name="customerName"/> <input type="text" name="qualityEmployee"/>
</li> </li>
<li class="select-time"> <li class="select-time">
<label>录入时间:</label> <label>录入时间:</label>
@ -70,15 +49,6 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:inboundOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:inboundOrder:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:inboundOrder:remove">
<i class="fa fa-remove"></i> 删除
</a> -->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -94,11 +64,11 @@
var removeFlag = [[${@permission.hasPermi('erp:inboundOrder:remove')}]]; var removeFlag = [[${@permission.hasPermi('erp:inboundOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('erp:inboundOrder:cancel')}]]; var cancelFlag = [[${@permission.hasPermi('erp:inboundOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('erp:inboundOrder:restore')}]]; var restoreFlag = [[${@permission.hasPermi('erp:inboundOrder:restore')}]];
var inboundStatusDatas = [[${@dict.getType('erp_inbound_status')}]];
var inboundTypeDatas = [[${@dict.getType('erp_inbound_type')}]];
var warehouseQualityStatusDatas = [[${@dict.getType('warehouse_quality_status')}]];
var orderTypeDatas = [[${@dict.getType('sys_order_type')}]]; var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]];
var qualityStorageStatusDatas = [[${@dict.getType('quality_storage_status')}]];
var prefix = ctx + "erp/inboundOrder"; var prefix = ctx + "erp/inboundOrder";
@ -115,94 +85,84 @@
modalName: "入库单", modalName: "入库单",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '主键ID',field: 'id',visible: false},
{ {
title: '品质单号', title: '品质单Id',
field: 'qualityOrderCode', field: 'qualityOrderId',
visible: false
}, },
{ {
title: '生产订单号', title: '品质单号',
field: 'makeNo', field: 'qualityOrderCode',
}, },
{ {
title: '仓库品质状态', title: '品质状态',
field: 'warehouseQualityStatus', field: 'qualityStatus',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(warehouseQualityStatusDatas, value); return $.table.selectDictLabel(qualityStatusDatas, value);
} }
}, },
{title: '入库状态',field: 'inboundStatus', {
formatter: function(value, row, index) { title: '入库单号',
return $.table.selectDictLabel(inboundStatusDatas, value); field: 'inStorageCode',
}
}, },
{title: '入库单号',field: 'inboundOrderNo',},
{title: '关联生产订单号',field: 'makeNo',},
{title: '关联销售订单号',field: 'saleNo',visible: false,},
{ {
title: '工程员', title: '关联订单号',
field: 'engineerName', field: 'relatedOrderCode',
}, },
{title: '生产订单类型',field: 'orderType',
{
title: '订单类型',
field: 'qualityOrderType',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(orderTypeDatas, value); return $.table.selectDictLabel(qualityOrderTypeDatas, value);
} }
}, },
{title: '入库类型',field: 'inboundType', {
title: '入库类型',
field: 'qualityStorageStatus',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(inboundTypeDatas, value); return $.table.selectDictLabel(qualityStorageStatusDatas, value);
} }
}, },
{ {
title: '客户Id', title: '本次到货数量',
field: 'customerId', field: 'thisArrivedNum',
}, },
{ {
title: '客户公司名称', title: '品质合格数',
field: 'customerName', field: 'qualityQualifiedNum',
}, },
{ {
title: '客户订单号', title: '品质不合格数',
field: 'salesOrderNumber', field: 'qualityUnqualifiedNum',
}, },
{ {
title: '物料合计', title: '交检时间',
field: 'materialTotal', field: 'deliveryInspectionTime',
}, },
{ {
title: '数量合计', title: '品质员',
field: 'numTotal', field: 'qualityEmployee',
}, },
{ {
title: '委内加工费总价', title: '录入人',
field: 'processingFeeTotal', field: 'createBy',
}, },
{ {
title: '品质合格数量', title: '录入时间',
field: 'qualityQualifiedNum', field: 'createTime',
}, },
{ {
title: '品质不合格数量', title: '更新人',
field: 'qualityUnqualifiedNum', field: 'updateBy',
}, },
{ {
title: '入库数量', title: '上次更新时间',
field: 'storageNum', field: 'updateTime',
}, },
{title: '录入人',field: 'inboundUser',},
{title: '录入时间',field: 'inboundTime',},
{title: '更新人',field: '',},
{title: '上次更新时间',field: '',},
{title: '操作', align: 'center',formatter: function(value, row, index) { {title: '操作', align: 'center',formatter: function(value, row, index) {
var actions = []; var actions = [];
/*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}*/
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join(''); return actions.join('');
} }
} }
@ -210,6 +170,13 @@
}; };
$.table.init(options); $.table.init(options);
}); });
//详情
function detail(qualityOrderId){
var url = prefix +'/detail/' + qualityOrderId;
$.modal.open("品质单详情",url)
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save