Compare commits

...

2 Commits

Author SHA1 Message Date
王晓迪 54978a01b0 [feat] 3 days ago
王晓迪 4313765a9a [feat] 3 days ago
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  2. 29
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  3. 19
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java
  5. 38
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  6. 2
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  7. 89
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

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

@ -46,6 +46,9 @@ public class ErpInboundOrderController extends BaseController
@Autowired
private ISysSalesOrderChildService salesOrderChildService;
@Autowired
private IWarehouseStorageOrderService storageOrderService;
@RequiresPermissions("erp:inboundOrder:view")
@GetMapping()
public String inboundOrder()
@ -59,11 +62,13 @@ public class ErpInboundOrderController extends BaseController
@RequiresPermissions("erp:inboundOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(QualityOrder qualityOrder)
public TableDataInfo list(WarehouseStorageOrder storageOrder)
{
startPage();
List<QualityOrder> list = qualityOrderService.selectAllMakeQualityOrderList(qualityOrder);
return getDataTable(list);
List<WarehouseStorageOrder> list = storageOrderService.selectWarehouseStorageOrderList(storageOrder);
List<WarehouseStorageOrder> filterList = list.stream()
.filter(item -> item.getWarehouseOrderType().equals("1")&&item.getWarehouseStorageType().equals("5")).collect(Collectors.toList());
return getDataTable(filterList);
}
/**

29
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java

@ -72,6 +72,35 @@ public class QualityOrderController extends BaseController
return getDataTable(list);
}
/**
* 查询来料品质管理品质单列表
*/
@PostMapping("/iqcOrderList")
@ResponseBody
public TableDataInfo iqcOrderList(QualityOrder qualityOrder)
{
startPage();
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
List<QualityOrder> filterList = list.stream()//采购订单(入库)或委外订单(入库)
.filter(item ->(item.getQualityOrderType().equals("0")||item.getQualityOrderType().equals("2"))
&&(item.getQualityStorageStatus().equals("0")||item.getQualityStorageStatus().equals("2"))).collect(Collectors.toList());
return getDataTable(filterList);
}
/**
* 查询生产品质管理品质单列表
*/
@PostMapping("/makeQualityList")
@ResponseBody
public TableDataInfo makeOrderList(QualityOrder qualityOrder)
{
startPage();
List<QualityOrder> list = qualityOrderService.selectQualityOrderList(qualityOrder);
List<QualityOrder> filterList = list.stream()//生产订单(入库)
.filter(item ->item.getQualityOrderType().equals("1") &&item.getQualityStorageStatus().equals("4")).collect(Collectors.toList());
return getDataTable(filterList);
}
/**
* 导出品质管理品质单列表
*/

19
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java

@ -76,13 +76,6 @@ public class QualityOrderReportController extends BaseController
}
@RequiresPermissions("quality:qualityReport:iqcView")
@GetMapping("/iqcQualityReport")
public String iqcQualityReport()
{
return prefix + "/iqcQualityReport";
}
/**
* 查询品质管理品质单报告列表
*/
@ -96,6 +89,18 @@ public class QualityOrderReportController extends BaseController
return getDataTable(list);
}
/**
* 查询品质管理品质单报告列表不带分页
*/
@PostMapping("/getReportList")
@ResponseBody
public TableDataInfo getReportList(QualityOrderReportVO qualityOrderReport)
{
startPage();
List<QualityOrderReportVO> list = qualityOrderReportService.selectQualityOrderReportListByQualityCOde(qualityOrderReport);
return getDataTable(list);
}
/**
* 导出品质管理品质单报告列表
*/

4
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java

@ -31,6 +31,10 @@ public interface IQualityOrderReportService
*/
public List<QualityOrderReportVO> selectQualityOrderReportList(QualityOrderReportVO qualityOrderReportVO);
/*
* 查询品质报告单列表*/
List<QualityOrderReportVO> selectQualityOrderReportListByQualityCOde(QualityOrderReportVO qualityReportVO);
/**
* 新增品质管理品质单报告
*

38
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java

@ -192,6 +192,14 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
return returnList;
}
/*
* 查询品质报告单列表*/
@Override
public List<QualityOrderReportVO> selectQualityOrderReportListByQualityCOde(QualityOrderReportVO qualityReportVO){
return qualityOrderReportMapper.selectQualityOrderReportList(qualityReportVO);
}
/**
* 新增生产成品品质单报告
*
@ -404,11 +412,8 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
if (processIsFinish) {
// 审核状态-审核通过
qualityOrderReportVO.setAuditStatus("1");
String materialNo = qualityOrderReportVO.getMaterialNo();
//成品品质
if(materialNo.startsWith("8")){
updateApprovedInfo(qualityOrderReportVO);
}
//更新审核通过数据
updateApprovedInfo(qualityOrderReportVO);
}
qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReportVO);
return processInstance;
@ -488,11 +493,11 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
qualityOrder.setUpdateTime(DateUtils.getNowDate());
int orderQualifiedNum = qualityOrder.getQualityQualifiedNum();
int orderUnqualifiedNum = qualityOrder.getQualityUnqualifiedNum();
int orderCheckNum = qualityOrder.getThisArrivedNum();
if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum < orderCheckNum){
int qualityNum = orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum;
if(qualityNum < qualityOrder.getThisArrivedNum()){
qualityOrder.setQualityStatus("1");//部分品质
}
if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum == orderCheckNum){
if(qualityNum == qualityOrder.getThisArrivedNum()){
qualityOrder.setQualityStatus("2");//全部品质
}
qualityOrderMapper.updateQualityOrder(qualityOrder);
@ -571,9 +576,6 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
storageOrder.setWarehouseStorageType("5");//生产入库
storageOrder.setWarehouseOrderType("1");//生产订单
storageOrder.setWarehouseDeptType("0");//入库部门:仓库
if(qualityOrderReportVO.getQualityOrderReportType().equals("0")){
storageOrder.setQualityUnqualifiedNum(0);
}
int storageResult = storageOrderMapper.insertWarehouseStorageOrder(storageOrder);
if(storageResult<=0){
throw new BusinessException("新增入库单失败");
@ -611,11 +613,22 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
int orderPendingReviewNum = qualityOrder.getPendingReviewNum();
orderPendingReviewNum = orderPendingReviewNum - checkNum;
qualityOrder.setPendingReviewNum(orderPendingReviewNum);
int orderQualifiedNum = qualityOrder.getQualityQualifiedNum();
int orderUnqualifiedNum = qualityOrder.getQualityUnqualifiedNum();
int qualityNum = orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum;
if(qualityNum == 0){
qualityOrder.setQualityStatus("0");//待品质
}
if(qualityNum < qualityOrder.getThisArrivedNum()){
qualityOrder.setQualityStatus("1");//部分品质
}
if(qualityNum == qualityOrder.getThisArrivedNum()){
qualityOrder.setQualityStatus("2");//全部品质
}
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(DateUtils.getNowDate());
qualityOrderMapper.updateQualityOrder(qualityOrder);
/*
* 更新设备状态(成品品质时才存在)*/
List<String> deviceIds = qualityOrderReportVO.getQualityReportDeviceIds();
@ -643,6 +656,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
WarehouseStorageOrder storageOrder = new WarehouseStorageOrder();
storageOrder.setWarehouseStorageCode(storageOrderCode);
storageOrder.setRelatedOrderCode(qualityReportVO.getRelatedOrderCode());
storageOrder.setQualityOrderCode(qualityReportVO.getQualityOrderCode());
storageOrder.setNotifyArrivedNum(qualityReportVO.getQualityHasqualifiedNum());
storageOrder.setQualityQualifiedNum(qualityReportVO.getQualityHasqualifiedNum());
storageOrder.setQualityUnqualifiedNum(qualityReportVO.getProcessBadNum());

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

@ -62,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="qualityOrderCode != null and qualityOrderCode != ''"> and quality_order_code = #{qualityOrderCode}</if>
<if test="inStorageCode != null and inStorageCode != ''"> and in_storage_code = #{inStorageCode}</if>
<if test="materialNo != null and materialNo != ''"> and material_no like concat('%', #{materialNo}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="relatedOrderCode != null and relatedOrderCode != ''"> and related_order_code = #{relatedOrderCode}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="qualityOrderType != null and qualityOrderType != ''"> and quality_order_type = #{qualityOrderType}</if>

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

@ -67,8 +67,8 @@
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]];
var qualityStorageStatusDatas = [[${@dict.getType('quality_storage_status')}]];
var warehouseStorageTypeDatas = [[${@dict.getType('warehouse_storage_type')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('storage_order_type')}]];
var prefix = ctx + "erp/inboundOrder";
@ -87,115 +87,90 @@
columns: [
{checkbox: true},
{
title: '品质单Id',
field: 'qualityOrderId',
title: '入库单id',
align: 'center',
field: 'warehouseStorageId',
visible: false
},
{
title: '品质单号',
align: 'center',
field: 'qualityOrderCode',
},
{
title: '品质状态',
field: 'qualityStatus',
align: 'center',
field: 'warehouseQualityStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(qualityStatusDatas, value);
}
},
{
title: '入库单号',
field: 'inStorageCode',
align: 'center',
field: 'warehouseStorageCode',
},
{
title: '关联订单号',
align: 'center',
field: 'relatedOrderCode',
},
{
title: '订单类型',
field: 'qualityOrderType',
align: 'center',
field: 'warehouseOrderType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(qualityOrderTypeDatas, value);
return $.table.selectDictLabel(warehouseOrderTypeDatas, value);
}
},
{
title: '入库类型',
field: 'qualityStorageStatus',
align: 'center',
field: 'warehouseStorageType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(qualityStorageStatusDatas, value);
return $.table.selectDictLabel(warehouseStorageTypeDatas, value);
}
},
// {
// title: '委内加工费总价',
// field: 'makeInTotalPrice',
// visible: false,
// 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: '品质合格数',
align: 'center',
field: 'qualityQualifiedNum',
},
{
title: '品质不合格数',
align: 'center',
field: 'qualityUnqualifiedNum',
},
{
title: '入库数',
align: 'center',
field: 'storageNum',
},
// {
// title: '交检时间',
// field: 'deliveryInspectionTime',
// },
// {
// title: '品质员',
// field: 'qualityEmployee',
// },
{
title: '录入人',
align: 'center',
field: 'createBy',
},
{
title: '录入时间',
align: 'center',
field: 'createTime',
},
{
title: '更新人',
align: 'center',
field: 'updateBy',
},
{
title: '上次更新时间',
align: 'center',
field: 'updateTime',
},
{title: '操作', align: 'center',formatter: function(value, row, index) {
{
title: '操作', align: 'center',formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="inboundOrderDetail(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="storageMakeDetail(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}
@ -205,11 +180,11 @@
});
//详情
function inboundOrderDetail(qualityOrderId){
var url = prefix +'/inboundOrderDetail/' + qualityOrderId;
$.modal.open("生产入库单详情",url)
}
/*入库-生产订单(生产入库)详情*/
function storageMakeDetail(warehouseStorageId){
var url = ctx + 'warehouse/storageOrder/storageMakeDetail/' + warehouseStorageId;
$.modal.open("详情",url);
};
</script>
</body>
</html>
Loading…
Cancel
Save