Merge remote-tracking branch 'origin/updateMenu' into updateMenu
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));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询备忘录列表
|
* 查询备忘录列表
|
||||||
|
|||||||
@ -7,10 +7,12 @@ import com.alibaba.excel.write.metadata.WriteSheet;
|
|||||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.*;
|
||||||
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;
|
||||||
@ -20,6 +22,7 @@ import org.dromara.common.web.core.BaseController;
|
|||||||
import org.dromara.design.domain.bo.*;
|
import org.dromara.design.domain.bo.*;
|
||||||
import org.dromara.design.domain.vo.*;
|
import org.dromara.design.domain.vo.*;
|
||||||
import org.dromara.design.exportUtil.bill.*;
|
import org.dromara.design.exportUtil.bill.*;
|
||||||
|
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -42,6 +45,7 @@ import java.util.*;
|
|||||||
public class BusBillofquantitiesVersionsController extends BaseController {
|
public class BusBillofquantitiesVersionsController extends BaseController {
|
||||||
|
|
||||||
private final IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
private final IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||||
|
private final IBusBillofquantitiesService busBillofquantitiesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入excel
|
* 导入excel
|
||||||
@ -224,38 +228,38 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
|||||||
// return R.ok(busBillofquantitiesVersionsService.queryById(id));
|
// return R.ok(busBillofquantitiesVersionsService.queryById(id));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
/**
|
||||||
// * 新增工程量清单版本
|
* 新增工程量清单版本
|
||||||
// */
|
*/
|
||||||
// @SaCheckPermission("design:billofquantitiesVersions:add")
|
@SaCheckPermission("design:billofquantitiesVersions:add")
|
||||||
// @Log(title = "工程量清单版本", businessType = BusinessType.INSERT)
|
@Log(title = "工程量清单版本", businessType = BusinessType.INSERT)
|
||||||
// @RepeatSubmit()
|
@RepeatSubmit()
|
||||||
// @PostMapping()
|
@PostMapping()
|
||||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBillofquantitiesVersionsBo bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBillofquantitiesBo bo) {
|
||||||
// return toAjax(busBillofquantitiesVersionsService.insertByBo(bo));
|
return toAjax(busBillofquantitiesService.insertByBo(bo));
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * 修改工程量清单版本
|
* 修改工程量清单版本
|
||||||
// */
|
*/
|
||||||
// @SaCheckPermission("design:billofquantitiesVersions:edit")
|
@SaCheckPermission("design:billofquantitiesVersions:edit")
|
||||||
// @Log(title = "工程量清单版本", businessType = BusinessType.UPDATE)
|
@Log(title = "工程量清单版本", businessType = BusinessType.UPDATE)
|
||||||
// @RepeatSubmit()
|
@RepeatSubmit()
|
||||||
// @PutMapping()
|
@PutMapping()
|
||||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBillofquantitiesVersionsBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBillofquantitiesBo bo) {
|
||||||
// return toAjax(busBillofquantitiesVersionsService.updateByBo(bo));
|
return toAjax(busBillofquantitiesService.updateByBo(bo));
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * 删除工程量清单版本
|
* 删除工程量清单版本
|
||||||
// *
|
*
|
||||||
// * @param ids 主键串
|
* @param ids 主键串
|
||||||
// */
|
*/
|
||||||
// @SaCheckPermission("design:billofquantitiesVersions:remove")
|
@SaCheckPermission("design:billofquantitiesVersions:remove")
|
||||||
// @Log(title = "工程量清单版本", businessType = BusinessType.DELETE)
|
@Log(title = "工程量清单版本", businessType = BusinessType.DELETE)
|
||||||
// @DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
// @PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
// return toAjax(busBillofquantitiesVersionsService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(busBillofquantitiesService.deleteWithValidByIds(List.of(ids), true));
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,8 +113,8 @@ public class DesSchemeController extends BaseController {
|
|||||||
@Log(title = "设计方案", businessType = BusinessType.INSERT)
|
@Log(title = "设计方案", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/upload")
|
@PostMapping("/upload")
|
||||||
public R<Long> addFile(MultipartFile file, Long projectId) {
|
public R<Long> addFile(MultipartFile file, Long projectId,String type) {
|
||||||
return R.ok(desSchemeService.addFile(file, projectId));
|
return R.ok(desSchemeService.addFile(file, projectId, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -51,6 +51,10 @@ public class DesScheme extends BaseEntity {
|
|||||||
* 审核状态
|
* 审核状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
/**
|
||||||
|
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||||
|
*/
|
||||||
|
private String schemeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序字段
|
* 排序字段
|
||||||
|
|||||||
@ -79,5 +79,10 @@ public class BusBillofquantitiesBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,5 +52,10 @@ public class DesSchemeBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||||
|
*/
|
||||||
|
private String schemeType;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,5 +64,10 @@ public class DesSchemeVo implements Serializable {
|
|||||||
@ExcelProperty(value = "审核状态")
|
@ExcelProperty(value = "审核状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||||
|
*/
|
||||||
|
private String schemeType;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
package org.dromara.design.service;
|
package org.dromara.design.service;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.design.domain.dto.ExportDto;
|
import org.dromara.design.domain.dto.ExportDto;
|
||||||
import org.dromara.design.domain.vo.DesSchemeVo;
|
import org.dromara.design.domain.vo.DesSchemeVo;
|
||||||
import org.dromara.design.domain.bo.DesSchemeBo;
|
import org.dromara.design.domain.bo.DesSchemeBo;
|
||||||
@ -11,7 +9,6 @@ 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.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -78,7 +75,7 @@ public interface IDesSchemeService extends IService<DesScheme>{
|
|||||||
/**
|
/**
|
||||||
* 添加文件
|
* 添加文件
|
||||||
*/
|
*/
|
||||||
Long addFile(MultipartFile file, Long projectId);
|
Long addFile(MultipartFile file, Long projectId, String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改文件
|
* 修改文件
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
package org.dromara.design.service.impl;
|
package org.dromara.design.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.NumberChineseFormatter;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
|
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.TableDataInfo;
|
||||||
@ -9,12 +14,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.utils.BatchNumberGenerator;
|
||||||
|
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||||
|
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.design.domain.bo.BusBillofquantitiesBo;
|
import org.dromara.design.domain.bo.BusBillofquantitiesBo;
|
||||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||||
import org.dromara.design.domain.BusBillofquantities;
|
import org.dromara.design.domain.BusBillofquantities;
|
||||||
import org.dromara.design.mapper.BusBillofquantitiesMapper;
|
import org.dromara.design.mapper.BusBillofquantitiesMapper;
|
||||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -31,6 +41,9 @@ import java.util.Collection;
|
|||||||
public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantitiesMapper, BusBillofquantities> implements IBusBillofquantitiesService {
|
public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantitiesMapper, BusBillofquantities> implements IBusBillofquantitiesService {
|
||||||
|
|
||||||
private final BusBillofquantitiesMapper baseMapper;
|
private final BusBillofquantitiesMapper baseMapper;
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工程量清单
|
* 查询工程量清单
|
||||||
@ -94,6 +107,31 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
|||||||
public Boolean insertByBo(BusBillofquantitiesBo bo) {
|
public Boolean insertByBo(BusBillofquantitiesBo bo) {
|
||||||
BusBillofquantities add = MapstructUtils.convert(bo, BusBillofquantities.class);
|
BusBillofquantities add = MapstructUtils.convert(bo, BusBillofquantities.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
|
// 生成当前节点的sid
|
||||||
|
String sid = BatchNumberGenerator.generateBatchNumber("GCLQD-");
|
||||||
|
add.setSid(sid);
|
||||||
|
//获取当前父节点下有多少子节点
|
||||||
|
Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getPid, bo.getPid())) +1;
|
||||||
|
if ("0".equals(bo.getPid())){
|
||||||
|
//当父节点为0时,生成中文编号作为顶层
|
||||||
|
String s = NumberChineseFormatter.numberCharToChinese((char) count.longValue(), false);
|
||||||
|
add.setNum(s);
|
||||||
|
}else {
|
||||||
|
//当父节点不为0时,生成数字编号作为子节点编号
|
||||||
|
BusBillofquantities busBillofquantities = baseMapper.selectOne(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getSid, bo.getPid()));
|
||||||
|
if (busBillofquantities == null){
|
||||||
|
throw new ServiceException("父节点不存在");
|
||||||
|
}
|
||||||
|
if ("0".equals(busBillofquantities.getPid())){
|
||||||
|
add.setNum(count.toString());
|
||||||
|
}else {
|
||||||
|
if (busBillofquantities.getNum() != null){
|
||||||
|
//当父节点有编号时,生成数字编号作为子节点编号 无编号时,不生成编号
|
||||||
|
String s = busBillofquantities.getNum() + "." + count;
|
||||||
|
add.setNum(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
@ -119,6 +157,22 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
|||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(BusBillofquantities entity) {
|
private void validEntityBeforeSave(BusBillofquantities entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
BusBillofquantitiesVersions versions = busBillofquantitiesVersionsService
|
||||||
|
.getBaseMapper()
|
||||||
|
.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||||
|
.eq(BusBillofquantitiesVersions::getVersions, entity.getVersions()));
|
||||||
|
if (versions == null) {
|
||||||
|
throw new ServiceException("版本不存在");
|
||||||
|
}
|
||||||
|
if (!BusinessStatusEnum.DRAFT.getStatus().equals(versions.getStatus())
|
||||||
|
&& !BusinessStatusEnum.BACK.getStatus().equals(versions.getStatus())
|
||||||
|
&& !BusinessStatusEnum.CANCEL.getStatus().equals(versions.getStatus())){
|
||||||
|
if (entity.getId() != null){
|
||||||
|
throw new ServiceException("版本处于审核中,不能修改");
|
||||||
|
}else {
|
||||||
|
throw new ServiceException("版本处于审核中,不能新增");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,6 +186,25 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
|||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
for (Long id : ids) {
|
||||||
|
BusBillofquantities busBillofquantities = baseMapper.selectById(id);
|
||||||
|
if (busBillofquantities == null) {
|
||||||
|
throw new ServiceException("数据不存在");
|
||||||
|
}
|
||||||
|
BusBillofquantitiesVersions versions = busBillofquantitiesVersionsService
|
||||||
|
.getBaseMapper()
|
||||||
|
.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||||
|
.eq(BusBillofquantitiesVersions::getVersions, busBillofquantities.getVersions()));
|
||||||
|
if (versions == null) {
|
||||||
|
throw new ServiceException("版本不存在");
|
||||||
|
}
|
||||||
|
if (!BusinessStatusEnum.DRAFT.getStatus().equals(versions.getStatus())
|
||||||
|
&& !BusinessStatusEnum.BACK.getStatus().equals(versions.getStatus())
|
||||||
|
&& !BusinessStatusEnum.CANCEL.getStatus().equals(versions.getStatus())){
|
||||||
|
throw new ServiceException("版本处于审核中,不能删除");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.oss.core.OssClient;
|
|
||||||
import org.dromara.common.oss.factory.OssFactory;
|
|
||||||
import org.dromara.design.domain.DesCollectFile;
|
|
||||||
import org.dromara.design.domain.DesPrelimScheme;
|
|
||||||
import org.dromara.design.domain.dto.ExportDto;
|
import org.dromara.design.domain.dto.ExportDto;
|
||||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
import org.dromara.system.service.ISysOssService;
|
import org.dromara.system.service.ISysOssService;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
@ -46,7 +41,6 @@ import java.net.http.HttpResponse;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -173,7 +167,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long addFile(MultipartFile file, Long projectId) {
|
public Long addFile(MultipartFile file, Long projectId, String type) {
|
||||||
SysOssVo upload = ossService.upload(file, ossService.minioFileName(ContactNoticeTemplate, file));
|
SysOssVo upload = ossService.upload(file, ossService.minioFileName(ContactNoticeTemplate, file));
|
||||||
DesScheme scheme = new DesScheme();
|
DesScheme scheme = new DesScheme();
|
||||||
scheme.setProjectId(projectId);
|
scheme.setProjectId(projectId);
|
||||||
@ -181,7 +175,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
|
|||||||
scheme.setOssId(upload.getOssId());
|
scheme.setOssId(upload.getOssId());
|
||||||
scheme.setFileName(upload.getOriginalName());
|
scheme.setFileName(upload.getOriginalName());
|
||||||
scheme.setFileUrl(upload.getUrl());
|
scheme.setFileUrl(upload.getUrl());
|
||||||
|
scheme.setSchemeType(type);
|
||||||
baseMapper.insert(scheme);
|
baseMapper.insert(scheme);
|
||||||
return scheme.getId();
|
return scheme.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
@ -65,6 +66,11 @@ 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
|
||||||
@ -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;
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
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;
|
||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询派单
|
* 查询派单
|
||||||
*
|
*
|
||||||
@ -222,34 +224,48 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的派单列表
|
* 查询符合条件的派单列表
|
||||||
*
|
*
|
||||||
@ -407,5 +416,4 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import org.dromara.workflow.common.ConditionalOnEnable;
|
|||||||
import org.dromara.workflow.domain.bo.FlowDefinitionBo;
|
import org.dromara.workflow.domain.bo.FlowDefinitionBo;
|
||||||
import org.dromara.workflow.domain.vo.FlowDefinitionVo;
|
import org.dromara.workflow.domain.vo.FlowDefinitionVo;
|
||||||
import org.dromara.workflow.service.IFlwDefinitionService;
|
import org.dromara.workflow.service.IFlwDefinitionService;
|
||||||
|
import org.dromara.workflow.service.IFlwInstanceService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -43,6 +44,7 @@ public class FlwDefinitionController extends BaseController {
|
|||||||
|
|
||||||
private final DefService defService;
|
private final DefService defService;
|
||||||
private final IFlwDefinitionService flwDefinitionService;
|
private final IFlwDefinitionService flwDefinitionService;
|
||||||
|
private final IFlwInstanceService flwInstanceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询流程定义列表
|
* 查询流程定义列表
|
||||||
@ -241,4 +243,12 @@ public class FlwDefinitionController extends BaseController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/init/{projectId}")
|
||||||
|
@RepeatSubmit()
|
||||||
|
public R<Boolean> initProject(@PathVariable String projectId) {
|
||||||
|
flwInstanceService.initProject(projectId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
import org.dromara.workflow.domain.bo.FlowInstanceBo;
|
import org.dromara.workflow.domain.bo.FlowInstanceBo;
|
||||||
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
||||||
|
|
||||||
@ -24,4 +25,10 @@ public interface FlwInstanceMapper {
|
|||||||
*/
|
*/
|
||||||
Page<FlowInstanceVo> selectInstanceList(@Param("page") Page<FlowInstanceVo> page, @Param(Constants.WRAPPER) Wrapper<FlowInstanceBo> queryWrapper);
|
Page<FlowInstanceVo> selectInstanceList(@Param("page") Page<FlowInstanceVo> page, @Param(Constants.WRAPPER) Wrapper<FlowInstanceBo> queryWrapper);
|
||||||
|
|
||||||
|
@Update("update flow_node set permission_flag = '1' where definition_id in (select id from flow_definition where flow_code like concat('',#{projectId},'%'))")
|
||||||
|
void updateCode(String projectId);
|
||||||
|
|
||||||
|
|
||||||
|
@Update("update flow_definition set is_publish = 1 where flow_code like concat('',#{projectId},'%')")
|
||||||
|
void updateFlowDefinition(String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,4 +156,12 @@ public interface IFlwInstanceService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean processInvalid(FlowInvalidBo bo);
|
boolean processInvalid(FlowInvalidBo bo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化项目流程定义
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
*/
|
||||||
|
void initProject(String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -445,4 +445,10 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
throw new ServiceException(e.getMessage());
|
throw new ServiceException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initProject(String projectId) {
|
||||||
|
flwInstanceMapper.updateCode(projectId);
|
||||||
|
flwInstanceMapper.updateFlowDefinition(projectId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user