个人首页添加项目切换,派单详情,附件
This commit is contained in:
@ -28,6 +28,7 @@ import org.dromara.common.core.domain.R;
|
|||||||
import org.dromara.common.core.domain.dto.UserDTO;
|
import org.dromara.common.core.domain.dto.UserDTO;
|
||||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
@ -37,8 +38,11 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
|||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||||
|
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||||
import org.dromara.patch.service.IPdMasterService;
|
import org.dromara.patch.service.IPdMasterService;
|
||||||
|
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
|
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
||||||
import org.dromara.system.domain.SysMenu;
|
import org.dromara.system.domain.SysMenu;
|
||||||
import org.dromara.system.domain.vo.RouterVo;
|
import org.dromara.system.domain.vo.RouterVo;
|
||||||
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
||||||
@ -98,6 +102,8 @@ public class PersonalHomeController extends BaseController {
|
|||||||
|
|
||||||
private final SysMenuServiceImpl sysMenuService;
|
private final SysMenuServiceImpl sysMenuService;
|
||||||
|
|
||||||
|
private final IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||||
|
|
||||||
// region AI 模块
|
// region AI 模块
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -189,7 +195,7 @@ public class PersonalHomeController extends BaseController {
|
|||||||
|
|
||||||
QueryWrapper<FlowTaskBo> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<FlowTaskBo> queryWrapper = new QueryWrapper<>();
|
||||||
List<Long> definitionIds = new ArrayList<>();
|
List<Long> definitionIds = new ArrayList<>();
|
||||||
if (!"0".equals(projectId)) {
|
if (StringUtils.isNotBlank(projectId) && !"0".equals(projectId)) {
|
||||||
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper<FlowDefinition>()
|
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(new LambdaQueryWrapper<FlowDefinition>()
|
||||||
.select(FlowDefinition::getId)
|
.select(FlowDefinition::getId)
|
||||||
.like(FlowDefinition::getFlowCode, projectId));
|
.like(FlowDefinition::getFlowCode, projectId));
|
||||||
@ -198,9 +204,31 @@ public class PersonalHomeController extends BaseController {
|
|||||||
definitionIds.add(flowDefinition.getId());
|
definitionIds.add(flowDefinition.getId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (definitionIds.isEmpty()) {
|
} else {
|
||||||
return null;
|
// 获取当前用户的所有项目
|
||||||
|
List<BusUserProjectRelevancy> projectRelevancyList = userProjectRelevancyService.lambdaQuery()
|
||||||
|
.eq(BusUserProjectRelevancy::getUserId, LoginHelper.getUserId())
|
||||||
|
.list();
|
||||||
|
List<Long> projectIds = projectRelevancyList.stream().map(BusUserProjectRelevancy::getProjectId).distinct().toList();
|
||||||
|
if (CollUtil.isEmpty(projectIds)) {
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
LambdaQueryWrapper<FlowDefinition> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.select(FlowDefinition::getId);
|
||||||
|
lqw.and(w -> {
|
||||||
|
for (Long id : projectIds) {
|
||||||
|
w.or().like(FlowDefinition::getFlowCode, id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
List<FlowDefinition> flowDefinitions = flowDefinitionMapper.selectList(lqw);
|
||||||
|
if (flowDefinitions != null && !flowDefinitions.isEmpty()) {
|
||||||
|
flowDefinitions.forEach(flowDefinition -> {
|
||||||
|
definitionIds.add(flowDefinition.getId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (definitionIds.isEmpty()) {
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
queryWrapper.eq("t.node_type", NodeType.BETWEEN.getKey());
|
queryWrapper.eq("t.node_type", NodeType.BETWEEN.getKey());
|
||||||
queryWrapper.in("t.processed_by", LoginHelper.getUserIdStr());
|
queryWrapper.in("t.processed_by", LoginHelper.getUserIdStr());
|
||||||
@ -229,7 +257,7 @@ public class PersonalHomeController extends BaseController {
|
|||||||
taskInfoDto.setTotal((long) page.size());
|
taskInfoDto.setTotal((long) page.size());
|
||||||
taskInfoDto.setWeekCount((long) weeklyTasks.size());
|
taskInfoDto.setWeekCount((long) weeklyTasks.size());
|
||||||
|
|
||||||
BusPdSjVo busPdSjVo = pdMasterService.queryPageListByDate();
|
BusPdSjVo busPdSjVo = pdMasterService.queryPageListByDate(projectId);
|
||||||
BusWjzxSjDateVo busWjzxSjDateVo = busWjzxService.queryWjzx();
|
BusWjzxSjDateVo busWjzxSjDateVo = busWjzxService.queryWjzx();
|
||||||
|
|
||||||
taskInfoDto.setBusWjzxSjDateVo(busWjzxSjDateVo);
|
taskInfoDto.setBusWjzxSjDateVo(busWjzxSjDateVo);
|
||||||
@ -299,6 +327,16 @@ public class PersonalHomeController extends BaseController {
|
|||||||
return pdMasterService.queryPageListBy(bo, pageQuery);
|
return pdMasterService.queryPageListBy(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取派单详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/pd/{id}")
|
||||||
|
public R<PdMasterVo> getPdInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(pdMasterService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询备忘录列表
|
* 查询备忘录列表
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
package org.dromara.patch.domain;
|
package org.dromara.patch.domain;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import java.util.Date;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 派单对象 pd_master
|
* 派单对象 pd_master
|
||||||
@ -63,7 +64,12 @@ public class PdMaster extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 任务状态
|
* 任务状态
|
||||||
*/
|
*/
|
||||||
private String taskStatus="0";
|
private String taskStatus = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件 id
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
|
|||||||
@ -1,15 +1,14 @@
|
|||||||
package org.dromara.patch.domain.bo;
|
package org.dromara.patch.domain.bo;
|
||||||
|
|
||||||
import org.dromara.patch.domain.PdMaster;
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.patch.domain.PdMaster;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 派单业务对象 pd_master
|
* 派单业务对象 pd_master
|
||||||
@ -25,7 +24,7 @@ public class PdMasterBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
@NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,5 +83,9 @@ public class PdMasterBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件 id
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,18 @@
|
|||||||
package org.dromara.patch.domain.vo;
|
package org.dromara.patch.domain.vo;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.dromara.patch.domain.PdMaster;
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
import org.dromara.patch.domain.PdMaster;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 派单视图对象 pd_master
|
* 派单视图对象 pd_master
|
||||||
*
|
*
|
||||||
@ -96,6 +93,16 @@ public class PdMasterVo implements Serializable {
|
|||||||
@ExcelProperty(value = "子用户")
|
@ExcelProperty(value = "子用户")
|
||||||
private String slaveName;
|
private String slaveName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件 id
|
||||||
|
*/
|
||||||
|
private String fileIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "fileIds")
|
||||||
|
private String fileNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前端显示
|
* 前端显示
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
package org.dromara.patch.service;
|
package org.dromara.patch.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.patch.domain.PdMaster;
|
||||||
|
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||||
import org.dromara.patch.domain.vo.PdMasterVo;
|
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
|
||||||
import org.dromara.patch.domain.PdMaster;
|
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -20,8 +20,9 @@ import java.util.List;
|
|||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-19
|
* @date 2025-08-19
|
||||||
*/
|
*/
|
||||||
public interface IPdMasterService extends IService<PdMaster>{
|
public interface IPdMasterService extends IService<PdMaster> {
|
||||||
List<PdMasterProgressVo> queryProgressList(Long masterId);
|
List<PdMasterProgressVo> queryProgressList(Long masterId);
|
||||||
|
|
||||||
void validEntityBeforeSave(PdMaster entity);
|
void validEntityBeforeSave(PdMaster entity);
|
||||||
|
|
||||||
// 新增进度
|
// 新增进度
|
||||||
@ -32,6 +33,7 @@ public interface IPdMasterService extends IService<PdMaster>{
|
|||||||
|
|
||||||
// 删除进度
|
// 删除进度
|
||||||
Boolean removeProgress(Long id);
|
Boolean removeProgress(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询派单
|
* 查询派单
|
||||||
*
|
*
|
||||||
@ -94,7 +96,8 @@ public interface IPdMasterService extends IService<PdMaster>{
|
|||||||
/**
|
/**
|
||||||
* 查询派单列表
|
* 查询派单列表
|
||||||
*
|
*
|
||||||
|
* @param projectId 项目 id
|
||||||
* @return 派单列表
|
* @return 派单列表
|
||||||
*/
|
*/
|
||||||
BusPdSjVo queryPageListByDate();
|
BusPdSjVo queryPageListByDate(String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,35 +1,33 @@
|
|||||||
package org.dromara.patch.service.impl;
|
package org.dromara.patch.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.translation.annotation.Translation;
|
import org.dromara.patch.domain.PdMaster;
|
||||||
import org.dromara.patch.domain.PdMasterSon;
|
import org.dromara.patch.domain.PdMasterSon;
|
||||||
import org.dromara.patch.domain.PdMasterUser;
|
import org.dromara.patch.domain.PdMasterUser;
|
||||||
|
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||||
import org.dromara.patch.enums.TaskStatusEnum;
|
|
||||||
import org.dromara.patch.service.IPdMasterSonService;
|
|
||||||
import org.dromara.patch.service.IPdMasterUserService;
|
|
||||||
import org.dromara.system.domain.SysUser;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
|
||||||
import org.dromara.patch.domain.vo.PdMasterVo;
|
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||||
import org.dromara.patch.domain.PdMaster;
|
import org.dromara.patch.enums.TaskStatusEnum;
|
||||||
import org.dromara.patch.mapper.PdMasterMapper;
|
import org.dromara.patch.mapper.PdMasterMapper;
|
||||||
import org.dromara.patch.service.IPdMasterService;
|
import org.dromara.patch.service.IPdMasterService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import org.dromara.patch.service.IPdMasterSonService;
|
||||||
|
import org.dromara.patch.service.IPdMasterUserService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -86,7 +84,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
if (one == null) {
|
if (one == null) {
|
||||||
throw new RuntimeException("执行人未找到!");
|
throw new RuntimeException("执行人未找到!");
|
||||||
}
|
}
|
||||||
if (!Objects.equals(userId, one.getSlaveid())){
|
if (!Objects.equals(userId, one.getSlaveid())) {
|
||||||
throw new RuntimeException("执行人不匹配!");
|
throw new RuntimeException("执行人不匹配!");
|
||||||
}
|
}
|
||||||
if (progress.getOrdersId() == null) {
|
if (progress.getOrdersId() == null) {
|
||||||
@ -105,7 +103,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
bigDecimal = bigDecimal.add(new BigDecimal(masterSon.getProgress()));
|
bigDecimal = bigDecimal.add(new BigDecimal(masterSon.getProgress()));
|
||||||
}
|
}
|
||||||
//bigDecimal是否为100,100变更数据状态
|
//bigDecimal是否为100,100变更数据状态
|
||||||
if (bigDecimal.compareTo(new BigDecimal("100")) == 0){
|
if (bigDecimal.compareTo(new BigDecimal("100")) == 0) {
|
||||||
//更新主表状态
|
//更新主表状态
|
||||||
PdMaster pdMaster = baseMapper.selectById(progress.getOrdersId());
|
PdMaster pdMaster = baseMapper.selectById(progress.getOrdersId());
|
||||||
pdMaster.setTaskStatus(TaskStatusEnum.FINISHED.getValue());
|
pdMaster.setTaskStatus(TaskStatusEnum.FINISHED.getValue());
|
||||||
@ -116,6 +114,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean editProgress(PdMasterProgressVo progress) {
|
public Boolean editProgress(PdMasterProgressVo progress) {
|
||||||
if (progress.getOrdersId() == null) {
|
if (progress.getOrdersId() == null) {
|
||||||
@ -158,8 +157,10 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
baseMapper.updateById(master);
|
baseMapper.updateById(master);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据主表ID查询进度详情列表
|
* 根据主表ID查询进度详情列表
|
||||||
|
*
|
||||||
* @param masterId 主表ID
|
* @param masterId 主表ID
|
||||||
* @return 进度详情列表
|
* @return 进度详情列表
|
||||||
*/
|
*/
|
||||||
@ -170,6 +171,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
}
|
}
|
||||||
return baseMapper.selectProgressByMasterId(masterId);
|
return baseMapper.selectProgressByMasterId(masterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询派单
|
* 查询派单
|
||||||
*
|
*
|
||||||
@ -177,7 +179,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
* @return 派单
|
* @return 派单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PdMasterVo queryById(Long id){
|
public PdMasterVo queryById(Long id) {
|
||||||
//1、获取基础数据
|
//1、获取基础数据
|
||||||
PdMasterVo pdMasterVo = baseMapper.selectVoById(id);
|
PdMasterVo pdMasterVo = baseMapper.selectVoById(id);
|
||||||
//2、查询下面的用户
|
//2、查询下面的用户
|
||||||
@ -209,7 +211,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
for (PdMasterSon pdMasterSon : list) {
|
for (PdMasterSon pdMasterSon : list) {
|
||||||
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
|
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
|
||||||
}
|
}
|
||||||
item.setCompletionProgress(bigDecimal+"%");
|
item.setCompletionProgress(bigDecimal + "%");
|
||||||
//执行人
|
//执行人
|
||||||
PdMasterUser one1 = pdMasterUserService.getById(item.getId());
|
PdMasterUser one1 = pdMasterUserService.getById(item.getId());
|
||||||
item.setSlaveName(one1.getSlaveName());
|
item.setSlaveName(one1.getSlaveName());
|
||||||
@ -222,39 +224,53 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
PdMasterBymiAndQt res = new PdMasterBymiAndQt();
|
PdMasterBymiAndQt res = new PdMasterBymiAndQt();
|
||||||
// 获取登陆人
|
// 获取登陆人
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
|
Long projectId = bo.getProjectId();
|
||||||
//获取我派发的
|
//获取我派发的
|
||||||
List<PdMasterVo> pdMasters = baseMapper.selectVoList(new LambdaQueryWrapper<PdMaster>().eq(PdMaster::getCreateBy, userId));
|
List<PdMasterVo> pdMasters = baseMapper.selectVoList(new LambdaQueryWrapper<PdMaster>()
|
||||||
|
.eq(projectId != null && projectId != 0, PdMaster::getProjectId, projectId)
|
||||||
|
.eq(PdMaster::getCreateBy, userId));
|
||||||
pdMasters = pdJudge(bo.getTaskType(), pdMasters);
|
pdMasters = pdJudge(bo.getTaskType(), pdMasters);
|
||||||
res.setWpd(pdMasters);
|
res.setWpd(pdMasters);
|
||||||
// 获取其他部门派发给我的
|
// 获取其他部门派发给我的
|
||||||
List<PdMasterUser> pdMasterUsers = pdMasterUserService.getBaseMapper().selectList(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getSlaveid, userId));
|
List<PdMasterUser> pdMasterUsers = pdMasterUserService.getBaseMapper().selectList(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getSlaveid, userId));
|
||||||
if (pdMasterUsers != null && pdMasterUsers.size() > 0) {
|
if (CollUtil.isNotEmpty(pdMasterUsers)) {
|
||||||
List<Long> collect = pdMasterUsers.stream().map(item ->item.getOrdersid()).collect((Collectors.toList()));
|
List<Long> collect = pdMasterUsers.stream().map(PdMasterUser::getOrdersid).collect((Collectors.toList()));
|
||||||
List<PdMasterVo> pdMasterVos = baseMapper.selectVoByIds(collect);
|
List<PdMasterVo> pdMasterVos = baseMapper.selectVoList(new LambdaQueryWrapper<PdMaster>()
|
||||||
|
.eq(projectId != null && projectId != 0, PdMaster::getProjectId, projectId)
|
||||||
|
.in(PdMaster::getId, collect));
|
||||||
pdMasterVos = pdJudge(bo.getTaskType(), pdMasterVos);
|
pdMasterVos = pdJudge(bo.getTaskType(), pdMasterVos);
|
||||||
res.setQtbm(pdMasterVos);
|
res.setQtbm(pdMasterVos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusPdSjVo queryPageListByDate() {
|
public BusPdSjVo queryPageListByDate(String projectId) {
|
||||||
BusPdSjVo res = new BusPdSjVo();
|
BusPdSjVo res = new BusPdSjVo();
|
||||||
// 获取登陆人
|
// 获取登陆人
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
//获取我派发的
|
//获取我派发的
|
||||||
Long l = baseMapper.selectCount(new LambdaQueryWrapper<PdMaster>().eq(PdMaster::getCreateBy, userId));
|
Long l = baseMapper.selectCount(new LambdaQueryWrapper<PdMaster>()
|
||||||
|
.eq(PdMaster::getCreateBy, userId)
|
||||||
|
.eq(StringUtils.isNotBlank(projectId) && !projectId.equals("0"), PdMaster::getProjectId, projectId));
|
||||||
//其他部门派发给我的
|
//其他部门派发给我的
|
||||||
Long count = pdMasterUserService.getBaseMapper().selectCount(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getSlaveid, userId));
|
List<PdMasterUser> pdMasterUsers = pdMasterUserService.getBaseMapper()
|
||||||
|
.selectList(new LambdaQueryWrapper<PdMasterUser>()
|
||||||
|
.eq(PdMasterUser::getSlaveid, userId));
|
||||||
|
Long l1 = 0L;
|
||||||
|
if (CollUtil.isNotEmpty(pdMasterUsers)) {
|
||||||
|
Set<Long> ids = pdMasterUsers.stream().map(PdMasterUser::getOrdersid).collect(Collectors.toSet());
|
||||||
|
l1 = baseMapper.selectCount(new LambdaQueryWrapper<PdMaster>()
|
||||||
|
.eq(StringUtils.isNotBlank(projectId) && !projectId.equals("0"), PdMaster::getProjectId, projectId)
|
||||||
|
.in(PdMaster::getId, ids));
|
||||||
|
}
|
||||||
res.setWdpdrw(l);
|
res.setWdpdrw(l);
|
||||||
res.setQtbmpd(count);
|
res.setQtbmpd(l1);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<PdMasterVo> pdJudge(Integer flow ,List<PdMasterVo> records) {
|
private List<PdMasterVo> pdJudge(Integer flow, List<PdMasterVo> records) {
|
||||||
if (records == null || records.size() == 0) return records;
|
if (records == null || records.size() == 0) return records;
|
||||||
|
|
||||||
//获取当前主数据下面的进度百分比
|
//获取当前主数据下面的进度百分比
|
||||||
@ -264,12 +280,12 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
for (PdMasterSon pdMasterSon : list) {
|
for (PdMasterSon pdMasterSon : list) {
|
||||||
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
|
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
|
||||||
}
|
}
|
||||||
item.setCompletionProgress(bigDecimal+"%");
|
item.setCompletionProgress(bigDecimal + "%");
|
||||||
if (bigDecimal.compareTo(new BigDecimal("0")) == 0) {
|
if (bigDecimal.compareTo(new BigDecimal("0")) == 0) {
|
||||||
item.setTapName("待处理");
|
item.setTapName("待处理");
|
||||||
}else if (bigDecimal.compareTo(new BigDecimal("100")) == 0) {
|
} else if (bigDecimal.compareTo(new BigDecimal("100")) == 0) {
|
||||||
item.setTapName("已完成");
|
item.setTapName("已完成");
|
||||||
}else if (bigDecimal.compareTo(new BigDecimal("100")) < 0) {
|
} else if (bigDecimal.compareTo(new BigDecimal("100")) < 0) {
|
||||||
item.setTapName("进行中");
|
item.setTapName("进行中");
|
||||||
}
|
}
|
||||||
//执行人
|
//执行人
|
||||||
@ -286,17 +302,11 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
if (flow == 4) {
|
if (flow == 4) {
|
||||||
return true;
|
return true;
|
||||||
} else if (flow == 1) {
|
} else if (flow == 1) {
|
||||||
if (item.getTapName().equals("进行中")) {
|
return item.getTapName().equals("进行中");
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (flow == 2) {
|
} else if (flow == 2) {
|
||||||
if (item.getTapName().equals("已完成")) {
|
return item.getTapName().equals("已完成");
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (flow == 3) {
|
} else if (flow == 3) {
|
||||||
if (item.getTapName().equals("待处理")) {
|
return item.getTapName().equals("待处理");
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -309,7 +319,6 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的派单列表
|
* 查询符合条件的派单列表
|
||||||
*
|
*
|
||||||
@ -371,7 +380,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
//1、修改数据
|
//1、修改数据
|
||||||
PdMaster update = MapstructUtils.convert(bo, PdMaster.class);
|
PdMaster update = MapstructUtils.convert(bo, PdMaster.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
if (baseMapper.updateById(update) > 0){
|
if (baseMapper.updateById(update) > 0) {
|
||||||
//2、删除子用户
|
//2、删除子用户
|
||||||
pdMasterUserService.remove(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getOrdersid, bo.getId()));
|
pdMasterUserService.remove(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getOrdersid, bo.getId()));
|
||||||
//3、新增子用户
|
//3、新增子用户
|
||||||
@ -399,7 +408,7 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
pdMasterUserService.getBaseMapper().delete(new LambdaQueryWrapper<PdMasterUser>().in(PdMasterUser::getOrdersid, ids));
|
pdMasterUserService.getBaseMapper().delete(new LambdaQueryWrapper<PdMasterUser>().in(PdMasterUser::getOrdersid, ids));
|
||||||
@ -407,5 +416,4 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user