43010 PNC增加装配件查询

tags/yfai-pcn-ext-v2.0
gsz 8 months ago
parent 2f3b3b0761
commit bb2a3f1092

@ -2,8 +2,11 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
import io.swagger.annotations.ApiOperation;
import java.util.List;
public interface IMesProduceSnPrintService {
@ApiOperation(value = "查询包装信息")
@ -14,4 +17,7 @@ public interface IMesProduceSnPrintService {
@ApiOperation(value = "打印")
MesProduceSnPrintModel doPrint(MesProduceSnPrintModel mesProduceSnPrintModel);
@ApiOperation(value = "装配件查询")
List<MesProductionAssembly> findMesProductionAssembly(MesProductionAssembly mesProductionAssembly);
}

@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnPrintService;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
@ -97,4 +98,20 @@ public class MesProduceSnPrintController {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@GetMapping("/mes-production-assembly/find")
@ApiOperation(value = "装配件查询")
public ResultBean findMesProductionAssembly(MesProductionAssembly mesProductionAssembly) {
try {
ValidatorBean.checkNotNull(mesProductionAssembly.getAssemblySn(), "装配件条码条码不能为空");
ValidatorBean.checkNotNull(mesProductionAssembly.getOrganizeCode(), "工厂代码不能为空");
return ResultBean.success("查询成功")
.setMsg(String.format("装配件【%s】条码查询成功!!!", mesProductionAssembly.getAssemblySn()))
.setResultList(mesProduceSnPrintService.findMesProductionAssembly(mesProductionAssembly));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -68,6 +68,8 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
@Autowired
private MesCustomerPartRepository mesCustomerPartRDao;
@Autowired
private MesProductionAssemblyRepository mesProductionAssemblyRepository;
@Autowired
private IConfigService configService;
@ -216,4 +218,21 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService {
MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(ddlPackBean);
return mesCustomerPart;
}
@Override
public List<MesProductionAssembly> findMesProductionAssembly(MesProductionAssembly requestModel) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(requestModel.getAssemblySn(), "assemblySn", packBean);
if (!StringUtils.isEmpty(requestModel.getPartNo())) {
DdlPreparedPack.getStringEqualPack(requestModel.getPartNo(), "partNo", packBean);
}
if (!StringUtils.isEmpty(requestModel.getAssemblyPartNo())) {
DdlPreparedPack.getStringEqualPack(requestModel.getAssemblyPartNo(), "assemblyPartNo", packBean);
}
List<MesProductionAssembly> mesProductionAssemblies = mesProductionAssemblyRepository.findByHqlWhere(packBean);
if (CollectionUtils.isEmpty(mesProductionAssemblies)) {
MesPcnException.throwMesBusiException("扫描的装配件条码【%s】条码不存在请扫描其他的装配件",requestModel.getAssemblySn());
}
return mesProductionAssemblies;
}
}

Loading…
Cancel
Save