From 8d786680daf317d600dbeb6228ae086182a2d7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=83=9C=E8=B6=85?= <504565038@qq.com> Date: Thu, 15 May 2025 11:49:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6=E8=A1=A8?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IProgressController.java | 5 +-- .../controller/IProgressNewController.java | 2 - .../mapper/IProgressNewMapper.java | 1 + .../impl/IProductionPlanServiceImpl.java | 2 +- .../service/impl/IProgressNewServiceImpl.java | 5 ++- .../service/impl/IProgressServiceImpl.java | 9 ++++- .../mappers/IProductionPlanMapper.xml | 37 +++++++++++-------- .../resources/mappers/IProgressNewMapper.xml | 3 ++ 8 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressController.java b/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressController.java index bbc6b2d..42cee2b 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressController.java +++ b/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressController.java @@ -39,7 +39,6 @@ public class IProgressController extends BaseController { @GetMapping("/list") @ApiOperation(value="分页查询",notes="分页查询") @ResponseBody - @Anonymous public AjaxResult queryList(IProgress iProgress, @RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "10") Integer pageSize) { List iProgresses = iiProgressService.queryListByContion(iProgress); @@ -64,11 +63,11 @@ public class IProgressController extends BaseController { @PostMapping("/add") @ApiOperation("增加") - @Anonymous + public AjaxResult add(@RequestBody IProgress iProgress) { iProgress.setCreateTime(new Date()); iProgress.setCreator(getUsername()); - return AjaxResult.success(iiProgressService.add(iProgress)); + return iiProgressService.add(iProgress); } diff --git a/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressNewController.java b/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressNewController.java index 1760f35..3af810d 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressNewController.java +++ b/src/main/java/com/zilber/boot/intelligencesite/controller/IProgressNewController.java @@ -44,7 +44,6 @@ public class IProgressNewController extends BaseController { @GetMapping("/list") @ApiOperation(value="分页查询",notes="分页查询") @ResponseBody - @Anonymous public AjaxResult queryList(IProductionPlan iProductionPlan,Date date, @RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "10") Integer pageSize) { List iProductionPlans = iiProductionPlanService.queryListNew(iProductionPlan,date); @@ -70,7 +69,6 @@ public class IProgressNewController extends BaseController { @PostMapping("/add") @ApiOperation("增加") - @Anonymous public AjaxResult add(@RequestBody IProgressNew iProgressNew) { iProgressNew.setCreateTime(new Date()); iProgressNew.setCreator(getUsername()); diff --git a/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java b/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java index 7a2e62e..ece7e93 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java +++ b/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java @@ -24,4 +24,5 @@ public interface IProgressNewMapper extends BaseMapper { List queryProcessSj(@Param("planId") Long planId, @Param("date") String date); + List queryYsg(); } diff --git a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java index ee36603..4279439 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java +++ b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java @@ -116,7 +116,7 @@ public class IProductionPlanServiceImpl extends ServiceImpl ysg = iProgressMapper.queryYsg(); //已施工 + List ysg = iProgressNewMapper.queryYsg(); //已施工 //int gcjd=iProductionPlanMapper.queryGcjd();//工程进度 Map map = new HashMap(); map.put("list", total);//总工期 diff --git a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressNewServiceImpl.java b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressNewServiceImpl.java index 7f40e07..5169108 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressNewServiceImpl.java +++ b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressNewServiceImpl.java @@ -32,8 +32,8 @@ public class IProgressNewServiceImpl extends ServiceImpl list=iProgressNewMapper.queryList(new IProgress().setPlanId(iProgressNew.getPlanId())); if(ObjectUtils.isEmpty(ip)){ - List list=iProgressNewMapper.queryList(new IProgress().setPlanId(iProgressNew.getPlanId())); long total = list.stream().mapToLong(IProgressNew::getDayProgress).sum(); if(iProgressNew.getDayProgress()+total>100){ return AjaxResult.error("已超出最大值,最大值应为"+ (100 - total)); @@ -42,15 +42,16 @@ public class IProgressNewServiceImpl extends ServiceImpl list=iProgressNewMapper.queryList(new IProgress().setPlanId(iProgressNew.getPlanId())); long total = list.stream().mapToLong(IProgressNew::getDayProgress).sum(); if(iProgressNew.getDayProgress()+total>100){ return AjaxResult.error("已超出最大值,最大值应为"+ (100 - total)); } ip.setDayProgress(ip.getDayProgress()+iProgressNew.getDayProgress()); + ip.setAccumulativeProgress(ip.getAccumulativeProgress()+iProgressNew.getDayProgress()); return AjaxResult.success(iProgressNewMapper.updateById(ip)); } } diff --git a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressServiceImpl.java b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressServiceImpl.java index e596943..6a79fe0 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressServiceImpl.java +++ b/src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressServiceImpl.java @@ -1,10 +1,13 @@ package com.zilber.boot.intelligencesite.service.impl; import com.zilber.boot.intelligencesite.entity.IProgress; +import com.zilber.boot.intelligencesite.entity.IProgressNew; import com.zilber.boot.intelligencesite.mapper.IProgressMapper; +import com.zilber.boot.intelligencesite.mapper.IProgressNewMapper; import com.zilber.boot.intelligencesite.service.IIProgressService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zilber.boot.utils.AjaxResult; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -26,6 +29,8 @@ public class IProgressServiceImpl extends ServiceImpl queryList(IProgress iProgress) { @@ -34,8 +39,8 @@ public class IProgressServiceImpl extends ServiceImpl list=iProgressMapper.queryList(new IProgress().setPlanId(iProgress.getPlanId())); - long total = list.stream().mapToLong(IProgress::getDayProgress).sum(); + List list=iProgressNewMapper.queryList(new IProgress().setPlanId(iProgress.getPlanId())); + long total = list.stream().mapToLong(IProgressNew::getDayProgress).sum(); if(iProgress.getDayProgress()+total>100){ return AjaxResult.error("已超出最大值,最大值应为"+ (100 - total)); } diff --git a/src/main/resources/mappers/IProductionPlanMapper.xml b/src/main/resources/mappers/IProductionPlanMapper.xml index c3056ed..2425b99 100644 --- a/src/main/resources/mappers/IProductionPlanMapper.xml +++ b/src/main/resources/mappers/IProductionPlanMapper.xml @@ -72,22 +72,27 @@ FROM select count(*) from i_production_plan where principal is not null select * from i_progress_new where plan_id=#{planId} and date_format(process_date,'%y%m%d') = date_format(#{date},'%y%m%d') +