质量 缺陷类型 NC处理

tags/yfai-pcn-ext-v1.0
LML丶 1 year ago
parent 3911ce6313
commit f92b4243c1

@ -3,6 +3,8 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNcProcessingService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesInputNcProcessingModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
@ -44,19 +46,20 @@ public class MesNcProcessingController {
@PostMapping("/save-nc")
@ApiOperation(value = "NC处理")
public ResultBean saveNc(@RequestBody String serialNumber, Integer person, Integer type) {
public ResultBean saveNc(@RequestBody MesInputNcProcessingModel model) {
try {
// 数据校验
ValidatorBean.checkNotNull(serialNumber, "产品条码不能为空");
ValidatorBean.checkNotNull(model.getSerialNumber(), "产品条码不能为空");
ValidatorBean.checkNotNull(model.getType(), "类型不能为空");
String description = MesPcnExtEnumUtil.NC_TYPE.valueOfDescription(type);
String description = MesPcnExtEnumUtil.NC_TYPE.valueOfDescription(model.getType());
if (StringUtils.isEmpty(description)) {
throw new ImppBusiException(String.format("【%s】类型不存在请检查数据", type));
throw new ImppBusiException(String.format("【%s】类型不存在请检查数据", model.getType()));
}
ncProcessingService.saveNc(serialNumber, person, type, "CK01");
ncProcessingService.saveNc(model.getSerialNumber(), model.getPerson(), model.getType(), "CK01");
// ncProcessingService.saveNc(serialNumber, person, type, AuthUtil.getOrganizeCode());
return ResultBean.success("查询成功");
} catch (ImppBusiException imppException) {

@ -2,7 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNcProcessingService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingDefectModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
@ -92,9 +92,9 @@ public class MesNcProcessingService implements IMesNcProcessingService {
}
});
List<MesNcProcessingDefectModel> defectModelList = new ArrayList<>();
List<MesNcProcessingInputModel> defectModelList = new ArrayList<>();
defectMap.forEach((k, v) -> {
MesNcProcessingDefectModel model = new MesNcProcessingDefectModel();
MesNcProcessingInputModel model = new MesNcProcessingInputModel();
model.setDefectCode(k);
model.setQty(v.size());
model.setDefectName(v.get(0).getDefectName());

@ -0,0 +1,28 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author :
* @CreateDate : 2024-05-09 18:08
* @Modify:
**/
@Data
public class MesInputNcProcessingModel {
@ApiParam("条码")
private String serialNumber;
@ApiParam("责任人")
private Integer person;
@ApiParam("类型")
private Integer type;
}

@ -27,7 +27,7 @@ public class MesNcProcessingModel {
private MesPartTypePicture partTypePicture;
@ApiParam("缺陷列表")
private List<MesNcProcessingDefectModel> defectModelList;
private List<MesNcProcessingInputModel> defectModelList;
@ApiParam("物料")
private MesPart part;

Loading…
Cancel
Save