|
|
|
@ -136,7 +136,7 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
List<MesProductionAssemblyContext> productionAssemblyContextList = prodRuleContext.getAssemblyDataContext(workCenter);
|
|
|
|
|
for (MesProductionAssemblyContext productionAssemblyContext : productionAssemblyContextList) {
|
|
|
|
|
if (StringUtils.isEmpty(productionAssemblyContext.getIsCheckedRawMix()) && Objects.equals(productionAssemblyContext.getAssemblyStatus(), MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue())) {
|
|
|
|
|
double remainQty = getRemainQty(organizeCode, productionAssemblyContext.getAssemblyPartNo());
|
|
|
|
|
double remainQty = getRemainQty(organizeCode, productionAssemblyContext.getAssemblyPartNo(), productionAssemblyContext.getAssemblySn());
|
|
|
|
|
if (rawWeight > remainQty) {
|
|
|
|
|
productionAssemblyContext.setIsCheckedRawMix(null);
|
|
|
|
|
productionAssemblyContext.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue());
|
|
|
|
@ -233,9 +233,10 @@ public class MesFunctionDialogInputRawMixWeightService extends BaseSwsService im
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private double getRemainQty(String organizeCode, String partNo) {
|
|
|
|
|
private double getRemainQty(String organizeCode, String partNo, String barcode) {
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partNo, "partNo", ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(barcode, "barCode", ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getOrderBy("createDatetime", CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), ddlPackBean);
|
|
|
|
|
MesRawSnWeightRecord record = rawSnWeightRecordRDao.getByProperty(ddlPackBean);
|
|
|
|
|
if (record != null) {
|
|
|
|
|