修改进度逻辑

main
刘胜超 1 week ago
parent 8308eb59af
commit da62ea09a7
  1. 3
      src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java
  2. 23
      src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java
  3. 3
      src/main/resources/mappers/IProgressNewMapper.xml

@ -21,4 +21,7 @@ public interface IProgressNewMapper extends BaseMapper<IProgressNew> {
IProgressNew queryByDate(@Param("planId") Long planId, Date processDate);
List<IProgressNew> queryList(IProgress setPlanId);
List<IProgressNew> queryProcessSj(@Param("planId") Long planId, @Param("date") String date);
}

@ -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<IProductionPlanMappe
private IManpowerMapper iManpowerMapper;
@Resource
private IWarnMapper iWarnMapper;
@Resource
private IProgressNewMapper iProgressNewMapper;
@Override
@ -66,8 +59,8 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe
map.put("plan", daypercent);
map.put("date", recentWeekDates.get(i));
List<IProgress> progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i));
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();
List<IProgressNew> 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<IProductionPlanMappe
map.put("plan", currentpercent);
map.put("date", recentWeekDates.get(i));
//查询计划实际填报情况
List<IProgress> progresseslist = iProgressMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i));
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();
List<IProgressNew> progresseslist = iProgressNewMapper.queryProcessSj(iProductionPlan.getId(),recentWeekDates.get(i));
long total = progresseslist.stream().mapToLong(IProgressNew::getDayProgress).sum();
/* List<IProgress> progresseslist = iProgressMapper.queryList(new IProgress().setPlanId(iProductionPlan.getId()));
long total = progresseslist.stream().mapToLong(IProgress::getDayProgress).sum();*/
map.put("sj", total);

@ -34,5 +34,8 @@ id, plan_id, day_progress, accumulative_progress, create_time, creator,process_
</where>
order by create_time desc
</select>
<select id="queryProcessSj" resultMap="IProgressResult">
select * from i_progress_new where plan_id=#{planId} and date_format(process_date,'%y%m%d') = date_format(#{date},'%y%m%d')
</select>
</mapper>

Loading…
Cancel
Save