46970 返工拆解查询装配件条码,不能根据装配件条码而要根据id去查询并且修改

dev_temp_xw_202505150000_46970
xiangwei.zhang 2 months ago
parent 2a0cb8222a
commit e608665df9

@ -31,6 +31,9 @@ public interface IMesAssemblyExtService {
@ApiOperation(value = "获取装配件绑定记录")
List<MesProductionAssembly> getProductionAssemblyList(String organizeCode, String assemblySn);
@ApiOperation(value = "获取装配件绑定记录")
public List<MesProductionAssembly> getProductionAssemblyById(String organizeCode, Long id);
@ApiOperation(value = "获取装配件规则且唯一绑定记录")
List<MesProductionAssemblyUnique> getProductionAssemblyUniqueList(String organizeCode, String assemblySn);

@ -40,6 +40,8 @@ public interface IMesProductionRecordService {
void updateProductionRecord(String organizeCode, String userName, Long id, String errorMsg);
void updateProductionRecordList(String organizeCode, String userName, List<Long> id, String errorMsg);
@ApiOperation(value = "查询加工记录信息PDA报表")
ResultBean queryMesProductionRecordReport(String organizeCode, String productSn);

@ -875,7 +875,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
}
} else if (assemblyModel.getFlag() == CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) {
//装配解绑
saveProductionAssembly(organizeCode, userName, assemblyModel.getAssemblySn());
saveProductionAssembly(organizeCode, userName, assemblyModel.getId());
//自制件更新条码状态 条码状态可用
if(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_10.getValue() == assemblyModel.getMatchType()){
updateOldSn(organizeCode,assemblyModel.getAssemblySn(), userName, null);
@ -917,8 +917,8 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
}
}
private void saveProductionAssembly(String organizeCode,String userName, String assemblySN) {
List<MesProductionAssembly> assemblyList = mesAssemblyExtService.getProductionAssemblyList(organizeCode, assemblySN);
private void saveProductionAssembly(String organizeCode,String userName, Long id) {
List<MesProductionAssembly> assemblyList = mesAssemblyExtService.getProductionAssemblyById(organizeCode, id);
if(CollectionUtils.isEmpty(assemblyList)){
return;
}

@ -253,6 +253,14 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), assemblySn});
}
@Override
public List<MesProductionAssembly> getProductionAssemblyById(String organizeCode, Long id) {
return productionAssemblyRepository.findByProperty(
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.ID},
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), id});
}
@Override
public List<MesProductionAssemblyUnique> getProductionAssemblyUniqueList(String organizeCode, String assemblySn) {
return productionAssemblyUniqueRepository.findByProperty(

@ -145,6 +145,35 @@ public class MesProductionRecordService implements IMesProductionRecordService {
}
}
@Override
public void updateProductionRecordList(String organizeCode, String userName, List<Long> ids, String errorMsg) {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getInPackList(ids, "id", ddlPackBean);
List<MesProductionRecord> mesProductionRecordList = productionRecordRepository.findByHqlWhere(ddlPackBean);
List<Long> failList = new ArrayList<>();
List<Long> noFailList = new ArrayList<>();
if (!CollectionUtils.isEmpty(mesProductionRecordList)) {
failList = mesProductionRecordList.stream().filter(mesProductionRecord -> Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList());
noFailList = mesProductionRecordList.stream().filter(mesProductionRecord -> !Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(failList)) {
DdlPackBean failPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getInPackList(failList, "id", failPackBean);
productionRecordRepository.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime", "reportStatus", "remark"},
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg}, failPackBean);
}
if (!CollectionUtils.isEmpty(noFailList)) {
DdlPackBean nofailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getInPackList(noFailList, "id", nofailPackBean);
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg }, nofailPackBean);
}
}
}
@Override
public ResultBean queryMesProductionRecordReport(String organizeCode, String productSn) {

Loading…
Cancel
Save