Browse Source

[feat]

品质管理 制程检验
新增制程检验controller导出多选和全部记录接口;
新增制程检验service根据制程检验单号查找导出制程检验列表接口
新增service查找导出全部记录接口;
新增制程检验导出对象公共部分赋值方法;
新增循环物料、物料工序和工序不合格数初始化导出对象列表方法;
新增制程检验导出实体类;
dev
王晓迪 3 months ago
parent
commit
dafe8e604c
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java
  2. 80
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutProcessExportVO.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java
  4. 86
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java

12
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java

@ -8,6 +8,7 @@ import com.ruoyi.erp.domain.ErpBom;
import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial;
import com.ruoyi.quality.domain.QualityManufacturingProcess;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.quality.domain.VO.CheckoutProcessExportVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -67,10 +68,9 @@ public class QualityManufacturingCheckoutController extends BaseController
public AjaxResult export(@RequestBody String[] checkouts)
{
String checkoutString = String.join(",", checkouts); // 带分隔符
// List<ErpBom> list = erpBomService.getExportListByNos(bomNos);
// ExcelUtil<> util = new ExcelUtil<ErpBom>(ErpBom.class);
// return util.exportExcel(list, bomNoString);
return AjaxResult.success();
List<CheckoutProcessExportVO> exportVOS = qualityManufacturingCheckoutService.getExportList(checkouts);
ExcelUtil<CheckoutProcessExportVO> util = new ExcelUtil<CheckoutProcessExportVO>(CheckoutProcessExportVO.class);
return util.exportExcel(exportVOS, checkoutString);
}
/**
@ -82,8 +82,8 @@ public class QualityManufacturingCheckoutController extends BaseController
@ResponseBody
public AjaxResult export(QualityManufacturingCheckout qualityManufacturingCheckout)
{
List<QualityManufacturingCheckout> list = qualityManufacturingCheckoutService.selectQualityManufacturingCheckoutList(qualityManufacturingCheckout);
ExcelUtil<QualityManufacturingCheckout> util = new ExcelUtil<QualityManufacturingCheckout>(QualityManufacturingCheckout.class);
List<CheckoutProcessExportVO> list = qualityManufacturingCheckoutService.getAllExportList(qualityManufacturingCheckout);
ExcelUtil<CheckoutProcessExportVO> util = new ExcelUtil<CheckoutProcessExportVO>(CheckoutProcessExportVO.class);
return util.exportExcel(list, "品质管理制程检验数据");
}

80
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutProcessExportVO.java

@ -0,0 +1,80 @@
package com.ruoyi.quality.domain.VO;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.quality.domain.QualityManufacturingMaterialProcess;
import lombok.Data;
import java.util.Date;
@Data
public class CheckoutProcessExportVO {
/** 制程检验单号 */
@Excel(name = "制程检验单号",sort = 1)
private String manufacturingCheckoutCode;
/** 生产单号 */
@Excel(name = "生产单号",sort = 2)
private String makeNo;
/** 料号 */
@Excel(name = "料号",sort = 3)
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称",sort = 4)
private String materialName;
/** 设备名称 */
@Excel(name = "设备名称",sort = 5)
private String deviceName;
/** 设备型号 */
@Excel(name = "设备型号",sort = 6)
private String deviceModelCode;
/** 制程工序编号 */
@Excel(name = "工序编号",sort = 7)
private String manufacturingProcessCode;
/** 车间名称 */
@Excel(name = "车间名称",sort = 8)
private String workshopName;
/** 制程工序名称 */
@Excel(name = "工序名称",sort = 9,dictType = "manufacturing_process_name")
private String manufacturingProcessName;
/** 工序顺序 */
@Excel(name = "工序顺序",sort = 10)
private String processSequence;
/** 零件名称 */
@Excel(name = "零件名称",sort = 11)
private String modName;
/** 工序检验项目 */
@Excel(name = "工序检验项目",sort = 12)
private String processInspectionItem;
/** 工序检验状态 */
@Excel(name = "检验状态",sort = 13)
private String processInspectionStatus;
/** 检验数量(合格/不合格) */
@Excel(name = "数量",sort = 14)
private int processInspectionsum;
/** 检验报告 */
@Excel(name = "检验报告",sort = 15)
private String reportPhotourl;
/** 完成时间 */
@Excel(name = "完成时间",sort = 16,dateFormat = "YYYY-MM-dd")
private Date completeDate;
/** 备注 */
@Excel(name = "备注",sort = 17)
private String remark;
}

11
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java

@ -5,6 +5,7 @@ import com.ruoyi.quality.domain.QualityManufacturingCheckout;
import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial;
import com.ruoyi.quality.domain.QualityManufacturingProcess;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.quality.domain.VO.CheckoutProcessExportVO;
/**
* 品质管理制程检验Service接口
@ -114,4 +115,14 @@ public interface IQualityManufacturingCheckoutService
* */
QualityManufacturingCheckoutMaterial selectDetailByCodes(String materialNo, String manufacturingCheckoutCode);
/*
* 根据制程检验单号查找导出制程检验列表
* */
List<CheckoutProcessExportVO> getExportList(String[] checkoutCodes);
/*
* 查找导出全部制程检验列表
* */
List<CheckoutProcessExportVO> getAllExportList(QualityManufacturingCheckout qualityManufacturingCheckout);
}

86
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java

@ -12,6 +12,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quality.domain.*;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.quality.domain.VO.CheckoutProcessExportVO;
import com.ruoyi.quality.mapper.*;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom;
@ -369,4 +370,89 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
return checkoutMaterial;
}
public CheckoutProcessExportVO initExportVO(QualityManufacturingCheckoutMaterial material,QualityManufacturingMaterialProcess process){
CheckoutProcessExportVO exportVO = new CheckoutProcessExportVO();
exportVO.setManufacturingCheckoutCode(material.getManufacturingCheckoutCode());
exportVO.setMakeNo(material.getMakeNo());
exportVO.setMaterialNo(material.getMaterialNo());
exportVO.setMaterialName(material.getMaterialName());
exportVO.setDeviceName(process.getDeviceName());
exportVO.setDeviceModelCode(process.getDeviceModelCode());
exportVO.setManufacturingProcessCode(process.getManufacturingProcessCode());
exportVO.setWorkshopName(process.getWorkshopName());
exportVO.setManufacturingProcessName(process.getManufacturingProcessName());
exportVO.setProcessSequence(process.getProcessSequence());
exportVO.setModName(process.getModName());
exportVO.setProcessInspectionItem(process.getProcessInspectionItem());
exportVO.setCompleteDate(material.getCheckoutTime());
return exportVO;
}
@Override
public List<CheckoutProcessExportVO> getExportList(String[] checkoutCodes) {
List<CheckoutProcessExportVO> checkoutProcessExportVOList = new ArrayList<>();
for (String code:checkoutCodes) {
List<QualityManufacturingCheckoutMaterial> materials = checkoutMaterialMapper.selectCheckoutMaterialByCode(code);
if (StringUtils.isEmpty(materials)){
log.warn("未查找到制程工序物料相关数据: {}");
}else {
checkoutProcessExportVOList = createExportVOListByMaterialList(materials);
}
}
return checkoutProcessExportVOList;
}
@Override
public List<CheckoutProcessExportVO> getAllExportList(QualityManufacturingCheckout qualityManufacturingCheckout) {
List<CheckoutProcessExportVO> checkoutProcessExportVOList = new ArrayList<>();
List<QualityManufacturingCheckoutMaterial> materials = checkoutMaterialMapper.selectQualityManufacturingCheckoutMaterialList();
if (StringUtils.isEmpty(materials)){
log.warn("未查找到制程工序物料相关数据: {}");
}else {
checkoutProcessExportVOList = createExportVOListByMaterialList(materials);
}
return checkoutProcessExportVOList;
}
public List<CheckoutProcessExportVO> createExportVOListByMaterialList(List<QualityManufacturingCheckoutMaterial> materials) {
List<CheckoutProcessExportVO> checkoutProcessExportVOList = new ArrayList<>();
if (materials != null) {
for (QualityManufacturingCheckoutMaterial material : materials) {
Map<String, Object> params = new HashMap<>();
params.put("materialNo", material.getMaterialNo());
params.put("manufacturingCheckoutCode", material.getManufacturingCheckoutCode());
List<QualityManufacturingMaterialProcess> materialProcessList = materialProcessMapper.selectCheckoutMaterialProcessByCodes(params);
for (QualityManufacturingMaterialProcess materialProcess : materialProcessList) {
if (materialProcess.getOkAcceptedNum() != 0) {
CheckoutProcessExportVO exportVO = initExportVO(material, materialProcess);
exportVO.setProcessInspectionsum(materialProcess.getOkAcceptedNum());
exportVO.setReportPhotourl(materialProcess.getOkAcceptedPhotourl());
exportVO.setProcessInspectionStatus("OK");
checkoutProcessExportVOList.add(exportVO);
}
if (materialProcess.getSpecialConcessionsNum() != 0) {
CheckoutProcessExportVO exportVO = initExportVO(material, materialProcess);
exportVO.setProcessInspectionsum(materialProcess.getSpecialConcessionsNum());
exportVO.setReportPhotourl(materialProcess.getSpecialConcessionsPhotourl());
exportVO.setProcessInspectionStatus("特采");
checkoutProcessExportVOList.add(exportVO);
}
params.put("manufacturingProcessCode", materialProcess.getManufacturingProcessCode());
List<QualityManufacturingUnqualifiedClass> unqualifiedClassList = unqualifiedClassMapper.selectCheckoutUnqualifiedClassByCodes(params);
if (unqualifiedClassList != null) {
for (QualityManufacturingUnqualifiedClass unqualified : unqualifiedClassList) {
CheckoutProcessExportVO exportVO = initExportVO(material, materialProcess);
exportVO.setProcessInspectionsum(unqualified.getProcessBadNum());
exportVO.setReportPhotourl(unqualified.getProcessBadPhotourl());
exportVO.setProcessInspectionStatus("NG");
checkoutProcessExportVOList.add(exportVO);
}
}
}
}
}
return checkoutProcessExportVOList;
}
}

Loading…
Cancel
Save