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;
import java.util.List;
import java.util.stream.Collectors;
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.dto.SysEquipMaterialDto;
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.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,6 +41,8 @@ public class ErpInboundOrderController extends BaseController
@Autowired
private IErpInboundOrderService erpInboundOrderService;
@Autowired
private IQualityOrderService qualityOrderService;
@Autowired
private ISysSalesOrderChildService salesOrderChildService;
@ -52,11 +59,12 @@ public class ErpInboundOrderController extends BaseController
@RequiresPermissions("erp:inboundOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpInboundOrder erpInboundOrder)
public TableDataInfo list(QualityOrder qualityOrder)
{
startPage();
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder);
return getDataTable(list);
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
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)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErpInboundOrder erpInboundOrder)
public AjaxResult export(QualityOrder qualityOrder)
{
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder);
ExcelUtil<ErpInboundOrder> util = new ExcelUtil<ErpInboundOrder>(ErpInboundOrder.class);
return util.exportExcel(list, "入库单数据");
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
ExcelUtil<QualityOrder> util = new ExcelUtil<QualityOrder>(QualityOrder.class);
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));
}
/**
* 删除入库单
*/
@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")
@Log(title = "入库单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(erpInboundOrderService.cancelErpInboundOrderById(id));
}
// /**
// * 委内入库单详情页面
// */
// @GetMapping("/detail/{qualityOrderId}")
// public String detail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
// {
// QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
// mmap.put("qualityOrder", qualityOrder);
// 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}")
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">
<ul>
<li>
<label>生产订单号:</label>
<input type="text" name="makeNo"/>
</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>
<label>品质单号:</label>
<input type="text" name="qualityOrderCode"/>
</li>
<li>
<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>
<label>入库类型:</label>
<select name="inboundType" th:with="type=${@dict.getType('erp_inbound_type')}">
<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')}">
<label>品质状态:</label>
<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>客户Id</label>
<input type="text" name="customerId"/>
<label>关联订单号:</label>
<input type="text" name="relatedOrderCode"/>
</li>
<li>
<label>客户名称</label>
<input type="text" name="customerName"/>
<label>品质员:</label>
<input type="text" name="qualityEmployee"/>
</li>
<li class="select-time">
<label>录入时间:</label>
@ -70,15 +49,6 @@
</div>
<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">
<i class="fa fa-download"></i> 导出
</a>
@ -94,11 +64,11 @@
var removeFlag = [[${@permission.hasPermi('erp:inboundOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('erp:inboundOrder:cancel')}]];
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";
@ -115,94 +85,84 @@
modalName: "入库单",
columns: [
{checkbox: true},
{title: '主键ID',field: 'id',visible: false},
{
title: '品质单号',
field: 'qualityOrderCode',
title: '品质单Id',
field: 'qualityOrderId',
visible: false
},
{
title: '生产订单号',
field: 'makeNo',
title: '品质单号',
field: 'qualityOrderCode',
},
{
title: '仓库品质状态',
field: 'warehouseQualityStatus',
title: '品质状态',
field: 'qualityStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(warehouseQualityStatusDatas, value);
return $.table.selectDictLabel(qualityStatusDatas, value);
}
},
{title: '入库状态',field: 'inboundStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inboundStatusDatas, value);
}
{
title: '入库单号',
field: 'inStorageCode',
},
{title: '入库单号',field: 'inboundOrderNo',},
{title: '关联生产订单号',field: 'makeNo',},
{title: '关联销售订单号',field: 'saleNo',visible: false,},
{
title: '工程员',
field: 'engineerName',
title: '关联订单号',
field: 'relatedOrderCode',
},
{title: '生产订单类型',field: 'orderType',
{
title: '订单类型',
field: 'qualityOrderType',
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) {
return $.table.selectDictLabel(inboundTypeDatas, value);
return $.table.selectDictLabel(qualityStorageStatusDatas, value);
}
},
{
title: '客户Id',
field: 'customerId',
title: '本次到货数量',
field: 'thisArrivedNum',
},
{
title: '客户公司名称',
field: 'customerName',
title: '品质合格数',
field: 'qualityQualifiedNum',
},
{
title: '客户订单号',
field: 'salesOrderNumber',
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
},
{
title: '物料合计',
field: 'materialTotal',
title: '交检时间',
field: 'deliveryInspectionTime',
},
{
title: '数量合计',
field: 'numTotal',
title: '品质员',
field: 'qualityEmployee',
},
{
title: '委内加工费总价',
field: 'processingFeeTotal',
title: '录入人',
field: 'createBy',
},
{
title: '品质合格数量',
field: 'qualityQualifiedNum',
title: '录入时间',
field: 'createTime',
},
{
title: '品质不合格数量',
field: 'qualityUnqualifiedNum',
title: '更新人',
field: 'updateBy',
},
{
title: '入库数量',
field: 'storageNum',
title: '上次更新时间',
field: 'updateTime',
},
{title: '录入人',field: 'inboundUser',},
{title: '录入时间',field: 'inboundTime',},
{title: '更新人',field: '',},
{title: '上次更新时间',field: '',},
{title: '操作', align: 'center',formatter: function(value, row, index) {
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-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> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}
@ -210,6 +170,13 @@
};
$.table.init(options);
});
//详情
function detail(qualityOrderId){
var url = prefix +'/detail/' + qualityOrderId;
$.modal.open("品质单详情",url)
}
</script>
</body>
</html>
Loading…
Cancel
Save