Browse Source

[feat]

品质管理 品质单
新增品质单mapper列表查询料号、物料名称模糊搜索;
新增品质单查询来料品质单controller接口;
新增查询品质报告单列表(不分页)service和controller方法;
修改品质报告单启动流程service方法,提交即结束时更新审核通过数据,修改审批通过、拒绝service方法,根据数量更新品质单品质状态,修改生成入库单service方法,添加品质单号赋值语句;
dev
王晓迪 3 days ago
parent
commit
54978a01b0
  1. 29
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 19
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java
  4. 38
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  5. 2
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml

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

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

Loading…
Cancel
Save