派单任务,备忘录查询接口
This commit is contained in:
@ -0,0 +1,105 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 备忘录
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/bwl/bwl")
|
||||
public class BusBwlController extends BaseController {
|
||||
|
||||
private final IBusBwlService busBwlService;
|
||||
|
||||
/**
|
||||
* 查询备忘录列表
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusBwlVo> list(BusBwlBo bo, PageQuery pageQuery) {
|
||||
return busBwlService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出备忘录列表
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:export")
|
||||
@Log(title = "备忘录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusBwlBo bo, HttpServletResponse response) {
|
||||
List<BusBwlVo> list = busBwlService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "备忘录", BusBwlVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备忘录详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusBwlVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busBwlService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:add")
|
||||
@Log(title = "备忘录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBwlBo bo) {
|
||||
return toAjax(busBwlService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:edit")
|
||||
@Log(title = "备忘录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBwlBo bo) {
|
||||
return toAjax(busBwlService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除备忘录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:remove")
|
||||
@Log(title = "备忘录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBwlService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,26 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.dto.TaskInfoDto;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.dto.UserDTO;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||
import org.dromara.patch.service.IPdMasterService;
|
||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||
import org.dromara.warm.flow.core.FlowEngine;
|
||||
import org.dromara.warm.flow.core.entity.User;
|
||||
@ -36,6 +46,7 @@ import java.util.*;
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/personalHome")
|
||||
public class PersonalHomeController extends BaseController {
|
||||
|
||||
@ -46,6 +57,34 @@ public class PersonalHomeController extends BaseController {
|
||||
@Autowired
|
||||
private SysUserServiceImpl userService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IPdMasterService pdMasterService;
|
||||
|
||||
private final IBusBwlService busBwlService;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
*/
|
||||
// @SaCheckPermission("patch:master:list")
|
||||
@GetMapping("/listPd")
|
||||
public PdMasterBymiAndQt listPd(PdMasterBo bo, PageQuery pageQuery) {
|
||||
return pdMasterService.queryPageListBy(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询备忘录列表
|
||||
*/
|
||||
@SaCheckPermission("bwl:bwl:list")
|
||||
@GetMapping("/listbwl")
|
||||
public TableDataInfo<BusBwlVo> listbwl(BusBwlBo bo, PageQuery pageQuery) {
|
||||
return busBwlService.queryPageListbwl(bo, pageQuery);
|
||||
}
|
||||
|
||||
@GetMapping("/getTaskList")
|
||||
public R<TaskInfoDto> getTaskList(String projectId) {
|
||||
TaskInfoDto taskInfoDto = new TaskInfoDto();
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
package org.dromara.bigscreen.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 备忘录对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_bwl")
|
||||
public class BusBwl extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package org.dromara.bigscreen.domain.dto;
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 备忘录业务对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusBwl.class, reverseConvertGenerate = false)
|
||||
public class BusBwlBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@NotNull(message = "备忘录ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 备忘录视图对象 bus_bwl
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusBwl.class)
|
||||
public class BusBwlVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 备忘录ID
|
||||
*/
|
||||
@ExcelProperty(value = "备忘录ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ExcelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 状态(0:未完成 1:已完成)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=:未完成,1=:已完成")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划开始时间")
|
||||
private Date jhkssj;
|
||||
|
||||
/**
|
||||
* 计划结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划结束时间")
|
||||
private Date jhjssj;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package org.dromara.bigscreen.mapper;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 备忘录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface BusBwlMapper extends BaseMapperPlus<BusBwl, BusBwlVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* 备忘录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
public interface IBusBwlService extends IService<BusBwl>{
|
||||
|
||||
/**
|
||||
* 查询备忘录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 备忘录
|
||||
*/
|
||||
BusBwlVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 备忘录分页列表
|
||||
*/
|
||||
TableDataInfo<BusBwlVo> queryPageList(BusBwlBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 备忘录列表
|
||||
*/
|
||||
List<BusBwlVo> queryList(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusBwlBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除备忘录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
TableDataInfo<BusBwlVo> queryPageListbwl(BusBwlBo bo, PageQuery pageQuery);
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.bigscreen.domain.BusBwl;
|
||||
import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
||||
import org.dromara.bigscreen.mapper.BusBwlMapper;
|
||||
import org.dromara.bigscreen.service.IBusBwlService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 备忘录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusBwlServiceImpl extends ServiceImpl<BusBwlMapper, BusBwl> implements IBusBwlService {
|
||||
|
||||
private final BusBwlMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询备忘录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 备忘录
|
||||
*/
|
||||
@Override
|
||||
public BusBwlVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 备忘录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusBwlVo> queryPageList(BusBwlBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
Page<BusBwlVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BusBwlVo> queryPageListbwl(BusBwlBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
lqw.eq(BusBwl::getCreateBy, LoginHelper.getUserId());
|
||||
Page<BusBwlVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的备忘录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 备忘录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusBwlVo> queryList(BusBwlBo bo) {
|
||||
LambdaQueryWrapper<BusBwl> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusBwl> buildQueryWrapper(BusBwlBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusBwl> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusBwl::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BusBwl::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), BusBwl::getContent, bo.getContent());
|
||||
lqw.eq(bo.getStatus() != null, BusBwl::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getJhkssj() != null, BusBwl::getJhkssj, bo.getJhkssj());
|
||||
lqw.eq(bo.getJhjssj() != null, BusBwl::getJhjssj, bo.getJhjssj());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusBwlBo bo) {
|
||||
BusBwl add = MapstructUtils.convert(bo, BusBwl.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备忘录
|
||||
*
|
||||
* @param bo 备忘录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusBwlBo bo) {
|
||||
BusBwl update = MapstructUtils.convert(bo, BusBwl.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBwl entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除备忘录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -38,6 +38,12 @@ public class PdMasterBo extends BaseEntity {
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
|
||||
/**
|
||||
* 任务类型 1进行中 2已完成 3待处理 4所有
|
||||
*/
|
||||
private Integer taskType;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package org.dromara.patch.domain.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PdMasterBymiAndQt {
|
||||
|
||||
private List<PdMasterVo> wpd;
|
||||
|
||||
private List<PdMasterVo> qtbm;
|
||||
}
|
||||
@ -97,4 +97,10 @@ public class PdMasterVo implements Serializable {
|
||||
private String slaveName;
|
||||
|
||||
|
||||
/**
|
||||
* 前端显示
|
||||
*/
|
||||
private String tapName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.patch.service;
|
||||
|
||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||
import org.dromara.patch.domain.vo.PdMasterVo;
|
||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||
@ -79,4 +80,12 @@ public interface IPdMasterService extends IService<PdMaster>{
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询派单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 派单列表
|
||||
*/
|
||||
PdMasterBymiAndQt queryPageListBy(PdMasterBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.patch.domain.PdMasterSon;
|
||||
import org.dromara.patch.domain.PdMasterUser;
|
||||
import org.dromara.patch.domain.bo.PdMasterProgressReq;
|
||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||
import org.dromara.patch.domain.vo.PdMasterProgressVo;
|
||||
import org.dromara.patch.enums.TaskStatusEnum;
|
||||
import org.dromara.patch.service.IPdMasterSonService;
|
||||
@ -32,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 派单Service业务层处理
|
||||
@ -214,6 +216,85 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdMasterBymiAndQt queryPageListBy(PdMasterBo bo, PageQuery pageQuery) {
|
||||
PdMasterBymiAndQt res = new PdMasterBymiAndQt();
|
||||
// 获取登陆人
|
||||
Long userId = LoginHelper.getUserId();
|
||||
//获取我派发的
|
||||
List<PdMasterVo> pdMasters = baseMapper.selectVoList(new LambdaQueryWrapper<PdMaster>().eq(PdMaster::getCreateBy, userId));
|
||||
pdMasters = pdJudge(bo.getTaskType(), pdMasters);
|
||||
res.setWpd(pdMasters);
|
||||
// 获取其他部门派发给我的
|
||||
List<PdMasterUser> pdMasterUsers = pdMasterUserService.getBaseMapper().selectList(new LambdaQueryWrapper<PdMasterUser>().eq(PdMasterUser::getSlaveid, userId));
|
||||
if (pdMasterUsers != null && pdMasterUsers.size() > 0) {
|
||||
List<Long> collect = pdMasterUsers.stream().map(item ->item.getOrdersid()).collect((Collectors.toList()));
|
||||
List<PdMasterVo> pdMasterVos = baseMapper.selectVoByIds(collect);
|
||||
pdMasterVos = pdJudge(bo.getTaskType(), pdMasterVos);
|
||||
res.setQtbm(pdMasterVos);
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private List<PdMasterVo> pdJudge(Integer flow ,List<PdMasterVo> records) {
|
||||
if (records == null || records.size() == 0) return records;
|
||||
|
||||
//获取当前主数据下面的进度百分比
|
||||
records.forEach(item -> {
|
||||
List<PdMasterSon> list = pdMasterSonService.list(new LambdaQueryWrapper<PdMasterSon>().eq(PdMasterSon::getOrdersId, item.getId()));
|
||||
BigDecimal bigDecimal = new BigDecimal("0");
|
||||
for (PdMasterSon pdMasterSon : list) {
|
||||
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
|
||||
}
|
||||
item.setCompletionProgress(bigDecimal+"%");
|
||||
if (bigDecimal.compareTo(new BigDecimal("0")) == 0) {
|
||||
item.setTapName("待处理");
|
||||
}else if (bigDecimal.compareTo(new BigDecimal("100")) == 0) {
|
||||
item.setTapName("已完成");
|
||||
}else if (bigDecimal.compareTo(new BigDecimal("100")) < 0) {
|
||||
item.setTapName("进行中");
|
||||
}
|
||||
//执行人
|
||||
PdMasterUser one1 = pdMasterUserService.getById(item.getId());
|
||||
if (one1 != null) {
|
||||
item.setSlaveName(one1.getSlaveName());
|
||||
item.setSlaveid(one1.getSlaveid());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (flow != null) {
|
||||
records = records.stream().filter(item -> {
|
||||
if (flow == 4) {
|
||||
return true;
|
||||
} else if (flow == 1) {
|
||||
if (item.getTapName().equals("进行中")) {
|
||||
return true;
|
||||
}
|
||||
} else if (flow == 2) {
|
||||
if (item.getTapName().equals("已完成")) {
|
||||
return true;
|
||||
}
|
||||
} else if (flow == 3) {
|
||||
if (item.getTapName().equals("待处理")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
return records;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的派单列表
|
||||
*
|
||||
@ -309,4 +390,6 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user