Browse Source

[fix] 品质管理 生产管理

新增 委内入库单详情页面
新增 修改保存委内入库单详情接口
新增 品质单查询接口查询入库类型为委内和生产的数据
委内入库单和生产订单前端列表对委内加工费总价进行合计
dev
liuxiaoxu 4 months ago
parent
commit
16f7aa60e7
  1. 106
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java
  4. 10
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java
  5. 39
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  6. 56
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  7. 207
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrderDetail.html

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

@ -62,9 +62,8 @@ public class ErpInboundOrderController extends BaseController
public TableDataInfo list(QualityOrder qualityOrder) public TableDataInfo list(QualityOrder qualityOrder)
{ {
startPage(); startPage();
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder); List<QualityOrder> list = qualityOrderService.selectAllMakeQualityOrderList(qualityOrder);
List<QualityOrder> qualityOrderList = list.stream().filter(q -> q.getQualityStorageStatus().equals("1") || q.getQualityStorageStatus().equals("4")).collect(Collectors.toList()); return getDataTable(list);
return getDataTable(qualityOrderList);
} }
/** /**
@ -76,10 +75,9 @@ public class ErpInboundOrderController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult export(QualityOrder qualityOrder) public AjaxResult export(QualityOrder qualityOrder)
{ {
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder); List<QualityOrder> list = qualityOrderService.selectAllMakeQualityOrderList(qualityOrder);
ExcelUtil<QualityOrder> util = new ExcelUtil<QualityOrder>(QualityOrder.class); 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(list, "入库单数据");
return util.exportExcel(qualityOrderList, "入库单数据");
} }
/** /**
@ -127,55 +125,67 @@ public class ErpInboundOrderController extends BaseController
} }
// /** /**
// * 委内入库单详情页面 * 委内入库单详情页面
// */ */
// @GetMapping("/detail/{qualityOrderId}") @GetMapping("/inboundOrderDetail/{qualityOrderId}")
// public String detail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap) public String inboundOrderDetail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
// {
// QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
// mmap.put("qualityOrder", qualityOrder);
// return prefix + "/edit";
// }
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{ {
mmap.put("currentUser", ShiroUtils.getSysUser()); QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
ErpInboundOrder erpInboundOrder = erpInboundOrderService.selectErpInboundOrderById(id); mmap.put("qualityOrder", qualityOrder);
String inboundType = erpInboundOrder.getInboundType(); return prefix + "/inboundOrderDetail";
mmap.put("erpInboundOrder", erpInboundOrder);
// 生产入库
if("0".equals(inboundType)){
return prefix + "/produceInboundDetail";
}
// 委内入库
else if("1".equals(inboundType)){
return prefix + "/processInboundDetail";
}
return "";
} }
@GetMapping("/detailEquipmentResume")
public String detailEquipmentResume(@RequestParam("curIndex")Integer curIndex
,@RequestParam("makeNo")String makeNo /**
,@RequestParam("saleNo")String saleNo * 委内入库单详情页面
,@RequestParam("materialNo")String materialNo */
,@RequestParam("inboundOrderNo")String inboundOrderNo, ModelMap mmap) @ResponseBody
@GetMapping("/inboundOrderDetail")
public AjaxResult inboundOrderDetailSave(QualityOrder qualityOrder)
{ {
SysEquipMaterialDto equipMaterialDto = new SysEquipMaterialDto(); return toAjax(qualityOrderService.qualityOrderDetailSave(qualityOrder));
mmap.put("currentUser", ShiroUtils.getSysUser());
SysSalesOrderChild salesOrderChild = salesOrderChildService.selectOneByQuoteIdAndMaterialCode(saleNo, materialNo);
BeanUtils.copyProperties(salesOrderChild,equipMaterialDto);
equipMaterialDto.setMakeNo(makeNo);
equipMaterialDto.setCurIndex(curIndex);
equipMaterialDto.setInboundOrderNo(inboundOrderNo);
mmap.put("equipMaterial", equipMaterialDto);
return prefix + "/equipmentResumeDetail";
} }
// @GetMapping("/detail/{id}")
// public String detail(@PathVariable("id") Long id, ModelMap mmap)
// {
// mmap.put("currentUser", ShiroUtils.getSysUser());
// ErpInboundOrder erpInboundOrder = erpInboundOrderService.selectErpInboundOrderById(id);
// String inboundType = erpInboundOrder.getInboundType();
// mmap.put("erpInboundOrder", erpInboundOrder);
// // 生产入库
// if("0".equals(inboundType)){
// return prefix + "/produceInboundDetail";
// }
// // 委内入库
// else if("1".equals(inboundType)){
// return prefix + "/processInboundDetail";
// }
// return "";
// }
//
// @GetMapping("/detailEquipmentResume")
// public String detailEquipmentResume(@RequestParam("curIndex")Integer curIndex
// ,@RequestParam("makeNo")String makeNo
// ,@RequestParam("saleNo")String saleNo
// ,@RequestParam("materialNo")String materialNo
// ,@RequestParam("inboundOrderNo")String inboundOrderNo, ModelMap mmap)
// {
// SysEquipMaterialDto equipMaterialDto = new SysEquipMaterialDto();
// mmap.put("currentUser", ShiroUtils.getSysUser());
// SysSalesOrderChild salesOrderChild = salesOrderChildService.selectOneByQuoteIdAndMaterialCode(saleNo, materialNo);
// BeanUtils.copyProperties(salesOrderChild,equipMaterialDto);
// equipMaterialDto.setMakeNo(makeNo);
// equipMaterialDto.setCurIndex(curIndex);
// equipMaterialDto.setInboundOrderNo(inboundOrderNo);
// mmap.put("equipMaterial", equipMaterialDto);
// return prefix + "/equipmentResumeDetail";
// }

4
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java

@ -85,4 +85,8 @@ public interface QualityOrderMapper
*/ */
public QualityOrder selectQualityOrderByCode(String qualityOrderCode); public QualityOrder selectQualityOrderByCode(String qualityOrderCode);
/**
* 生产入库和委内入库相关品质单数据
* */
List<QualityOrder> selectAllMakeQualityOrderList(QualityOrder qualityOrder);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java

@ -96,4 +96,9 @@ public interface IQualityOrderService
* 品质单详情通用保存方法 * 品质单详情通用保存方法
* */ * */
int qualityOrderDetailSave(QualityOrder qualityOrder); int qualityOrderDetailSave(QualityOrder qualityOrder);
/**
* 生产入库和委内入库相关品质单数据
* */
List<QualityOrder> selectAllMakeQualityOrderList(QualityOrder qualityOrder);
} }

10
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java

@ -413,6 +413,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService
tempQualityOrder.setQualityUnqualifiedNum(qualityUnqualifiedNumSum); tempQualityOrder.setQualityUnqualifiedNum(qualityUnqualifiedNumSum);
tempQualityOrder.setThisArrivedNum(thisArrivedNumSum); tempQualityOrder.setThisArrivedNum(thisArrivedNumSum);
//数据生成到入库单中,后续进行入库操作 //数据生成到入库单中,后续进行入库操作
int updateStorageOrderResult = warehouseStorageOrderService.insertWarehouseStorageOrderByMakeInQualityOrder(tempQualityOrder, qualityOrderDetailList); int updateStorageOrderResult = warehouseStorageOrderService.insertWarehouseStorageOrderByMakeInQualityOrder(tempQualityOrder, qualityOrderDetailList);
if (updateStorageOrderResult <= 0){ if (updateStorageOrderResult <= 0){
@ -449,6 +450,15 @@ public class QualityOrderServiceImpl implements IQualityOrderService
return 1; return 1;
} }
/**
* 生产入库和委内入库相关品质单数据
* */
@Override
public List<QualityOrder> selectAllMakeQualityOrderList(QualityOrder qualityOrder) {
return qualityOrderMapper.selectAllMakeQualityOrderList(qualityOrder);
}
//品质单不合格分类表 //品质单不合格分类表
private void insertQualityOrderUnqualifiedByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail) { private void insertQualityOrderUnqualifiedByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail) {
QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified(); QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified();

39
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml

@ -76,6 +76,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectAllMakeQualityOrderList" parameterType="QualityOrder" resultMap="QualityOrderResult">
select
qo.quality_order_id,
qo.quality_order_code,
qo.in_storage_code,
qo.related_order_code,
qo.quality_status,
qo.quality_order_type,
qo.quality_storage_status,
qo.this_arrived_num,
qo.quality_qualified_num,
qo.quality_unqualified_num,
qo.warehouse_code,
qo.warehouse_name,
qo.delivery_inspection_time,
qo.quality_employee,
qo.remark,
qo.create_by,
qo.create_time,
qo.update_by,
qo.update_time,
qo.make_in_total_price
from quality_order qo
<where>
<if test="qualityOrderCode != null and qualityOrderCode != ''"> and qo.quality_order_code = #{qualityOrderCode}</if>
<if test="inStorageCode != null and inStorageCode != ''"> and qo.in_storage_code = #{inStorageCode}</if>
<if test="relatedOrderCode != null and relatedOrderCode != ''"> and qo.related_order_code = #{relatedOrderCode}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and qo.quality_status = #{qualityStatus}</if>
<if test="qualityOrderType != null and qualityOrderType != ''"> and qo.quality_order_type = #{qualityOrderType}</if>
<if test="qualityStorageStatus != null and qualityStorageStatus != ''"> and qo.quality_storage_status = #{qualityStorageStatus}</if>
<if test="qualityEmployee != null and qualityEmployee != ''"> and qo.quality_employee = #{qualityEmployee}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
and (qo.quality_storage_status = '1' or qo.quality_storage_status = '4')
</where>
order by qo.create_time desc
</select>
<insert id="insertQualityOrder" parameterType="QualityOrder" useGeneratedKeys="true" keyProperty="qualityOrderId"> <insert id="insertQualityOrder" parameterType="QualityOrder" useGeneratedKeys="true" keyProperty="qualityOrderId">
insert into quality_order insert into quality_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

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

@ -83,6 +83,7 @@
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "入库单", modalName: "入库单",
showFooter: true,
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{ {
@ -125,9 +126,34 @@
} }
}, },
{ {
title: '本次到货数量', title: '委内加工费总价',
field: 'thisArrivedNum', field: 'makeInTotalPrice',
footerFormatter: function (value) {
const total = value.reduce((accumulator, currentValue) => {
// 直接访问makeInTotalPrice,如果它是null或undefined,则使用0
const makeInTotalPrice = currentValue.makeInTotalPrice || 0;
return accumulator + parseFloat(makeInTotalPrice);
}, 0);
return total;
}
}, },
// {
// field: 'entrysalary',
// title: '入职薪资',
// sortable: true,
// footerFormatter: function (value) {
// var count = 0;
// console.log(value);
// for (var i=0; i<value.length;i++) {
// count += parseFloat(JSON.parse(JSON.stringify(value[i])).entrysalary);
// }
// return count;
// }
// },
{ {
title: '品质合格数', title: '品质合格数',
field: 'qualityQualifiedNum', field: 'qualityQualifiedNum',
@ -136,14 +162,20 @@
title: '品质不合格数', title: '品质不合格数',
field: 'qualityUnqualifiedNum', field: 'qualityUnqualifiedNum',
}, },
{ {
title: '交检时间', title: '入库数',
field: 'deliveryInspectionTime', field: 'storage_num',
},
{
title: '品质员',
field: 'qualityEmployee',
}, },
// {
// title: '交检时间',
// field: 'deliveryInspectionTime',
// },
// {
// title: '品质员',
// field: 'qualityEmployee',
// },
{ {
title: '录入人', title: '录入人',
field: 'createBy', field: 'createBy',
@ -162,7 +194,7 @@
}, },
{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" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="inboundOrderDetail(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join(''); return actions.join('');
} }
} }
@ -173,9 +205,9 @@
//详情 //详情
function detail(qualityOrderId){ function inboundOrderDetail(qualityOrderId){
var url = prefix +'/detail/' + qualityOrderId; var url = prefix +'/inboundOrderDetail/' + qualityOrderId;
$.modal.open("品质单详情",url) $.modal.open("委内入库单详情",url)
} }
</script> </script>
</body> </body>

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

@ -0,0 +1,207 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('委内加工单品质')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-makeInStartingQualityDetail-edit" th:object="${qualityOrder}">
<input name="qualityOrderId" th:field="*{qualityOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">品质单号:</label>
<div class="col-sm-8">
<input name="qualityOrderCode" th:field="*{qualityOrderCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="inStorageCode" th:field="*{inStorageCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联订单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质单订单类型:</label>
<div class="col-sm-8">
<select name="qualityOrderType" class="form-control m-b" th:with="type=${@dict.getType('quality_order_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质单入库类型:</label>
<div class="col-sm-8">
<select name="qualityStorageStatus" class="form-control m-b" th:with="type=${@dict.getType('quality_storage_status')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityStorageStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交付质检时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryInspectionTime" th:value="${#dates.format(qualityOrder.deliveryInspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]
var qualityOrder = [[${qualityOrder}]]
var prefix = ctx + "quality/qualityOrder";
$("#form-makeInStartingQualityDetail-edit").validate({
focusCleanup: true
});
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const qualityOrderData = $("#form-makeInStartingQualityDetail-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"qualityOrderDetailId": item.qualityOrderDetailId,
"materialNo": item.materialNo,
"thisArrivedNum": item.thisArrivedNum,
"qualityQualifiedNum": item.qualityQualifiedNum,
"qualityUnqualifiedNum": item.qualityUnqualifiedNum
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityOrderData, {
qualityOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/inboundOrderDetail", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/getMaterialListByQualityOrderCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '品质单详情ID',
field: 'qualityOrderDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo'
},
{
title: '物料名称',
field: 'materialName'
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '物料图片地址',
field: 'materialPhotourl',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '委内已完成数',
field: 'makeInNum',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
},
{
title: '品质合格数',
field: 'qualityQualifiedNum',
},
{
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
}]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
qualityOrderCode: qualityOrderCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>
Loading…
Cancel
Save