|
@@ -11,6 +11,7 @@ import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.vo.*;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
+import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
|
|
@@ -67,6 +68,8 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
|
|
|
private ApsCraftStepService apsCraftStepService;
|
|
|
@Autowired
|
|
|
private ApsCraftEquService apsCraftEquService;
|
|
|
+ @Autowired
|
|
|
+ private ReportCheckServiceImpl reportCheckService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -536,6 +539,18 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
|
|
|
return R.error(r.getMsg());
|
|
|
}
|
|
|
|
|
|
+ //查询新的输出物料
|
|
|
+ List<ApsReportOutputDo> newOutputDos = apsReportOutputService.list(new QueryWrapper<ApsReportOutputDo>().lambda().eq(ApsReportOutputDo::getMainid, apsReportRecordsDo.getId()));
|
|
|
+ //填补对应的检验等级和是否合格
|
|
|
+ if(apsReportOutputDoList.size() == newOutputDos.size()){
|
|
|
+ for (int i = 0; i < newOutputDos.size(); i++) {
|
|
|
+ newOutputDos.get(i).setInsepctionlevel(apsReportOutputDoList.get(i).getInsepctionlevel());
|
|
|
+ newOutputDos.get(i).setQualified(apsReportOutputDoList.get(i).getQualified());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //更新输出物料
|
|
|
+ apsReportOutputService.updateBatchById(newOutputDos);
|
|
|
+
|
|
|
//=================新增在制品库存=================
|
|
|
//查询报工记录对应的物料子表
|
|
|
List<ApsReportOutputDo> apsReportOutputDos = apsReportOutputService.list(new QueryWrapper<ApsReportOutputDo>().lambda().eq(ApsReportOutputDo::getMainid, apsReportRecordsDo.getId()));
|
|
@@ -576,6 +591,43 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
|
|
|
return R.error(r2.getMsg());
|
|
|
}
|
|
|
|
|
|
+ //===========提交校验================
|
|
|
+ //如果输出物料中不存在 检验等级 为 待判 的,则直接提交校验
|
|
|
+ //获取当前的输出物料
|
|
|
+ List<ApsReportOutputDo> outputDos = apsReportOutputService.list(new QueryWrapper<ApsReportOutputDo>().lambda().eq(ApsReportOutputDo::getMainid, apsReportRecordsDo.getId()));
|
|
|
+ List<ApsReportOutputDo> collect = outputDos.stream().filter(item -> item.getInsepctionlevel().equals(SaveConstans.CheckLevel.WAITING_JUDGMENT)).collect(Collectors.toList());
|
|
|
+ if (collect.size() > 0) {
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ //遍历输出物料 拼接输出物料描述,并更新
|
|
|
+ for (ApsReportOutputDo outputDo : outputDos) {
|
|
|
+ ApsReportOutputDo needUpdate = new ApsReportOutputDo();
|
|
|
+ needUpdate.setId(outputDo.getId());
|
|
|
+ String outputdesc = "";
|
|
|
+ outputdesc += outputDo.getOutputmaterial().split(" ")[0];
|
|
|
+ outputdesc += " 厚" + outputDo.getThickness() + "*宽" + outputDo.getWidth();
|
|
|
+ if (ObjectUtil.isNotEmpty(outputDo.getLength())) {
|
|
|
+ outputdesc += "*长" + outputDo.getLength();
|
|
|
+ }
|
|
|
+ outputdesc += " mm " + outputDo.getWeight() + "吨";
|
|
|
+ needUpdate.setOutputdesc(outputdesc);
|
|
|
+ apsReportOutputService.updateById(needUpdate);
|
|
|
+ }
|
|
|
+ //调用提交检验接口
|
|
|
+ R r1 = reportCheckService.updateRelevantInformation(apsReportRecordsDo.getId());
|
|
|
+ if (!r1.getCode().equals("200")) {
|
|
|
+ throw new CustomException(r1.getMsg());
|
|
|
+ }
|
|
|
+ //当前登录人
|
|
|
+ SysUserVo currentUser = CXCommonUtils.getCurrentUser();
|
|
|
+ //更新检查记录的检验人、检验时间
|
|
|
+ ApsReportRecordsDo needUpdate = new ApsReportRecordsDo();
|
|
|
+ needUpdate.setId(apsReportRecordsDo.getId());
|
|
|
+ needUpdate.setCheckid(currentUser.getId());
|
|
|
+ needUpdate.setCheckusername(currentUser.getName());
|
|
|
+ needUpdate.setCheckdate(DateUtil.date());
|
|
|
+ this.updateById(needUpdate);
|
|
|
+
|
|
|
return R.ok();
|
|
|
}
|
|
|
|