forked from I3-YF/i3plus-mes-pcn-yfai
加料防错功能开发
parent
a16c50d568
commit
6cb853902e
@ -0,0 +1,58 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesRawPartChargingService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesRawPartChargingModel;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :加料防错
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/30 14:38
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesRawPartCharging")
|
||||||
|
public class MesRawPartChargingController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesRawPartChargingService mesRawPartChargingService;
|
||||||
|
|
||||||
|
@GetMapping("/findMesRawPackagePart")
|
||||||
|
@ApiOperation(value = "原材料容器零件关系")
|
||||||
|
public ResultBean findMesRawPackagePart(MesRawPartChargingModel mesRawPartChargingModel) {
|
||||||
|
try {
|
||||||
|
ValidatorBean.checkNotNull(mesRawPartChargingModel.getPackageSn(),"料筒条码不能为空");
|
||||||
|
mesRawPartChargingModel.setUserName(AuthUtil.getSessionUser().getUserName());
|
||||||
|
mesRawPartChargingModel.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("执行成功").setResultObject(mesRawPartChargingService.findMesRawPackagePart(mesRawPartChargingModel));
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/doAction")
|
||||||
|
@ApiOperation(value = "操作")
|
||||||
|
public ResultBean doAction(@RequestBody MesRawPartChargingModel mesRawPartChargingModel) {
|
||||||
|
try {
|
||||||
|
ValidatorBean.checkNotNull(mesRawPartChargingModel.getType(), "操作类型不能为空");
|
||||||
|
mesRawPartChargingModel.setUserName(AuthUtil.getSessionUser().getUserName());
|
||||||
|
mesRawPartChargingModel.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("执行成功").setResultObject(mesRawPartChargingService.doAction(mesRawPartChargingModel));
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesRawPackage;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesRawPackageDetail;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesRawPackagePart;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 原材料容器明细Model
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/30 11:40
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class MesRawPackageModel {
|
||||||
|
|
||||||
|
@ApiParam("原材料容器")
|
||||||
|
private MesRawPackage mesRawPackage;
|
||||||
|
|
||||||
|
@ApiParam("原材料容器明细")
|
||||||
|
private MesRawPackageDetail mesRawPackageDetail;
|
||||||
|
|
||||||
|
@ApiParam("原材料容器零件关系表")
|
||||||
|
private List<MesRawPackagePart> mesRawPackagePartList;
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesRawPackagePart;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 加料防错
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/30 11:40
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class MesRawPartChargingModel {
|
||||||
|
@ApiParam("操作人")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ApiParam("工厂代码")
|
||||||
|
private String organizeCode;
|
||||||
|
|
||||||
|
@ApiParam("料筒条码")
|
||||||
|
private String packageSn;
|
||||||
|
|
||||||
|
@ApiParam("原料条码")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiParam("批次号")
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
@ApiParam("操作类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiParam("原材料容器")
|
||||||
|
private MesRawPackageModel mesRawPackageModel;
|
||||||
|
|
||||||
|
@ApiParam("原材料容器零件关系")
|
||||||
|
private MesRawPackagePart mesRawPackagePart;
|
||||||
|
|
||||||
|
@ApiParam("产品条码")
|
||||||
|
private MesProduceSn mesProduceSn;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue