Browse Source

[feat]品质管理:

制程检验
新增回显到前端的物料信息CheckoutMaterialVO类
新增与生产单号有关的查询物料信息接口
dev
liuxiaoxu 7 months ago
parent
commit
43cbb68410
  1. 1
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java
  2. 39
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java
  3. 43
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java
  4. 6
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java
  5. 39
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java
  6. 77
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html

1
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java

@ -189,7 +189,6 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain
if (StringUtils.isEmpty(sysMakeorderBoms)){
// 记录日志
log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
throw new RuntimeException("未查找到物料相关数据");
}
for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) {
AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO();

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

@ -1,15 +1,14 @@
package com.ruoyi.quality.controller;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualityManufacturingCheckout;
@ -124,28 +123,26 @@ public class QualityManufacturingCheckoutController extends BaseController
return toAjax(qualityManufacturingCheckoutService.deleteQualityManufacturingCheckoutByIds(ids));
}
/**
* 作废品质管理制程检验
* 查找与客户生产单号有关的物料信息
*/
@RequiresPermissions("quality:manufacturingCheckout:cancel")
@Log(title = "品质管理制程检验", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(qualityManufacturingCheckoutService.cancelQualityManufacturingCheckoutById(id));
@GetMapping("/materialSelect")
public String materialSelect(@RequestParam String makeNo, ModelMap modelMap)
{
modelMap.put("makeNo",makeNo);
return prefix + "/materialSelect";
}
/**
* 恢复品质管理制程检验
*/
@RequiresPermissions("quality:manufacturingCheckout:restore")
@Log(title = "品质管理制程检验", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
* 查找与客户生产单号有关的物料信息
* */
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(qualityManufacturingCheckoutService.restoreQualityManufacturingCheckoutById(id));
@PostMapping("/getMaterialInfoByMakeNo")
public TableDataInfo getMaterialInfoByMakeNo(@RequestParam String makeNo){
startPage();
List<CheckoutMaterialVO> list = qualityManufacturingCheckoutService.selectMaterialInfoByMakeNo(makeNo);
return getDataTable(list);
}
}

43
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java

@ -0,0 +1,43 @@
package com.ruoyi.quality.domain.VO;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@Data
public class CheckoutMaterialVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
private String materialType;
/** 物料图片地址 */
@Excel(name = "物料图片地址")
private String materialPhotourl;
/** 物料品牌 */
@Excel(name = "物料品牌")
private String materialBrand;
/** 物料单位 */
@Excel(name = "物料单位")
private String materialUnit;
/** 物料描述 */
@Excel(name = "物料描述")
private String materialDescribe;
/** 物料加工方式 */
@Excel(name = "物料加工方式")
private String materialProcessMethod;
}

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

@ -2,6 +2,7 @@ package com.ruoyi.quality.service;
import java.util.List;
import com.ruoyi.quality.domain.QualityManufacturingCheckout;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
/**
* 品质管理制程检验Service接口
@ -72,4 +73,9 @@ public interface IQualityManufacturingCheckoutService
* @return
*/
int restoreQualityManufacturingCheckoutById(Long manufacturingCheckoutId);
/*
* 查找与制程检验有关的物料信息
* */
List<CheckoutMaterialVO> selectMaterialInfoByMakeNo(String makeNo);
}

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

@ -2,13 +2,19 @@ package com.ruoyi.quality.service.impl;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualityManufacturingCheckoutMapper;
@ -23,12 +29,16 @@ import org.springframework.transaction.annotation.Transactional;
* @author 刘晓旭
* @date 2024-05-13
*/
@Slf4j
@Service
public class QualityManufacturingCheckoutServiceImpl implements IQualityManufacturingCheckoutService
{
@Autowired
private QualityManufacturingCheckoutMapper qualityManufacturingCheckoutMapper;
@Autowired
private SysMakeorderBomMapper sysMakeorderBomMapper;
/**
* 查询品质管理制程检验
*
@ -164,4 +174,33 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
{
return qualityManufacturingCheckoutMapper.restoreQualityManufacturingCheckoutById(manufacturingCheckoutId);
}
/*
* 查找与制程检验有关的物料信息
* */
@Override
public List<CheckoutMaterialVO> selectMaterialInfoByMakeNo(String makeNo) {
ArrayList<CheckoutMaterialVO> checkoutMaterialVOS = new ArrayList<>();
List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeorderBoms)){
// 记录日志
log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
}
for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) {
CheckoutMaterialVO checkoutMaterialVO = new CheckoutMaterialVO();
checkoutMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo());
checkoutMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand());
checkoutMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe());
checkoutMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName());
checkoutMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod());
checkoutMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl());
checkoutMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit());
checkoutMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType());
checkoutMaterialVOS.add(checkoutMaterialVO);
}
return checkoutMaterialVOS;
}
}

77
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('选择物料信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-materialSelect-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "quality/manufacturingCheckout";
// 从后端拿到传入的makeNo
var makeNo = /*[[${makeNo}]]*/ '';
$(function() {
var options = {
id: 'bootstrap-materialSelect-table',
clickToSelect: true, // 点击选中行
singleSelect: true, // 单选
url: prefix + "/getMaterialInfoByMakeNo",
queryParams:queryParams,
modalName: "物料信息",
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '加工方式',
field: 'materialProcessMethod',
},
]
};
$.table.init(options);
});
function queryParams(params) {
var curParams = {
// 现在使用从Thymeleaf传过来的makeNo
makeNo: makeNo
};
return curParams;
}
</script>
</body>
</html>
Loading…
Cancel
Save