From d8fd780001b14102cfbcb9ff5034f1f680f044ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=83=9C=E8=B6=85?= <504565038@qq.com> Date: Tue, 13 May 2025 13:39:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E5=AE=9E=E9=99=85=E5=AE=8C=E6=88=90=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boot/intelligencesite/mapper/IProgressMapper.java | 3 +++ .../service/impl/IProductionPlanServiceImpl.java | 10 +++++++--- src/main/resources/mappers/IProgressMapper.xml | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressMapper.java b/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressMapper.java index d306a23..929f6c4 100644 --- a/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressMapper.java +++ b/src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressMapper.java @@ -2,6 +2,7 @@ package com.zilber.boot.intelligencesite.mapper; import com.zilber.boot.intelligencesite.entity.IProgress; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @@ -21,4 +22,6 @@ public interface IProgressMapper extends BaseMapper { List queryListByContion(IProgress iProgress); List queryYsg(); + + List queryProcessSj(@Param("planId") Long planId, @Param("date") String date); } 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 bd1f502..31d5ea6 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 @@ -62,7 +62,9 @@ public class IProductionPlanServiceImpl extends ServiceImpl progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); + long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); + map.put("sj", total); res.add(map); }else{ //获取每个计划时间差(结束时间-开始时间) @@ -79,9 +81,11 @@ public class IProductionPlanServiceImpl extends ServiceImpl progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId())); + List progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); - map.put("total", total); + /* List progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId())); + long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();*/ + map.put("sj", total); res.add(map); } } diff --git a/src/main/resources/mappers/IProgressMapper.xml b/src/main/resources/mappers/IProgressMapper.xml index e1ad55b..e3fe7f5 100644 --- a/src/main/resources/mappers/IProgressMapper.xml +++ b/src/main/resources/mappers/IProgressMapper.xml @@ -59,10 +59,14 @@ FROM and accumulative_progress like concat('%', #{accumulativeProgress}, '%') and create_time=#{createTime} and creator=#{creator} + and date_format(process_date,'%y%m%d') = date_format(#{processDate},'%y%m%d') + From 021bc54a07e6487b1c6b8c3ffdbded425f791796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=83=9C=E8=B6=85?= <504565038@qq.com> Date: Tue, 13 May 2025 14:24:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E8=AE=A1=E5=88=92=E5=AE=8C=E6=88=90=E6=95=B0?= =?UTF-8?q?=E4=B8=BA=E5=B9=B3=E5=9D=87=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IProductionPlanServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 31d5ea6..ed3e2ae 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 @@ -18,6 +18,8 @@ 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.*; @@ -60,7 +62,9 @@ public class IProductionPlanServiceImpl extends ServiceImpl progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i)); long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum(); @@ -70,12 +74,12 @@ public class IProductionPlanServiceImpl extends ServiceImpl 0) { currentpercent = BigDecimal.valueOf(100); - } + }*/ map.put("name", iProductionPlan.getPlanName()); map.put("plan", currentpercent);