修改进度监控实际完成数

main
刘胜超 2 weeks ago
parent 947e0213db
commit d8fd780001
  1. 3
      src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressMapper.java
  2. 10
      src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java
  3. 4
      src/main/resources/mappers/IProgressMapper.xml

@ -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<IProgress> {
List<IProgress> queryListByContion(IProgress iProgress);
List<IProgress> queryYsg();
List<IProgress> queryProcessSj(@Param("planId") Long planId, @Param("date") String date);
}

@ -62,7 +62,9 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe
map.put("name", iProductionPlan.getPlanName());
map.put("plan", 0);
map.put("date", recentWeekDates.get(i));
map.put("sj", 0);
List<IProgress> 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<IProductionPlanMappe
map.put("plan", currentpercent);
map.put("date", recentWeekDates.get(i));
//查询计划实际填报情况
List<IProgress> progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId()));
List<IProgress> progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i));
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();
map.put("total", total);
/* List<IProgress> progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId()));
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();*/
map.put("sj", total);
res.add(map);
}
}

@ -59,10 +59,14 @@ FROM
<if test="accumulativeProgress != null"> and accumulative_progress like concat('%', #{accumulativeProgress}, '%')</if>
<if test="createTime != null"> and create_time=#{createTime}</if>
<if test="creator != null and creator != ''"> and creator=#{creator}</if>
<if test="processDate != null">and date_format(process_date,'%y%m%d') = date_format(#{processDate},'%y%m%d')</if>
</where>
</select>
<select id="queryYsg" resultMap="IProgressResult">
select * from i_progress where accumulative_progress is not null GROUP BY plan_id
</select>
<select id="queryProcessSj" resultMap="IProgressResult">
select * from i_progress where plan_id=#{planId} and date_format(process_date,'%y%m%d') = date_format(#{date},'%y%m%d')
</select>
</mapper>

Loading…
Cancel
Save