Compare commits

...

4 Commits

  1. 9
      ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
  2. 2
      ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue
  3. 92
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java
  4. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/entity/Modulex.java
  5. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/mapper/ModulexMapper.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java

@ -176,11 +176,12 @@ export default {
// align: "center", // align: "center",
// dataIndex: 'pmDescribe' // dataIndex: 'pmDescribe'
// }, // },
// { {
// title:'', title:'责任人',
// align:"center", align:"center",
// dataIndex: 'managerUsers' // dataIndex: 'managerUsers'
// }, dataIndex: 'managerUsers_dictText'
},
{ {
title: '任务等级', title: '任务等级',
align: "center", align: "center",

@ -7,7 +7,7 @@
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="项目名称"> <a-form-item label="项目名称">
<!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>--> <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
<j-input placeholder="输入账号模糊查询" v-model="queryParam.projectName"></j-input> <j-input placeholder="" v-model="queryParam.projectName"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>

@ -1,6 +1,7 @@
package org.jeecg.modules.modulex.controller; package org.jeecg.modules.modulex.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -12,28 +13,34 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.mapper.ModulexMapper;
import org.jeecg.modules.modulex.service.IModulexService; import org.jeecg.modules.modulex.service.IModulexService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Description: 模块管理 * @Description: 模块管理
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-04-10 * @Date: 2023-04-10
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="模块管理") @Api(tags = "模块管理")
@RestController @RestController
@RequestMapping("/modulex/modulex") @RequestMapping("/modulex/modulex")
@Slf4j @Slf4j
public class ModulexController extends JeecgController<Modulex, IModulexService> { public class ModulexController extends JeecgController<Modulex, IModulexService> {
@Autowired @Autowired
private IModulexService modulexService; private IModulexService modulexService;
@Resource
private ModulexMapper modulexMapper;
/** /**
* 分页列表查询 * 分页列表查询
@ -45,52 +52,87 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
* @return * @return
*/ */
@AutoLog(value = "模块管理-分页列表查询") @AutoLog(value = "模块管理-分页列表查询")
@ApiOperation(value="模块管理-分页列表查询", notes="模块管理-分页列表查询") @ApiOperation(value = "模块管理-分页列表查询", notes = "模块管理-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> queryPageList(Modulex modulex, public Result<?> queryPageList(Modulex modulex,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<Modulex> queryWrapper = QueryGenerator.initQueryWrapper(modulex, req.getParameterMap()); QueryWrapper<Modulex> queryWrapper = QueryGenerator.initQueryWrapper(modulex, req.getParameterMap());
Page<Modulex> page = new Page<Modulex>(pageNo, pageSize); Page<Modulex> page = new Page<Modulex>(pageNo, pageSize);
IPage<Modulex> pageList = modulexService.page(page, queryWrapper); IPage<Modulex> pageList = modulexService.page(page, queryWrapper);
List<Modulex> modulexList = pageList.getRecords();
for (Modulex modu :modulexList) {
if (!StringUtils.hasText(modu.getManagerUsers())){
break;
}else {
String[] split = modu.getManagerUsers().split(",");
List<String> stringList = Arrays.asList(split);
List<String> strings = new ArrayList<>();
stringList.forEach(manager -> {
String realName = modulexMapper.getRealName(manager);
if (StringUtils.hasText(realName)) {
strings.add(realName);
} else {
strings.add(manager);
}
});
String toString = strings.toString();
String substring = toString.substring(1, toString.length() - 1);
modu.setManagerUsers_dictText(substring);
}
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@GetMapping(value = "/fabu") @GetMapping(value = "/fabu")
public Result<?> fabu(@RequestParam(name="id") String id) { public Result<?> fabu(@RequestParam(name = "id") String id) {
return modulexService.fabu(id); return modulexService.fabu(id);
} }
@GetMapping(value = "/kaishi") @GetMapping(value = "/kaishi")
public Result<?> kaishi(@RequestParam(name="id") String id) { public Result<?> kaishi(@RequestParam(name = "id") String id) {
return modulexService.kaishi(id); return modulexService.kaishi(id);
} }
@GetMapping(value = "/tijiao") @GetMapping(value = "/tijiao")
public Result<?> tijiao(@RequestParam(name="id") String id) { public Result<?> tijiao(@RequestParam(name = "id") String id) {
return modulexService.tijiao(id); return modulexService.tijiao(id);
} }
@GetMapping(value = "/cehui") @GetMapping(value = "/cehui")
public Result<?> cehui(@RequestParam(name="id") String id) { public Result<?> cehui(@RequestParam(name = "id") String id) {
return modulexService.cehui(id); return modulexService.chehui(id);
} }
@GetMapping(value = "/shenhe") @GetMapping(value = "/shenhe")
public Result<?> shenhe(@RequestParam(name="id") String id) { public Result<?> shenhe(@RequestParam(name = "id") String id) {
return modulexService.shenhe(id); return modulexService.shenhe(id);
} }
/** /**
* 添加 * 添加
* * moduleName 中文名称
* @param modulex * 相同上级的模块不能重名
* @return
*/ */
@AutoLog(value = "模块管理-添加") @AutoLog(value = "模块管理-添加")
@ApiOperation(value="模块管理-添加", notes="模块管理-添加") @ApiOperation(value = "模块管理-添加", notes = "模块管理-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody Modulex modulex) { public Result<?> add(@RequestBody Modulex modulex) {
//版本号 顺序累加;初始值1 //版本号 顺序累加;初始值1
if (StringUtils.hasText(modulex.getPid())) {
List<String> collect = modulexService.list(
new LambdaQueryWrapper<Modulex>()
.eq(StringUtils.hasText(modulex.getPid()), Modulex::getPid, modulex.getPid()))
.stream().map(Modulex::getModuleName).collect(Collectors.toList());
collect.add(modulex.getModuleName());
HashSet<String> setList = new HashSet<>(collect);
if (collect.size() != setList.size()){
return Result.error("相同上级的模块不能重名");
}
}
Integer newVersion = modulexService.getMaxVersion(modulex.getVerison()); Integer newVersion = modulexService.getMaxVersion(modulex.getVerison());
modulex.setVerison(newVersion+1); modulex.setVerison(newVersion + 1);
modulexService.save(modulex); modulexService.save(modulex);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -102,7 +144,7 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
* @return * @return
*/ */
@AutoLog(value = "模块管理-编辑") @AutoLog(value = "模块管理-编辑")
@ApiOperation(value="模块管理-编辑", notes="模块管理-编辑") @ApiOperation(value = "模块管理-编辑", notes = "模块管理-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<?> edit(@RequestBody Modulex modulex) { public Result<?> edit(@RequestBody Modulex modulex) {
modulexService.updateById(modulex); modulexService.updateById(modulex);
@ -116,9 +158,9 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
* @return * @return
*/ */
@AutoLog(value = "模块管理-通过id删除") @AutoLog(value = "模块管理-通过id删除")
@ApiOperation(value="模块管理-通过id删除", notes="模块管理-通过id删除") @ApiOperation(value = "模块管理-通过id删除", notes = "模块管理-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
modulexService.removeById(id); modulexService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
@ -130,9 +172,9 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
* @return * @return
*/ */
@AutoLog(value = "模块管理-批量删除") @AutoLog(value = "模块管理-批量删除")
@ApiOperation(value="模块管理-批量删除", notes="模块管理-批量删除") @ApiOperation(value = "模块管理-批量删除", notes = "模块管理-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.modulexService.removeByIds(Arrays.asList(ids.split(","))); this.modulexService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
@ -144,11 +186,11 @@ public class ModulexController extends JeecgController<Modulex, IModulexService>
* @return * @return
*/ */
@AutoLog(value = "模块管理-通过id查询") @AutoLog(value = "模块管理-通过id查询")
@ApiOperation(value="模块管理-通过id查询", notes="模块管理-通过id查询") @ApiOperation(value = "模块管理-通过id查询", notes = "模块管理-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
Modulex modulex = modulexService.getById(id); Modulex modulex = modulexService.getById(id);
if(modulex==null) { if (modulex == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(modulex); return Result.OK(modulex);

@ -2,6 +2,7 @@ package org.jeecg.modules.modulex.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -96,6 +97,13 @@ public class Modulex implements Serializable {
@Excel(name = "责任人", width = 15) @Excel(name = "责任人", width = 15)
@ApiModelProperty(value = "责任人") @ApiModelProperty(value = "责任人")
private String managerUsers; private String managerUsers;
/**
* 上面的字段 本身的数据字典无法翻译 也不能直接把原来的字段替换掉
* 用这个字段代表 翻译后的值 不改变原先的
*/
@TableField(exist = false)
private String managerUsers_dictText;
/** /**
* 任务等级 * 任务等级
* 12345默认2 * 12345默认2

@ -2,6 +2,7 @@ package org.jeecg.modules.modulex.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.entity.Modulex;
/** /**
@ -12,4 +13,6 @@ import org.jeecg.modules.modulex.entity.Modulex;
*/ */
public interface ModulexMapper extends BaseMapper<Modulex> { public interface ModulexMapper extends BaseMapper<Modulex> {
@Select("SELECT realname FROM sys_user WHERE id = #{id}")
String getRealName(String id);
} }

@ -24,7 +24,7 @@ public interface IModulexService extends IService<Modulex> {
Result<?> tijiao(String id); Result<?> tijiao(String id);
Result<?> cehui(String id); Result<?> chehui(String id);
Result<?> shenhe(String id); Result<?> shenhe(String id);
} }

@ -103,7 +103,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
* @param id modulex表的主键id * @param id modulex表的主键id
*/ */
@Override @Override
public Result<?> cehui(String id) { public Result<?> chehui(String id) {
Modulex byId = this.getById(id); Modulex byId = this.getById(id);
if (byId.getWorkStatus() == 2) { if (byId.getWorkStatus() == 2) {
return Result.error("正处于开发中"); return Result.error("正处于开发中");

Loading…
Cancel
Save