Merge remote-tracking branch 'origin/dev_2307' into dev_2307

dev^2
zjh 1 year ago
commit e2d6ac6cb8
  1. 2
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 25
      ant-design-vue-jeecg/src/views/task/TaskList.vue
  3. 7
      jeecg-boot/jeecg-boot-module-system/pom.xml
  4. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java
  5. 29
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java
  6. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/dto/ExcelInfo.java
  8. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/ModulexTemplate.java
  9. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java
  10. 81
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java
  11. 188
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
  12. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java
  13. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java
  14. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java

@ -349,7 +349,7 @@ export const JeecgListMixin = {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false;
// 新增/修改 成功时,重载列表
// 重载列表
this.loadData();
},
// 任务管理-任务-分解

@ -21,7 +21,22 @@
style="width: 100%"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="任务等级">
<!-- <j-input placeholder="" v-model="queryParam.moduleId"></j-input>-->
<j-dict-select-tag v-model="queryParam.workStatus" placeholder="请选择等级"
dict-code="task_work_status"
style="width: 100%"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="任务类型">
<!-- <j-input placeholder="" v-model="queryParam.moduleId"></j-input>-->
<j-dict-select-tag v-model="queryParam.typeId" placeholder="请选择任务类型"
dict-code="task_type,type_name,id"
style="width: 100%"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="4" :sm="12">
<a-form-item label="责任人">
<j-dict-select-tag v-model="queryParam.managerUsers" placeholder="请选责任人"
@ -35,7 +50,13 @@
<j-input placeholder="" v-model="queryParam.taskName"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="日期">
<j-dict-select-tag v-model="queryParam.time" placeholder="请选择日期"
dict-code="task_time_status"
style="width: 100%"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>

@ -110,6 +110,13 @@
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.belerweb/pinyin4j -->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-module-cms</artifactId>

@ -52,11 +52,6 @@ public class FunctionxTest implements Serializable {
*/
private String pmDescribe;
/**
* 分析图
*/
private String diagrams;
/**
* 用户角色
*/

@ -101,19 +101,18 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
fun.setFunctionCode(list.get(3)); // 功能编码
fun.setFunctionType(list.get(4)); // 功能类型
fun.setPmDescribe(list.get(5)); // 功能描述
fun.setDiagrams(list.get(6)); // 分析图
fun.setUserRole(list.get(7)); // 用户角色
fun.setManagerUsers(list.get(8)); // 责任人
fun.setWorkLevel(list.get(9)); // 任务等级
fun.setWorkStatus(list.get(10)); // 任务状态
fun.setPublishTime(list.get(11)); // 发布时间
fun.setStartTime(list.get(12)); // 开始时间
fun.setDuration(list.get(13)); // 任务时长
fun.setSubmitTime(list.get(14)); // 提交时间
fun.setRealDuration(list.get(15)); // 实际时长
fun.setStatus(list.get(16)); // 功能状态
fun.setVerisonStatus(list.get(17)); // 版本状态
fun.setVerison(list.get(18)); // 版本号
fun.setUserRole(list.get(6)); // 用户角色
fun.setManagerUsers(list.get(7)); // 责任人
fun.setWorkLevel(list.get(8)); // 任务等级
fun.setWorkStatus(list.get(9)); // 任务状态
fun.setPublishTime(list.get(10)); // 发布时间
fun.setStartTime(list.get(11)); // 开始时间
fun.setDuration(list.get(12)); // 任务时长
fun.setSubmitTime(list.get(13)); // 提交时间
fun.setRealDuration(list.get(14)); // 实际时长
fun.setStatus(list.get(15)); // 功能状态
fun.setVerisonStatus(list.get(16)); // 版本状态
fun.setVerison(list.get(17)); // 版本号
fun.setCreatName(username);
listVo.add(fun);
@ -150,7 +149,6 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
String functionCode = function.getFunctionCode();
String functionType = function.getFunctionType();
String pmDescribe = function.getPmDescribe();
String diagrams = function.getDiagrams();
String userRole = function.getUserRole();
String managerUsers = function.getManagerUsers();
String workLevel = function.getWorkLevel();
@ -237,9 +235,6 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
if(StringUtils.isNotBlank(pmDescribe)){ // 功能描述
functionx.setPmDescribe(pmDescribe);
}
if(StringUtils.isNotBlank(diagrams)){ // 分析图
functionx.setDiagrams(diagrams);
}
if(StringUtils.isNotBlank(userRole)){ // 用户角色
LambdaQueryWrapper<ProjectUserRole> queryWrapperUser = new LambdaQueryWrapper<>();
queryWrapperUser.eq(ProjectUserRole::getUserRole,userRole); // 是否匹配项目id?

@ -57,12 +57,12 @@ public class RequirementType implements Serializable {
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**项目id*/
@Excel(name = "项目id", width = 15, dictTable = "projectx", dicText = "project_name", dicCode = "id")
@Excel(name = "项目", width = 15, dictTable = "projectx", dicText = "project_name", dicCode = "id")
@Dict(dictTable = "projectx", dicText = "project_name", dicCode = "id")
@ApiModelProperty(value = "项目id")
private java.lang.String projectId;
/**上级类型id*/
@Excel(name = "上级类型id", width = 15, dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
@Excel(name = "上级类型", width = 15, dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
@Dict(dictTable = "requirement_type", dicText = "type_name", dicCode = "id")
@ApiModelProperty(value = "上级类型id")
private java.lang.String upperId;

@ -121,7 +121,7 @@ public class ExcelInfo {
return "1";
if(value.equals("SMALLINT"))
return "2";
if(value.equals("MEDIUMINT")||value.equals("废弃"))
if(value.equals("MEDIUMINT"))
return "3";
if(value.equals("INT"))
return "4";
@ -133,7 +133,7 @@ public class ExcelInfo {
return "7";
if(value.equals("DECIMAL"))
return "8";
if(value.equals("YEAR"))
if(value.equals("YEAR")||value.equals("废弃"))
return "9";
if(value.equals("TIME"))
return "10";

@ -171,18 +171,7 @@ public class ModulexTemplate implements Serializable {
@ApiModelProperty(value = "关联实体")
@Dict(dictTable = "tablex", dicText = "table_name", dicCode = "id")
private String relatedBean;
/**
* 原型图
*/
@Excel(name = "原型图", width = 15)
@ApiModelProperty(value = "原型图")
private String prototypes;
/**
* 分析图
*/
@Excel(name = "分析图", width = 15)
@ApiModelProperty(value = "分析图")
private String diagrams;
/**
* 模块状态
* 正常1停用0废弃9默认1

@ -42,4 +42,5 @@ public interface IModulexService extends IService<Modulex> {
List<ModuleFunctionRule> exportXlslist(HttpServletRequest request, String selections,Modulex modulex);
Result<?> importExcel(MultipartFile file) throws Exception;
}

@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
@ -479,12 +484,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
modulexVo.setRelatedBean(value);
break;
case 16:
modulexVo.setPrototypes(value);
break;
case 17:
modulexVo.setDiagrams(value);
break;
case 18:
if (value == null || value == "") {
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
@ -492,7 +491,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
}
modulexVo.setStatus(value);
break;
case 19:
case 17:
if (value == null || value == "") {
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
@ -500,7 +499,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
}
modulexVo.setVerisonStatus(value);
break;
case 20:
case 18:
if (value == null || value == "") {
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
@ -621,6 +620,23 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,模块编码不能为空或者模块编码过长");
}
String modulecode = null;
LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Projectx::getProjectName,projectId);
Projectx projectx = projectxService.getOne(queryWrapper);
String firstChar = this.toFirstChar(moduleName);
String projectCode = projectx.getProjectCode();
if(projectCode==null){
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("项目编码不存在,请重新填写");
}
modulecode = projectCode + firstChar;
if(!modulecode.equals(moduleCode)){
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("模块编码不规范,导入失败");
}
modulex.setModuleCode(moduleCode);
String pmDescribe = modulexTemplate.getPmDescribe();
if(StringUtils.isBlank(pmDescribe)){
@ -631,20 +647,23 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
modulex.setManagerUsers(null);
}else {
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysUserLambdaQueryWrapper.eq(SysUser::getUsername,managerUsers);
SysUser iSysUserServiceOne = iSysUserService.getOne(sysUserLambdaQueryWrapper);
String[] split = managerUsers.split(",");
// sysUserLambdaQueryWrapper.eq(SysUser::getUsername,managerUsers);
sysUserLambdaQueryWrapper.in(SysUser::getUsername,split);
List<SysUser> iSysUserServiceOne = iSysUserService.list(sysUserLambdaQueryWrapper);
if(iSysUserServiceOne==null){
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,责任人信息查询不到");
}else {
String id = iSysUserServiceOne.getId();
if (id == null) {
List<String> list = iSysUserServiceOne.stream().map(SysUser::getId).collect(Collectors.toList());
// String id = iSysUserServiceOne.getId();
if (list == null) {
message.put("isVisible", "false");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,责任人信息查询不到");
}
modulex.setManagerUsers(id);
modulex.setManagerUsers(String.valueOf(list));
}
}
String workLevel = modulexTemplate.getWorkLevel();
@ -784,14 +803,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
return Result.error("关联实体不存在");
}
}
String prototypes = modulexTemplate.getPrototypes();
if(StringUtils.isBlank(prototypes)){
modulex.setPrototypes(null);
}modulex.setPrototypes(prototypes);
String diagrams = modulexTemplate.getDiagrams();
if(StringUtils.isBlank(diagrams)){
modulex.setDiagrams(null);
}modulex.setDiagrams(diagrams);
String status = modulexTemplate.getStatus();
if(StringUtils.isBlank(status)){
message.put("isVisible", "false");
@ -1179,4 +1190,32 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
moduleFunctionRule.setVerison(x.getVerison());
return moduleFunctionRule;
}
/**
* 获取字符串拼音的第一个字母
* @param chinese
* @return
*/
public static String toFirstChar(String chinese){
String pinyinStr = "";
char[] newChar = chinese.toCharArray(); //转为单个字符
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
for (int i = 0; i < newChar.length; i++) {
if (newChar[i] > 128) {
try {
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0);
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
}else{
pinyinStr += newChar[i];
}
}
return pinyinStr;
}
}

@ -42,10 +42,7 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.*;
/**
* @Description: 任务管理
@ -101,17 +98,114 @@ public class TaskController extends JeecgController<Task, ITaskService> {
@ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(Task task,
@RequestParam(name = "type", required = false) List<String> type,
@RequestParam(name = "userName", defaultValue = "") String userName,
@RequestParam(name = "time", required = false) Integer time,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Task> queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap());
HttpServletRequest req) throws ParseException {
QueryWrapper<Task> queryWrapper = new QueryWrapper<>();
Page<Task> page = new Page<Task>(pageNo, pageSize);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (!StringUtils.equals(ADMIN, user.getUsername())) {
queryWrapper.like("manager_users", user.getId());
}
queryWrapper.orderByDesc("create_time");
if (type != null && type.size() > 0)
queryWrapper.and(qw -> {
for (int i = 0; i < type.size(); i++) {
qw.eq("type_id", type.get(i));
if (i != type.size() - 1)
qw.or();
}
});
// projectId
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH) + 1;
int day = now.get(Calendar.DAY_OF_MONTH);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (time != null) {
switch (time) {
case 1: {//当前天
Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00");
Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59");
queryWrapper.ge("start_time", startTime);
queryWrapper.le("start_time", endTime);
break;
}
case 2: {//当前周
Calendar now1 = Calendar.getInstance();
now1.set(Calendar.DAY_OF_WEEK, 2);
int year1 = now1.get(Calendar.YEAR);
int month1 = now1.get(Calendar.MONTH) + 1;
int day1 = now1.get(Calendar.DAY_OF_MONTH);
now1.set(Calendar.DATE, now1.get(Calendar.DATE) + 6);
int year2 = now1.get(Calendar.YEAR);
int month2 = now1.get(Calendar.MONTH) + 1;
int day2 = now1.get(Calendar.DAY_OF_MONTH);
Date startTime = sdf.parse(year1 + "-" + month1 + "-" + day1 + " 00:00:00");
Date endTime = sdf.parse(year2 + "-" + month2 + "-" + day2 + " 23:59:59");
queryWrapper.ge("start_time", startTime);
queryWrapper.le("start_time", endTime);
}
case 3: {//当前月
int minDay = now.getActualMinimum(Calendar.DAY_OF_MONTH);
int lastDay = now.getActualMaximum(Calendar.DAY_OF_MONTH);
Date startTime = sdf.parse(year + "-" + month + "-" + minDay + " 00:00:00");
Date endTime = sdf.parse(year + "-" + month + "-" + lastDay + " 23:59:59");
queryWrapper.ge("start_time", startTime);
queryWrapper.le("start_time", endTime);
break;
}
// case 4: {
// Date startTime = sdf.parse(year + "-" + month + "-" + day + " 00:00:00");
// Date endTime = sdf.parse(year + "-" + month + "-" + day + " 23:59:59");
// queryWrapper.ge("create_time", startTime);
// queryWrapper.le("create_time", endTime);
// break;
// }
}
}
if (task != null && StringUtils.isNotBlank(task.getModuleId())) {
String moduleId = task.getModuleId();
queryWrapper.like("module_id", moduleId);
}
if (task != null && StringUtils.isNotBlank(task.getProjectId())) {
String projectId = task.getProjectId();
queryWrapper.like("project_id", projectId);
}
if (task != null && StringUtils.isNotBlank(task.getTypeId())) {
String typeId = task.getTypeId();
queryWrapper.like("type_id", typeId);
}
if (task != null && StringUtils.isNotBlank(task.getManagerUsers())) {
String managerUsers = task.getManagerUsers();
queryWrapper.like("manager_users", managerUsers);
}
// List<SysUser> sysUsers = taskService.UserIdByUserName(userName);
// queryWrapper.and(qw -> {
// for (int i = 0; i < sysUsers.size(); i++) {
// qw.like("manager_users", sysUsers.get(i).getId());
// if (i != sysUsers.size() - 1)
// qw.or();
// }
// });
if (task != null && StringUtils.isNotBlank(task.getTaskName())) {
String tas = task.getTaskName();
if (tas.startsWith("*") && tas.endsWith("*"))
tas = tas.substring(1, tas.length() - 1);
queryWrapper.like("task_name", tas);
}
if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 0 || task.getWorkStatus() == 1)) {
queryWrapper.in("work_status", 0, 1);
} else if (task != null && task.getWorkStatus() != null && (task.getWorkStatus() == 2 || task.getWorkStatus() == 9)) {
queryWrapper.in("work_status", 2, 9);
} else if (task != null && task.getWorkStatus() != null) {
queryWrapper.eq("work_status", task.getWorkStatus());
}
queryWrapper.orderByDesc("update_time");
IPage<Task> pageList = taskService.page(page, queryWrapper);
pageList.getRecords().stream().forEach(e -> {
String startDate = DateUtils.date2Str(e.getStartTime(), new SimpleDateFormat(FORMAT));
@ -147,9 +241,80 @@ public class TaskController extends JeecgController<Task, ITaskService> {
}
String managerUsers = e.getManagerUsers();
if (managerUsers != null && !managerUsers.equals("")) {
SysUser byId = iSysUserService.getById(managerUsers);
String[] managerUsers1 = managerUsers.split(",");
StringBuilder avatars = new StringBuilder();
for (String managerUser : managerUsers1) {
SysUser byId = iSysUserService.getById(managerUser);
if (byId != null)
avatars.append(byId.getAvatar()).append(",");
}
avatars = new StringBuilder(avatars.substring(0, avatars.length() - 1));
e.setHeadpic(avatars.toString());
}
});
return Result.OK(pageList);
}
@AutoLog(value = "任务管理-分页列表查询")
@ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询")
@GetMapping(value = "/list1")
public Result<?> queryPageList1(Task task,
@RequestParam(name = "userId") String userId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Task> queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap());
Page<Task> page = new Page<Task>(pageNo, pageSize);
queryWrapper.like("manager_users", userId);
queryWrapper.like("work_status", 3);
queryWrapper.orderByDesc("update_time");
IPage<Task> pageList = taskService.page(page, queryWrapper);
pageList.getRecords().stream().forEach(e -> {
String startDate = DateUtils.date2Str(e.getStartTime(), new SimpleDateFormat(FORMAT));
String endDate = DateUtils.date2Str(e.getExpectedEndTime(), new SimpleDateFormat(FORMAT));
String startEndTime = startDate + "-" + endDate;
e.setStartEndTime(startEndTime);
Projectx projectx = iProjectxService.getById(e.getProjectId());
e.setUnion(projectx.getProjectName());
if (StringUtils.isNotBlank(e.getModuleId())) {
Modulex modulex = iModulexService.getById(e.getModuleId());
e.setUnion(e.getUnion() + "-" + modulex.getModuleName());
}
if (StringUtils.isNotBlank(e.getFunctionId())) {
Functionx functionx = iFunctionxService.getById(e.getFunctionId());
e.setUnion(e.getUnion() + "-" + functionx.getFunctionName());
}
if (StringUtils.isNotBlank(e.getRuleId())) {
Rulex rulex = iRulexService.getById(e.getRuleId());
e.setUnion(e.getUnion() + "-" + rulex.getRuleCode());
}
if (StringUtils.isNotBlank(e.getUpperId())) {
Task taskUpper = taskService.getById(e.getUpperId());
if (ObjectUtils.isNotEmpty(taskUpper)) {
e.setUpperTaskName(taskUpper.getTaskName());
}
}
if (e.getTaskFile() != null && !e.getTaskFile().equals("")) {
e.setContentType("file");
} else if (e.getTaskPic() != null && !e.getTaskPic().equals("")) {
e.setContentType("image");
} else {
e.setContentType("text");
}
String managerUsers = e.getManagerUsers();
if (managerUsers != null && !managerUsers.equals("")) {
String[] managerUsers1 = managerUsers.split(",");
StringBuilder avatars = new StringBuilder();
for (String managerUser : managerUsers1) {
SysUser byId = iSysUserService.getById(managerUser);
if (byId != null)
e.setHeadpic(byId.getAvatar());
avatars.append(byId.getAvatar()).append(",");
}
avatars = new StringBuilder(avatars.substring(0, avatars.length() - 1));
e.setHeadpic(avatars.toString());
}
});
@ -184,7 +349,12 @@ public class TaskController extends JeecgController<Task, ITaskService> {
@ApiOperation(value = "任务管理-编辑", notes = "任务管理-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Task task) {
String taskDescribe = task.getTaskDescribe();
boolean st = taskDescribe.contains("data:image/png;base64");
if (st)
return Result.error("不能直接将图片放入任务描述中,因为图片将会进行base64转码,数据库中text字段不一定存下");
taskService.updateById(task);
return Result.OK("编辑成功!");
}

@ -97,6 +97,7 @@ public class Task implements Serializable {
*/
@Excel(name = "模块id", width = 15)
@ApiModelProperty(value = "模块id")
@Dict(dictTable = "modulex", dicText = "module_name",dicCode = "id")
private java.lang.String moduleId;
/**
* 功能id

@ -2,8 +2,11 @@ package org.jeecg.modules.task.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.task.entity.Task;
import java.util.List;
/**
* @Description: 任务管理
* @Author: jeecg-boot
@ -26,4 +29,6 @@ public interface ITaskService extends IService<Task> {
Result<?> fabu(String id);
String fillTaskName(String projectId, String typeId);
// List<SysUser> UserIdByUserName(String userName);
}

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.task.entity.Task;
import org.jeecg.modules.task.mapper.TaskMapper;
import org.jeecg.modules.task.service.ITaskService;
@ -35,7 +37,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
@Resource
private ITaskTypeService iTaskTypeService;
// @Resource
// private ISysUserService sysUserService;
/**
* 责任人回显
* 责任人回显
*/
@Override
@ -145,4 +150,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
String fillName = taskType.getTypeName() + "-" + projectx.getProjectName();
return fillName;
}
// @Override
// public List<SysUser> UserIdByUserName(String userName) {
// if (userName==null)
// return null;
// LambdaQueryWrapper<SysUser> wrapper=new LambdaQueryWrapper<>();
// if(userName.startsWith("*")&&userName.endsWith("*"))
// userName = userName.substring(1, userName.length() - 1);
// wrapper.eq(SysUser::getUsername,userName);
// return sysUserService.list(wrapper);
// }
}

Loading…
Cancel
Save