Compare commits

...

2 Commits

Author SHA1 Message Date
username 3f261b8279 feat:修改任务列表
1 month ago
username 492027d7e6 feat:修改任务列表页面
1 month ago

@ -0,0 +1,219 @@
package com.bs.cm.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log;
import com.bs.common.core.controller.BaseController;
import com.bs.common.core.domain.AjaxResult;
import com.bs.common.core.page.TableDataInfo;
import com.bs.common.enums.BusinessType;
import com.bs.common.utils.poi.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
import com.bs.cm.domain.CmAttach;
import com.bs.cm.service.ICmAttachService;
import javax.annotation.Resource;
/**
* Controller
*
* @author bs
* @date 2025-03-04
*/
@Api(tags = "附近信息")
@RestController
@RequestMapping("/cm/attach")
public class CmAttachController extends BaseController {
@Resource
private ICmAttachService cmAttachService;
/**
*
*/
@ApiOperation("分页查询附近信息列表")
@GetMapping("/pageList")
public TableDataInfo pageList(CmAttach cmAttach) {
startPage();
LambdaQueryWrapper<CmAttach> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,cmAttach);
List<CmAttach> list = cmAttachService.list(queryWrapper);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("查询附近信息列表")
@GetMapping("/list")
public AjaxResult list(CmAttach cmAttach) {
LambdaQueryWrapper<CmAttach> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,cmAttach);
List<CmAttach> list = cmAttachService.list(queryWrapper);
return success(list);
}
/**
*
*/
@ApiOperation("导出附近信息列表")
@Log(title = "附近信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CmAttach cmAttach) {
LambdaQueryWrapper<CmAttach> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,cmAttach);
List<CmAttach> list = cmAttachService.list(queryWrapper);
ExcelUtil<CmAttach> util = new ExcelUtil<CmAttach>(CmAttach. class);
util.exportExcel(response, list, "附近信息数据");
}
/**
*
*/
@ApiOperation("获取附近信息详细信息")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(cmAttachService.getById(id));
}
/**
*
*/
@ApiOperation("新增附近信息")
@Log(title = "附近信息新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CmAttach cmAttach) {
return toAjax(cmAttachService.save(cmAttach));
}
/**
*
*/
@ApiOperation("修改附近信息")
@Log(title = "附近信息修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CmAttach cmAttach) {
return toAjax(cmAttachService.updateById(cmAttach));
}
/**
*
*/
@ApiOperation("删除附近信息")
@Log(title = "附近信息删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(cmAttachService.removeBatchByIds(ids));
}
/**
*
*/
private void condition (LambdaQueryWrapper<CmAttach> queryWrapper,CmAttach cmAttach){
//用户id
if(null != cmAttach.getId()){
queryWrapper.eq(CmAttach::getId,cmAttach.getId());
}
//文件组id
if(StringUtils.isNotEmpty(cmAttach.getFileId())){
queryWrapper.eq(CmAttach::getFileId,cmAttach.getFileId());
}
//文件排序
if(null != cmAttach.getFileSort()){
queryWrapper.eq(CmAttach::getFileSort,cmAttach.getFileSort());
}
//文件名称(编译后)
if(StringUtils.isNotEmpty(cmAttach.getAttachName())){
queryWrapper.eq(CmAttach::getAttachName,cmAttach.getAttachName());
}
//文件类型
if(StringUtils.isNotEmpty(cmAttach.getAttachFileType())){
queryWrapper.eq(CmAttach::getAttachFileType,cmAttach.getAttachFileType());
}
//文件编码类型
if(StringUtils.isNotEmpty(cmAttach.getAttachContentType())){
queryWrapper.eq(CmAttach::getAttachContentType,cmAttach.getAttachContentType());
}
//文件大小
if(null != cmAttach.getAttachFileSize()){
queryWrapper.eq(CmAttach::getAttachFileSize,cmAttach.getAttachFileSize());
}
//文件路径
if(StringUtils.isNotEmpty(cmAttach.getAttachFileUrl())){
queryWrapper.eq(CmAttach::getAttachFileUrl,cmAttach.getAttachFileUrl());
}
//文件名(原始)
if(StringUtils.isNotEmpty(cmAttach.getOldName())){
queryWrapper.eq(CmAttach::getOldName,cmAttach.getOldName());
}
//文件版本号
if(StringUtils.isNotEmpty(cmAttach.getVersionNo())){
queryWrapper.eq(CmAttach::getVersionNo,cmAttach.getVersionNo());
}
//创建部门
if(null != cmAttach.getCreateDept()){
queryWrapper.eq(CmAttach::getCreateDept,cmAttach.getCreateDept());
}
//创建人
if(null != cmAttach.getCreateBy()){
queryWrapper.eq(CmAttach::getCreateBy,cmAttach.getCreateBy());
}
//创建时间
if(null != cmAttach.getCreateTime()){
queryWrapper.eq(CmAttach::getCreateTime,cmAttach.getCreateTime());
}
//修改人
if(null != cmAttach.getUpdateBy()){
queryWrapper.eq(CmAttach::getUpdateBy,cmAttach.getUpdateBy());
}
//修改时间
if(null != cmAttach.getUpdateTime()){
queryWrapper.eq(CmAttach::getUpdateTime,cmAttach.getUpdateTime());
}
//备注
if(StringUtils.isNotEmpty(cmAttach.getRemark())){
queryWrapper.eq(CmAttach::getRemark,cmAttach.getRemark());
}
//删除标志0代表存在 2代表删除
if(StringUtils.isNotEmpty(cmAttach.getDelFlag())){
queryWrapper.eq(CmAttach::getDelFlag,cmAttach.getDelFlag());
}
//${column.columnComment}
if(StringUtils.isNotEmpty(cmAttach.getTenantId())){
queryWrapper.eq(CmAttach::getTenantId,cmAttach.getTenantId());
}
}
}

@ -0,0 +1,95 @@
package com.bs.cm.domain;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
/**
* cm_attach
*
* @author bs
* @date 2025-03-04
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cm_attach")
@Data
public class CmAttach extends BaseEntity{
private static final long serialVersionUID = 1L;
/** 用户id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(value = "用户id")
private Long id;
/** 文件组id */
@Excel(name = "文件组id")
@ApiModelProperty(value = "文件组id")
private String fileId;
/** 文件排序 */
@Excel(name = "文件排序")
@ApiModelProperty(value = "文件排序")
private Long fileSort;
/** 文件名称(编译后) */
@Excel(name = "文件名称", readConverterExp = "编=译后")
@ApiModelProperty(value = "文件名称(编译后)")
private String attachName;
/** 文件类型 */
@Excel(name = "文件类型")
@ApiModelProperty(value = "文件类型")
private String attachFileType;
/** 文件编码类型 */
@Excel(name = "文件编码类型")
@ApiModelProperty(value = "文件编码类型")
private String attachContentType;
/** 文件大小 */
@Excel(name = "文件大小")
@ApiModelProperty(value = "文件大小")
private Long attachFileSize;
/** 文件路径 */
@Excel(name = "文件路径")
@ApiModelProperty(value = "文件路径")
private String attachFileUrl;
/** 文件名(原始) */
@Excel(name = "文件名", readConverterExp = "原=始")
@ApiModelProperty(value = "文件名(原始)")
private String oldName;
/** 文件版本号 */
@Excel(name = "文件版本号")
@ApiModelProperty(value = "文件版本号")
private String versionNo;
/** 备注 */
@Excel(name = "备注")
@ApiModelProperty(value = "备注")
private String remark;
}

@ -0,0 +1,14 @@
package com.bs.cm.mapper;
import com.bs.common.mybatis.mapper.BaseMapperX;
import com.bs.cm.domain.CmAttach;
/**
* Mapper
*
* @author bs
* @date 2025-03-04
*/
public interface CmAttachMapper extends BaseMapperX<CmAttach> {
}

@ -0,0 +1,14 @@
package com.bs.cm.service;
import com.github.yulichang.base.MPJBaseService;
import com.bs.cm.domain.CmAttach;
/**
* Service
*
* @author bs
* @date 2025-03-04
*/
public interface ICmAttachService extends MPJBaseService<CmAttach>{
}

@ -0,0 +1,19 @@
package com.bs.cm.service.impl;
import com.bs.cm.mapper.CmAttachMapper;
import com.bs.cm.domain.CmAttach;
import com.bs.cm.service.ICmAttachService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
*
* @author bs
* @date 2025-03-04
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class CmAttachServiceImpl extends MPJBaseServiceImpl<CmAttachMapper, CmAttach> implements ICmAttachService {
}

@ -1,8 +1,17 @@
package com.bs.ct.controller; package com.bs.ct.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.bs.common.core.domain.entity.SysDept;
import com.bs.ct.domain.CtTaskBranch;
import com.bs.ct.service.ICtTaskBranchService;
import com.bs.system.service.ISysDeptService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -39,6 +48,10 @@ import javax.annotation.Resource;
public class CtTaskInfoController extends BaseController { public class CtTaskInfoController extends BaseController {
@Resource @Resource
private ICtTaskInfoService ctTaskInfoService; private ICtTaskInfoService ctTaskInfoService;
@Autowired
private ISysDeptService deptService;
@Resource
private ICtTaskBranchService ctTaskBranchService;
/** /**
* *
@ -50,6 +63,7 @@ public class CtTaskInfoController extends BaseController {
LambdaQueryWrapper<CtTaskInfo> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<CtTaskInfo> queryWrapper = new LambdaQueryWrapper();
condition(queryWrapper,ctTaskInfo); condition(queryWrapper,ctTaskInfo);
List<CtTaskInfo> list = ctTaskInfoService.list(queryWrapper); List<CtTaskInfo> list = ctTaskInfoService.list(queryWrapper);
setAll(list);
return getDataTable(list); return getDataTable(list);
} }
@ -65,6 +79,42 @@ public class CtTaskInfoController extends BaseController {
return success(list); return success(list);
} }
private void setAll(List<CtTaskInfo> list) {
List<SysDept> depts = deptService.selectDeptList(new SysDept());
Map<Long, String> deptMap = depts.stream()
.collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
for (CtTaskInfo taskInfo : list) {
Date startDate = taskInfo.getStartDate();
Date endDate = taskInfo.getEndDate();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
// 转换日期为字符串
String startDateStr = sdf.format(startDate);
String endDateStr = sdf.format(endDate);
taskInfo.setStartToEndDate(startDateStr + "-" + endDateStr);
String deptName = deptMap.get(taskInfo.getDeptId());
taskInfo.setDeptName(deptName);
}
}
/**
*
*/
@ApiOperation("撤回其他任务")
@GetMapping("/withdraw/{ids}")
public void withdraw(@PathVariable List<Long> ids) {
List<CtTaskInfo> sdTaskOthers = ctTaskInfoService.listByIds(ids);
for (CtTaskInfo sdTaskOther : sdTaskOthers) {
sdTaskOther.setStatus("0");
}
List<CtTaskBranch> sdTaskOtherBranches = ctTaskBranchService.list(new LambdaQueryWrapper<CtTaskBranch>()
.in(CtTaskBranch::getTaskId, ids));
for (CtTaskBranch sdTaskOtherBranch : sdTaskOtherBranches) {
sdTaskOtherBranch.setTaskStatus("0");
}
ctTaskBranchService.updateBatchById(sdTaskOtherBranches);
ctTaskInfoService.updateBatchById(sdTaskOthers);
}
/** /**
* *
*/ */
@ -95,6 +145,13 @@ public class CtTaskInfoController extends BaseController {
@Log(title = "任务信息新增", businessType = BusinessType.INSERT) @Log(title = "任务信息新增", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody CtTaskInfo ctTaskInfo) { public AjaxResult add(@RequestBody CtTaskInfo ctTaskInfo) {
Long newId = System.currentTimeMillis() + new Random().nextInt(1000);
ctTaskInfo.setId(newId);
List<CtTaskBranch> branchList = ctTaskInfo.getBranchList();
for (CtTaskBranch sdTaskOtherBranch : branchList) {
sdTaskOtherBranch.setTaskId(ctTaskInfo.getId());
ctTaskBranchService.saveOrUpdate(sdTaskOtherBranch);
}
return toAjax(ctTaskInfoService.save(ctTaskInfo)); return toAjax(ctTaskInfoService.save(ctTaskInfo));
} }
@ -105,6 +162,17 @@ public class CtTaskInfoController extends BaseController {
@Log(title = "任务信息修改", businessType = BusinessType.UPDATE) @Log(title = "任务信息修改", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody CtTaskInfo ctTaskInfo) { public AjaxResult edit(@RequestBody CtTaskInfo ctTaskInfo) {
List<CtTaskBranch> branchList = ctTaskInfo.getBranchList();
if (branchList != null && branchList.size() > 0) {
for (CtTaskBranch sdTaskOtherBranch : branchList) {
sdTaskOtherBranch.setTaskId(ctTaskInfo.getId());
if (sdTaskOtherBranch.getId() == null) {
ctTaskBranchService.save(sdTaskOtherBranch);
} else {
ctTaskBranchService.updateById(sdTaskOtherBranch);
}
}
}
return toAjax(ctTaskInfoService.updateById(ctTaskInfo)); return toAjax(ctTaskInfoService.updateById(ctTaskInfo));
} }
@ -136,7 +204,7 @@ public class CtTaskInfoController extends BaseController {
//任务标题 //任务标题
if(Validator.isNotEmpty(ctTaskInfo.getTaskTitle())){ if(Validator.isNotEmpty(ctTaskInfo.getTaskTitle())){
queryWrapper.eq(CtTaskInfo::getTaskTitle,ctTaskInfo.getTaskTitle()); queryWrapper.like(CtTaskInfo::getTaskTitle,ctTaskInfo.getTaskTitle());
} }
//任务编号 //任务编号
@ -146,17 +214,17 @@ public class CtTaskInfoController extends BaseController {
//开始时间 //开始时间
if(Validator.isNotEmpty(ctTaskInfo.getStartDate())){ if(Validator.isNotEmpty(ctTaskInfo.getStartDate())){
queryWrapper.eq(CtTaskInfo::getStartDate,ctTaskInfo.getStartDate()); queryWrapper.ge(CtTaskInfo::getStartDate,ctTaskInfo.getStartDate());
} }
//结束时间 //结束时间
if(Validator.isNotEmpty(ctTaskInfo.getEndDate())){ if(Validator.isNotEmpty(ctTaskInfo.getEndDate())){
queryWrapper.eq(CtTaskInfo::getEndDate,ctTaskInfo.getEndDate()); queryWrapper.le(CtTaskInfo::getEndDate,ctTaskInfo.getEndDate());
} }
//任务要求 //任务要求
if(Validator.isNotEmpty(ctTaskInfo.getTaskContent())){ if(Validator.isNotEmpty(ctTaskInfo.getTaskContent())){
queryWrapper.eq(CtTaskInfo::getTaskContent,ctTaskInfo.getTaskContent()); queryWrapper.like(CtTaskInfo::getTaskContent,ctTaskInfo.getTaskContent());
} }
//完成状态 //完成状态

@ -1,6 +1,8 @@
package com.bs.ct.domain; package com.bs.ct.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel; import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity; import com.bs.common.core.domain.BaseEntity;
@ -63,6 +65,11 @@ public class CtTaskInfo extends BaseEntity{
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private Date endDate; private Date endDate;
//@Excel(name = "任务要求")
@ApiModelProperty(value = "任务期限")
@TableField(exist = false)
private String startToEndDate;
/** 任务要求 */ /** 任务要求 */
@Excel(name = "任务要求") @Excel(name = "任务要求")
@ -101,10 +108,17 @@ public class CtTaskInfo extends BaseEntity{
/** 任务发起部门 */ /** 任务发起部门 */
@Excel(name = "任务发起部门") //@Excel(name = "任务发起部门")
@ApiModelProperty(value = "任务发起部门") @ApiModelProperty(value = "任务发起部门")
private Long deptId; private Long deptId;
/** 任务发起部门 */
@Excel(name = "任务发起部门")
@ApiModelProperty(value = "任务发起部门")
@TableField(exist = false)
private String deptName;
/** 任务发布日期 */ /** 任务发布日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -112,6 +126,21 @@ public class CtTaskInfo extends BaseEntity{
@ApiModelProperty(value = "任务发布日期") @ApiModelProperty(value = "任务发布日期")
private Date taskDate; private Date taskDate;
@Excel(name = "办理单位")
@ApiModelProperty(value = "办理单位")
@TableField(exist = false)
private String transactBranchName;
@Excel(name = "办理部门")
@ApiModelProperty(value = "办理部门")
@TableField(exist = false)
private String transactDeptName;
@Excel(name = "办理人")
@ApiModelProperty(value = "办理人")
@TableField(exist = false)
private String transactInitiator;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
@ -119,6 +148,7 @@ public class CtTaskInfo extends BaseEntity{
private String remarks; private String remarks;
@TableField(exist = false)
private List<CtTaskBranch> branchList;
} }

@ -4,6 +4,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.bs.cm.domain.CmAttach;
import com.bs.cm.service.ICmAttachService;
import org.aspectj.util.FileUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +38,9 @@ public class CommonController
@Autowired @Autowired
private ServerConfig serverConfig; private ServerConfig serverConfig;
@Autowired
private ICmAttachService cmAttachService;
private static final String FILE_DELIMETER = ","; private static final String FILE_DELIMETER = ",";
@ -73,7 +80,7 @@ public class CommonController
* *
*/ */
@PostMapping("/upload") @PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception public AjaxResult uploadFile(MultipartFile file, String fileId) throws Exception
{ {
try try
{ {
@ -82,12 +89,34 @@ public class CommonController
// 上传并返回新文件名称 // 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName; String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success(); String newFileName = FileUtils.getName(fileName);
ajax.put("url", url); String originalFilename = file.getOriginalFilename();
ajax.put("fileName", fileName); CmAttach cmAttach = new CmAttach();
ajax.put("newFileName", FileUtils.getName(fileName)); cmAttach.setFileId(fileId);
ajax.put("originalFilename", file.getOriginalFilename()); cmAttach.setFileSort(1L);
return ajax; cmAttach.setAttachName(newFileName);
cmAttach.setAttachContentType(file.getContentType());
cmAttach.setAttachFileSize(file.getSize());
// String suffix = FileUtil.getExtensionName(originalFilename);
// String type = FileUtil.getFileType(suffix);
// cmAttach.setAttachFileType(type);
cmAttach.setAttachFileUrl(fileName);
cmAttach.setOldName(originalFilename);
cmAttach.setVersionNo("1");
cmAttach.setRemark("");
boolean save = cmAttachService.save(cmAttach);
if (save) {
Long id = cmAttach.getId();
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileId", id);
ajax.put("fileName", fileName);
ajax.put("newFileName", newFileName);
ajax.put("cmAttach", cmAttach);
ajax.put("originalFilename", originalFilename);
return ajax;
}
return null;
} }
catch (Exception e) catch (Exception e)
{ {

@ -1,18 +1,16 @@
package com.bs.web.controller.system; package com.bs.web.controller.system;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bs.common.annotation.Log; import com.bs.common.annotation.Log;
import com.bs.common.constant.UserConstants; import com.bs.common.constant.UserConstants;
import com.bs.common.core.controller.BaseController; import com.bs.common.core.controller.BaseController;
@ -45,6 +43,42 @@ public class SysDeptController extends BaseController
return success(depts); return success(depts);
} }
@GetMapping({"/getTree"})
@ResponseBody
public List<SysDept> getTree(SysDept dept) {
List<SysDept> depts = deptService.selectDeptList(dept);
List<SysDept> tree = buildDeptTree(depts);
return tree;
}
// 构建树状结构
public static List<SysDept> buildDeptTree(List<SysDept> deptList) {
Map<Long, SysDept> deptMap = new HashMap<>();
List<SysDept> rootDepts = new ArrayList<>();
// 将所有部门添加到映射中
for (SysDept dept : deptList) {
deptMap.put(dept.getDeptId(), dept);
}
// 构建树状结构
for (SysDept dept : deptList) {
Long parentId = dept.getParentId();
if (parentId == null || parentId == 0 || !deptMap.containsKey(parentId)) {
// 如果没有父节点或父节点不在列表中,视为根节点
rootDepts.add(dept);
} else {
SysDept parentDept = deptMap.get(parentId);
if (parentDept != null) {
// 确保父节点有一个 children 列表
if (parentDept.getChildren() == null) {
parentDept.setChildren(new ArrayList<>());
}
parentDept.getChildren().add(dept);
}
}
}
return rootDepts;
}
/** /**
* *
*/ */

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bs.cm.mapper.CmAttachMapper">
</mapper>

@ -67,8 +67,8 @@ public class BaseEntity implements Serializable {
/** /**
* *
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) // @TableField(fill = FieldFill.INSERT_UPDATE)
private String remark; // private String remarks;
/** /**
* *
*/ */
@ -147,15 +147,15 @@ public class BaseEntity implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getRemark() //public String getRemarks()
{ // {
return remark; // return remarks;
} // }
public void setRemark(String remark) //public void setRemarks(String remarks)
{ // {
this.remark = remark; // this.remarks = remarks;
} // }
public Map<String, Object> getParams() public Map<String, Object> getParams()
{ {

@ -66,6 +66,8 @@
"@vue/cli-service": "4.4.6", "@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3", "babel-plugin-dynamic-import-node": "2.3.3",
"browserslist": "^4.24.4",
"caniuse-lite": "^1.0.30001700",
"chalk": "4.1.0", "chalk": "4.1.0",
"compression-webpack-plugin": "5.0.2", "compression-webpack-plugin": "5.0.2",
"connect": "3.6.6", "connect": "3.6.6",

@ -9,6 +9,15 @@ export function listDept(query) {
}) })
} }
// 查询部门列表
export function getAllTree(query) {
return request({
url: '/system/dept/getTree',
method: 'get',
params: query
})
}
// 查询部门列表(排除节点) // 查询部门列表(排除节点)
export function listDeptExcludeChild(deptId) { export function listDeptExcludeChild(deptId) {
return request({ return request({
@ -49,4 +58,4 @@ export function delDept(deptId) {
url: '/system/dept/' + deptId, url: '/system/dept/' + deptId,
method: 'delete' method: 'delete'
}) })
} }

@ -26,6 +26,14 @@ export function getInfo(id) {
}) })
} }
// 撤回其他任务
export function withdrawOther(id) {
return request({
url: '/task/info/withdraw/' + id,
method: 'get'
})
}
// 新增任务信息 // 新增任务信息
export function addInfo(data) { export function addInfo(data) {
return request({ return request({

@ -20,7 +20,7 @@
</template> </template>
<script> <script>
// import { getAllTree } from "@/api/"; import { getAllTree } from "@/api/system/dept";
export default { export default {
name: "BranchCascaderDialog", name: "BranchCascaderDialog",
@ -118,4 +118,4 @@ export default {
</script> </script>
<style> <style>
</style> </style>

@ -6,39 +6,44 @@
<div> <div>
<div :span="24"> <div :span="24">
<el-form ref="seachForm" :inline="true" class="demo-form-inline"> <el-form ref="seachForm" :inline="true" class="demo-form-inline">
<el-form-item label="机构代码"> <el-form-item label="任务名称">
<el-input <el-input
v-model="query.branchCode" v-model="query.taskTitle"
placeholder="请输入" placeholder="请输入"
maxlength="32" maxlength="32"
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item label="机构名称"> <el-form-item label="任务类型">
<el-input <el-input
v-model="query.branchName" v-model="query.taskType"
placeholder="请输入" placeholder="请输入"
maxlength="32" maxlength="32"
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item label="开始时间"> <el-form-item label="任务内容">
<el-date-picker <el-input
v-model="query.startDate" v-model="query.taskContent"
value-format="yyyy-MM-dd" placeholder="请输入"
type="date" maxlength="32"
placeholder="选择日期"
clearable clearable
></el-date-picker> />
</el-form-item> </el-form-item>
<el-form-item label="结束时间"> <el-form-item label="任务状态">
<el-date-picker <el-input
v-model="query.endDate" v-model="query.status"
value-format="yyyy-MM-dd" placeholder="请输入"
type="date" maxlength="32"
placeholder="选择日期"
clearable clearable
></el-date-picker> />
</el-form-item>
<el-form-item label="申请日期">
<!-- <el-date-picker v-model="query.applyTimeVo" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"
clearable></el-date-picker> -->
<el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" placeholder="选择日期"
@change="dateRangeChange" style="width: 220px;" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
@ -83,54 +88,84 @@
<!-- <el-table-column type="selection" width="50" /> --> <!-- <el-table-column type="selection" width="50" /> -->
<el-table-column <el-table-column
align="center" align="center"
label="机构代码" label="任务名称"
show-overflow-tooltip show-overflow-tooltip
min-width="90" min-width="160"
prop="branchCode" prop="taskTitle"
> />
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="机构名称" label="任务类型"
show-overflow-tooltip
min-width="160"
prop="taskType"
/>
<el-table-column
align="center"
label="任务内容"
show-overflow-tooltip
min-width="160"
prop="taskContent"
/>
<el-table-column
align="center"
label="发布单位"
show-overflow-tooltip show-overflow-tooltip
min-width="160" min-width="160"
prop="branchName" prop="branchName"
> >
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="发布部门"
show-overflow-tooltip
min-width="160"
prop="deptName"
>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="任务标题" label="发布人"
show-overflow-tooltip show-overflow-tooltip
min-width="160" min-width="160"
prop="sdTaskOther.taskTitle" prop="taskInitiator"
/> >
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="开始时间" label="任务期限"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
prop="sdTaskOther.startDate" prop="startToEndDate"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="结束时间" label="办理单位"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
prop="sdTaskOther.endDate" prop="transactBranchName"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="反馈时间" label="办理部门"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
prop="sdTaskOtherFeedbackByFeedback.feedbackTime" prop="transactDeptName"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="反馈状态" label="办理人"
show-overflow-tooltip
min-width="120"
prop="transactInitiator"
>
</el-table-column>
<el-table-column
align="center"
label="任务状态"
show-overflow-tooltip show-overflow-tooltip
min-width="90" min-width="90"
> >
@ -185,7 +220,7 @@
<script> <script>
import AuditDialog from "@/views/task-distribut/send/other-task/components/AuditDialog"; import AuditDialog from "@/views/task-distribut/send/other-task/components/AuditDialog";
import TableMixin from "@/mixins/table-mixin"; import TableMixin from "@/mixins/table-mixin";
import { pageListBranch } from "@/api/task/branch"; import { pageListInfo } from "@/api/task/info";
export default { export default {
name: "BranchOtherTask", name: "BranchOtherTask",
@ -195,8 +230,8 @@ export default {
mixins: [TableMixin], mixins: [TableMixin],
pageInfo: { pageInfo: {
title: "机构任务", title: "机构任务",
exportUrl: "/task/other/branch/export", exportUrl: "/task/info/export",
pageListApi: pageListBranch, pageListApi: pageListInfo,
// deleteApi: delOther, // deleteApi: delOther,
defaultQuery: { defaultQuery: {
isPublish: "1", isPublish: "1",
@ -229,12 +264,18 @@ export default {
}, },
}, },
data() { data() {
return {}; return {
dateRange: [],
};
}, },
methods: { methods: {
// isMe(row) { // isMe(row) {
// return row.userId === this.$store.getters?.userInfo?.userId; // return row.userId === this.$store.getters?.userInfo?.userId;
// }, // },
dateRangeChange(val) {
this.query.startDate = val?.[0];
this.query.endDate = val?.[1];
},
MXCreated() { MXCreated() {
this.$options.pageInfo.defaultQuery.taskId = null, this.$options.pageInfo.defaultQuery.taskId = null,
this.query.taskId = null; this.query.taskId = null;

@ -143,6 +143,8 @@ import {
listBranch, listBranch,
} from "@/api/task/branch"; } from "@/api/task/branch";
// import { getDateStr } from "@/utils/"; // import { getDateStr } from "@/utils/";
import { getAllTree } from "@/api/system/dept";
export default { export default {
components: { components: {
@ -209,11 +211,18 @@ export default {
} }
if (!this.dialogForm.branchCode) { if (!this.dialogForm.branchCode) {
let dept = null; let dept = null;
this.$store.getters.depts.forEach(v => { // getAllTree().then((res) => {
if (!dept || dept.deptId > v.deptId) { // res.forEach(v => {
dept = v; // if (!dept || dept.deptId > v.deptId) {
} // dept = v;
}); // }
// });
// });
// this.$store.getters.forEach(v => {
// if (!dept || dept.deptId > v.deptId) {
// dept = v;
// }
// });
if (dept) { if (dept) {
this.dialogForm.branchCode = dept.deptId; this.dialogForm.branchCode = dept.deptId;
this.dialogForm.branchName = dept.deptName; this.dialogForm.branchName = dept.deptName;
@ -264,7 +273,7 @@ export default {
taskId: this.dialogForm.id, taskId: this.dialogForm.id,
}) })
.then((res) => { .then((res) => {
this.branchList = res || []; this.branchList = res.data || [];
this.branchLoading = false; this.branchLoading = false;
}) })
.catch((e) => { .catch((e) => {
@ -317,7 +326,7 @@ export default {
return newVal; return newVal;
}), }),
status: this.isSubmit, // status: this.isSubmit, //
taskDate: getDateStr(), // taskDate: getDateStr(),
}; };
} }
return { return {

@ -42,7 +42,7 @@
<script> <script>
import TableEditMixin from "@/mixins/table-edit-mixin"; import TableEditMixin from "@/mixins/table-edit-mixin";
import FileUpload from "@/components/FileUpload"; import FileUpload from "@/components/FileUpload";
import { addBranch, updateBranch } from "@/api/task/branch"; import { updateInfo } from "@/api/task/info";
export default { export default {
@ -55,7 +55,7 @@ export default {
defaultForm: { defaultForm: {
}, },
title: "任务备注", title: "任务备注",
updateApi: updateBranch, updateApi: updateInfo,
// addApi: addBranch, // addApi: addBranch,
}, },
data() { data() {

@ -188,7 +188,7 @@
@pagination="getTableList" @pagination="getTableList"
/> />
</el-card> </el-card>
<BranchOtherTask customLoad :isPublish="false" :taskId="selectTask.id"></BranchOtherTask> <!-- <BranchOtherTask customLoad :isPublish="false" :taskId="selectTask.id"></BranchOtherTask>-->
<EditDialog ref="editDialog" @refresh="getTableList"></EditDialog> <EditDialog ref="editDialog" @refresh="getTableList"></EditDialog>
<RemarkDialog ref="remarkDialog" @refresh="getTableList"></RemarkDialog> <RemarkDialog ref="remarkDialog" @refresh="getTableList"></RemarkDialog>
</div> </div>
@ -199,7 +199,7 @@
import EditDialog from "./components/EditDialog"; import EditDialog from "./components/EditDialog";
import RemarkDialog from "./components/RemarkDialog"; import RemarkDialog from "./components/RemarkDialog";
import TableMixin from "@/mixins/table-mixin"; import TableMixin from "@/mixins/table-mixin";
import { pageListInfo, delInfo, getInfo as withdrawOther,getInfo as editByAffiliation } from "@/api/task/info"; import { pageListInfo, delInfo, withdrawOther,getInfo as editByAffiliation } from "@/api/task/info";
import BranchOtherTask from '@/views/task-distribut/feedback/other-task'; import BranchOtherTask from '@/views/task-distribut/feedback/other-task';
export default { export default {
@ -256,16 +256,16 @@ export default {
this.$refs.remarkDialog.open(row); this.$refs.remarkDialog.open(row);
}, },
// //
toPrivate(row) { // toPrivate(row) {
this.$confirm(`确定设置为${row.affiliation ? '公开':'私有'}吗?`, '温馨提示', { // this.$confirm(`${row.affiliation ? '':''}`, '', {
type: 'warning' // type: 'warning'
}).then(res => { // }).then(res => {
editByAffiliation(row.id).then(() => { // editByAffiliation(row.id).then(() => {
this.$message.success('设置成功'); // this.$message.success('');
this.getTableList(); // this.getTableList();
}); // });
}); // });
} // }
} }
}; };
</script> </script>

Loading…
Cancel
Save