From 4f5a89a9e9f914cc3f67eec00ccd111b942049fb Mon Sep 17 00:00:00 2001 From: think <1787994136@qq.com> Date: Fri, 17 Jan 2025 15:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=E6=8F=92?= =?UTF-8?q?=E6=B4=BB=E9=A1=BA=E5=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/plansub/PlanSubController.java | 10 +++ .../shopCalendar/ShopCalendarMapper.java | 16 ++++ .../heli/service/plansub/PlanSubService.java | 2 + .../service/plansub/PlanSubServiceImpl.java | 8 ++ .../src/api/heli/plansub/index.ts | 5 ++ .../src/views/heli/plan/edit.vue | 79 +++++++++++-------- 6 files changed, 86 insertions(+), 34 deletions(-) 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 42e7be2..aae3a4c 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 @@ -63,6 +63,16 @@ public class PlanSubController { } + @GetMapping("/getSearchRlTs") + @Operation(summary = "查询设置的负责人设计时间是否和其他项目冲突") + @Parameter(name = "names", description = "负责人", required = true) + @PreAuthorize("@ss.hasPermission('heli:material-plan:delete')") + public CommonResult getSearchRlTs(@RequestParam("startDateTime") String startDateTime,@RequestParam("endDateTime") String endDateTime) { + Integer planSubDOList = planSubService.getSearchRlTs(startDateTime,endDateTime); + return success(planSubDOList); + + } + @GetMapping("/getOwnderMp") @Operation(summary = "查询设置的负责人设计时间是否和其他项目冲突") @Parameter(name = "names", description = "负责人", required = true) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/shopCalendar/ShopCalendarMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/shopCalendar/ShopCalendarMapper.java index c74c872..fb6cb57 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/shopCalendar/ShopCalendarMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/shopCalendar/ShopCalendarMapper.java @@ -49,6 +49,22 @@ public interface ShopCalendarMapper extends BaseMapperX { return selectPage(reqVO, query); } + default List getSearchRlTs(String startDateTime,String endDateTime ) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + try { + query.selectAll(ShopCalendarDO.class); + query.ne(ShopCalendarDO::getIfjiejiari,"true"); + query.between(ShopCalendarDO::getDates,startDateTime,endDateTime) + + ; + return selectList(query); + } catch (Exception e) { + // 处理异常,例如记录日志或抛出自定义异常 + System.out.println("发生了一个异常: " + e.getMessage()); + } + return selectList(query); + } + default List searchRllists(String Dates,Long tianShu ) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); try { 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 70cda00..81610e8 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 @@ -60,6 +60,8 @@ public interface PlanSubService { */ List searchOwner(String name,String dateOne, String dateTwo,String id,int type); + Integer getSearchRlTs(String startDateTime,String endDateTime); + List serarchRl(String endDateTime, Long tianShu); /** 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 d58fe53..b716db9 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 @@ -74,6 +74,14 @@ public class PlanSubServiceImpl implements PlanSubService { return planSubMapper.selectById(id); } + @Override + public Integer getSearchRlTs(String startDateTime,String endDateTime){ + + List shopCalendarDOS =shopCalendarMapper.getSearchRlTs(startDateTime,endDateTime); + int a = shopCalendarDOS.size(); + return a; + } + @Override public List serarchRl(String endDateTime,Long tianShu){ List shopCalendarDOS =shopCalendarMapper.searchRllists(endDateTime,tianShu); 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 ee5898b..5079daf 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 @@ -37,6 +37,11 @@ export const getOwnderPlanChaHuo = async (ownder: number,dateOne: string ,dateTw export const getOwnderPlanSub = async (endDateTime: string,tianShu: number ) => { return await request.get({ url: `/heli/plan-sub/getSearchRl?endDateTime=` + endDateTime+`&tianShu=`+tianShu}) } +//计算工时 +export const getSearchRlTsS = async (startDateTime: string,endDateTime: string ) => { + return await request.get({ url: `/heli/plan-sub/getSearchRlTs?startDateTime=` + startDateTime+`&endDateTime=`+endDateTime}) +} + /* export const getOwnderPlanSub = async (ownder: number,dateOne: string ,dateTwo: string,id: number,type: number) => { return await request.get({ url: `/heli/plan-sub/getOwnderMp?names=` + ownder+`&dateOne=`+dateOne+`&dateTwo=`+dateTwo+`&id=`+id+`&type=`+type}) } */ 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 be6c414..0873770 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 @@ -749,6 +749,7 @@ const clouse = () => { /* 计算设计天数 */ const handleDateChange = (index, startBlankDate,blankDate,num,ownder,id) =>{ + dataListShuju.value = []; if (typeof startBlankDate === 'undefined' || startBlankDate === null || startBlankDate === '') { message.error("请选择开始日期,否则无法计算设计天数") return; @@ -763,7 +764,11 @@ const handleDateChange = (index, startBlankDate,blankDate,num,ownder,id) =>{ message.error("开始时间必须早于结束时间,否则无法计算设计天数,请检查") return; } - // + + //调用查询天数的后端接口 + getSearchRlTs(startBlankDate,blankDate,index,num,ownder); + + //计算天数 // 将日期字符串转换为Date对象 @@ -774,43 +779,49 @@ const handleDateChange = (index, startBlankDate,blankDate,num,ownder,id) =>{ const timeDiff = Math.abs(date2.getTime() - date1.getTime()); const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); const tianshu = diffDays+1; - //"1":毛坯设计;"2":2D设计;"3":3D设计 - if(num === "1"){ - //调用接口查询检索设计时间是否冲突 - formData.value.projectPlanSubs[index].blankNum = tianshu; - - - // formatDate(startBlankDate,'YYYY-MM-DD') - if(ownder){ - prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); - getOwnderList(index) - } - - /* getOwnderList(index,ownder,startBlankDate,blankDate,id) */ - - - }else if(num === "2"){ - //调用接口查询检索设计时间是否冲突 - formData.value.projectPlanSubs[index].twoDimNum = tianshu; - - if(ownder){ - prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); - getOwnderLists(index) - } - - }else{ - formData.value.projectPlanSubs[index].threeDimNum = tianshu; - if(ownder){ - prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); - getOwnderListss(index) - } - - - } + + } + +const getSearchRlTs = async(startDateTime:string,endDateTime:string,index:number ,num:string,ownder:number) => { + let data = await PlanSubApi.getSearchRlTsS(formatDate(startDateTime,'YYYY-MM-DD'),formatDate(endDateTime,'YYYY-MM-DD')); + if(num === "1"){ + //调用接口查询检索设计时间是否冲突 + formData.value.projectPlanSubs[index].blankNum = data; + + + // formatDate(startBlankDate,'YYYY-MM-DD') + if(ownder){ + prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); + getOwnderList(index) + } + + /* getOwnderList(index,ownder,startBlankDate,blankDate,id) */ + + + }else if(num === "2"){ + //调用接口查询检索设计时间是否冲突 + formData.value.projectPlanSubs[index].twoDimNum = data; + + if(ownder){ + prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); + getOwnderLists(index) + } + + }else{ + formData.value.projectPlanSubs[index].threeDimNum = data; + if(ownder){ + prod.value.projectPlanSubs = JSON.parse(JSON.stringify(formData.value.projectPlanSubs)); + getOwnderListss(index) + } + + + } +} + //选择3D const getOwnderListss = async (index: number) => { /* const dataListShuju = []; */