Browse Source

[feat]

品质管理 品质单
修改品质单controller,新增跳转选择出货设备方法、生产入库品质单(其他)开始品质方法;
修改品质单、品质单详情、品质单报告mapper,新增字段;
修改品质报告单service,去除多余方法,新增添加生产成品品质单报告方法、修改保存品质报告按钮、审批流程启动、创建品质报告审核流程、审核通过后更新数据、审核拒绝后更新数据方法;
修改不良分类对象和mapper,新增字段;
修改入库单service相关字段类型;
新增品质报告controller、品质报告关联设备对象和mapper;
dev
王晓迪 4 days ago
parent
commit
c8a37e39db
  1. 42
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 278
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderReportController.java
  3. 22
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java
  4. 65
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityReportDevice.java
  5. 23
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java
  6. 77
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityReportDeviceMapper.java
  7. 31
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java
  8. 755
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  9. 53
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  10. 37
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml
  11. 24
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  12. 200
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml
  13. 15
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml
  14. 70
      ruoyi-admin/src/main/resources/mapper/quality/QualityReportDeviceMapper.xml

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

@ -4,10 +4,14 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.quality.domain.QualityOrderDetail; import com.ruoyi.quality.domain.QualityOrderDetail;
import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.domain.QualityOrderReport;
import com.ruoyi.quality.domain.QualityShippingDevice;
import com.ruoyi.quality.service.IQualityOrderDetailService; import com.ruoyi.quality.service.IQualityOrderDetailService;
import com.ruoyi.quality.service.IQualityOrderReportService; import com.ruoyi.quality.service.IQualityOrderReportService;
import com.ruoyi.quality.service.IQualityShippingDeviceService;
import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -45,6 +49,9 @@ public class QualityOrderController extends BaseController
@Autowired @Autowired
private IQualityOrderReportService orderReportService; private IQualityOrderReportService orderReportService;
@Autowired
private IQualityShippingDeviceService qualitySDeviceService;
@RequiresPermissions("quality:qualityOrder:view") @RequiresPermissions("quality:qualityOrder:view")
@GetMapping() @GetMapping()
public String qualityOrder() public String qualityOrder()
@ -146,7 +153,27 @@ public class QualityOrderController extends BaseController
return toAjax(qualityOrderService.updateQualityOrder(qualityOrder)); return toAjax(qualityOrderService.updateQualityOrder(qualityOrder));
} }
/**
* 跳转选择出货设备
*/
@GetMapping("/addShippingDevice/{qualityOrderCode}")
public String addShippingDevice(@PathVariable("qualityOrderCode") String qualityOrderCode, ModelMap mmap)
{
mmap.put("qualityOrderCode", qualityOrderCode);
return prefix + "/addShippingDevice";
}
/**
* 选择出货设备列表
*/
@PostMapping("/selectShippingDevice")
@ResponseBody
public TableDataInfo selectShippingDevice(QualityShippingDevice qualityShippingDevice)
{
startPage();
List<QualityShippingDevice> shippingDevices = qualitySDeviceService.selectQualityShippingDeviceList(qualityShippingDevice);
return getDataTable(shippingDevices);
}
/** /**
* 品质单列表详情接口 * 品质单列表详情接口
@ -360,7 +387,7 @@ public class QualityOrderController extends BaseController
/*1111111111*/ /*1111111111*/
/** /**
* 生产入库品质单开始品质 * 生产入库品质单成品开始品质
*/ */
@GetMapping("/makeStartingQuality/{qualityOrderId}") @GetMapping("/makeStartingQuality/{qualityOrderId}")
public String makeStartingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap) public String makeStartingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
@ -371,7 +398,7 @@ public class QualityOrderController extends BaseController
} }
/** /**
* 修改保存生产入库品质单开始品质 * 修改保存生产入库品质单成品开始品质
*/ */
@RequiresPermissions("quality:qualityOrder:makeStartingQuality") @RequiresPermissions("quality:qualityOrder:makeStartingQuality")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@ -381,7 +408,16 @@ public class QualityOrderController extends BaseController
{ {
return toAjax(qualityOrderService.updateMakeStartingQuality(qualityOrder)); return toAjax(qualityOrderService.updateMakeStartingQuality(qualityOrder));
} }
/**
* 生产入库品质单其他开始品质
*/
@GetMapping("/makeOtherStartingQuality/{qualityOrderId}")
public String makeOtherStartingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
{
QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
mmap.put("qualityOrder", qualityOrder);
return prefix + "/makeOtherStartingQuality";
}
/** /**

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

@ -0,0 +1,278 @@
package com.ruoyi.quality.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.quality.domain.QualityOrderReportUnqualified;
import com.ruoyi.quality.domain.QualityShippingDevice;
import com.ruoyi.quality.domain.VO.QualityOrderReportVO;
import com.ruoyi.quality.service.IQualityOrderReportUnqualifiedService;
import com.ruoyi.quality.service.IQualityShippingDeviceService;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualityOrderReport;
import com.ruoyi.quality.service.IQualityOrderReportService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 品质管理品质报告单Controller
*
* @author 刘晓旭
* @date 2024-11-19
*/
@Controller
@RequestMapping("/quality/qualityReport")
public class QualityOrderReportController extends BaseController
{
private String prefix = "quality/qualityReport";
@Autowired
private IQualityOrderReportService qualityOrderReportService;
@Autowired
private IQualityShippingDeviceService qualityShippingDeviceService;
@Autowired
private IQualityOrderReportUnqualifiedService unqualifiedService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@Autowired
private ISysRoleService roleService;
@RequiresPermissions("quality:qualityReport:view")
@GetMapping()
public String qualityReport()
{
return prefix + "/qualityReport";
}
@RequiresPermissions("quality:qualityReport:iqcView")
@GetMapping("/iqcQualityReport")
public String iqcQualityReport()
{
return prefix + "/iqcQualityReport";
}
/**
* 查询品质管理品质单报告列表
*/
@RequiresPermissions("quality:qualityReport:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(QualityOrderReportVO qualityOrderReport)
{
startPage();
List<QualityOrderReportVO> list = qualityOrderReportService.selectQualityOrderReportList(qualityOrderReport);
return getDataTable(list);
}
/**
* 导出品质管理品质单报告列表
*/
@RequiresPermissions("quality:qualityReport:export")
@Log(title = "品质管理品质单报告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(QualityOrderReportVO qualityOrderReport)
{
List<QualityOrderReportVO> list = qualityOrderReportService.selectQualityOrderReportList(qualityOrderReport);
ExcelUtil<QualityOrderReportVO> util = new ExcelUtil<QualityOrderReportVO>(QualityOrderReportVO.class);
return util.exportExcel(list, "品质管理品质单报告数据");
}
/**
* 新增品质管理品质单报告
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存品质管理品质报告单
*/
@Log(title = "品质报告单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@RequestBody QualityOrderReportVO qualityOrderReportVO)
{
qualityOrderReportVO.setAuditStatus("0");
qualityOrderReportService.submitApply(qualityOrderReportVO);
return AjaxResult.success();
}
/**
* 加载审批弹窗
* @param taskId
* @param mmap
* @return
*/
@GetMapping("/showVerifyDialog/{taskId}")
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
QualityOrderReportVO qualityOrderReportVO = qualityOrderReportService.selectQualityOrderReportById(new Long(processInstance.getBusinessKey()));
mmap.put("formData", qualityOrderReportVO);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public QualityOrderReportVO getObj(@RequestParam(value = "requisiteId", required = false) Long qualityOrderReportId, HttpSession session) {
if (qualityOrderReportId != null) {
return qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportId);
}
return new QualityOrderReportVO();
}
/**
* 完成任务
*
* @return
*/
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@ModelAttribute("preloadObj") QualityOrderReportVO qualityOrderReportVO, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = qualityOrderReportVO.getInstanceId();
//获取实例类型
String instanceType = qualityOrderReportVO.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, qualityOrderReportVO.getApplyTitle(), qualityOrderReportVO.getQualityOrderReportCode(), "qualityOrderReport", new HashMap<String, Object>(), request);
QualityOrderReportVO tempQualityReport = qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportVO.getQualityOrderReportId());
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
if(!approvedFlag){
// 审核状态-审核拒绝
tempQualityReport.setAuditStatus("2");
qualityOrderReportService.updateDisApprovedInfo(tempQualityReport);
}else{
// 审核状态-审核通过
tempQualityReport.setAuditStatus("1");
//生产品质
if(tempQualityReport.getQualityOrderReportType().equals("0")
||tempQualityReport.getQualityOrderReportType().equals("1")){
qualityOrderReportService.updateApprovedInfo(tempQualityReport);
}
}
}
qualityOrderReportService.updateMakeOrderQualityReport(tempQualityReport);
return success("任务已完成");
}
/**
* 品质管理品质单报告详情
*/
@GetMapping("/detail/{qualityOrderReportId}")
public String detail(@PathVariable("qualityOrderReportId") Long qualityOrderReportId, ModelMap mmap)
{
QualityOrderReportVO qualityOrderReport = qualityOrderReportService.selectQualityOrderReportById(qualityOrderReportId);
mmap.put("qualityOrderReport", qualityOrderReport);
return prefix + "/detail";
}
@PostMapping("/getReportDevice")
@ResponseBody
public TableDataInfo getReportDevice(QualityShippingDevice qualityShippingDevice)
{
startPage();
List<QualityShippingDevice> list = qualityShippingDeviceService.selectQualityShippingDeviceList(qualityShippingDevice);
return getDataTable(list);
}
@PostMapping("/getReportUnqualified")
@ResponseBody
public TableDataInfo getReportUnqualified(QualityOrderReportUnqualified unqualified)
{
startPage();
List<QualityOrderReportUnqualified> list = unqualifiedService.selectQualityOrderReportUnqualifiedList(unqualified);
return getDataTable(list);
}
/**
* 修改保存品质管理品质单报告
*/
@RequiresPermissions("quality:qualityReport:edit")
@Log(title = "品质管理品质单报告", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(QualityOrderReport qualityOrderReport)
{
return toAjax(qualityOrderReportService.updateQualityOrderReport(qualityOrderReport));
}
/**
* 删除品质管理品质单报告
*/
@RequiresPermissions("quality:qualityReport:remove")
@Log(title = "品质管理品质单报告", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(qualityOrderReportService.deleteQualityOrderReportByIds(ids));
}
/**
* 作废品质管理品质单报告
*/
@RequiresPermissions("quality:qualityReport:cancel")
@Log(title = "品质管理品质单报告", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(qualityOrderReportService.cancelQualityOrderReportById(id));
}
/**
* 恢复品质管理品质单报告
*/
@RequiresPermissions("quality:qualityReport:restore")
@Log(title = "品质管理品质单报告", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(qualityOrderReportService.restoreQualityOrderReportById(id));
}
}

22
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java

@ -21,6 +21,12 @@ public class QualityOrderReportUnqualified extends BaseEntity
/** 品质单报告Id */ /** 品质单报告Id */
private Long qualityOrderReportId; private Long qualityOrderReportId;
/** 品质单报告单号 */
private String qualityOrderReportCode;
/** 品质报告关联出货设备ID */
private String shippingDeviceId;
/** 供应商Id */ /** 供应商Id */
@Excel(name = "供应商Id") @Excel(name = "供应商Id")
private String supplierCode; private String supplierCode;
@ -144,6 +150,22 @@ public class QualityOrderReportUnqualified extends BaseEntity
return unqualifiedReportUrl; return unqualifiedReportUrl;
} }
public String getQualityOrderReportCode() {
return qualityOrderReportCode;
}
public void setQualityOrderReportCode(String qualityOrderReportCode) {
this.qualityOrderReportCode = qualityOrderReportCode;
}
public String getShippingDeviceId() {
return shippingDeviceId;
}
public void setShippingDeviceId(String shippingDeviceId) {
this.shippingDeviceId = shippingDeviceId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

65
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityReportDevice.java

@ -0,0 +1,65 @@
package com.ruoyi.quality.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 品质报告单关联出货设备对象 quality_report_device
*
* @author ruoyi
* @date 2024-11-19
*/
public class QualityReportDevice extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 出货设备id */
@Excel(name = "出货设备id")
private String shippingDeviceId;
/** 关联品质报告单号 */
@Excel(name = "关联品质报告单号")
private String qualityOrderReportCode;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setShippingDeviceId(String shippingDeviceId)
{
this.shippingDeviceId = shippingDeviceId;
}
public String getShippingDeviceId()
{
return shippingDeviceId;
}
public void setQualityOrderReportCode(String qualityOrderReportCode)
{
this.qualityOrderReportCode = qualityOrderReportCode;
}
public String getQualityOrderReportCode()
{
return qualityOrderReportCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("shippingDeviceId", getShippingDeviceId())
.append("qualityOrderReportCode", getQualityOrderReportCode())
.toString();
}
}

23
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.quality.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.domain.QualityOrderReport;
import com.ruoyi.quality.domain.VO.QualityOrderReportVO;
/** /**
* 品质管理品质单报告Mapper接口 * 品质管理品质单报告Mapper接口
@ -17,41 +18,41 @@ public interface QualityOrderReportMapper
* @param qualityOrderReportId 品质管理品质单报告ID * @param qualityOrderReportId 品质管理品质单报告ID
* @return 品质管理品质单报告 * @return 品质管理品质单报告
*/ */
public QualityOrderReport selectQualityOrderReportById(Long qualityOrderReportId); public QualityOrderReportVO selectQualityOrderReportById(Long qualityOrderReportId);
/** /**
* 查询品质管理品质单报告列表 * 查询品质管理品质单报告列表
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 品质管理品质单报告集合 * @return 品质管理品质单报告集合
*/ */
public List<QualityOrderReport> selectQualityOrderReportList(QualityOrderReport qualityOrderReport); public List<QualityOrderReportVO> selectQualityOrderReportList(QualityOrderReportVO qualityOrderReportVO);
/** /**
* 新增品质管理品质单报告 * 新增品质管理品质单报告
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 结果 * @return 结果
*/ */
public int insertQualityOrderReport(QualityOrderReport qualityOrderReport); public int insertQualityOrderReport(QualityOrderReportVO qualityOrderReportVO);
/** /**
* 通过品质单报告物料号和供应商编号修改品质管理品质单报告 * 通过品质单报告物料号和供应商编号修改品质管理品质单报告
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 结果 * @return 结果
*/ */
public int updateQualityOrderReport(QualityOrderReport qualityOrderReport); public int updateQualityOrderReport(QualityOrderReportVO qualityOrderReportVO);
/** /**
* 通过品质单报告Id修改品质管理品质单报告 * 通过品质单报告Id修改品质管理品质单报告
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 结果 * @return 结果
*/ */
public int updateQualityOrderReportById(QualityOrderReport qualityOrderReport); public int updateQualityOrderReportById(QualityOrderReportVO qualityOrderReportVO);
/** /**
@ -87,11 +88,11 @@ public interface QualityOrderReportMapper
public int restoreQualityOrderReportById(Long qualityOrderReportId); public int restoreQualityOrderReportById(Long qualityOrderReportId);
/*根据供应商ID和物料号以及品质单号查询品质报告*/ /*根据供应商ID和物料号以及品质单号查询品质报告*/
QualityOrderReport selectQualityOrderReportByNoAndCode(QualityOrderReport qualityOrderReport); QualityOrderReportVO selectQualityOrderReportByNoAndCode(QualityOrderReportVO qualityOrderReportVO);
/* /*
* 查询委内加工入库单品质报告 * 查询委内加工入库单品质报告
* */ * */
QualityOrderReport selectMakeInOrderReportByNoAndCode(QualityOrderReport tempQualityOrderReport); QualityOrderReportVO selectMakeInOrderReportByNoAndCode(QualityOrderReportVO qualityOrderReportVO);
} }

77
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityReportDeviceMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.quality.mapper;
import java.util.List;
import com.ruoyi.quality.domain.QualityReportDevice;
/**
* 品质报告单关联出货设备Mapper接口
*
* @author ruoyi
* @date 2024-11-19
*/
public interface QualityReportDeviceMapper
{
/**
* 查询品质报告单关联出货设备
*
* @param id 品质报告单关联出货设备ID
* @return 品质报告单关联出货设备
*/
public QualityReportDevice selectQualityReportDeviceById(Long id);
/**
* 查询品质报告单关联出货设备列表
*
* @param qualityReportDevice 品质报告单关联出货设备
* @return 品质报告单关联出货设备集合
*/
public List<QualityReportDevice> selectQualityReportDeviceList(QualityReportDevice qualityReportDevice);
/**
* 新增品质报告单关联出货设备
*
* @param qualityReportDevice 品质报告单关联出货设备
* @return 结果
*/
public int insertQualityReportDevice(QualityReportDevice qualityReportDevice);
/**
* 修改品质报告单关联出货设备
*
* @param qualityReportDevice 品质报告单关联出货设备
* @return 结果
*/
public int updateQualityReportDevice(QualityReportDevice qualityReportDevice);
/**
* 删除品质报告单关联出货设备
*
* @param id 品质报告单关联出货设备ID
* @return 结果
*/
public int deleteQualityReportDeviceById(Long id);
/**
* 批量删除品质报告单关联出货设备
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteQualityReportDeviceByIds(String[] ids);
/**
* 作废品质报告单关联出货设备
*
* @param id 品质报告单关联出货设备ID
* @return 结果
*/
public int cancelQualityReportDeviceById(Long id);
/**
* 恢复品质报告单关联出货设备
*
* @param id 品质报告单关联出货设备ID
* @return 结果
*/
public int restoreQualityReportDeviceById(Long id);
}

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

@ -2,6 +2,10 @@ package com.ruoyi.quality.service;
import java.util.List; import java.util.List;
import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.domain.QualityOrderReport;
import com.ruoyi.quality.domain.VO.QualityOrderReportVO;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 品质管理品质单报告Service接口 * 品质管理品质单报告Service接口
@ -17,23 +21,23 @@ public interface IQualityOrderReportService
* @param qualityOrderReportId 品质管理品质单报告ID * @param qualityOrderReportId 品质管理品质单报告ID
* @return 品质管理品质单报告 * @return 品质管理品质单报告
*/ */
public QualityOrderReport selectQualityOrderReportById(Long qualityOrderReportId); public QualityOrderReportVO selectQualityOrderReportById(Long qualityOrderReportId);
/** /**
* 查询品质管理品质单报告列表 * 查询品质管理品质单报告列表
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 品质管理品质单报告集合 * @return 品质管理品质单报告集合
*/ */
public List<QualityOrderReport> selectQualityOrderReportList(QualityOrderReport qualityOrderReport); public List<QualityOrderReportVO> selectQualityOrderReportList(QualityOrderReportVO qualityOrderReportVO);
/** /**
* 新增品质管理品质单报告 * 新增品质管理品质单报告
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 结果 * @return 结果
*/ */
public int insertQualityOrderReport(QualityOrderReport qualityOrderReport); public int insertMakeQualityOrderReport(QualityOrderReportVO qualityOrderReportVO);
/** /**
* 修改品质管理品质单报告 * 修改品质管理品质单报告
@ -85,4 +89,21 @@ public interface IQualityOrderReportService
* 修改保存委内加工入库单品质报告按钮 * 修改保存委内加工入库单品质报告按钮
*/ */
int updateMakeInOrderReport(QualityOrderReport qualityOrderReport); int updateMakeInOrderReport(QualityOrderReport qualityOrderReport);
int updateMakeOrderQualityReport(QualityOrderReportVO qualityOrderReportVO);
/**
* 审批流程启动
* */
ProcessInstance submitApply(QualityOrderReportVO qualityOrderReportVO);
/*
* 审核通过后更新数据(生产入库成品品质)
* 更新品质单表品质单详情表品质单关联设备表售后设备表生产订单生产订单bom已完成数*/
void updateApprovedInfo(QualityOrderReportVO qualityOrderReportVO);
/*
* 审核拒绝后更新数据(生产入库成品品质)
* 更新品质单表品质单详情表品质单关联设备表售后设备表*/
void updateDisApprovedInfo(QualityOrderReportVO qualityOrderReportVO);
} }

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

@ -1,27 +1,42 @@
package com.ruoyi.quality.service.impl; package com.ruoyi.quality.service.impl;
import java.text.DecimalFormat; import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date; import com.github.pagehelper.Page;
import java.util.List; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.quality.domain.*; import com.ruoyi.quality.domain.*;
import com.ruoyi.quality.mapper.QualityOrderDetailMapper; import com.ruoyi.quality.domain.VO.QualityOrderReportVO;
import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; import com.ruoyi.quality.mapper.*;
import com.ruoyi.quality.mapper.QualityRefundsExchangesOrderMapper; import com.ruoyi.system.domain.SysMakeOrder;
import org.apache.avalon.framework.service.ServiceException; import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualityOrderReportMapper;
import com.ruoyi.quality.service.IQualityOrderReportService; import com.ruoyi.quality.service.IQualityOrderReportService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/** /**
* 品质管理品质单报告Service业务层处理 * 品质管理品质单报告Service业务层处理
@ -30,8 +45,7 @@ import org.springframework.util.CollectionUtils;
* @date 2024-05-20 * @date 2024-05-20
*/ */
@Service @Service
public class QualityOrderReportServiceImpl implements IQualityOrderReportService public class QualityOrderReportServiceImpl implements IQualityOrderReportService {
{
@Autowired @Autowired
private QualityOrderReportMapper qualityOrderReportMapper; private QualityOrderReportMapper qualityOrderReportMapper;
@ -44,6 +58,45 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
@Autowired @Autowired
private QualityRefundsExchangesOrderMapper refundsExchangesOrderMapper; private QualityRefundsExchangesOrderMapper refundsExchangesOrderMapper;
@Autowired
private QualityShippingDeviceMapper shippingDeviceMapper;
@Autowired
private AfterSalesShippingDeviceMapper afterSalesDeviceMapper;
@Autowired
private QualityReportDeviceMapper qualityReportDeviceMapper;
@Autowired
private QualityOrderMapper qualityOrderMapper;
@Autowired
private ISysRoleService roleService;
@Autowired
private TaskService taskService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private IProcessService processService;
@Autowired
private SysMakeOrderMapper makeOrderMapper;
@Autowired
private SysMakeorderBomMapper makeorderBomMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private WarehouseStorageOrderMapper storageOrderMapper;
@Autowired
private WarehouseStorageOrderDetailMapper storageDetailMapper;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@ -54,36 +107,170 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* @return 品质管理品质单报告 * @return 品质管理品质单报告
*/ */
@Override @Override
public QualityOrderReport selectQualityOrderReportById(Long qualityOrderReportId) public QualityOrderReportVO selectQualityOrderReportById(Long qualityOrderReportId) {
{ QualityOrderReportVO qualityOrderReport = qualityOrderReportMapper.selectQualityOrderReportById(qualityOrderReportId);
return qualityOrderReportMapper.selectQualityOrderReportById(qualityOrderReportId); QualityReportDevice tempDevice = new QualityReportDevice();
tempDevice.setQualityOrderReportCode(qualityOrderReport.getQualityOrderReportCode());
List<QualityReportDevice> reportDevices = qualityReportDeviceMapper.selectQualityReportDeviceList(tempDevice);
List<String> deviceIds = new ArrayList<>();
if (StringUtils.isNotEmpty(reportDevices)) {
for (QualityReportDevice device : reportDevices) {
deviceIds.add(device.getShippingDeviceId());
}
}
qualityOrderReport.setQualityReportDeviceIds(deviceIds);
return qualityOrderReport;
} }
/** /**
* 查询品质管理品质单报告列表 * 查询品质管理品质单报告列表
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 品质管理品质单报告 * @return 品质管理品质单报告
*/ */
@Override @Override
public List<QualityOrderReport> selectQualityOrderReportList(QualityOrderReport qualityOrderReport) public List<QualityOrderReportVO> selectQualityOrderReportList(QualityOrderReportVO qualityOrderReportVO) {
{ PageDomain pageDomain = TableSupport.buildPageRequest();
return qualityOrderReportMapper.selectQualityOrderReportList(qualityOrderReport); Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<QualityOrderReportVO> list = (Page<QualityOrderReportVO>) qualityOrderReportMapper.selectQualityOrderReportList(qualityOrderReportVO);
Page<QualityOrderReportVO> returnList = new Page<>();
for (QualityOrderReportVO orderReportVO : list) {
SysUser sysUser = userMapper.selectUserByLoginName(orderReportVO.getCreateBy());
if (sysUser != null) {
orderReportVO.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(orderReportVO.getApplyUser());
if (sysUser2 != null) {
orderReportVO.setApplyUserName(sysUser2.getUserName());
}
String instanceId = orderReportVO.getInstanceId();
// 当前环节
if (StringUtils.isNotBlank(instanceId)) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(instanceId)
// .singleResult();
.list(); // 例如请假会签,会同时拥有多个任务
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
String taskId = task.getId();
orderReportVO.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
orderReportVO.setTodoUserId(String.join(",", todoUserList));
}
if (task.getSuspensionState() == 2) {
orderReportVO.setTaskName("已挂起");
orderReportVO.setSuspendState("2");
} else {
orderReportVO.setTaskName(task.getName());
orderReportVO.setSuspendState("1");
}
} else {
// 已办结或者已撤销
orderReportVO.setTaskName("已结束");
}
} else {
orderReportVO.setTaskName("未启动");
}
orderReportVO.setTaskStatus(orderReportVO.getTaskName());
if (orderReportVO.getAuditStatus() == null) {
orderReportVO.setTaskStatus("未启动");
} else if (orderReportVO.getAuditStatus().equals("1")) {
orderReportVO.setTaskStatus("审核通过");
} else if (orderReportVO.getAuditStatus().equals("2")) {
orderReportVO.setTaskStatus("审核拒绝");
}
returnList.add(orderReportVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
} }
/** /**
* 新增品质管理品质单报告 * 新增生产成品品质单报告
* *
* @param qualityOrderReport 品质管理品质单报告 * @param qualityOrderReportVO 品质管理品质单报告
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertQualityOrderReport(QualityOrderReport qualityOrderReport) @Transactional(rollbackFor = Exception.class)
{ public int insertMakeQualityOrderReport(QualityOrderReportVO qualityOrderReportVO) {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
qualityOrderReport.setCreateBy(loginName); String qualityOrderCode = qualityOrderReportVO.getQualityOrderCode();
qualityOrderReport.setCreateTime(DateUtils.getNowDate()); String qualityReportCode = redisCache.generateBillNo("PZBG");
return qualityOrderReportMapper.insertQualityOrderReport(qualityOrderReport); QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailByCode(qualityOrderCode);
qualityOrderReportVO.setQualityOrderType(qualityOrderDetail.getQualityOrderType());
qualityOrderReportVO.setQualityStorageStatus(qualityOrderDetail.getQualityStorageStatus());
//更新品质单详情待审核数
int qualifiedNum = qualityOrderReportVO.getOkAcceptedNum() + qualityOrderReportVO.getSpecialConcessionsNum();
int pendingReviewNum = qualifiedNum + qualityOrderReportVO.getProcessBadNum();
int detailPendingNum = qualityOrderDetail.getPendingReviewNum();
detailPendingNum = detailPendingNum + pendingReviewNum;
qualityOrderDetail.setPendingReviewNum(detailPendingNum);
orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail);
//更新品质单待审核数、品检员
QualityOrder qualityOrder = qualityOrderMapper.selectQualityOrderByCode(qualityOrderCode);
int orderPendingNum = qualityOrder.getPendingReviewNum();
orderPendingNum = orderPendingNum + pendingReviewNum;
qualityOrder.setPendingReviewNum(orderPendingNum);
qualityOrder.setQualityEmployee(loginName);
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(DateUtils.getNowDate());
qualityOrderMapper.updateQualityOrder(qualityOrder);
//新增不良分类列表
List<QualityOrderReportUnqualified> unqualifiedList = qualityOrderReportVO.getUnqualifiedDataList();
if (StringUtils.isNotEmpty(unqualifiedList)) {
for (QualityOrderReportUnqualified unqualified : unqualifiedList) {
unqualified.setQualityOrderReportCode(qualityReportCode);
unqualified.setCreateBy(ShiroUtils.getLoginName());
unqualified.setCreateTime(DateUtils.getNowDate());
int result = unqualifiedMapper.insertQualityOrderReportUnqualified(unqualified);
if (result <= 0) {
throw new BusinessException("新增不良分类失败!");
}
}
}
if(qualityOrderReportVO.getQualityOrderReportType().equals("0")){
//品质报告单关联出货设备ID集合
List<String> uniqueDeviceIds = qualityOrderReportVO.getQualityReportDeviceIds();
for (String deviceId : uniqueDeviceIds) {
//保存品质报告单关联设备表
QualityReportDevice qualityReportDevice = new QualityReportDevice();
qualityReportDevice.setQualityOrderReportCode(qualityReportCode);
qualityReportDevice.setShippingDeviceId(deviceId);
qualityReportDeviceMapper.insertQualityReportDevice(qualityReportDevice);
//更新品质单关联设备表提交/审核状态
QualityShippingDevice shippingDevice = shippingDeviceMapper.selectQualityShippingDeviceByDeviceId(deviceId);
if (shippingDevice == null) {
throw new BusinessException(deviceId + "设备不存在于该品质单中");
}
shippingDevice.setQualityAuditStatus("3");//已提交
shippingDeviceMapper.updateQualityShippingDevice(shippingDevice);
//更新售后设备品质状态为待品质
AfterSalesShippingDevice afterSalesDevice = afterSalesDeviceMapper.selectAfterSalesShippingDeviceByShippingDeviceId(deviceId);
afterSalesDevice.setQualityStatus("1");//待品质
afterSalesDevice.setUpdateBy(ShiroUtils.getLoginName());
afterSalesDevice.setUpdateTime(DateUtils.getNowDate());
afterSalesDeviceMapper.updateAfterSalesShippingDevice(afterSalesDevice);
}
}
qualityOrderReportVO.setQualityHasqualifiedNum(qualifiedNum);
qualityOrderReportVO.setCheckNum(pendingReviewNum);
qualityOrderReportVO.setQualityOrderReportCode(qualityReportCode);
qualityOrderReportVO.setCreateBy(loginName);
qualityOrderReportVO.setCreateTime(DateUtils.getNowDate());
return qualityOrderReportMapper.insertQualityOrderReport(qualityOrderReportVO);
} }
/** /**
@ -94,120 +281,8 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public int updateQualityOrderReport(QualityOrderReport qualityOrderReport) public int updateQualityOrderReport(QualityOrderReport qualityOrderReport) {
{ return 0;
String loginName = ShiroUtils.getLoginName();
QualityOrderReportUnqualified tempOrderReportUnqualified = new QualityOrderReportUnqualified();
String materialNo = qualityOrderReport.getMaterialNo();
String supplierCode = qualityOrderReport.getSupplierCode();
String qualityOrderCode = qualityOrderReport.getQualityOrderCode();
tempOrderReportUnqualified.setMaterialNo(materialNo);
tempOrderReportUnqualified.setSupplierCode(supplierCode);
QualityOrderDetail tempQualityOrderDetail = new QualityOrderDetail();
tempQualityOrderDetail.setMaterialNo(materialNo);
tempQualityOrderDetail.setSupplierCode(supplierCode);
tempQualityOrderDetail.setQualityOrderCode(qualityOrderCode);
//从数据库查询品质报告详情数据
QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailByCodeAndNo(tempQualityOrderDetail);
//计算品质单详情中的品质合格数量
Integer okAcceptedNum = qualityOrderReport.getOkAcceptedNum();
Integer specialConcessionsNum = qualityOrderReport.getSpecialConcessionsNum();
//品质合格数
Integer qualityQualifiedNum = okAcceptedNum + specialConcessionsNum;
//后续要处理这个本次到货数
//本次到货数
// Integer thisArrivedNum = qualityOrderDetail.getThisArrivedNum();
// if (thisArrivedNum != null){
// if (qualityQualifiedNum>thisArrivedNum){
// throw new BusinessException("OK允收数和特采/让步数总和小于等于本次到货数");
// }
// }
//更新品质报告详情中的品质合格数的数据
qualityOrderDetail.setQualityQualifiedNum(qualityQualifiedNum);
//更新品质已合格数
qualityOrderDetail.setQualityHasqualifiedNum(qualityQualifiedNum);
//获得品质报告中的不合格数模块数据
List<QualityOrderReportUnqualified> unqualifiedDataList = qualityOrderReport.getUnqualifiedDataList();
/*如果进行品质的订单类型是采购或者委外*/
// if (qualityOrderDetail.getQualityOrderType().equals("0") || qualityOrderDetail.getQualityOrderType().equals("2")){
// /*有品质不合格,需要在退换货入库前退货进行记录*/
//
// String refundsExchangesCode = redisCache.generateBillNo("ZCGX");
// QualityRefundsExchanges qualityRefundsExchanges = new QualityRefundsExchanges();
// qualityRefundsExchanges.setRefundsExchangesCode(refundsExchangesCode);
// qualityRefundsExchanges.setRefundsExchangesStatus("0");
//
// for (QualityOrderReportUnqualified tempQualityOrderReportUnqualified : unqualifiedDataList) {
// QualityRefundsExchangesOrder qualityRefundsExchangesOrder = new QualityRefundsExchangesOrder();
// qualityRefundsExchangesOrder.setRefundsExchangesCode(refundsExchangesCode);
// qualityRefundsExchangesOrder.setOkReportUrl(qualityOrderReport.getOkReportUrl());
// qualityRefundsExchangesOrder.setOkAcceptedNum(qualityOrderReport.getOkAcceptedNum());
// qualityRefundsExchangesOrder.setSpecialReportUrl(qualityOrderReport.getSpecialReportUrl());
// qualityRefundsExchangesOrder.setSpecialConcessionsNum(qualityOrderReport.getSpecialConcessionsNum());
// qualityRefundsExchangesOrder.setMaterialNo(materialNo);
// qualityRefundsExchangesOrder.setMaterialName(qualityOrderReport.getMaterialName());
// qualityRefundsExchangesOrder.setMakeTotal(qualityOrderReport.getMakeTotal());
// qualityRefundsExchangesOrder.setQualityHasqualifiedNum(qualityOrderReport.getQualityHasqualifiedNum());
// qualityRefundsExchangesOrder.setProcessBadNum(tempQualityOrderReportUnqualified.getProcessBadNum());
// qualityRefundsExchangesOrder.setProcessBadClassification(tempQualityOrderReportUnqualified.getProcessBadClassification());
// qualityRefundsExchangesOrder.setProcessBadGrade(tempQualityOrderReportUnqualified.getProcessBadGrade());
// qualityRefundsExchangesOrder.setUpdateBy(loginName);
// qualityRefundsExchangesOrder.setUpdateTime(new Date());
// refundsExchangesOrderMapper.insertQualityRefundsExchangesOrder(qualityRefundsExchangesOrder);
// }
// }
//计算不良数量的合计值
int processBadNumTotal = 0;
if (!CollectionUtils.isEmpty(unqualifiedDataList)){
processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum();
}
//后续处理本次到货数
// if (processBadNumTotal>thisArrivedNum){
// throw new BusinessException("不良数量的总和小于等于本次到货数");
// }
//更新品质报告详情品质不合格数
qualityOrderDetail.setQualityUnqualifiedNum(processBadNumTotal);
qualityOrderDetail.setUpdateBy(loginName);
qualityOrderDetail.setUpdateTime(new Date());
//更新品质报告详情数据表
int updateQualityOrderDetailResult = orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail);
if (updateQualityOrderDetailResult <= 0){
throw new BusinessException("更新品质单详情数据失败");
}
List<QualityOrderReportUnqualified> qualityOrderReportUnqualifieds = unqualifiedMapper.selectQualityOrderReportUnqualifiedByCodeAndNo(tempOrderReportUnqualified);
if (StringUtils.isEmpty(qualityOrderReportUnqualifieds)){
//如果后端不合格数列表值为空,就新增一个
for (QualityOrderReportUnqualified tempQualityOrderReportUnqualified : unqualifiedDataList) {
QualityOrderReportUnqualified qualityOrderReportUnqualified = getQualityOrderReportUnqualified(materialNo, supplierCode, tempQualityOrderReportUnqualified);
qualityOrderReportUnqualified.setCreateBy(loginName);
qualityOrderReportUnqualified.setCreateTime(new Date());
unqualifiedMapper.insertQualityOrderReportUnqualified(qualityOrderReportUnqualified);
}
}else {
//如果后端不合格数列表值为不空,就更新
for (QualityOrderReportUnqualified tempQualityOrderReportUnqualified : unqualifiedDataList) {
QualityOrderReportUnqualified qualityOrderReportUnqualified = getQualityOrderReportUnqualified(materialNo, supplierCode, tempQualityOrderReportUnqualified);
qualityOrderReportUnqualified.setUpdateBy(loginName);
qualityOrderReportUnqualified.setUpdateTime(new Date());
unqualifiedMapper.updateQualityOrderReportUnqualified(qualityOrderReportUnqualified);
}
}
qualityOrderReport.setUpdateBy(loginName);
qualityOrderReport.setUpdateTime(new Date());
return qualityOrderReportMapper.updateQualityOrderReport(qualityOrderReport);
} }
//更新品质报告不合格数量模块的数据 //更新品质报告不合格数量模块的数据
@ -228,8 +303,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteQualityOrderReportByIds(String ids) public int deleteQualityOrderReportByIds(String ids) {
{
return qualityOrderReportMapper.deleteQualityOrderReportByIds(Convert.toStrArray(ids)); return qualityOrderReportMapper.deleteQualityOrderReportByIds(Convert.toStrArray(ids));
} }
@ -240,8 +314,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteQualityOrderReportById(Long qualityOrderReportId) public int deleteQualityOrderReportById(Long qualityOrderReportId) {
{
return qualityOrderReportMapper.deleteQualityOrderReportById(qualityOrderReportId); return qualityOrderReportMapper.deleteQualityOrderReportById(qualityOrderReportId);
} }
@ -252,8 +325,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int cancelQualityOrderReportById(Long qualityOrderReportId) public int cancelQualityOrderReportById(Long qualityOrderReportId) {
{
return qualityOrderReportMapper.cancelQualityOrderReportById(qualityOrderReportId); return qualityOrderReportMapper.cancelQualityOrderReportById(qualityOrderReportId);
} }
@ -264,21 +336,20 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int restoreQualityOrderReportById(Long qualityOrderReportId) public int restoreQualityOrderReportById(Long qualityOrderReportId) {
{
return qualityOrderReportMapper.restoreQualityOrderReportById(qualityOrderReportId); return qualityOrderReportMapper.restoreQualityOrderReportById(qualityOrderReportId);
} }
/*根据供应商ID和物料号以及品质单号查询品质报告*/ /*根据供应商ID和物料号以及品质单号查询品质报告*/
@Override @Override
public QualityOrderReport selectQualityOrderReportByNoAndCode(String materialNo, String supplierCode,String qualityOrderCode) { public QualityOrderReportVO selectQualityOrderReportByNoAndCode(String materialNo, String supplierCode, String qualityOrderCode) {
QualityOrderReport tempQualityOrderReport = new QualityOrderReport(); QualityOrderReportVO tempQualityOrderReport = new QualityOrderReportVO();
tempQualityOrderReport.setMaterialNo(materialNo); tempQualityOrderReport.setMaterialNo(materialNo);
tempQualityOrderReport.setSupplierCode(supplierCode); tempQualityOrderReport.setSupplierCode(supplierCode);
tempQualityOrderReport.setQualityOrderCode(qualityOrderCode); tempQualityOrderReport.setQualityOrderCode(qualityOrderCode);
QualityOrderReport qualityOrderReport = qualityOrderReportMapper.selectQualityOrderReportByNoAndCode(tempQualityOrderReport); QualityOrderReportVO qualityOrderReportVO = qualityOrderReportMapper.selectQualityOrderReportByNoAndCode(tempQualityOrderReport);
return qualityOrderReport; return qualityOrderReportVO;
} }
/* /*
@ -286,10 +357,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
* */ * */
@Override @Override
public QualityOrderReport selectMakeInOrderReportByNoAndCode(String materialNo, String qualityOrderCode) { public QualityOrderReport selectMakeInOrderReportByNoAndCode(String materialNo, String qualityOrderCode) {
QualityOrderReport tempQualityOrderReport = new QualityOrderReport(); QualityOrderReport qualityOrderReport = new QualityOrderReport();
tempQualityOrderReport.setMaterialNo(materialNo);
tempQualityOrderReport.setQualityOrderCode(qualityOrderCode);
QualityOrderReport qualityOrderReport = qualityOrderReportMapper.selectMakeInOrderReportByNoAndCode(tempQualityOrderReport);
return qualityOrderReport; return qualityOrderReport;
} }
@ -300,101 +368,318 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public int updateMakeInOrderReport(QualityOrderReport qualityOrderReport) { public int updateMakeInOrderReport(QualityOrderReport qualityOrderReport) {
return 0;
}
String loginName = ShiroUtils.getLoginName(); /**
* 修改保存品质报告按钮
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateMakeOrderQualityReport(QualityOrderReportVO qualityOrderReportVO) {
qualityOrderReportVO.setUpdateBy(ShiroUtils.getLoginName());
qualityOrderReportVO.setUpdateTime(DateUtils.getNowDate());
return qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReportVO);
}
String materialNo = qualityOrderReport.getMaterialNo(); /**
String qualityOrderCode = qualityOrderReport.getQualityOrderCode(); * 审批流程启动
*/
QualityOrderDetail tempQualityOrderDetail = new QualityOrderDetail(); @Override
tempQualityOrderDetail.setMaterialNo(materialNo); public ProcessInstance submitApply(QualityOrderReportVO qualityOrderReportVO) {
tempQualityOrderDetail.setQualityOrderCode(qualityOrderCode); SysUser user = ShiroUtils.getSysUser();
qualityOrderReportVO.setApplyUser(user.getLoginName());
//从数据库查询品质报告详情数据 qualityOrderReportVO.setApplyTime(DateUtils.getNowDate());
QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectMakeInOrderDetailByCodeAndNo(tempQualityOrderDetail); // 保存
//计算品质单详情中的品质合格数量 insertMakeQualityOrderReport(qualityOrderReportVO);
Integer okAcceptedNum = qualityOrderReport.getOkAcceptedNum(); // 启动流程
Integer specialConcessionsNum = qualityOrderReport.getSpecialConcessionsNum(); String applyTitle = user.getUserName() + "发起了品质报告单提交审批-" + DateUtils.dateTimeNow();
//品质合格数 String instanceType = "submit";
Integer qualityQualifiedNum = okAcceptedNum + specialConcessionsNum; ProcessInstance processInstance = startProcessInstance(applyTitle, instanceType, qualityOrderReportVO, user);
//后续要处理这个本次到货数 String processInstanceId = processInstance.getProcessInstanceId();
//本次到货数 // 提交实例id
// Integer thisArrivedNum = qualityOrderDetail.getThisArrivedNum(); qualityOrderReportVO.setSubmitInstanceId(processInstanceId);
// if (thisArrivedNum != null){ // 存在提交完就流程结束的情况
// if (qualityQualifiedNum>thisArrivedNum){ boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
// throw new BusinessException("OK允收数和特采/让步数总和小于等于本次到货数"); if (processIsFinish) {
// } // 审核状态-审核通过
// } qualityOrderReportVO.setAuditStatus("1");
//更新品质报告详情中的品质合格数的数据 String materialNo = qualityOrderReportVO.getMaterialNo();
qualityOrderDetail.setQualityQualifiedNum(qualityQualifiedNum); //成品品质
//更新品质已合格数 if(materialNo.startsWith("8")){
qualityOrderDetail.setQualityHasqualifiedNum(qualityQualifiedNum); updateApprovedInfo(qualityOrderReportVO);
//获得品质报告中的不合格数模块数据 }
List<QualityOrderReportUnqualified> unqualifiedDataList = qualityOrderReport.getUnqualifiedDataList(); }
// if (CollectionUtils.isEmpty(unqualifiedDataList)){ qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReportVO);
// throw new BusinessException("品质单不合格数数据为空"); return processInstance;
// }
int processBadNumTotal = 0;
if (!CollectionUtils.isEmpty(unqualifiedDataList)){
//计算不良数量的合计值
processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum();
}
//更新品质报告详情品质不合格数
qualityOrderDetail.setQualityUnqualifiedNum(processBadNumTotal);
qualityOrderDetail.setUpdateBy(loginName);
qualityOrderDetail.setUpdateTime(new Date());
//更新品质报告详情数据表
int updateQualityOrderDetailResult = orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail);
if (updateQualityOrderDetailResult <= 0){
throw new BusinessException("更新品质单详情数据失败");
} }
/**
* 创建品质报告审核流程
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, QualityOrderReportVO qualityOrderReportVO, SysUser user) {
Long reportId = qualityOrderReportVO.getQualityOrderReportId();
String businessKey = reportId.toString(); // 实体类 ID,作为流程的业务 key
String key = "qualityOrderReport";
Map<String, Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
qualityOrderReportVO.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, qualityOrderReportVO.getQualityOrderReportCode(), key, variables);
String processInstanceId = processInstance.getId();
qualityOrderReportVO.setInstanceId(processInstanceId); // 建立双向关系
qualityOrderReportVO.setInstanceType(instanceType);
return processInstance;
}
//生成品质报告不合格数 /**
for (QualityOrderReportUnqualified qualityOrderReportUnqualified : unqualifiedDataList) { * 发起人节点判断
qualityOrderReportUnqualified.setQualityOrderReportId(qualityOrderReport.getQualityOrderReportId()); */
qualityOrderReportUnqualified.setCreateBy(loginName); private void buildAuthority(SysUser user, Map<String, Object> variables) {
qualityOrderReportUnqualified.setCreateTime(new Date()); Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
qualityOrderReportUnqualified.setMaterialNo(qualityOrderReport.getMaterialNo()); if (roleKeys.contains("pzwyRole")) {
qualityOrderReportUnqualified.setMaterialName(qualityOrderReport.getMaterialName()); variables.put("authority", 1);
int insertUnqualifiedResult = unqualifiedMapper.insertQualityOrderReportUnqualified(qualityOrderReportUnqualified); }
if (insertUnqualifiedResult <= 0){ if (roleKeys.contains("pzjlRole") || roleKeys.contains("admin")) {
throw new BusinessException("新增品质报告不合格数数据失败"); variables.put("authority", 2);
} }
} }
qualityOrderReport.setUpdateBy(loginName); /*
qualityOrderReport.setUpdateTime(new Date()); * 审核通过后更新数据(生产入库成品品质)
return qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReport); * 成品品质更新品质单表品质单详情表品质单关联设备表售后设备表生产订单生产订单bom已完成数和状态新增入库单入库单详情
* 半成品其他品质更新品质单表品质单详情表生产订单生产订单bom已完成数和状态新增入库单入库单详情*/
@Override
public void updateApprovedInfo(QualityOrderReportVO qualityOrderReportVO) {
String quaoityOrderCode = qualityOrderReportVO.getQualityOrderCode();
String materialNo = qualityOrderReportVO.getMaterialNo();
String makeNo = qualityOrderReportVO.getRelatedOrderCode();
String loginName = ShiroUtils.getLoginName();
int qualifiedNum = qualityOrderReportVO.getQualityHasqualifiedNum();
int unQualifiedNum = qualityOrderReportVO.getProcessBadNum();
int checkNum = qualityOrderReportVO.getCheckNum();
/**
更新品质单详情合格数不良数
*/
QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailByCode(quaoityOrderCode);
qualityOrderDetail.setQualityQualifiedNum(qualifiedNum);
qualityOrderDetail.setQualityUnqualifiedNum(unQualifiedNum);
//更新待审核数
int detailPendingReviewNum = qualityOrderDetail.getPendingReviewNum();
detailPendingReviewNum = detailPendingReviewNum - checkNum;
qualityOrderDetail.setPendingReviewNum(detailPendingReviewNum);
qualityOrderDetail.setUpdateBy(loginName);
qualityOrderDetail.setUpdateTime(DateUtils.getNowDate());
orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail);
/**
更新品质单合格数不良数*/
QualityOrder qualityOrder = qualityOrderMapper.selectQualityOrderByCode(quaoityOrderCode);
qualityOrder.setQualityQualifiedNum(qualifiedNum);
qualityOrder.setQualityUnqualifiedNum(unQualifiedNum);
//更新待审核数
int orderPendingReviewNum = qualityOrder.getPendingReviewNum();
orderPendingReviewNum = orderPendingReviewNum - checkNum;
qualityOrder.setPendingReviewNum(orderPendingReviewNum);
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(DateUtils.getNowDate());
int orderQualifiedNum = qualityOrder.getQualityQualifiedNum();
int orderUnqualifiedNum = qualityOrder.getQualityUnqualifiedNum();
int orderCheckNum = qualityOrder.getThisArrivedNum();
if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum < orderCheckNum){
qualityOrder.setQualityStatus("1");//部分品质
}
if(orderQualifiedNum + orderUnqualifiedNum + orderPendingReviewNum == orderCheckNum){
qualityOrder.setQualityStatus("2");//全部品质
}
qualityOrderMapper.updateQualityOrder(qualityOrder);
/*
* 更新设备状态*/
List<String> deviceIds = qualityOrderReportVO.getQualityReportDeviceIds();
if (StringUtils.isNotEmpty(deviceIds)) {
for (String deviceId : deviceIds) {
//更新品质单关联设备状态
QualityShippingDevice shippingDevice = shippingDeviceMapper.selectQualityShippingDeviceByDeviceId(deviceId);
shippingDevice.setQualityAuditStatus("1");//审核通过
shippingDevice.setQualityStatus("3");//品质不合格(审核通过)
shippingDevice.setUpdateBy(loginName);
shippingDevice.setUpdateTime(DateUtils.getNowDate());
shippingDeviceMapper.updateQualityShippingDevice(shippingDevice);
//更新售后出货设备状态
AfterSalesShippingDevice afterSalesDevice = afterSalesDeviceMapper.selectAfterSalesShippingDeviceByShippingDeviceId(deviceId);
afterSalesDevice.setQualityStatus("3");//品质不合格(审核通过)
afterSalesDevice.setUpdateBy(loginName);
afterSalesDevice.setUpdateTime(DateUtils.getNowDate());
afterSalesDeviceMapper.updateAfterSalesShippingDevice(afterSalesDevice);
}
}
//更新生产订单bom已完成数
SysMakeorderBom tempBom = new SysMakeorderBom();
tempBom.setMakeNo(makeNo);
tempBom.setMaterialNo(materialNo);
SysMakeorderBom makeorderBom = makeorderBomMapper.selectSysMakeorderBomByNo(tempBom);
if(makeorderBom == null){
throw new BusinessException("关联生产单bom为空!请检查");
}
int bomFinishNum = makeorderBom.getFinishNum();
bomFinishNum = bomFinishNum + qualifiedNum;
makeorderBom.setFinishNum(bomFinishNum);
makeorderBomMapper.updateSysMakeorderBom(makeorderBom);
//更新生产订单已完成数
SysMakeOrder makeOrder = makeOrderMapper.selectMakeOrderByMakeNo(makeNo);
if(makeOrder == null){
throw new BusinessException("关联生产订单不存在!请检查");
}
int makeOrderFinishNum = makeOrder.getFinishNum();
int makeOrderNum = makeOrder.getMaterialSum();
makeOrderFinishNum = makeOrderFinishNum + qualifiedNum;
makeOrder.setFinishNum(makeOrderFinishNum);
//订单数>完成数,部分完成,部分品质
if(makeOrderNum > makeOrderFinishNum){
makeOrder.setMakeStatus("5");
makeOrder.setQualityStatus("1");
}
//订单数=完成数,全部完成,全部品质
if(makeOrderNum == makeOrderFinishNum){
makeOrder.setMakeStatus("6");
makeOrder.setQualityStatus("2");
}
makeOrder.setUpdateBy(ShiroUtils.getLoginName());
makeOrder.setUpdateTime(DateUtils.getNowDate());
makeOrderMapper.updateSysMakeOrder(makeOrder);
//合格数大于0生成入库单
if (qualifiedNum > 0) {
String storageOrderCode = redisCache.generateBillNo("RK");
WarehouseStorageOrderDetail storageOrderDetail = generateWarehouseDetail(storageOrderCode,qualityOrderReportVO,qualityOrderDetail);
storageOrderDetail.setWarehouseStorageStatus("2");//待入库
storageOrderDetail.setWarehouseQualityStatus("2");//全部品质
storageOrderDetail.setWarehouseStorageType("5");//生产入库
storageOrderDetail.setWarehouseOrderType("1");//生产订单
storageOrderDetail.setWarehouseDeptType("0");//入库部门:仓库
int detailResult = storageDetailMapper.insertWarehouseStorageOrderDetail(storageOrderDetail);
if(detailResult<=0){
throw new BusinessException("新增入库单详情失败");
}
WarehouseStorageOrder storageOrder = generateWarehouseStorageOrderByMakeOrder(storageOrderCode,qualityOrderReportVO);
storageOrder.setWarehouseStorageStatus("2");//待入库
storageOrder.setWarehouseQualityStatus("2");//全部品质
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("新增入库单失败");
}
//更新品质报告单入库单号
qualityOrderReportVO.setInStorageCode(storageOrderCode);
qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReportVO);
}
} }
/*
* 审核拒绝后更新数据(生产入库成品品质)
* 更新品质单表品质单详情表品质单关联设备表售后设备表*/
@Override
public void updateDisApprovedInfo(QualityOrderReportVO qualityOrderReportVO) {
String quaoityOrderCode = qualityOrderReportVO.getQualityOrderCode();
String materialNo = qualityOrderReportVO.getMaterialNo();
String makeNo = qualityOrderReportVO.getRelatedOrderCode();
String loginName = ShiroUtils.getLoginName();
int checkNum = qualityOrderReportVO.getCheckNum();
/** /**
*退换货单号生产规则 更新品质单详情待审核数
*系统自动生成按照特定编码编码暂用THH+年月日+001
*自增长:THH20231111001THH20231111002
*
*/ */
QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailByCode(quaoityOrderCode);
int detailPendingReviewNum = qualityOrderDetail.getPendingReviewNum();
detailPendingReviewNum = detailPendingReviewNum - checkNum;
qualityOrderDetail.setPendingReviewNum(detailPendingReviewNum);
qualityOrderDetail.setUpdateBy(loginName);
qualityOrderDetail.setUpdateTime(DateUtils.getNowDate());
orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail);
/**
更新品质单待审核数*/
QualityOrder qualityOrder = qualityOrderMapper.selectQualityOrderByCode(quaoityOrderCode);
int orderPendingReviewNum = qualityOrder.getPendingReviewNum();
orderPendingReviewNum = orderPendingReviewNum - checkNum;
qualityOrder.setPendingReviewNum(orderPendingReviewNum);
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(DateUtils.getNowDate());
qualityOrderMapper.updateQualityOrder(qualityOrder);
private String generateNewCode(String prefix, String maxCode) {
if (StringUtils.isEmpty(maxCode)){
return prefix+"001";
}
//解析并递增编号
int sequence = Integer.parseInt(maxCode.substring(4)) + 1 ;
//检查序列号是否溢出 /*
if (sequence > 999){ * 更新设备状态(成品品质时才存在)*/
throw new BusinessException("当日编号已达到最大值999,请检查或调整策略"); List<String> deviceIds = qualityOrderReportVO.getQualityReportDeviceIds();
if (StringUtils.isNotEmpty(deviceIds)) {
for (String deviceId : deviceIds) {
//更新品质单关联设备状态
QualityShippingDevice shippingDevice = shippingDeviceMapper.selectQualityShippingDeviceByDeviceId(deviceId);
shippingDevice.setQualityAuditStatus("2");//审核拒绝
shippingDevice.setQualityStatus("1");//待品质
shippingDevice.setUpdateBy(loginName);
shippingDevice.setUpdateTime(DateUtils.getNowDate());
shippingDeviceMapper.updateQualityShippingDevice(shippingDevice);
//更新售后出货设备状态
AfterSalesShippingDevice afterSalesDevice = afterSalesDeviceMapper.selectAfterSalesShippingDeviceByShippingDeviceId(deviceId);
afterSalesDevice.setQualityStatus("1");//待品质
afterSalesDevice.setUpdateBy(loginName);
afterSalesDevice.setUpdateTime(DateUtils.getNowDate());
afterSalesDeviceMapper.updateAfterSalesShippingDevice(afterSalesDevice);
}
}
} }
//格式化序列号,自动补零至三位 //根据品质报告生成入库单
DecimalFormat df = new DecimalFormat("000"); public WarehouseStorageOrder generateWarehouseStorageOrderByMakeOrder(String storageOrderCode,QualityOrderReportVO qualityReportVO){
WarehouseStorageOrder storageOrder = new WarehouseStorageOrder();
storageOrder.setWarehouseStorageCode(storageOrderCode);
storageOrder.setRelatedOrderCode(qualityReportVO.getRelatedOrderCode());
storageOrder.setNotifyArrivedNum(qualityReportVO.getQualityHasqualifiedNum());
storageOrder.setQualityQualifiedNum(qualityReportVO.getQualityHasqualifiedNum());
storageOrder.setQualityUnqualifiedNum(qualityReportVO.getProcessBadNum());
storageOrder.setDeliveryInspectionTime(qualityReportVO.getDeliveryInspectionTime());
storageOrder.setQualityTime(qualityReportVO.getCheckoutCompletionTime());
storageOrder.setArrivedTime(DateUtils.getNowDate());
storageOrder.setCreateBy(ShiroUtils.getLoginName());
storageOrder.setCreateTime(DateUtils.getNowDate());
return storageOrder;
}
return prefix + df.format(sequence); //根据品质报告、品质单详情生成入库单详情
public WarehouseStorageOrderDetail generateWarehouseDetail(String storageOrderCode,QualityOrderReportVO reportVO,QualityOrderDetail qualityOrderDetail){
WarehouseStorageOrderDetail storageOrderDetail = new WarehouseStorageOrderDetail();
storageOrderDetail.setWarehouseStorageCode(storageOrderCode);
storageOrderDetail.setRelatedOrderCode(reportVO.getRelatedOrderCode());
storageOrderDetail.setNotifyArriveNum(reportVO.getQualityHasqualifiedNum());
storageOrderDetail.setNotifyHasArrivedNum(reportVO.getQualityHasqualifiedNum());
storageOrderDetail.setQualityQualifiedNum(reportVO.getQualityHasqualifiedNum());
storageOrderDetail.setQualityHasQualifiedNum(reportVO.getQualityHasqualifiedNum());
storageOrderDetail.setDeliveryInspectionTime(reportVO.getDeliveryInspectionTime());
storageOrderDetail.setQualityTime(reportVO.getCheckoutCompletionTime());
storageOrderDetail.setMaterialNo(reportVO.getMaterialNo());
storageOrderDetail.setMaterialName(reportVO.getMaterialName());
storageOrderDetail.setMaterialType(qualityOrderDetail.getMaterialType());
storageOrderDetail.setMaterialUnit(qualityOrderDetail.getMaterialUnit());
storageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand());
storageOrderDetail.setMaterialPhotourl(qualityOrderDetail.getMaterialPhotourl());
storageOrderDetail.setMaterialDescribe(qualityOrderDetail.getMaterialDescribe());
storageOrderDetail.setMaterialModel(qualityOrderDetail.getMaterialModel());
storageOrderDetail.setMaterialProcessMethod(qualityOrderDetail.getMaterialProcessMethod());
storageOrderDetail.setMaterialDeptType(qualityOrderDetail.getMaterialDeptType());
storageOrderDetail.setMakeTotal(qualityOrderDetail.getMakeTotal());
storageOrderDetail.setArrivedTime(DateUtils.getNowDate());
storageOrderDetail.setCreateBy(ShiroUtils.getLoginName());
storageOrderDetail.setCreateTime(DateUtils.getNowDate());
return storageOrderDetail;
} }
} }

53
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -821,7 +821,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
tempDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo()); tempDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo());
QualityOrderDetail qualityOrderDetail = qualityOrderDetailMapper.selectQualityOrderDetailByStorageCodeAndno(tempDetail); QualityOrderDetail qualityOrderDetail = qualityOrderDetailMapper.selectQualityOrderDetailByStorageCodeAndno(tempDetail);
Integer actualArriveNum = qualityOrderDetail.getActualArriveNum(); Integer actualArriveNum = qualityOrderDetail.getCheckNum();
Integer qualityUnqualifiedNum = qualityOrderDetail.getQualityUnqualifiedNum(); Integer qualityUnqualifiedNum = qualityOrderDetail.getQualityUnqualifiedNum();
historicalTotal = BigDecimal.valueOf(actualArriveNum) historicalTotal = BigDecimal.valueOf(actualArriveNum)
@ -923,54 +923,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
* */ * */
@Override @Override
public int insertWarehouseStorageOrderByMakeInQualityOrder(QualityOrder tempQualityOrder, List<QualityOrderDetail> qualityOrderDetailList) { public int insertWarehouseStorageOrderByMakeInQualityOrder(QualityOrder tempQualityOrder, List<QualityOrderDetail> qualityOrderDetailList) {
WarehouseStorageOrder warehouseStorageOrder = new WarehouseStorageOrder(); return 0;
String loginName = ShiroUtils.getLoginName();
warehouseStorageOrder.setWarehouseStorageCode(tempQualityOrder.getWarehouseCode());
warehouseStorageOrder.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode());
//暂收设置为全部品质
warehouseStorageOrder.setWarehouseQualityStatus("2");
warehouseStorageOrder.setWarehouseStorageStatus("2");
warehouseStorageOrder.setWarehouseStorageType("2");
warehouseStorageOrder.setWarehouseOrderType("1");
warehouseStorageOrder.setDeliveryInspectionTime(tempQualityOrder.getDeliveryInspectionTime());
warehouseStorageOrder.setQualityUnqualifiedNum(tempQualityOrder.getQualityUnqualifiedNum());
warehouseStorageOrder.setQualityQualifiedNum(tempQualityOrder.getQualityQualifiedNum());
warehouseStorageOrder.setCreateBy(loginName);
warehouseStorageOrder.setQualityTime(DateUtils.getNowDate());
warehouseStorageOrder.setCreateTime(DateUtils.getNowDate());
//设置委内完成数总价
warehouseStorageOrder.setMakeInTotalPrice(tempQualityOrder.getMakeInTotalPrice());
//插入入库单详情数据
for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) {
WarehouseStorageOrderDetail warehouseStorageOrderDetail = new WarehouseStorageOrderDetail();
warehouseStorageOrderDetail.setWarehouseStorageCode(tempQualityOrder.getWarehouseCode());
warehouseStorageOrderDetail.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode());
warehouseStorageOrderDetail.setWarehouseQualityStatus("2");
warehouseStorageOrderDetail.setWarehouseStorageStatus("2");
warehouseStorageOrderDetail.setWarehouseStorageType("2");
warehouseStorageOrderDetail.setWarehouseOrderType("1");
//当作委内入库数
warehouseStorageOrderDetail.setMakeStorageNum(qualityOrderDetail.getMakeInNum());
//设置委内加工费单价
warehouseStorageOrderDetail.setMakeInUnitPrice(qualityOrderDetail.getMakeInUnitPrice());
//设置品质已合格数
warehouseStorageOrderDetail.setQualityHasQualifiedNum(qualityOrderDetail.getQualityQualifiedNum());
warehouseStorageOrderDetail.setMaterialNo(qualityOrderDetail.getMaterialNo());
warehouseStorageOrderDetail.setMaterialName(qualityOrderDetail.getMaterialName());
warehouseStorageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand());
warehouseStorageOrderDetail.setMaterialDescribe(qualityOrderDetail.getMaterialDescribe());
warehouseStorageOrderDetail.setMaterialPhotourl(qualityOrderDetail.getMaterialPhotourl());
warehouseStorageOrderDetail.setMaterialProcessMethod(qualityOrderDetail.getMaterialProcessMethod());
warehouseStorageOrderDetail.setMaterialType(qualityOrderDetail.getMaterialType());
warehouseStorageOrderDetail.setMaterialUnit(qualityOrderDetail.getMaterialUnit());
warehouseStorageOrderDetail.setCreateBy(loginName);
warehouseStorageOrderDetail.setCreateTime(DateUtils.getNowDate());
storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail);
}
return warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder);
} }
/* /*
@ -1321,7 +1274,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
//更新生产订单的数据 //更新生产订单的数据
SysMakeOrder tempSysMakeOrder = sysMakeOrderMapper.selectMakeOrderByMakeNo(warehouseStorageOrder.getRelatedOrderCode()); SysMakeOrder tempSysMakeOrder = sysMakeOrderMapper.selectMakeOrderByMakeNo(warehouseStorageOrder.getRelatedOrderCode());
tempSysMakeOrder.setEceiptNum(Long.valueOf(storageNum)); tempSysMakeOrder.setEceiptNum(storageNum);
//设置生产状态为全部完成 //设置生产状态为全部完成
tempSysMakeOrder.setMakeStatus("6"); tempSysMakeOrder.setMakeStatus("6");
int updateMakeOrderResult = sysMakeOrderService.updateByMakeNo(tempSysMakeOrder); int updateMakeOrderResult = sysMakeOrderService.updateByMakeNo(tempSysMakeOrder);

37
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml

@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialType" column="material_type" /> <result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" /> <result property="materialPhotourl" column="material_photoUrl" />
<result property="materialModel" column="material_model" />
<result property="materialBrand" column="material_brand" /> <result property="materialBrand" column="material_brand" />
<result property="materialUnit" column="material_unit" /> <result property="materialUnit" column="material_unit" />
<result property="materialDescribe" column="material_describe" /> <result property="materialDescribe" column="material_describe" />
@ -31,18 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialDeptType" column="material_dept_type"/> <result property="materialDeptType" column="material_dept_type"/>
<result property="makeTotal" column="make_total" /> <result property="makeTotal" column="make_total" />
<result property="makeCompletionNum" column="make_completion_num" /> <result property="makeCompletionNum" column="make_completion_num" />
<result property="actualArriveNum" column="actual_arrive_num" />
<result property="thisArrivedNum" column="this_arrived_num" />
<result property="qualityHasqualifiedNum" column="quality_hasqualified_num" /> <result property="qualityHasqualifiedNum" column="quality_hasqualified_num" />
<result property="qualityQualifiedNum" column="quality_qualified_num" /> <result property="qualityQualifiedNum" column="quality_qualified_num" />
<result property="qualityUnqualifiedNum" column="quality_unqualified_num" /> <result property="qualityUnqualifiedNum" column="quality_unqualified_num" />
<result property="makeInNum" column="make_in_num" />
<result property="makeInUnitPrice" column="make_in_unit_price" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="checkNum" column="check_num" />
<result property="pendingReviewNum" column="pending_review_num" />
</resultMap> </resultMap>
<sql id="selectQualityOrderDetailVo"> <sql id="selectQualityOrderDetailVo">
@ -65,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
material_name, material_name,
material_type, material_type,
material_photoUrl, material_photoUrl,
material_model,
material_brand, material_brand,
material_unit, material_unit,
material_describe, material_describe,
@ -72,18 +72,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
material_dept_type, material_dept_type,
make_total, make_total,
make_completion_num, make_completion_num,
actual_arrive_num,
this_arrived_num,
quality_hasqualified_num, quality_hasqualified_num,
quality_qualified_num, quality_qualified_num,
quality_unqualified_num, quality_unqualified_num,
make_in_num,
make_in_unit_price,
remark, remark,
create_by, create_by,
create_time, create_time,
update_by, update_by,
update_time update_time,
check_num,
pending_review_num
from quality_order_detail from quality_order_detail
</sql> </sql>
@ -150,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if> <if test="materialType != null">material_type,</if>
<if test="materialPhotourl != null">material_photoUrl,</if> <if test="materialPhotourl != null">material_photoUrl,</if>
<if test="materialModel != null">material_model,</if>
<if test="materialBrand != null">material_brand,</if> <if test="materialBrand != null">material_brand,</if>
<if test="materialUnit != null">material_unit,</if> <if test="materialUnit != null">material_unit,</if>
<if test="materialDescribe != null">material_describe,</if> <if test="materialDescribe != null">material_describe,</if>
@ -157,18 +156,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialDeptType">material_dept_type,</if> <if test="materialDeptType">material_dept_type,</if>
<if test="makeTotal != null">make_total,</if> <if test="makeTotal != null">make_total,</if>
<if test="makeCompletionNum != null">make_completion_num,</if> <if test="makeCompletionNum != null">make_completion_num,</if>
<if test="actualArriveNum != null">actual_arrive_num,</if>
<if test="thisArrivedNum != null">this_arrived_num,</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num,</if> <if test="qualityHasqualifiedNum != null">quality_hasqualified_num,</if>
<if test="qualityQualifiedNum != null">quality_qualified_num,</if> <if test="qualityQualifiedNum != null">quality_qualified_num,</if>
<if test="qualityUnqualifiedNum != null">quality_unqualified_num,</if> <if test="qualityUnqualifiedNum != null">quality_unqualified_num,</if>
<if test="makeInNum != null">make_in_num,</if>
<if test="makeInUnitPrice != null">make_in_unit_price,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="checkNum != null">check_num,</if>
<if test="pendingReviewNum != null">pending_review_num,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="qualityOrderCode != null">#{qualityOrderCode},</if> <if test="qualityOrderCode != null">#{qualityOrderCode},</if>
@ -189,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if> <if test="materialType != null">#{materialType},</if>
<if test="materialPhotourl != null">#{materialPhotourl},</if> <if test="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialModel != null">#{materialModel},</if>
<if test="materialBrand != null">#{materialBrand},</if> <if test="materialBrand != null">#{materialBrand},</if>
<if test="materialUnit != null">#{materialUnit},</if> <if test="materialUnit != null">#{materialUnit},</if>
<if test="materialDescribe != null">#{materialDescribe},</if> <if test="materialDescribe != null">#{materialDescribe},</if>
@ -196,18 +194,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialDeptType">#{materialDeptType},</if> <if test="materialDeptType">#{materialDeptType},</if>
<if test="makeTotal != null">#{makeTotal},</if> <if test="makeTotal != null">#{makeTotal},</if>
<if test="makeCompletionNum != null">#{makeCompletionNum},</if> <if test="makeCompletionNum != null">#{makeCompletionNum},</if>
<if test="actualArriveNum != null">#{actualArriveNum},</if>
<if test="thisArrivedNum != null">#{thisArrivedNum},</if>
<if test="qualityHasqualifiedNum != null">#{qualityHasqualifiedNum},</if> <if test="qualityHasqualifiedNum != null">#{qualityHasqualifiedNum},</if>
<if test="qualityQualifiedNum != null">#{qualityQualifiedNum},</if> <if test="qualityQualifiedNum != null">#{qualityQualifiedNum},</if>
<if test="qualityUnqualifiedNum != null">#{qualityUnqualifiedNum},</if> <if test="qualityUnqualifiedNum != null">#{qualityUnqualifiedNum},</if>
<if test="makeInNum != null">#{makeInNum},</if>
<if test="makeInUnitPrice != null">#{makeInUnitPrice},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="checkNum != null">#{checkNum},</if>
<if test="pendingReviewNum != null">#{pendingReviewNum},</if>
</trim> </trim>
</insert> </insert>
@ -232,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if> <if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if>
<if test="materialModel != null">material_model = #{materialModel},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if> <if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if> <if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if> <if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
@ -239,18 +236,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialDeptType != null">material_dept_type = #{materialDeptType},</if> <if test="materialDeptType != null">material_dept_type = #{materialDeptType},</if>
<if test="makeTotal != null">make_total = #{makeTotal},</if> <if test="makeTotal != null">make_total = #{makeTotal},</if>
<if test="makeCompletionNum != null">make_completion_num = #{makeCompletionNum},</if> <if test="makeCompletionNum != null">make_completion_num = #{makeCompletionNum},</if>
<if test="actualArriveNum != null">actual_arrive_num = #{actualArriveNum},</if>
<if test="thisArrivedNum != null">this_arrived_num = #{thisArrivedNum},</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if> <if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if>
<if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if> <if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if>
<if test="qualityUnqualifiedNum != null">quality_unqualified_num = #{qualityUnqualifiedNum},</if> <if test="qualityUnqualifiedNum != null">quality_unqualified_num = #{qualityUnqualifiedNum},</if>
<if test="makeInNum != null">make_in_num = #{makeInNum},</if>
<if test="makeInUnitPrice != null">make_in_unit_price= #{makeInUnitPrice},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="checkNum != null">check_num = #{checkNum},</if>
<if test="pendingReviewNum != null">pending_review_num = #{pendingReviewNum},</if>
</trim> </trim>
where quality_order_detail_id = #{qualityOrderDetailId} where quality_order_detail_id = #{qualityOrderDetailId}
</update> </update>

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

@ -16,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qualityQualifiedNum" column="quality_qualified_num" /> <result property="qualityQualifiedNum" column="quality_qualified_num" />
<result property="qualityUnqualifiedNum" column="quality_unqualified_num" /> <result property="qualityUnqualifiedNum" column="quality_unqualified_num" />
<result property="storageNum" column="storage_num" /> <result property="storageNum" column="storage_num" />
<result property="makeInTotalPrice" column="make_in_total_price" /> <!-- <result property="makeInTotalPrice" column="make_in_total_price" />-->
<result property="deliveryInspectionTime" column="delivery_inspection_time" /> <result property="deliveryInspectionTime" column="delivery_inspection_time" />
<result property="qualityEmployee" column="quality_employee" /> <result property="qualityEmployee" column="quality_employee" />
<result property="warehouseCode" column="warehouse_code" /> <result property="warehouseCode" column="warehouse_code" />
@ -26,6 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="pendingReviewNum" column="pending_review_num" />
</resultMap> </resultMap>
<sql id="selectQualityOrderVo"> <sql id="selectQualityOrderVo">
@ -48,7 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time, create_time,
update_by, update_by,
update_time, update_time,
make_in_total_price material_no,
material_name,
pending_review_num
from quality_order from quality_order
</sql> </sql>
@ -100,7 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qo.create_time, qo.create_time,
qo.update_by, qo.update_by,
qo.update_time, qo.update_time,
qo.make_in_total_price, qo.material_no,
qo.material_name,
qo.pending_review_num,
wso.storage_num wso.storage_num
from quality_order qo from quality_order qo
left join warehouse_storage_order wso on wso.related_order_code = qo.related_order_code left join warehouse_storage_order wso on wso.related_order_code = qo.related_order_code
@ -114,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityStorageStatus != null and qualityStorageStatus != ''"> and qo.quality_storage_status = #{qualityStorageStatus}</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="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> <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') and (qo.quality_storage_status = '4')
</where> </where>
order by qo.create_time desc order by qo.create_time desc
</select> </select>
@ -142,6 +149,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="pendingReviewNum != null">pending_review_num,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="qualityOrderCode != null">#{qualityOrderCode},</if> <if test="qualityOrderCode != null">#{qualityOrderCode},</if>
@ -163,6 +173,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="pendingReviewNum != null">#{pendingReviewNum},</if>
</trim> </trim>
</insert> </insert>
@ -188,6 +201,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="pendingReviewNum != null">pending_review_num = #{pendingReviewNum},</if>
</trim> </trim>
where quality_order_id = #{qualityOrderId} where quality_order_id = #{qualityOrderId}
</update> </update>

200
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml

@ -4,41 +4,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quality.mapper.QualityOrderReportMapper"> <mapper namespace="com.ruoyi.quality.mapper.QualityOrderReportMapper">
<resultMap type="QualityOrderReport" id="QualityOrderReportResult"> <resultMap type="QualityOrderReportVO" id="QualityOrderReportResult">
<result property="qualityOrderReportId" column="quality_order_report_id" /> <result property="qualityOrderReportId" column="quality_order_report_id"/>
<result property="qualityOrderCode" column="quality_order_code" /> <result property="supplierCode" column="supplier_code"/>
<result property="supplierCode" column="supplier_code" /> <result property="supplierName" column="supplier_name"/>
<result property="supplierName" column="supplier_name" /> <result property="qualityOrderReportCode" column="quality_order_report_code"/>
<result property="materialNo" column="material_no" /> <result property="qualityOrderReportType" column="quality_order_report_type"/>
<result property="materialName" column="material_name" /> <result property="qualityOrderCode" column="quality_order_code"/>
<result property="makeTotal" column="make_total" /> <result property="relatedOrderCode" column="related_order_code"/>
<result property="makeInNum" column="make_in_num" /> <result property="materialNo" column="material_no"/>
<result property="actualArriveNum" column="actual_arrive_num" /> <result property="inStorageCode" column="in_storage_code"/>
<result property="qualityHasqualifiedNum" column="quality_hasqualified_num" /> <result property="qualityOrderType" column="quality_order_type"/>
<result property="okAcceptedNum" column="ok_accepted_num" /> <result property="materialName" column="material_name"/>
<result property="okReportUrl" column="ok_report_url" /> <result property="makeTotal" column="make_total"/>
<result property="specialConcessionsNum" column="special_concessions_num" /> <result property="qualityStorageStatus" column="quality_storage_status"/>
<result property="specialReportUrl" column="special_report_url" /> <result property="deliveryInspectionTime" column="delivery_inspection_time"/>
<result property="checkoutCompletionTime" column="checkout_completion_time" /> <result property="qualityHasqualifiedNum" column="quality_hasqualified_num"/>
<result property="processBadClassification" column="process_bad_classification" /> <result property="okAcceptedNum" column="ok_accepted_num"/>
<result property="processBadGrade" column="process_bad_grade" /> <result property="okReportUrl" column="ok_report_url"/>
<result property="processBadNum" column="process_bad_num" /> <result property="specialConcessionsNum" column="special_concessions_num"/>
<result property="unqualifiedReportUrl" column="unqualified_report_url" /> <result property="specialReportUrl" column="special_report_url"/>
<result property="remark" column="remark" /> <result property="checkoutCompletionTime" column="checkout_completion_time"/>
<result property="createBy" column="create_by" /> <result property="checkNum" column="check_num"/>
<result property="createTime" column="create_time" /> <result property="processBadNum" column="process_bad_num"/>
<result property="updateBy" column="update_by" /> <result property="unqualifiedReportUrl" column="unqualified_report_url"/>
<result property="updateTime" column="update_time" /> <result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="auditStatus" column="audit_status"/>
<result property="useStatus" column="use_status"/>
<result property="instanceId" column="instance_id"/>
<result property="instanceType" column="instance_type"/>
<result property="submitInstanceId" column="submit_instance_id"/>
<result property="applyTitle" column="apply_title"/>
<result property="applyUser" column="apply_user"/>
<result property="applyTime" column="apply_time"/>
<result property="restoreInstanceId" column="restore_instance_id"/>
<result property="cancelInstanceId" column="cancel_instance_id"/>
<result property="cancelRemark" column="cancel_remark"/>
</resultMap> </resultMap>
<sql id="selectQualityOrderReportVo"> <sql id="selectQualityOrderReportVo">
select quality_order_report_id, quality_order_code, supplier_code, supplier_name, material_no, material_name, make_total, make_in_num, actual_arrive_num,quality_hasqualified_num, ok_accepted_num, ok_report_url, special_concessions_num, special_report_url, checkout_completion_time, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report select quality_order_report_id, supplier_code, quality_order_report_code,
quality_order_code, supplier_name, material_no, in_storage_code,
quality_order_type, material_name, make_total, quality_storage_status,
delivery_inspection_time, quality_hasqualified_num, ok_accepted_num,
ok_report_url, special_concessions_num, special_report_url,quality_order_report_type,
checkout_completion_time, check_num, process_bad_num, unqualified_report_url,
remark, create_by, create_time, update_by, update_time, audit_status,
use_status, instance_id, instance_type, submit_instance_id, apply_title,apply_time,
apply_user, restore_instance_id, cancel_instance_id, cancel_remark,related_order_code
from quality_order_report
</sql> </sql>
<select id="selectQualityOrderReportList" parameterType="QualityOrderReport" resultMap="QualityOrderReportResult"> <select id="selectQualityOrderReportList" parameterType="QualityOrderReportVO" resultMap="QualityOrderReportResult">
<include refid="selectQualityOrderReportVo"/> <include refid="selectQualityOrderReportVo"/>
<where> <where>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''"> and quality_order_report_code = #{qualityOrderReportCode}</if>
<if test="qualityOrderCode != null and qualityOrderCode != ''"> and quality_order_code = #{qualityOrderCode}</if>
<if test="materialNo != null and materialNo != ''"> and material_no like concat('%', #{materialNo}, '%')</if>
<if test="inStorageCode != null and inStorageCode != ''"> and in_storage_code = #{inStorageCode}</if>
<if test="qualityOrderType != null and qualityOrderType != ''"> and quality_order_type = #{qualityOrderType}</if>
<if test="qualityOrderReportType != null and qualityOrderReportType != ''"> and quality_order_report_type = #{qualityOrderReportType}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="qualityStorageStatus != null and qualityStorageStatus != ''"> and quality_storage_status = #{qualityStorageStatus}</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>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if>
</where> </where>
order by create_time desc,audit_status asc
</select> </select>
<select id="selectQualityOrderReportById" parameterType="Long" resultMap="QualityOrderReportResult"> <select id="selectQualityOrderReportById" parameterType="Long" resultMap="QualityOrderReportResult">
@ -46,14 +82,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where quality_order_report_id = #{qualityOrderReportId} where quality_order_report_id = #{qualityOrderReportId}
</select> </select>
<select id="selectQualityOrderReportByNoAndCode" parameterType="QualityOrderReport" resultMap="QualityOrderReportResult"> <select id="selectQualityOrderReportByNoAndCode" parameterType="QualityOrderReportVO" resultMap="QualityOrderReportResult">
<include refid="selectQualityOrderReportVo"/> <include refid="selectQualityOrderReportVo"/>
where material_no = #{materialNo} where material_no = #{materialNo}
and supplier_code = #{supplierCode} and supplier_code = #{supplierCode}
and quality_order_code = #{qualityOrderCode} and quality_order_code = #{qualityOrderCode}
</select> </select>
<select id="selectMakeInOrderReportByNoAndCode" parameterType="QualityOrderReport" resultMap="QualityOrderReportResult"> <select id="selectMakeInOrderReportByNoAndCode" parameterType="QualityOrderReportVO" resultMap="QualityOrderReportResult">
<include refid="selectQualityOrderReportVo"/> <include refid="selectQualityOrderReportVo"/>
where material_no = #{materialNo} where material_no = #{materialNo}
and quality_order_code = #{qualityOrderCode} and quality_order_code = #{qualityOrderCode}
@ -61,25 +97,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertQualityOrderReport" parameterType="QualityOrderReport" useGeneratedKeys="true" keyProperty="qualityOrderReportId"> <insert id="insertQualityOrderReport" parameterType="QualityOrderReportVO" useGeneratedKeys="true" keyProperty="qualityOrderReportId">
insert into quality_order_report insert into quality_order_report
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="qualityOrderCode != null">quality_order_code,</if>
<if test="supplierCode != null">supplier_code,</if> <if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if> <if test="supplierName != null">supplier_name,</if>
<if test="qualityOrderReportCode != null">quality_order_report_code,</if>
<if test="qualityOrderReportType != null">quality_order_report_type,</if>
<if test="qualityOrderCode != null">quality_order_code,</if>
<if test="relatedOrderCode != null">related_order_code,</if>
<if test="materialNo != null">material_no,</if> <if test="materialNo != null">material_no,</if>
<if test="inStorageCode != null">in_storage_code,</if>
<if test="qualityOrderType != null">quality_order_type,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="makeTotal != null">make_total,</if> <if test="makeTotal != null">make_total,</if>
<if test="makeInNum != null">make_in_num,</if> <if test="qualityStorageStatus != null">quality_storage_status,</if>
<if test="actualArriveNum != null">actual_arrive_num,</if> <if test="deliveryInspectionTime != null">delivery_inspection_time,</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num,</if> <if test="qualityHasqualifiedNum != null">quality_hasqualified_num,</if>
<if test="okAcceptedNum != null">ok_accepted_num,</if> <if test="okAcceptedNum != null">ok_accepted_num,</if>
<if test="okReportUrl != null">ok_report_url,</if> <if test="okReportUrl != null">ok_report_url,</if>
<if test="specialConcessionsNum != null">special_concessions_num,</if> <if test="specialConcessionsNum != null">special_concessions_num,</if>
<if test="specialReportUrl != null">special_report_url,</if> <if test="specialReportUrl != null">special_report_url,</if>
<if test="checkoutCompletionTime != null">checkout_completion_time,</if> <if test="checkoutCompletionTime != null">checkout_completion_time,</if>
<if test="processBadClassification != null">process_bad_classification,</if> <if test="checkNum != null">check_num,</if>
<if test="processBadGrade != null">process_bad_grade,</if>
<if test="processBadNum != null">process_bad_num,</if> <if test="processBadNum != null">process_bad_num,</if>
<if test="unqualifiedReportUrl != null">unqualified_report_url,</if> <if test="unqualifiedReportUrl != null">unqualified_report_url,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
@ -87,24 +127,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="useStatus != null">use_status,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="cancelRemark != null">cancel_remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="qualityOrderCode != null">#{qualityOrderCode},</if>
<if test="supplierCode != null">#{supplierCode},</if> <if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if> <if test="supplierName != null">#{supplierName},</if>
<if test="qualityOrderReportCode != null">#{qualityOrderReportCode},</if>
<if test="qualityOrderReportType != null">#{qualityOrderReportType},</if>
<if test="qualityOrderCode != null">#{qualityOrderCode},</if>
<if test="relatedOrderCode != null">#{relatedOrderCode},</if>
<if test="materialNo != null">#{materialNo},</if> <if test="materialNo != null">#{materialNo},</if>
<if test="inStorageCode != null">#{inStorageCode},</if>
<if test="qualityOrderType != null">#{qualityOrderType},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="makeTotal != null">#{makeTotal},</if> <if test="makeTotal != null">#{makeTotal},</if>
<if test="makeInNum != null">#{makeInNum},</if> <if test="qualityStorageStatus != null">#{qualityStorageStatus},</if>
<if test="actualArriveNum != null">#{actualArriveNum},</if> <if test="deliveryInspectionTime != null">#{deliveryInspectionTime},</if>
<if test="qualityHasqualifiedNum != null">#{qualityHasqualifiedNum},</if> <if test="qualityHasqualifiedNum != null">#{qualityHasqualifiedNum},</if>
<if test="okAcceptedNum != null">#{okAcceptedNum},</if> <if test="okAcceptedNum != null">#{okAcceptedNum},</if>
<if test="okReportUrl != null">#{okReportUrl},</if> <if test="okReportUrl != null">#{okReportUrl},</if>
<if test="specialConcessionsNum != null">#{specialConcessionsNum},</if> <if test="specialConcessionsNum != null">#{specialConcessionsNum},</if>
<if test="specialReportUrl != null">#{specialReportUrl},</if> <if test="specialReportUrl != null">#{specialReportUrl},</if>
<if test="checkoutCompletionTime != null">#{checkoutCompletionTime},</if> <if test="checkoutCompletionTime != null">#{checkoutCompletionTime},</if>
<if test="processBadClassification != null">#{processBadClassification},</if> <if test="checkNum != null">#{checkNum},</if>
<if test="processBadGrade != null">#{processBadGrade},</if>
<if test="processBadNum != null">#{processBadNum},</if> <if test="processBadNum != null">#{processBadNum},</if>
<if test="unqualifiedReportUrl != null">#{unqualifiedReportUrl},</if> <if test="unqualifiedReportUrl != null">#{unqualifiedReportUrl},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
@ -112,28 +167,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="cancelRemark != null">#{cancelRemark},</if>
</trim> </trim>
</insert> </insert>
<update id="updateQualityOrderReport" parameterType="QualityOrderReport"> <update id="updateQualityOrderReport" parameterType="QualityOrderReportVO">
update quality_order_report update quality_order_report
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="qualityOrderCode != null">quality_order_code = #{qualityOrderCode},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if> <if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="qualityOrderReportCode != null">quality_order_report_code = #{qualityOrderReportCode},</if>
<if test="qualityOrderReportType != null">quality_order_report_type = #{qualityOrderReportType},</if>
<if test="qualityOrderCode != null">quality_order_code = #{qualityOrderCode},</if>
<if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="inStorageCode != null">in_storage_code = #{inStorageCode},</if>
<if test="qualityOrderType != null">quality_order_type = #{qualityOrderType},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="makeTotal != null">make_total = #{makeTotal},</if> <if test="makeTotal != null">make_total = #{makeTotal},</if>
<if test="makeInNum != null">make_in_num = #{makeInNum},</if> <if test="qualityStorageStatus != null">quality_storage_status = #{qualityStorageStatus},</if>
<if test="actualArriveNum != null">actual_arrive_num = #{actualArriveNum},</if> <if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if> <if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if>
<if test="okAcceptedNum != null">ok_accepted_num = #{okAcceptedNum},</if> <if test="okAcceptedNum != null">ok_accepted_num = #{okAcceptedNum},</if>
<if test="okReportUrl != null">ok_report_url = #{okReportUrl},</if> <if test="okReportUrl != null">ok_report_url = #{okReportUrl},</if>
<if test="specialConcessionsNum != null">special_concessions_num = #{specialConcessionsNum},</if> <if test="specialConcessionsNum != null">special_concessions_num = #{specialConcessionsNum},</if>
<if test="specialReportUrl != null">special_report_url = #{specialReportUrl},</if> <if test="specialReportUrl != null">special_report_url = #{specialReportUrl},</if>
<if test="checkoutCompletionTime != null">checkout_completion_time = #{checkoutCompletionTime},</if> <if test="checkoutCompletionTime != null">checkout_completion_time = #{checkoutCompletionTime},</if>
<if test="processBadClassification != null">process_bad_classification = #{processBadClassification},</if> <if test="checkNum != null">check_num = #{checkNum},</if>
<if test="processBadGrade != null">process_bad_grade = #{processBadGrade},</if>
<if test="processBadNum != null">process_bad_num = #{processBadNum},</if> <if test="processBadNum != null">process_bad_num = #{processBadNum},</if>
<if test="unqualifiedReportUrl != null">unqualified_report_url = #{unqualifiedReportUrl},</if> <if test="unqualifiedReportUrl != null">unqualified_report_url = #{unqualifiedReportUrl},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
@ -141,31 +211,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim> </trim>
where material_no = #{materialNo} where material_no = #{materialNo}
and supplier_code = #{supplierCode} and supplier_code = #{supplierCode}
</update> </update>
<update id="updateQualityOrderReportById" parameterType="QualityOrderReport"> <update id="updateQualityOrderReportById" parameterType="QualityOrderReportVO">
update quality_order_report update quality_order_report
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="qualityOrderCode != null">quality_order_code = #{qualityOrderCode},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if> <if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="qualityOrderReportCode != null">quality_order_report_code = #{qualityOrderReportCode},</if>
<if test="qualityOrderReportType != null">quality_order_report_type = #{qualityOrderReportType},</if>
<if test="qualityOrderCode != null">quality_order_code = #{qualityOrderCode},</if>
<if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="inStorageCode != null">in_storage_code = #{inStorageCode},</if>
<if test="qualityOrderType != null">quality_order_type = #{qualityOrderType},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="makeTotal != null">make_total = #{makeTotal},</if> <if test="makeTotal != null">make_total = #{makeTotal},</if>
<if test="makeInNum != null">make_in_num = #{makeInNum},</if> <if test="qualityStorageStatus != null">quality_storage_status = #{qualityStorageStatus},</if>
<if test="actualArriveNum != null">actual_arrive_num = #{actualArriveNum},</if> <if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if> <if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if>
<if test="okAcceptedNum != null">ok_accepted_num = #{okAcceptedNum},</if> <if test="okAcceptedNum != null">ok_accepted_num = #{okAcceptedNum},</if>
<if test="okReportUrl != null">ok_report_url = #{okReportUrl},</if> <if test="okReportUrl != null">ok_report_url = #{okReportUrl},</if>
<if test="specialConcessionsNum != null">special_concessions_num = #{specialConcessionsNum},</if> <if test="specialConcessionsNum != null">special_concessions_num = #{specialConcessionsNum},</if>
<if test="specialReportUrl != null">special_report_url = #{specialReportUrl},</if> <if test="specialReportUrl != null">special_report_url = #{specialReportUrl},</if>
<if test="checkoutCompletionTime != null">checkout_completion_time = #{checkoutCompletionTime},</if> <if test="checkoutCompletionTime != null">checkout_completion_time = #{checkoutCompletionTime},</if>
<if test="processBadClassification != null">process_bad_classification = #{processBadClassification},</if> <if test="checkNum != null">check_num = #{checkNum},</if>
<if test="processBadGrade != null">process_bad_grade = #{processBadGrade},</if>
<if test="processBadNum != null">process_bad_num = #{processBadNum},</if> <if test="processBadNum != null">process_bad_num = #{processBadNum},</if>
<if test="unqualifiedReportUrl != null">unqualified_report_url = #{unqualifiedReportUrl},</if> <if test="unqualifiedReportUrl != null">unqualified_report_url = #{unqualifiedReportUrl},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
@ -173,6 +258,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim> </trim>
where quality_order_report_id = #{qualityOrderReportId} where quality_order_report_id = #{qualityOrderReportId}
</update> </update>

15
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml

@ -20,15 +20,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="qualityOrderReportCode" column="quality_order_report_code" />
<result property="shippingDeviceId" column="shipping_device_id" />
</resultMap> </resultMap>
<sql id="selectQualityOrderReportUnqualifiedVo"> <sql id="selectQualityOrderReportUnqualifiedVo">
select order_report_unqualified_id, quality_order_report_id, supplier_code, supplier_name, material_no, material_name, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report_unqualified select order_report_unqualified_id, quality_order_report_id, supplier_code, supplier_name,
material_no, material_name, process_bad_classification, process_bad_grade, process_bad_num,
unqualified_report_url, remark, create_by, create_time, update_by, update_time,
quality_order_report_code,shipping_device_id from quality_order_report_unqualified
</sql> </sql>
<select id="selectQualityOrderReportUnqualifiedList" parameterType="QualityOrderReportUnqualified" resultMap="QualityOrderReportUnqualifiedResult"> <select id="selectQualityOrderReportUnqualifiedList" parameterType="QualityOrderReportUnqualified" resultMap="QualityOrderReportUnqualifiedResult">
<include refid="selectQualityOrderReportUnqualifiedVo"/> <include refid="selectQualityOrderReportUnqualifiedVo"/>
<where> <where>
<if test="shippingDeviceId != null and shippingDeviceId != ''"> and shipping_device_id = #{shippingDeviceId}</if>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''"> and quality_order_report_code = #{qualityOrderReportCode}</if>
</where> </where>
</select> </select>
@ -53,6 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into quality_order_report_unqualified insert into quality_order_report_unqualified
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="qualityOrderReportId != null">quality_order_report_id,</if> <if test="qualityOrderReportId != null">quality_order_report_id,</if>
<if test="qualityOrderReportCode != null">quality_order_report_code,</if>
<if test="shippingDeviceId != null">shipping_device_id,</if>
<if test="supplierCode != null">supplier_code,</if> <if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if> <if test="supplierName != null">supplier_name,</if>
<if test="materialNo != null">material_no,</if> <if test="materialNo != null">material_no,</if>
@ -69,6 +78,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="qualityOrderReportId != null">#{qualityOrderReportId},</if> <if test="qualityOrderReportId != null">#{qualityOrderReportId},</if>
<if test="qualityOrderReportCode != null">#{qualityOrderReportCode},</if>
<if test="shippingDeviceId != null">#{shippingDeviceId},</if>
<if test="supplierCode != null">#{supplierCode},</if> <if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if> <if test="supplierName != null">#{supplierName},</if>
<if test="materialNo != null">#{materialNo},</if> <if test="materialNo != null">#{materialNo},</if>
@ -89,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update quality_order_report_unqualified update quality_order_report_unqualified
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="qualityOrderReportId != null">quality_order_report_id= #{qualityOrderReportId},</if> <if test="qualityOrderReportId != null">quality_order_report_id= #{qualityOrderReportId},</if>
<if test="qualityOrderReportCode != null">quality_order_report_code= #{qualityOrderReportCode},</if>
<if test="shippingDeviceId != null">shipping_device_id= #{shippingDeviceId},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if> <if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>

70
ruoyi-admin/src/main/resources/mapper/quality/QualityReportDeviceMapper.xml

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quality.mapper.QualityReportDeviceMapper">
<resultMap type="QualityReportDevice" id="QualityReportDeviceResult">
<result property="id" column="id" />
<result property="shippingDeviceId" column="shipping_device_id" />
<result property="qualityOrderReportCode" column="quality_order_report_code" />
</resultMap>
<sql id="selectQualityReportDeviceVo">
select id, shipping_device_id, quality_order_report_code from quality_report_device
</sql>
<select id="selectQualityReportDeviceList" parameterType="QualityReportDevice" resultMap="QualityReportDeviceResult">
<include refid="selectQualityReportDeviceVo"/>
<where>
<if test="shippingDeviceId != null and shippingDeviceId != ''"> and shipping_device_id = #{shippingDeviceId}</if>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''"> and quality_order_report_code = #{qualityOrderReportCode}</if>
</where>
</select>
<select id="selectQualityReportDeviceById" parameterType="Long" resultMap="QualityReportDeviceResult">
<include refid="selectQualityReportDeviceVo"/>
where id = #{id}
</select>
<insert id="insertQualityReportDevice" parameterType="QualityReportDevice" useGeneratedKeys="true" keyProperty="id">
insert into quality_report_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id,</if>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">quality_order_report_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">#{shippingDeviceId},</if>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">#{qualityOrderReportCode},</if>
</trim>
</insert>
<update id="updateQualityReportDevice" parameterType="QualityReportDevice">
update quality_report_device
<trim prefix="SET" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id = #{shippingDeviceId},</if>
<if test="qualityOrderReportCode != null and qualityOrderReportCode != ''">quality_order_report_code = #{qualityOrderReportCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQualityReportDeviceById" parameterType="Long">
delete from quality_report_device where id = #{id}
</delete>
<delete id="deleteQualityReportDeviceByIds" parameterType="String">
delete from quality_report_device where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="cancelQualityReportDeviceById" parameterType="Long">
update quality_report_device set del_flag = '1' where id = #{id}
</update>
<update id="restoreQualityReportDeviceById" parameterType="Long">
update quality_report_device set del_flag = '0' where id = #{id}
</update>
</mapper>
Loading…
Cancel
Save