diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java index b4e7371d..1d870a44 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/pgmaster/PgMasterController.java @@ -20,6 +20,8 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMap import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper; import com.chanko.yunxi.mes.module.heli.service.bgmasterline.BgMasterLineService; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -74,6 +76,8 @@ public class PgMasterController { private BgMasterLineMapper bgMasterLineMapper; @Resource private ProcedureMapper procedureMapper; + @Resource + private AdminUserMapper adminUserMapper; @GetMapping("/getBomMx") @@ -180,31 +184,165 @@ public class PgMasterController { }else { LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); wrapper1.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDO.getId()); - wrapper1.eq(TaskDispatchDetailDO::getCheckYn,0); - wrapper1.eq(TaskDispatchDetailDO::getTestYn,"Y"); + wrapper1.eq(TaskDispatchDetailDO::getCheckYn, 0); + wrapper1.eq(TaskDispatchDetailDO::getTestYn, "Y"); List list = taskDispatchDetailMapper.selectList(wrapper1); - if (ObjectUtil.isNotEmpty( list)){ - if (list.size()==detailDOS.size()){ - return error(400,"零件已全部检验完成"); - }else{ + if (ObjectUtil.isNotEmpty(list)) { + if (list.size() == detailDOS.size()) { + return error(400, "零件已全部检验完成"); + } else { + Map userNameMap = new HashMap<>(); + Map procedureNameMap = new HashMap<>(); List collect1 = detailDOS.stream().filter(item -> item.getProcedureStatus() != 2).collect(Collectors.toList()); - List collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).collect(Collectors.toList()); - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.in(ProcedureDO::getId, collect); - List procedureDOS = procedureMapper.selectList(lambdaQueryWrapper); - // 转换为 Map - Map procedureNameMap = procedureDOS.stream() + List collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).filter(Objects::nonNull).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(collect)) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(ProcedureDO::getId, collect); + List procedureDOS = procedureMapper.selectList(lambdaQueryWrapper); + +// 转换为 Map + procedureNameMap = procedureDOS.stream() .collect(Collectors.toMap( ProcedureDO::getId, ProcedureDO::getName, (existing, replacement) -> existing )); + } + + List collectOwer = collect1.stream().map(TaskDispatchDetailDO::getOwner).filter(Objects::nonNull).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(collectOwer)) { + LambdaQueryWrapper queryWrapper2 = new LambdaQueryWrapper<>(); + queryWrapper2.in(AdminUserDO::getId, collectOwer); + List userDOS = adminUserMapper.selectList(queryWrapper2); + userNameMap = userDOS.stream() + .collect(Collectors.toMap( + AdminUserDO::getId, + AdminUserDO::getNickname, + (existing, replacement) -> existing + )); + } + List collect2 = collect1.stream().filter(item -> item.getReportProcess() == 1).collect(Collectors.toList()); List collect3 = collect1.stream().filter(item -> item.getReportProcess() != 1).collect(Collectors.toList()); - return error(400,"该零件没有报工完成,请联系报工人员!"); + // 1. 遍历 collect2(正在报工的) + StringBuilder messageBuilder = new StringBuilder("该零件"); + for (TaskDispatchDetailDO item : collect2) { + Long procedureId = item.getProcedureId(); // 获取工序ID + Long ownerId = item.getOwner(); // 获取负责人ID + + // 从map中获取名称 + String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序"); + String ownerName = ""; + if (item.getDispatchType() == 1) { + ownerName = userNameMap.getOrDefault(ownerId, "未知负责人"); + } else { + ownerName = item.getPostId(); + } + // 拼接消息 + messageBuilder.append(String.format("%s工序正在报工,没有结束,负责人%s,", + procedureName, ownerName)); + } + + // 2. 遍历 collect3(没有报工的) + for (TaskDispatchDetailDO item : collect3) { + Long procedureId = item.getProcedureId(); // 获取工序ID + Long ownerId = item.getOwner(); // 获取负责人ID + + // 从map中获取名称 + String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序"); + String ownerName = ""; + if (item.getDispatchType() == 1) { + ownerName = userNameMap.getOrDefault(ownerId, "未知负责人"); + } else { + ownerName = item.getPostId(); + } + // 拼接消息 + messageBuilder.append(String.format("%s工序没有报工,负责人%s,", + procedureName, ownerName)); + } + + String fullMessage = messageBuilder.toString(); + if (fullMessage.endsWith(",")) { + fullMessage = fullMessage.substring(0, fullMessage.length() - 1); + } + return error(411, fullMessage); } - }else{ - return error(400,"该零件没有报工完成,请联系报工人员!"); + } else { + Map userNameMap = new HashMap<>(); + Map procedureNameMap = new HashMap<>(); + List collect1 = detailDOS.stream().filter(item -> item.getProcedureStatus() != 2).collect(Collectors.toList()); + List collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).filter(Objects::nonNull).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(collect)) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(ProcedureDO::getId, collect); + List procedureDOS = procedureMapper.selectList(lambdaQueryWrapper); + +// 转换为 Map + procedureNameMap = procedureDOS.stream() + .collect(Collectors.toMap( + ProcedureDO::getId, + ProcedureDO::getName, + (existing, replacement) -> existing + )); + } + + List collectOwer = collect1.stream().map(TaskDispatchDetailDO::getOwner).filter(Objects::nonNull).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(collectOwer)) { + LambdaQueryWrapper queryWrapper2 = new LambdaQueryWrapper<>(); + queryWrapper2.in(AdminUserDO::getId, collectOwer); + List userDOS = adminUserMapper.selectList(queryWrapper2); + userNameMap = userDOS.stream() + .collect(Collectors.toMap( + AdminUserDO::getId, + AdminUserDO::getNickname, + (existing, replacement) -> existing + )); + } + + List collect2 = collect1.stream().filter(item -> item.getReportProcess() == 1).collect(Collectors.toList()); + List collect3 = collect1.stream().filter(item -> item.getReportProcess() != 1).collect(Collectors.toList()); + // 1. 遍历 collect2(正在报工的) + StringBuilder messageBuilder = new StringBuilder("该零件"); + for (TaskDispatchDetailDO item : collect2) { + Long procedureId = item.getProcedureId(); // 获取工序ID + Long ownerId = item.getOwner(); // 获取负责人ID + + // 从map中获取名称 + String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序"); + String ownerName = ""; + if (item.getDispatchType() == 1) { + ownerName = userNameMap.getOrDefault(ownerId, "未知负责人"); + } else { + ownerName = item.getPostId(); + } + // 拼接消息 + messageBuilder.append(String.format("%s工序正在报工,没有结束,负责人%s,", + procedureName, ownerName)); + } + + // 2. 遍历 collect3(没有报工的) + for (TaskDispatchDetailDO item : collect3) { + Long procedureId = item.getProcedureId(); // 获取工序ID + Long ownerId = item.getOwner(); // 获取负责人ID + + // 从map中获取名称 + String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序"); + String ownerName = ""; + if (item.getDispatchType() == 1) { + ownerName = userNameMap.getOrDefault(ownerId, "未知负责人"); + } else { + ownerName = item.getPostId(); + } + // 拼接消息 + messageBuilder.append(String.format("%s工序没有报工,负责人%s,", + procedureName, ownerName)); + } + + String fullMessage = messageBuilder.toString(); + if (fullMessage.endsWith(",")) { + fullMessage = fullMessage.substring(0, fullMessage.length() - 1); + } + return error(411, fullMessage); } } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java index 2317fda4..85264a34 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/PlanSubController.java @@ -150,5 +150,10 @@ public class PlanSubController { ExcelUtils.write(response, "生产计划子项目.xls", "数据", PlanSubRespVO.class, BeanUtils.toBean(list, PlanSubRespVO.class)); } - + @PostMapping("/verification") + @Operation(summary = "创建生产计划子项目") + @PreAuthorize("@ss.hasPermission('heli:plan-sub:create')") + public CommonResult verification(@RequestBody List list) { + return planSubService.verification(list); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java index 7369ff1e..92881690 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubService.java @@ -79,4 +79,6 @@ public interface PlanSubService { PageResult getPlanSubPage(PlanSubPageReqVO pageReqVO); Integer getSearchRlT(PlanSubDetailRespVO pageReqVO); + + CommonResult verification(List list); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java index 6bb6164b..24c950cd 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plansub/PlanSubServiceImpl.java @@ -665,4 +665,138 @@ public class PlanSubServiceImpl implements PlanSubService { return 1; } + @Override + public CommonResult verification(List list) { + HashSet userIds = new HashSet<>(); + for (PlanSubSaveReqVO planSubSaveReqVO : list) { + if (planSubSaveReqVO.getTwoDimOwner() != null) { + userIds.add(planSubSaveReqVO.getTwoDimOwner()); + } + if (planSubSaveReqVO.getThreeDimOwner() != null) { + userIds.add(planSubSaveReqVO.getThreeDimOwner()); + } + if (planSubSaveReqVO.getBlankOwner() != null) { + userIds.add(planSubSaveReqVO.getBlankOwner()); + } + } + if (ObjectUtil.isNotEmpty(userIds)) { + List planSubDetailDOS = planSubDetailMapper.selectExistList(userIds); +// checkForConflicts(list, planSubDetailDOS); + + // 为了提高查询效率,将 list2 按 Owner 转换为 Map + Map> tasksByOwner = new HashMap<>(); + for (PlanSubDetailDO task : planSubDetailDOS) { + tasksByOwner.computeIfAbsent(task.getTwoDimOwner(), k -> new ArrayList<>()).add(task); + } + + // 将每个工艺任务拆分成独立的任务项,方便统一检查 + List allNewItems = new ArrayList<>(); + for (PlanSubSaveReqVO task : list) { + if (!task.isHasSaveInBlankDetail() && task.getBlankOwner() != null && task.getStartBlankDate() != null && task.getBlankDate() != null) { + allNewItems.add(new TaskItem(Long.valueOf(task.getBlankOwner()), task.getStartBlankDate(), task.getBlankDate(), "毛坯",task.getName())); + } + if (!task.isHasSaveIn2DDetail() && task.getTwoDimOwner() != null && task.getStartTwoDimDate() != null && task.getTwoDimDate() != null) { + allNewItems.add(new TaskItem(Long.valueOf(task.getTwoDimOwner()), task.getStartTwoDimDate(), task.getTwoDimDate(), "2D",task.getName())); + } + if (!task.isHasSaveIn3DDetail() && task.getThreeDimOwner() != null && task.getStartThreeDimDate() != null && task.getThreeDimDate() != null) { + allNewItems.add(new TaskItem(Long.valueOf(task.getThreeDimOwner()), task.getStartThreeDimDate(), task.getThreeDimDate(), "3D",task.getName())); + } + } + + // 对所有新任务项进行两两比较 + for (int i = 0; i < allNewItems.size(); i++) { + TaskItem item1 = allNewItems.get(i); + for (int j = i + 1; j < allNewItems.size(); j++) { + TaskItem item2 = allNewItems.get(j); + // 只检查同一个责任人负责的任务 + if (item1.owner.equals(item2.owner)) { + if (hasOverlap(item1.start, item1.end, item2.start, item2.end)) { + return CommonResult.success(item1.projectName+" "+item1.type+item1.start.toString().substring(0,10)+" -"+item1.end.toString().substring(0,10)+"跟"+item1.projectName+" "+item1.type+" "+item2.start.toString().substring(0,10)+item2.end.toString().substring(0,10)+"存在交集,请确认!"); + } + } + } + } + for (PlanSubSaveReqVO newTask : list) { + // 检查毛坯任务 + if (!newTask.isHasSaveInBlankDetail() && newTask.getBlankOwner() != null){ + Long owner = Long.valueOf(newTask.getBlankOwner()); + // 2. 检查 list1 与 list2 之间的时间冲突 + if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartBlankDate()) || ObjectUtil.isEmpty(newTask.getBlankDate())) { + continue; + } + + List existingTasksForOwner = tasksByOwner.get(owner); + if (existingTasksForOwner == null) { + continue; + } + for (PlanSubDetailDO existingTask : existingTasksForOwner) { + if (hasOverlap(newTask.getStartBlankDate(), newTask.getBlankDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) { + String typeName = ""; + if ("BLUEPRINT_3D".equals(existingTask.getSubType())){ + typeName = "3D"; + }else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){ + typeName = "2D"; + }else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){ + typeName = "毛坯"; + } + return CommonResult.success(newTask.getName()+" 毛坯 "+newTask.getStartBlankDate().toString().substring(0,10)+" -"+ newTask.getBlankDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!"); + } + } + } + // 检查2D任务 + if (!newTask.isHasSaveIn2DDetail() && newTask.getTwoDimOwner() != null){ + Long owner = Long.valueOf(newTask.getTwoDimOwner()); + // 2. 检查 list1 与 list2 之间的时间冲突 + if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartTwoDimDate()) || ObjectUtil.isEmpty(newTask.getTwoDimDate())) { + continue; + } + + List existingTasksForOwner = tasksByOwner.get(owner); + if (existingTasksForOwner == null) { + continue; + } + for (PlanSubDetailDO existingTask : existingTasksForOwner) { + if (hasOverlap(newTask.getStartTwoDimDate(), newTask.getTwoDimDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) { + String typeName = ""; + if ("BLUEPRINT_3D".equals(existingTask.getSubType())){ + typeName = "3D"; + }else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){ + typeName = "2D"; + }else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){ + typeName = "毛坯"; + } + return CommonResult.success(newTask.getName()+" 2D "+newTask.getStartTwoDimDate().toString().substring(0,10)+" -"+ newTask.getTwoDimDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!"); + } + } + } + // 检查3D任务 + if (!newTask.isHasSaveIn3DDetail() && newTask.getThreeDimOwner() != null){ + Long owner = Long.valueOf(newTask.getThreeDimOwner()); + // 2. 检查 list1 与 list2 之间的时间冲突 + if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartThreeDimDate()) || ObjectUtil.isEmpty(newTask.getThreeDimDate())) { + continue; + } + + List existingTasksForOwner = tasksByOwner.get(owner); + if (existingTasksForOwner == null) { + continue; + } + for (PlanSubDetailDO existingTask : existingTasksForOwner) { + if (hasOverlap(newTask.getStartThreeDimDate(), newTask.getThreeDimDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) { + String typeName = ""; + if ("BLUEPRINT_3D".equals(existingTask.getSubType())){ + typeName = "3D"; + }else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){ + typeName = "2D"; + }else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){ + typeName = "毛坯"; + } + return CommonResult.success(newTask.getName()+" 3D "+newTask.getStartThreeDimDate().toString().substring(0,10)+" -"+ newTask.getThreeDimDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!"); + } + } + } + } + } + return CommonResult.success(true); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java index 49c821cf..2361d293 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java @@ -163,6 +163,6 @@ public class TaskInReportServiceImpl implements TaskInReportService { updateWrapper.eq(TaskDispatchDetailDO::getId, taskInReport.getDispatchDetailId()); updateWrapper.set(TaskDispatchDetailDO::getInReportProcess, 1); taskDispatchDetailMapper.update(updateWrapper); - return null; + return CommonResult.success( true); } } diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts index 8fc4f641..de3c1ba1 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plansub/index.ts @@ -86,3 +86,6 @@ export const deletePlanSub = async (id: number) => { export const exportPlanSub = async (params) => { return await request.download({ url: `/heli/plan-sub/export-excel`, params }) } +export const verification = async (data) => { + return await request.post({ url: `/heli/plan-sub/verification`, data }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue index 255c33ba..a65c8ad9 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/plan/edit.vue @@ -878,7 +878,7 @@ class="!w-265px" v-model="row.twoDimOwner" clearable - @change="handleSelectedUser7($index)" + @change="handleUser7($index)" filterable > { if (!formData.value.projectPlanSubs[currentIndex].startBlankDate) { for (var i = 0; i < formData.value.projectPlanSubs.length; i++) { var item = formData.value.projectPlanSubs[i] - console.log(item.blankOwner) if (item.blankOwner != null && item.blankOwner == userId) { if (item.blankDate != null) { if (maxBeginDate == null) { @@ -2850,6 +2864,14 @@ const handleSelectedUser6 = async (currentIndex) => { formData.value.projectPlanSubs[currentIndex].startBlankDate = maxDateDO.maxTime } } + if (formData.value.projectPlanSubs[currentIndex].blankOwner && formData.value.projectPlanSubs[currentIndex].startBlankDate && formData.value.projectPlanSubs[currentIndex].blankDate) { + var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs); + if (!(newVar == true)) { + message.error(newVar); + formData.value.projectPlanSubs[currentIndex].blankOwner = null + return + } + } } // 设备型号 const handleSelectedequip = (scope, newValue: any) => { @@ -2862,7 +2884,7 @@ const handleSelectedequip = (scope, newValue: any) => { } } // 2D负责人 -const handleSelectedUser7 = async (currentIndex) => { +const handleUser7 = async (currentIndex) => { var userId = formData.value.projectPlanSubs[currentIndex].twoDimOwner var maxBeginDate = null if (!formData.value.projectPlanSubs[currentIndex].startTwoDimDate) { @@ -2913,6 +2935,14 @@ const handleSelectedUser7 = async (currentIndex) => { formData.value.projectPlanSubs[currentIndex].startTwoDimDate = maxDateDO.maxTime } } + if (formData.value.projectPlanSubs[currentIndex].twoDimOwner&&formData.value.projectPlanSubs[currentIndex].startTwoDimDate&&formData.value.projectPlanSubs[currentIndex].twoDimDate){ + var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs); + if (!(newVar==true)){ + message.error(newVar); + formData.value.projectPlanSubs[currentIndex].twoDimOwner = null + return + } + } } // 3D负责人 const handleSelectedUser8 = async (currentIndex) => { @@ -2966,6 +2996,14 @@ const handleSelectedUser8 = async (currentIndex) => { formData.value.projectPlanSubs[currentIndex].startThreeDimDate = maxDateDO.maxTime } } + if (formData.value.projectPlanSubs[currentIndex].threeDimOwner&&formData.value.projectPlanSubs[currentIndex].startThreeDimDate&&formData.value.projectPlanSubs[currentIndex].threeDimDate){ + var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs); + if (!(newVar==true)){ + message.error(newVar); + formData.value.projectPlanSubs[currentIndex].threeDimOwner = null + return + } + } } // 责任人 const handleSelectedUser9 = (currentIndex, newValue: any) => { diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue index 8e731bca..89faef83 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/processdesign/overview.vue @@ -223,6 +223,19 @@ const exportLoading = ref(false) // 导出的加载中 /** 查询列表 */ const getList = async () => { + if (queryParams.designDate && typeof queryParams.designDate === 'number') { + // 检查是否是合理的时间戳(在1970-01-01之后的时间戳) + const timestamp = queryParams.designDate; + const dateObj = new Date(timestamp); + // 验证日期有效性 + if (!isNaN(dateObj.getTime())) { + const year = dateObj.getFullYear(); + const month = String(dateObj.getMonth() + 1).padStart(2, '0'); + const day = String(dateObj.getDate()).padStart(2, '0'); + queryParams.designDate = `${year}-${month}-${day}`; + } + } + loading.value = true try { const data = await ProcessDesignApi.getProcessDesignPages(queryParams) diff --git a/mes-ui/mini-app/src/pages/index/index.vue b/mes-ui/mini-app/src/pages/index/index.vue index 7c96560b..7f2c9e92 100644 --- a/mes-ui/mini-app/src/pages/index/index.vue +++ b/mes-ui/mini-app/src/pages/index/index.vue @@ -98,7 +98,7 @@ const categoryList = ref([ path: "productionInReport", name: "下料报工", auth: false, - imgUrl: "/static/images/productionReport.png", + imgUrl: "/static/images/productionInReport.png", defaultImgUrl: "/static/images/approveOrder-default.png", }, ]); diff --git a/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue b/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue index c2e09fa1..5cc141fd 100644 --- a/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue +++ b/mes-ui/mini-app/src/pages/productionInReport/productionInReport-detail.vue @@ -196,13 +196,19 @@ if (val){ length.value = parseFloat(val).toFixed(2) var newPrice = await getCompositionAPI(detailInfo.value.compositionId); - console.log(newPrice) - console.log(newPrice.price) + if (newPrice.price!=detailInfo.value.price){ + uni.showToast({ + icon: 'none', + duration: 3000, + title: '单价有调整,请刷新界面', + }) + } if (matType.value == '1' || matType.value == '3') { if (widht.value > 0 && hight.value > 0) { var rawResult = length.value * widht.value * hight.value * detailInfo.value.density / 1000000; weight.value = rawResult.toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value = price.toFixed(2) } } else if (matType.value=='2'){ @@ -214,20 +220,37 @@ const CONSTANT_FACTOR = 3.14 / 1000000; var rawResult = CONSTANT_FACTOR * radiusSquared * hight.value * detailInfo.value.density; weight.value = rawResult.toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value = price.toFixed(2) } } } } + const handleMatTypeChange=(val)=>{ + if (val){ + if (val=='2'){ + widht.value='' + } + } + } const handleWidhtChange =async (val) => { if (val){ widht.value=parseFloat(val).toFixed(2) + var newPrice = await getCompositionAPI(detailInfo.value.compositionId); + if (newPrice.price!=detailInfo.value.price){ + uni.showToast({ + icon: 'none', + duration: 3000, + title: '单价有调整,请刷新界面', + }) + } if (matType.value=='1'||matType.value=='3'){ if (length.value>0&&hight.value>0){ var rawResult = length.value*widht.value*hight.value*detailInfo.value.density/1000000; weight.value= rawResult.toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value= price.toFixed(2) } } @@ -236,11 +259,20 @@ const handleHightChange =async (val) => { if (val){ hight.value=parseFloat(val).toFixed(2) + var newPrice = await getCompositionAPI(detailInfo.value.compositionId); + if (newPrice.price!=detailInfo.value.price){ + uni.showToast({ + icon: 'none', + duration: 3000, + title: '单价有调整,请刷新界面', + }) + } if (matType.value=='1'||matType.value=='3'){ if (widht.value>0&&length.value>0){ var rawResult = length.value*widht.value*hight.value*detailInfo.value.density/1000000; weight.value= rawResult.toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value= price.toFixed(2) } }else if (matType.value=='2') { @@ -252,7 +284,8 @@ const CONSTANT_FACTOR = 3.14 / 1000000; var rawResult = CONSTANT_FACTOR * radiusSquared * hight.value * detailInfo.value.density; weight.value= rawResult.toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value= price.toFixed(2) } } @@ -261,8 +294,17 @@ } const handleWeightChange =async (val) => { if (val){ + var newPrice = await getCompositionAPI(detailInfo.value.compositionId); + if (newPrice.price!=detailInfo.value.price){ + uni.showToast({ + icon: 'none', + duration: 3000, + title: '单价有调整,请刷新界面', + }) + } weight.value=parseFloat(val).toFixed(2) - var price = weight.value * detailInfo.value.price; + // var price = weight.value * detailInfo.value.price; + var price = weight.value * newPrice.price; reportPrice.value= price.toFixed(2) } } @@ -434,7 +476,7 @@ *物料类型: + :localdata="unitDict" placeholder="请选择物料类型" @change="handleMatTypeChange"> @@ -446,7 +488,7 @@ *宽度: - mm @@ -454,7 +496,7 @@ *高度: + placeholder="请输入高度" > mm diff --git a/mes-ui/mini-app/src/services/constants.ts b/mes-ui/mini-app/src/services/constants.ts index 55827869..1e4754d2 100644 --- a/mes-ui/mini-app/src/services/constants.ts +++ b/mes-ui/mini-app/src/services/constants.ts @@ -7,7 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ // export const serviceDomain = 'https://nxhs.cjyx.cc' -// export const serviceDomain = 'https://star.hz-hl.com' + // export const serviceDomain = 'https://star.hz-hl.com' // export const serviceDomain = 'http://222.71.165.187:9010' -// export const serviceDomain = 'http://localhost:8080' -export const serviceDomain = 'https://nxhs.cjyx.cc' +export const serviceDomain = 'http://localhost:8080' +// export const serviceDomain = 'https://nxhs.cjyx.cc' diff --git a/mes-ui/mini-app/src/static/images/approveOrder-default.png b/mes-ui/mini-app/src/static/images/approveOrder-default.png deleted file mode 100644 index dd157789..00000000 Binary files a/mes-ui/mini-app/src/static/images/approveOrder-default.png and /dev/null differ diff --git a/mes-ui/mini-app/src/static/images/productionInReport.png b/mes-ui/mini-app/src/static/images/productionInReport.png new file mode 100644 index 00000000..c7160d72 Binary files /dev/null and b/mes-ui/mini-app/src/static/images/productionInReport.png differ diff --git a/mes-ui/mini-app/src/utils/http.ts b/mes-ui/mini-app/src/utils/http.ts index 7007ffcf..250b558e 100644 --- a/mes-ui/mini-app/src/utils/http.ts +++ b/mes-ui/mini-app/src/utils/http.ts @@ -96,7 +96,15 @@ export const http = (options: UniApp.RequestOptions) => { loginStore.clearInfo() uni.navigateTo({ url: '/pages/login/login' }) reject(res) - } else { + } else if (res.data?.code === 411){ + const msg = (res.data as Data).msg + uni.showModal({ + icon: 'none', + duration: 3000, + title: msg || '请求错误', + }) + reject(res) + }else { const msg = (res.data as Data).msg uni.showToast({ icon: 'none',