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 67ae1ea..ece7e93 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java +++ b/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java @@ -21,4 +21,8 @@ public interface IProgressNewMapper extends BaseMapper { IProgressNew queryByDate(@Param("planId") Long planId, Date processDate); List queryList(IProgress setPlanId); + + 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 677373e..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 @@ -1,14 +1,7 @@ package com.zilber.boot.intelligencesite.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.zilber.boot.intelligencesite.entity.IManpower; -import com.zilber.boot.intelligencesite.entity.IProductionPlan; -import com.zilber.boot.intelligencesite.entity.IProgress; -import com.zilber.boot.intelligencesite.entity.IWarn; -import com.zilber.boot.intelligencesite.mapper.IManpowerMapper; -import com.zilber.boot.intelligencesite.mapper.IProductionPlanMapper; -import com.zilber.boot.intelligencesite.mapper.IProgressMapper; -import com.zilber.boot.intelligencesite.mapper.IWarnMapper; +import com.zilber.boot.intelligencesite.entity.*; +import com.zilber.boot.intelligencesite.mapper.*; import com.zilber.boot.intelligencesite.service.IIProductionPlanService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zilber.boot.utils.AjaxResult; @@ -18,8 +11,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; @@ -43,6 +34,8 @@ public class IProductionPlanServiceImpl extends ServiceImpl progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); - long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); + List progresseslist = iProgressNewMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); + long total = progresseslist.stream().mapToLong(IProgressNew::getDayProgress).sum(); map.put("sj", total); res.add(map); }else{ @@ -85,8 +78,8 @@ public class IProductionPlanServiceImpl extends ServiceImpl progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); - long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); + List progresseslist = iProgressNewMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); + long total = progresseslist.stream().mapToLong(IProgressNew::getDayProgress).sum(); /* List progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId())); long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();*/ map.put("sj", total); @@ -123,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 f2fa373..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 @@ -1,13 +1,10 @@ package com.zilber.boot.intelligencesite.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.sun.org.apache.regexp.internal.RE; 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.IIProgressNewService; -import com.zilber.boot.intelligencesite.service.IIProgressService; import com.zilber.boot.utils.AjaxResult; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; @@ -35,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)); @@ -45,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 + +