Merge remote-tracking branch 'origin/main'

main
liuao 1 week ago
commit 58cd6162d6
  1. 5
      src/main/java/com/zilber/boot/intelligencesite/controller/IProgressController.java
  2. 2
      src/main/java/com/zilber/boot/intelligencesite/controller/IProgressNewController.java
  3. 4
      src/main/java/com/zilber/boot/intelligencesite/mapper/IProgressNewMapper.java
  4. 25
      src/main/java/com/zilber/boot/intelligencesite/service/impl/IProductionPlanServiceImpl.java
  5. 8
      src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressNewServiceImpl.java
  6. 9
      src/main/java/com/zilber/boot/intelligencesite/service/impl/IProgressServiceImpl.java
  7. 37
      src/main/resources/mappers/IProductionPlanMapper.xml
  8. 6
      src/main/resources/mappers/IProgressNewMapper.xml

@ -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<IProgress> 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);
}

@ -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<IProductionPlan> 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());

@ -21,4 +21,8 @@ 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);
List<IProgressNew> queryYsg();
}

@ -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);
@ -123,7 +116,7 @@ public class IProductionPlanServiceImpl extends ServiceImpl<IProductionPlanMappe
int total = iProductionPlanMapper.queryTotal();//总工期
int sg = iManpowerMapper.querySg();//施工人员
int gl = iProductionPlanMapper.queryGl();//管理人员
List<IProgress> ysg = iProgressMapper.queryYsg(); //已施工
List<IProgressNew> ysg = iProgressNewMapper.queryYsg(); //已施工
//int gcjd=iProductionPlanMapper.queryGcjd();//工程进度
Map map = new HashMap();
map.put("list", total);//总工期

@ -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<IProgressNewMapper, IPr
public AjaxResult add(IProgressNew iProgressNew) {
//查询填报日期下的当日进度
IProgressNew ip=iProgressNewMapper.queryByDate(iProgressNew.getPlanId(),iProgressNew.getProcessDate());
if(ObjectUtils.isEmpty(ip)){
List<IProgressNew> list=iProgressNewMapper.queryList(new IProgress().setPlanId(iProgressNew.getPlanId()));
if(ObjectUtils.isEmpty(ip)){
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<IProgressNewMapper, IPr
iProgressNew1.setPlanId(iProgressNew.getPlanId());
iProgressNew1.setDayProgress(iProgressNew.getDayProgress());
iProgressNew1.setCreateTime(new Date());
iProgressNew1.setAccumulativeProgress(Integer.parseInt(String.valueOf(total))+iProgressNew.getDayProgress());
iProgressNew1.setProcessDate(iProgressNew.getProcessDate());
return AjaxResult.success(iProgressNewMapper.insert(iProgressNew1)) ;
}else{
List<IProgressNew> 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));
}
}

@ -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<IProgressMapper, IProgress
@Resource
private IProgressMapper iProgressMapper;
@Resource
private IProgressNewMapper iProgressNewMapper;
@Override
public List<IProgress> queryList(IProgress iProgress) {
@ -34,8 +39,8 @@ public class IProgressServiceImpl extends ServiceImpl<IProgressMapper, IProgress
@Override
public AjaxResult add(IProgress iProgress) {
List<IProgress> list=iProgressMapper.queryList(new IProgress().setPlanId(iProgress.getPlanId()));
long total = list.stream().mapToLong(IProgress::getDayProgress).sum();
List<IProgressNew> 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));
}

@ -72,22 +72,27 @@ FROM
select count(*) from i_production_plan where principal is not null
</select>
<select id="bigscreenProgress" resultMap="IProductionPlanResult">
SELECT
ipn.id,
ipn.plan_name,
ipn.project_stage,
ipn.description,
ipn.start_time,
ipn.end_time,
ipn.create_time,
ipn.creator,
ipn.duration,
ipn.keystage_time,
ipn.principal,
ipn.parent_id,
ip.accumulative_progress
FROM
i_production_plan ipn left join i_progress ip on ipn.id=ip.plan_id where ipn.parent_id =0
SELECT p.id,
p.plan_name,
p.project_stage,
p.description,
p.start_time,
p.end_time,
p.create_time,
p.creator,
p.duration,
p.keystage_time,
p.principal,
p.parent_id,
pg.accumulative_progress, pg.create_time
FROM i_production_plan p
JOIN i_progress_new pg ON p.id = pg.plan_id
JOIN (
SELECT plan_id, MAX(create_time) AS create_time
FROM i_progress_new
GROUP BY plan_id
) tmp ON pg.plan_id = tmp.plan_id AND pg.create_time = tmp.create_time where p.parent_id=0
</select>
<select id="statistics" resultMap="IProductionPlanResult">
select * from i_production_plan where parent_id =0

@ -34,5 +34,11 @@ 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>
<select id="queryYsg" resultMap="IProgressResult">
select * from i_progress_new GROUP BY plan_id
</select>
</mapper>

Loading…
Cancel
Save