裁片原材料防错优化

tags/yfai-pcn-ext-v2.3
yxw 9 months ago
parent b578de2b1a
commit 04e7942d04

@ -8,6 +8,7 @@ import cn.estsh.i3plus.pojo.base.common.Pager;
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.util.StringUtils;
@ -59,6 +60,10 @@ public class MesCutRawErrorProofingController {
@ApiOperation(value = "查询条码长度")
public ResultBean queryLengthByScanSn(MesCutRawErrorProofingModel model) {
try {
ValidatorBean.checkNotNull(model.getSn(), "查询条码不能为空");
ValidatorBean.checkNotNull(model.getOrganizeCode(), "工厂代码不能为空");
return ResultBean.success("查询成功").setResultObject(cutRawErrorProofingService.queryLengthBySn(model));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);

@ -216,7 +216,7 @@ public class MesCutRawErrorProofingService implements IMesCutRawErrorProofingSer
if (materialSnDb == null) MesPcnException.throwMesBusiException("条码【%s】不存在", model.getSn());
if (model.getSubLength() == null) MesPcnException.throwMesBusiException("条码【%s】为填减去长度", model.getSn());
if (model.getSubLength() == null) MesPcnException.throwMesBusiException("条码【%s】未输入减去长度", model.getSn());
if (materialSnDb.getSurplusLength() < model.getSubLength()) MesPcnException.throwMesBusiException("条码【%s】减去长度【%s】大于剩余长度【%s】", model.getSn(), materialSnDb.getSurplusLength(), model.getSubLength());

Loading…
Cancel
Save