diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js index 4d360d3..c4362d2 100644 --- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js +++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js @@ -349,7 +349,7 @@ export const JeecgListMixin = { this.$refs.modalForm.edit(record); this.$refs.modalForm.title = "复制"; this.$refs.modalForm.disableSubmit = false; - // 新增/修改 成功时,重载列表 + // 重载列表 this.loadData(); }, // 任务管理-任务-分解 diff --git a/ant-design-vue-jeecg/src/views/task/TaskList.vue b/ant-design-vue-jeecg/src/views/task/TaskList.vue index 48aed84..ed99163 100644 --- a/ant-design-vue-jeecg/src/views/task/TaskList.vue +++ b/ant-design-vue-jeecg/src/views/task/TaskList.vue @@ -21,7 +21,22 @@ style="width: 100%"> - + + + + + + + + + + + + - + + + + + 查询 diff --git a/jeecg-boot/jeecg-boot-module-system/pom.xml b/jeecg-boot/jeecg-boot-module-system/pom.xml index 47eb4bf..157365a 100644 --- a/jeecg-boot/jeecg-boot-module-system/pom.xml +++ b/jeecg-boot/jeecg-boot-module-system/pom.xml @@ -110,6 +110,13 @@ 3.17 + + + com.belerweb + pinyin4j + 2.5.1 + + org.jeecgframework.boot jeecg-boot-module-cms diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java index 7ac0734..daa02f1 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java @@ -52,11 +52,6 @@ public class FunctionxTest implements Serializable { */ private String pmDescribe; - /** - * 分析图 - */ - private String diagrams; - /** * 用户角色 */ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java index 3d0031b..b11e5fb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java @@ -101,19 +101,18 @@ public class FunctionXTestServiceImpl extends ServiceImpl queryWrapperUser = new LambdaQueryWrapper<>(); queryWrapperUser.eq(ProjectUserRole::getUserRole,userRole); // 是否匹配项目id? diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java index 3a76744..65e445f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/requirementtype/entity/RequirementType.java @@ -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; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/dto/ExcelInfo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/dto/ExcelInfo.java index 9b98666..163cef2 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/dto/ExcelInfo.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/dto/ExcelInfo.java @@ -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"; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/ModulexTemplate.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/ModulexTemplate.java index 328efab..9cfca17 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/ModulexTemplate.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/ModulexTemplate.java @@ -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 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java index 485d49d..ab443a0 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java @@ -42,4 +42,5 @@ public interface IModulexService extends IService { List exportXlslist(HttpServletRequest request, String selections,Modulex modulex); Result importExcel(MultipartFile file) throws Exception; + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index 5f596a7..d941267 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -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 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 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 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 impl webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("导入失败,模块编码不能为空或者模块编码过长"); } + String modulecode = null; + LambdaQueryWrapper 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 impl modulex.setManagerUsers(null); }else { LambdaQueryWrapper 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 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 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 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 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; + } + + + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java index e81391d..f378790 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java @@ -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,178 @@ public class TaskController extends JeecgController { @ApiOperation(value = "任务管理-分页列表查询", notes = "任务管理-分页列表查询") @GetMapping(value = "/list") public Result queryPageList(Task task, + @RequestParam(name = "type", required = false) List 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 queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap()); + HttpServletRequest req) throws ParseException { + QueryWrapper queryWrapper = new QueryWrapper<>(); Page page = new Page(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 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 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) + + 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 queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + queryWrapper.like("manager_users", userId); + queryWrapper.like("work_status", 3); + queryWrapper.orderByDesc("update_time"); IPage pageList = taskService.page(page, queryWrapper); pageList.getRecords().stream().forEach(e -> { String startDate = DateUtils.date2Str(e.getStartTime(), new SimpleDateFormat(FORMAT)); @@ -138,18 +296,25 @@ public class TaskController extends JeecgController { e.setUpperTaskName(taskUpper.getTaskName()); } } - if (e.getTaskFile()!=null&& !e.getTaskFile().equals("")){ + if (e.getTaskFile() != null && !e.getTaskFile().equals("")) { e.setContentType("file"); - }else if(e.getTaskPic()!=null&& !e.getTaskPic().equals("")){ + } else if (e.getTaskPic() != null && !e.getTaskPic().equals("")) { e.setContentType("image"); - }else{ + } else { e.setContentType("text"); } String managerUsers = e.getManagerUsers(); - if (managerUsers!=null&&!managerUsers.equals("")) { - SysUser byId = iSysUserService.getById(managerUsers); - if (byId!=null) - e.setHeadpic(byId.getAvatar()); + 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) + + 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 { @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("编辑成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java index c7f4af9..e75d257 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java @@ -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 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java index 52aae34..1cc1fb4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java @@ -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 { Result fabu(String id); String fillTaskName(String projectId, String typeId); + +// List UserIdByUserName(String userName); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java index 2a63008..ec6f254 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java @@ -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 implements IT @Resource private ITaskTypeService iTaskTypeService; +// @Resource +// private ISysUserService sysUserService; /** + * 责任人回显 * 责任人回显 */ @Override @@ -145,4 +150,14 @@ public class TaskServiceImpl extends ServiceImpl implements IT String fillName = taskType.getTypeName() + "-" + projectx.getProjectName(); return fillName; } +// @Override +// public List UserIdByUserName(String userName) { +// if (userName==null) +// return null; +// LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); +// if(userName.startsWith("*")&&userName.endsWith("*")) +// userName = userName.substring(1, userName.length() - 1); +// wrapper.eq(SysUser::getUsername,userName); +// return sysUserService.list(wrapper); +// } }