Browse Source

Merge branch 'refs/heads/feature-v1.4.0' into feature-v1.5.0

master_tdsql
hxh 9 months ago
parent
commit
d7707d31c0
  1. 74
      shuili-admin/src/main/java/com/kms/web/controller/system/SysDeptController.java
  2. 59
      shuili-admin/src/main/java/com/kms/web/controller/system/SysRoleController.java
  3. 37
      shuili-admin/src/main/java/com/kms/web/controller/system/SysXzqhController.java
  4. 2
      shuili-admin/src/main/java/com/kms/web/utils/WaterRequestUtil.java
  5. 9
      shuili-system/src/main/java/com/kms/yxgh/common/ApprovalTypeEnum.java
  6. 66
      shuili-system/src/main/java/com/kms/yxgh/common/controller/ApprovalController.java
  7. 16
      shuili-system/src/main/java/com/kms/yxgh/common/domain/ObjRoles.java
  8. 14
      shuili-system/src/main/java/com/kms/yxgh/common/dto/IAdcd.java
  9. 4
      shuili-system/src/main/java/com/kms/yxgh/common/dto/OperatorDto.java
  10. 29
      shuili-system/src/main/java/com/kms/yxgh/common/mapper/ApprovalObjRolesMapper.java
  11. 3
      shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalBusinessService.java
  12. 12
      shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalObjRolesService.java
  13. 24
      shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalService.java
  14. 28
      shuili-system/src/main/java/com/kms/yxgh/common/service/DefaultApprovalBusinessService.java
  15. 2
      shuili-system/src/main/java/com/kms/yxgh/df/controller/DfYhRecordController.java
  16. 3
      shuili-system/src/main/java/com/kms/yxgh/df/dto/DfCheckingLineSearchDto.java
  17. 3
      shuili-system/src/main/java/com/kms/yxgh/df/dto/DfRecordSearchDto.java
  18. 3
      shuili-system/src/main/java/com/kms/yxgh/df/dto/DfYhPlanSearchDto.java
  19. 3
      shuili-system/src/main/java/com/kms/yxgh/df/dto/DfYhRecordSearchDto.java
  20. 4
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingLineMapper.java
  21. 52
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfRecordMapper.java
  22. 4
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhPlanMapper.java
  23. 4
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhRecordMapper.java
  24. 36
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfRecordService.java
  25. 19
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhPlanService.java
  26. 29
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhRecordService.java
  27. 3
      shuili-system/src/main/java/com/kms/yxgh/sz/controller/SzYhRecordController.java
  28. 3
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/SzYhPlanSearchDto.java
  29. 3
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/SzYhRecordSearchDto.java
  30. 5
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhPlanMapper.java
  31. 4
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhRecordMapper.java
  32. 19
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhPlanService.java
  33. 34
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhRecordService.java
  34. 364
      shuili-system/src/main/resources/mapper/system/SysDeptMapper.xml
  35. 2
      shuili-system/src/main/resources/mapper/yxgh/DfYhPlanMapper.xml
  36. 2
      shuili-system/src/main/resources/mapper/yxgh/DfYhRecordMapper.xml
  37. 2
      shuili-system/src/main/resources/mapper/yxgh/SzYhPlanMapper.xml
  38. 2
      shuili-system/src/main/resources/mapper/yxgh/SzYhRecordMapper.xml
  39. 11
      sql/sy/v1.4.0/增量脚本/v1.4.0-update.sql

74
shuili-admin/src/main/java/com/kms/web/controller/system/SysDeptController.java

@ -11,6 +11,7 @@ import com.shuili.common.core.domain.entity.SysDept;
import com.shuili.common.enums.BusinessType;
import com.shuili.common.utils.FastDfsUtil;
import com.shuili.common.utils.StringUtils;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@ -27,8 +28,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController
{
public class SysDeptController extends BaseController {
@Autowired
private SysDeptService deptService;
@ -41,8 +41,7 @@ public class SysDeptController extends BaseController
@SaCheckLogin
@GetMapping("/list")
@SaCheckPermission(value = "system:dept:list")
public AjaxResult list(SysDept dept)
{
public AjaxResult list(SysDept dept) {
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(depts);
}
@ -53,16 +52,13 @@ public class SysDeptController extends BaseController
@SaCheckLogin
@GetMapping("/list/exclude/{deptId}")
@SaCheckPermission(value = "system:dept:list")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) String deptId)
{
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) String deptId) {
List<SysDept> depts = deptService.selectDeptList(new SysDept());
Iterator<SysDept> it = depts.iterator();
while (it.hasNext())
{
while (it.hasNext()) {
SysDept d = (SysDept) it.next();
if (d.getId().equals(deptId)
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
{
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) {
it.remove();
}
}
@ -75,10 +71,9 @@ public class SysDeptController extends BaseController
@SaCheckLogin
@GetMapping(value = "/{deptId}")
@SaCheckPermission(value = "system:dept:query")
public AjaxResult getInfo(@PathVariable String deptId)
{
SysDept selectDeptById = deptService.get(deptId);
return AjaxResult.success(selectDeptById);
public AjaxResult getInfo(@PathVariable String deptId) {
SysDept selectDeptById = deptService.get(deptId);
return AjaxResult.success(selectDeptById);
}
/**
@ -86,15 +81,14 @@ public class SysDeptController extends BaseController
*/
@SaCheckLogin
@PostMapping("/uploadLogo")
public AjaxResult uploadLogo(@RequestParam("avatarfile") MultipartFile file)
{
public AjaxResult uploadLogo(@RequestParam("avatarfile") MultipartFile file) {
try {
String uploadFile = fastUtil.uploadFile(file);
// String uploadFile = "group1/M00/05/27/wKgBFGCvaeiAPWu5AADSPy2Q2g0276.jpg";
AjaxResult ajax = AjaxResult.success();
ajax.put("logoUrl", uploadFile);
return ajax;
} catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error("上传图片异常,请联系管理员");
}
@ -104,8 +98,7 @@ public class SysDeptController extends BaseController
* 获取部门下拉树列表
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysDept dept)
{
public AjaxResult treeselect(SysDept dept) {
List<SysDept> depts = deptService.selectDeptList(dept);
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
}
@ -114,8 +107,7 @@ public class SysDeptController extends BaseController
* 加载对应角色部门列表树
*/
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") String roleId)
{
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") String roleId) {
List<SysDept> depts = deptService.selectDeptList(new SysDept());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
@ -130,40 +122,33 @@ public class SysDeptController extends BaseController
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@SaCheckPermission(value = "system:dept:add")
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
{
public AjaxResult add(@Validated @RequestBody SysDept dept) {
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setParentId("100");
int i = deptService.insertDept(dept);
return toAjax(i>0);
return toAjax(i > 0);
}
/**
* 修改部门
* 修改部门
*/
@SaCheckLogin
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@SaCheckPermission(value = "system:dept:edit")
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
{
@ApiOperation("部门修改")
public AjaxResult edit(@Validated @RequestBody SysDept dept) {
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(dept.getId()))
{
} else if (dept.getParentId().equals(dept.getId())) {
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getId()) > 0)
{
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getId()) > 0) {
return AjaxResult.error("该部门包含未停用的子部门!");
}
return toAjax(deptService.updateDept(dept)>0);
return toAjax(deptService.updateDept(dept) > 0);
}
/**
@ -173,17 +158,14 @@ public class SysDeptController extends BaseController
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@SaCheckPermission(value = "system:dept:remove")
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable String deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
public AjaxResult remove(@PathVariable String deptId) {
if (deptService.hasChildByDeptId(deptId)) {
return AjaxResult.error("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
if (deptService.checkDeptExistUser(deptId)) {
return AjaxResult.error("部门存在用户,不允许删除");
}
return toAjax(deptService.deleteDeptById(deptId)>0);
return toAjax(deptService.deleteDeptById(deptId) > 0);
}

59
shuili-admin/src/main/java/com/kms/web/controller/system/SysRoleController.java

@ -15,6 +15,7 @@ import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysRole;
import com.shuili.common.enums.BusinessType;
import com.shuili.common.utils.poi.ExcelUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -28,8 +29,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController
{
public class SysRoleController extends BaseController {
@Autowired
private SysRoleService roleService;
@Autowired
@ -44,19 +44,21 @@ public class SysRoleController extends BaseController
//获取所有的角色
@GetMapping("listAll")
public AjaxResult listAll(){
@ApiOperation("获取所有的角色")
public AjaxResult listAll() {
return AjaxResult.success(roleService.list());
}
@PostMapping("/list")
public IPage list(@RequestBody SearchParam<SysRole> sp)
{
@ApiOperation("角色列表")
public IPage list(@RequestBody SearchParam<SysRole> sp) {
return roleService.selectPage(sp);
}
/**
* 角色导出
*
* @param role
* @return
*/
@ -64,8 +66,7 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@SaCheckPermission(value = "system:role:export")
@PostMapping("/export")
public AjaxResult export(@RequestBody SysRole role)
{
public AjaxResult export(@RequestBody SysRole role) {
List<SysRole> list = roleService.listByIds(role.getIds());
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
return util.exportExcel(list, "角色数据");
@ -77,8 +78,7 @@ public class SysRoleController extends BaseController
@SaCheckLogin
@SaCheckPermission(value = "system:role:query")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable String roleId)
{
public AjaxResult getInfo(@PathVariable String roleId) {
/**
* 1.角色详情
* 2.角色相关的菜单
@ -104,17 +104,13 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.INSERT)
@SaCheckPermission(value = "system:role:add")
@PostMapping
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
{
public AjaxResult add(@Validated @RequestBody SysRole role) {
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
{
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
return toAjax(roleService.insertRole(role)>0);
return toAjax(roleService.insertRole(role) > 0);
}
@ -125,20 +121,15 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@SaCheckPermission(value = "system:role:edit")
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
public AjaxResult edit(@Validated @RequestBody SysRole role) {
roleService.checkRoleAllowed(role);
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
{
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
{
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
if (roleService.updateRole(role) > 0)
{
if (roleService.updateRole(role) > 0) {
// 更新缓存用户权限
// SysUser user = UserUtils.getUser();
@ -160,10 +151,9 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@SaCheckPermission(value = "system:role:edit")
@PutMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role)
{
public AjaxResult dataScope(@RequestBody SysRole role) {
roleService.checkRoleAllowed(role);
return toAjax(roleService.authDataScope(role)>0);
return toAjax(roleService.authDataScope(role) > 0);
}
/**
@ -173,8 +163,7 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@SaCheckPermission(value = "system:role:edit")
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role)
{
public AjaxResult changeStatus(@RequestBody SysRole role) {
roleService.checkRoleAllowed(role);
return toAjax(roleService.updateRoleStatus(role) > 0);
}
@ -186,17 +175,15 @@ public class SysRoleController extends BaseController
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@SaCheckPermission(value = "system:role:remove")
@DeleteMapping("/{roleIds}")
public AjaxResult remove(@PathVariable String[] roleIds)
{
return toAjax(roleService.deleteRoleByIds(roleIds) >0);
public AjaxResult remove(@PathVariable String[] roleIds) {
return toAjax(roleService.deleteRoleByIds(roleIds) > 0);
}
/**
* 获取角色选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
public AjaxResult optionselect() {
return AjaxResult.success(roleService.selectRoleAll());
}
}

37
shuili-admin/src/main/java/com/kms/web/controller/system/SysXzqhController.java

@ -25,8 +25,6 @@ import java.util.Arrays;
import java.util.List;
/**
* 行政区划Controller
*
@ -36,8 +34,7 @@ import java.util.List;
@RestController
@RequestMapping("/xzqh/xzqh")
@Api(tags = "行政区划")
public class SysXzqhController extends BaseController
{
public class SysXzqhController extends BaseController {
@Autowired
private SysXzqhService sysXzqhService;
@ -63,10 +60,9 @@ public class SysXzqhController extends BaseController
}
@GetMapping("/common")
public AjaxResult common(){
@ApiOperation("通用行政区划")
public AjaxResult common() {
SysUser user = UserUtils.getUser();
String deptId = user.getDeptId();
SysDept sysDept = sysDeptService.getById(deptId);
@ -76,19 +72,20 @@ public class SysXzqhController extends BaseController
/*if (userName.equals("admin")) {
List<SysXzqh> list = sysXzqhService.list();
return AjaxResult.success(list);
}else */if (xzqh.getLayer()==1) {
}else */
if (xzqh.getLayer() == 1) {
String substring = xzqh.getXzqhdm().substring(0, 2);
QueryWrapper<SysXzqh> queryWrapper = new QueryWrapper<>();
queryWrapper.likeRight("XZQHDM", substring);
List<SysXzqh> list = sysXzqhService.list(queryWrapper);
return AjaxResult.success(list);
} else if (xzqh.getLayer()==2) {
} else if (xzqh.getLayer() == 2) {
String substring = xzqh.getXzqhdm().substring(0, 4);
QueryWrapper<SysXzqh> queryWrapper = new QueryWrapper<>();
queryWrapper.likeRight("XZQHDM", substring);
List<SysXzqh> list = sysXzqhService.list(queryWrapper);
return AjaxResult.success(list);
}else {
} else {
return AjaxResult.success(xzqh);
}
}
@ -98,8 +95,7 @@ public class SysXzqhController extends BaseController
*/
@PostMapping("/list")
@ApiOperation("行政区划列表")
public IPage list(@RequestBody SearchParam<SysXzqh> sp)
{
public IPage list(@RequestBody SearchParam<SysXzqh> sp) {
return sysXzqhService.selectPage(sp);
}
@ -109,8 +105,7 @@ public class SysXzqhController extends BaseController
@Log(title = "行政区划导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ApiOperation("行政区划导出")
public AjaxResult export(@RequestBody SysXzqh sysXzqh)
{
public AjaxResult export(@RequestBody SysXzqh sysXzqh) {
List<SysXzqh> list = sysXzqhService.listByIds(sysXzqh.getIds());
ExcelUtil<SysXzqh> util = new ExcelUtil<>(SysXzqh.class);
return util.exportExcel(list, "xzqh");
@ -121,8 +116,7 @@ public class SysXzqhController extends BaseController
*/
@ApiOperation(" 行政区划详情")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
public AjaxResult getInfo(@PathVariable("id") String id) {
return AjaxResult.success(sysXzqhService.getById(id));
}
@ -132,8 +126,7 @@ public class SysXzqhController extends BaseController
@Log(title = "行政区划新增", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("行政区划新增")
public AjaxResult add(@RequestBody SysXzqh sysXzqh)
{
public AjaxResult add(@RequestBody SysXzqh sysXzqh) {
BaseEntityUtils.preInsert(sysXzqh);
return toAjax(sysXzqhService.save(sysXzqh));
}
@ -144,8 +137,7 @@ public class SysXzqhController extends BaseController
@ApiOperation("行政区划修改")
@Log(title = "行政区划修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysXzqh sysXzqh)
{
public AjaxResult edit(@RequestBody SysXzqh sysXzqh) {
return toAjax(sysXzqhService.updateById(sysXzqh));
}
@ -154,9 +146,8 @@ public class SysXzqhController extends BaseController
*/
@ApiOperation("行政区划删除")
@Log(title = "行政区划删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(sysXzqhService.removeByIds(Arrays.asList(ids)));
}
}

2
shuili-admin/src/main/java/com/kms/web/utils/WaterRequestUtil.java

@ -283,7 +283,7 @@ public class WaterRequestUtil {
log.info("--------请求获取门户角色信息,请求地址为:{}", roleUrl);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("page", 1);
hashMap.put("size", 100);
hashMap.put("size", 1000);
hashMap.put("systemCode", systemCode);
HttpRequest get = createPost(roleUrl, roleServiceId, roleAppsecret);
String body;

9
shuili-system/src/main/java/com/kms/yxgh/common/ApprovalTypeEnum.java

@ -24,4 +24,13 @@ public enum ApprovalTypeEnum {
this.service = SpringUtils.getBean(service);
}
public static ApprovalTypeEnum getApprovalTypeEnum(String value) {
for (ApprovalTypeEnum approvalTypeEnum : ApprovalTypeEnum.values()) {
if (approvalTypeEnum.getValue().equals(value)) {
return approvalTypeEnum;
}
}
return null;
}
}

66
shuili-system/src/main/java/com/kms/yxgh/common/controller/ApprovalController.java

@ -0,0 +1,66 @@
package com.kms.yxgh.common.controller;
import com.kms.yxgh.base.Response;
import com.kms.yxgh.common.ApprovalTypeEnum;
import com.kms.yxgh.common.service.ApprovalService;
import com.shuili.common.core.domain.entity.SysRole;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@AllArgsConstructor
@RequestMapping("/run/approval")
@Api(tags = "审批相关")
public class ApprovalController {
private final ApprovalService approvalService;
@GetMapping("/objs")
@ApiOperation("审批对象列表")
public Response<List<ApprovalObjDto>> getApprovalObjList() {
return Response.ok(Arrays.stream(ApprovalTypeEnum.values()).map(e -> {
ApprovalObjDto dto = new ApprovalObjDto();
dto.setCode(e.getValue());
dto.setName(e.getName());
return dto;
}).collect(Collectors.toList()));
}
@GetMapping("/objs/{type}/roles")
@ApiOperation("审批对象角色列表")
public Response<List<SysRole>> getApprovalObjRoles(@PathVariable("type") String type) {
ApprovalTypeEnum approvalTypeEnum = ApprovalTypeEnum.getApprovalTypeEnum(type);
if (approvalTypeEnum == null) {
return Response.ok();
}
return Response.ok(approvalService.roles(approvalTypeEnum));
}
@PutMapping("/objs/{type}/roles")
@ApiOperation("设置审批对象角色列表")
public Response<Void> updateApprovalObjRoles(@PathVariable("type") String type, @RequestBody List<String> roleIds) {
ApprovalTypeEnum approvalTypeEnum = ApprovalTypeEnum.getApprovalTypeEnum(type);
if (approvalTypeEnum != null) {
approvalService.updateRoles(approvalTypeEnum, roleIds);
}
return Response.ok();
}
@Data
@ApiModel("审批对象")
public static class ApprovalObjDto {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("编码")
private String code;
}
}

16
shuili-system/src/main/java/com/kms/yxgh/common/domain/ObjRoles.java

@ -0,0 +1,16 @@
package com.kms.yxgh.common.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kms.yxgh.base.SyBaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@TableName("bs_sgc_sp_objrole")
@Data
@ApiModel("审批对象执行角色")
public class ObjRoles extends SyBaseEntity {
private String objType;
private String roleId;
}

14
shuili-system/src/main/java/com/kms/yxgh/common/dto/IAdcd.java

@ -0,0 +1,14 @@
package com.kms.yxgh.common.dto;
public interface IAdcd {
String getAdcd();
default String getAdcdQx() {
String adcd = getAdcd();
if (adcd == null) {
return null;
}
return adcd.replaceAll("00(00)?$", "");
}
}

4
shuili-system/src/main/java/com/kms/yxgh/common/dto/OperatorDto.java

@ -2,10 +2,14 @@ package com.kms.yxgh.common.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel("操作人员")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OperatorDto {
@ApiModelProperty("主键")

29
shuili-system/src/main/java/com/kms/yxgh/common/mapper/ApprovalObjRolesMapper.java

@ -0,0 +1,29 @@
package com.kms.yxgh.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kms.yxgh.common.domain.ObjRoles;
import com.shuili.common.core.domain.entity.SysRole;
import com.shuili.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ApprovalObjRolesMapper extends BaseMapper<ObjRoles> {
@Select("select r.* from bs_sgc_sp_objrole o left join sys_role r on o.role_id = r.id where o.obj_type = #{objType}")
List<SysRole> getRolesByObjType(@Param("objType") String objType);
@Select("SELECT su.* " +
"FROM sys_user su " +
"JOIN sys_user_role sur ON su.id = sur.user_id " +
"JOIN bs_sgc_sp_objrole so ON sur.role_id = so.role_id " +
"WHERE so.obj_type = #{objType}")
List<SysUser> getUsers(@Param("objType") String objType);
}

3
shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalBusinessService.java

@ -2,6 +2,7 @@ package com.kms.yxgh.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.ApprovalTypeEnum;
import com.kms.yxgh.common.dto.ApprovalDetailDto;
import com.kms.yxgh.common.dto.ApprovalSearchDto;
import com.kms.yxgh.common.dto.OperatorDto;
@ -25,7 +26,7 @@ public interface ApprovalBusinessService<S, V> {
* @param formId 业务表单id
* @return 审批人列表
*/
List<OperatorDto> getOperatorList(String formId);
List<OperatorDto> getOperatorList(String formId, ApprovalTypeEnum approvalType);
/**
* 更新业务表达状态

12
shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalObjRolesService.java

@ -0,0 +1,12 @@
package com.kms.yxgh.common.service;
import com.kms.yxgh.common.domain.ObjRoles;
import com.kms.yxgh.common.mapper.ApprovalObjRolesMapper;
import com.shuili.common.core.service.BaseService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class ApprovalObjRolesService extends BaseService<ApprovalObjRolesMapper, ObjRoles> {
}

24
shuili-system/src/main/java/com/kms/yxgh/common/service/ApprovalService.java

@ -10,10 +10,12 @@ import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.ApprovalTypeEnum;
import com.kms.yxgh.common.domain.ApprovalOperator;
import com.kms.yxgh.common.domain.ApprovalTask;
import com.kms.yxgh.common.domain.ObjRoles;
import com.kms.yxgh.common.dto.ApprovalCommentDto;
import com.kms.yxgh.common.dto.ApprovalDetailDto;
import com.kms.yxgh.common.dto.DocDto;
import com.kms.yxgh.common.dto.OperatorDto;
import com.shuili.common.core.domain.entity.SysRole;
import com.shuili.common.core.domain.entity.SysUser;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@ -30,6 +32,7 @@ public class ApprovalService {
private final ApprovalTaskService approvalTaskService;
private final ApprovalOperatorService approvalOperatorService;
private final ApprovalObjRolesService approvalObjRolesService;
@Transactional(rollbackFor = Exception.class)
@ -48,7 +51,7 @@ public class ApprovalService {
approvalTask.setStatus(ApprovalStatusEnum.WAITING.getValue());
approvalTaskService.save(approvalTask);
String taskId = approvalTask.getId();
List<OperatorDto> operatorDtoList = service.getOperatorList(formId);
List<OperatorDto> operatorDtoList = service.getOperatorList(formId, approvalType);
if (CollectionUtil.isNotEmpty(operatorDtoList)) {
List<ApprovalOperator> approvalOperators = operatorDtoList.stream().map(operatorDto -> {
ApprovalOperator approvalOperator = new ApprovalOperator();
@ -155,4 +158,23 @@ public class ApprovalService {
service.updateApprovalStatus(formId, ApprovalStatusEnum.SUBMITTING);
}
}
public List<SysRole> roles(ApprovalTypeEnum approvalTypeEnum) {
return approvalObjRolesService.getBaseMapper().getRolesByObjType(approvalTypeEnum.getValue());
}
@Transactional(rollbackFor = Exception.class)
public void updateRoles(ApprovalTypeEnum approvalTypeEnum, List<String> roleIds) {
if (CollectionUtil.isNotEmpty(roleIds)) {
approvalObjRolesService.remove(Wrappers.<ObjRoles>lambdaQuery()
.eq(ObjRoles::getObjType, approvalTypeEnum.getValue()));
List<ObjRoles> objRolesList = roleIds.stream().map(roleId -> {
ObjRoles objRoles = new ObjRoles();
objRoles.setObjType(approvalTypeEnum.getValue());
objRoles.setRoleId(roleId);
return objRoles;
}).collect(Collectors.toList());
approvalObjRolesService.saveBatch(objRolesList);
}
}
}

28
shuili-system/src/main/java/com/kms/yxgh/common/service/DefaultApprovalBusinessService.java

@ -0,0 +1,28 @@
package com.kms.yxgh.common.service;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kms.yxgh.common.ApprovalTypeEnum;
import com.kms.yxgh.common.dto.OperatorDto;
import com.shuili.common.core.domain.BaseEntity;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public abstract class DefaultApprovalBusinessService<M extends BaseMapper<T>, T extends BaseEntity, S, V> extends BaseService<M, T> implements ApprovalBusinessService<S, V> {
@Autowired
private ApprovalObjRolesService approvalObjRolesService;
@Override
public List<OperatorDto> getOperatorList(String formId, ApprovalTypeEnum approvalType) {
List<SysUser> users = approvalObjRolesService.getBaseMapper().getUsers(approvalType.getValue());
return Optional.ofNullable(users)
.map(us -> us.stream().map(u -> new OperatorDto(u.getId(), u.getId(), u.getNickName())).collect(Collectors.toList()))
.orElse(Collections.emptyList());
}
}

2
shuili-system/src/main/java/com/kms/yxgh/df/controller/DfYhRecordController.java

@ -53,7 +53,7 @@ public class DfYhRecordController extends ApprovalAbstractController<DfYhRecordS
@GetMapping(value = "/{id}")
public Response<DfYhRecordDetailDto> getInfo(@PathVariable("id") String id) {
DfYhRecordDetailDto detailById = dfYhRecordService.getDetailById(id);
if (StringUtils.isNotEmpty(detailById.getPlanId())) {
if (detailById != null && StringUtils.isNotEmpty(detailById.getPlanId())) {
detailById.setPlan(dfYhPlanService.getDetailById(detailById.getPlanId()));
}
return Response.ok(detailById);

3
shuili-system/src/main/java/com/kms/yxgh/df/dto/DfCheckingLineSearchDto.java

@ -1,5 +1,6 @@
package com.kms.yxgh.df.dto;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -8,7 +9,7 @@ import java.util.List;
@Data
@ApiModel("堤防巡视检查路线查询")
public class DfCheckingLineSearchDto {
public class DfCheckingLineSearchDto implements IAdcd {
@ApiModelProperty("堤防编码")
private String dikeCode;

3
shuili-system/src/main/java/com/kms/yxgh/df/dto/DfRecordSearchDto.java

@ -1,5 +1,6 @@
package com.kms.yxgh.df.dto;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -17,7 +18,7 @@ import java.util.List;
@Data
@ApiModel("堤防巡视检查记录检索条件")
public class DfRecordSearchDto {
public class DfRecordSearchDto implements IAdcd {
@ApiModelProperty("行政区划")
private String adcd;

3
shuili-system/src/main/java/com/kms/yxgh/df/dto/DfYhPlanSearchDto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.df.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -18,7 +19,7 @@ import java.util.Date;
@Data
@ApiModel("堤防维修养护计划查询条件")
public class DfYhPlanSearchDto {
public class DfYhPlanSearchDto implements IAdcd {
@ApiModelProperty("id")
private String id;

3
shuili-system/src/main/java/com/kms/yxgh/df/dto/DfYhRecordSearchDto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.df.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -18,7 +19,7 @@ import java.util.Date;
@Data
@ApiModel("堤防养护记录查询")
public class DfYhRecordSearchDto {
public class DfYhRecordSearchDto implements IAdcd {
@ApiModelProperty("行政区划")
private String adcd;

4
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingLineMapper.java

@ -42,8 +42,8 @@ public interface DfCheckingLineMapper extends BaseMapper<DfCheckingLine> {
"<if test='dto.dikeType != null and dto.dikeType != \"\"'>",
"and df.dike_type = #{dto.dikeType} ",
"</if>",
"<if test='dto.adcd != null and dto.adcd != \"\"'>",
"and df.adcd like concat(#{dto.adcd}, '%') ",
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'>",
"and df.adcd like concat(#{dto.adcdQx}, '%') ",
"</if>",
"<if test='dto.lineName != null and dto.lineName != \"\"'>",
"and line.name like concat('%', #{dto.lineName}, '%') ",

52
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfRecordMapper.java

@ -1,7 +1,10 @@
package com.kms.yxgh.df.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kms.yxgh.df.domain.DfRecord;
import com.kms.yxgh.df.dto.DfRecordSearchDto;
import com.kms.yxgh.df.dto.DfRecordSimpleDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@ -20,4 +23,53 @@ public interface DfRecordMapper extends BaseMapper<DfRecord> {
@Select("SELECT MAX(create_time) FROM bs_sgc_df_xsjhjl WHERE dike_code = #{dikeCode} ")
Date getLastInsertTimeByDikeCode(@Param("dikeCode") String dikeCode);
@Select("<script>" +
"SELECT " +
"r.id, " +
"r.dike_code," +
"r.dike_name, " +
"r.dike_type, " +
"r.line_name, " +
"r.line_type, " +
"r.duty_holder_type, " +
"r.status, " +
"r.handle_status, " +
"r.start_date, " +
"r.end_date, " +
"r.create_time, " +
"r.update_time, " +
"r.create_uid, " +
"r.update_uid " +
"FROM bs_sgc_df_xsjhjl r " +
"Left JOIN att_dike_base df ON r.dike_code = df.dike_code and df.expr_date is null " +
"where 1=1" +
"<if test='dto.dikeName != null and dto.dikeName != \"\"'> " +
"and r.dike_name like concat('%',#{dto.dikeName},'%') " +
"</if> " +
"<if test='dto.dikeType != null and dto.dikeType != \"\"'> " +
"and r.dike_type = #{dto.dikeType} " +
"</if> " +
"<if test='dto.lineName != null and dto.lineName != \"\"'> " +
"and r.line_name like concat('%',#{dto.lineName},'%') " +
"</if> " +
"<if test='dto.lineType != null and dto.lineType != \"\"'> " +
"and r.line_type = #{dto.lineType} " +
"</if> " +
"<if test='dto.dutyHolderType != null and dto.dutyHolderType != \"\"'> " +
"and r.duty_holder_type = #{dto.dutyHolderType} " +
"</if> " +
"<if test='dto.status != null and dto.status != \"\"'> " +
"and r.status = #{dto.status} " +
"</if> " +
"<if test='dto.handleStatus != null and dto.handleStatus != \"\"'> " +
"and r.handle_status = #{dto.handleStatus} " +
"</if> " +
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'> " +
"and df.adcd like concat(#{dto.adcdQx},'%') " +
"</if> " +
"order by r.end_date desc " +
"</script>")
IPage<DfRecordSimpleDto> search(IPage<DfRecord> page, @Param("dto") DfRecordSearchDto dto);
}

4
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhPlanMapper.java

@ -45,8 +45,8 @@ public interface DfYhPlanMapper extends BaseMapper<DfYhPlan> {
"<if test='dto.name != null'>",
"AND yh.name LIKE CONCAT('%',#{dto.name},'%') ",
"</if>",
"<if test='dto.adcd != null and dto.adcd != \"\"'>",
"AND jb.adcd LIKE CONCAT(#{dto.adcd},'%') ",
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'>",
"AND jb.adcd LIKE CONCAT(#{dto.adcdQx},'%') ",
"</if>",
"<if test='dto.dikeName != null and dto.dikeName != \"\"'>",
"AND jb.dike_name LIKE CONCAT('%',#{dto.dikeName},'%') ",

4
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhRecordMapper.java

@ -56,8 +56,8 @@ public interface DfYhRecordMapper extends BaseMapper<DfYhRecord> {
"<if test='searchDto.name != null and searchDto.name != \"\"'>" +
"AND jh.name LIKE CONCAT('%',#{searchDto.name},'%') " +
"</if>" +
"<if test='searchDto.adcd != null and searchDto.adcd != \"\"'>" +
"AND df.adcd LIKE CONCAT(#{searchDto.adcd},'%') " +
"<if test='searchDto.adcdQx != null and searchDto.adcdQx != \"\"'>" +
"AND df.adcd LIKE CONCAT(#{searchDto.adcdQx},'%') " +
"</if>" +
"<if test='searchDto.status != null and searchDto.status != \"\"'>" +
"AND yhjl.status = #{searchDto.status} " +

36
shuili-system/src/main/java/com/kms/yxgh/df/service/DfRecordService.java

@ -56,32 +56,16 @@ public class DfRecordService extends BaseService<DfRecordMapper, DfRecord> {
public IPage<DfRecordSimpleDto> search(SearchParam<DfRecordSearchDto> sp) {
IPage<DfRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DfRecordSearchDto searchDto = sp.getData();
Wrapper<DfRecord> wp = Wrappers.<DfRecord>lambdaQuery()
.like(StringUtils.isNotBlank(searchDto.getDikeName()), DfRecord::getDikeName, searchDto.getDikeName())
.eq(StringUtils.isNotBlank(searchDto.getStatus()), DfRecord::getStatus, searchDto.getStatus())
.eq(StringUtils.isNotBlank(searchDto.getHandleStatus()), DfRecord::getHandleStatus, searchDto.getHandleStatus())
.eq(StringUtils.isNotBlank(searchDto.getDikeType()), DfRecord::getDikeType, searchDto.getDikeType())
.like(StringUtils.isNotBlank(searchDto.getLineName()), DfRecord::getLineName, searchDto.getLineName())
.eq(StringUtils.isNotBlank(searchDto.getLineType()), DfRecord::getLineType, searchDto.getLineType())
.eq(StringUtils.isNotBlank(searchDto.getDutyHolderType()), DfRecord::getDutyHolderType, searchDto.getDutyHolderType())
.orderByDesc(DfRecord::getEndDate);
page = page(page, wp);
if (CollectionUtil.isNotEmpty(page.getRecords())) {
List<DfRecordSimpleDto> records = page.getRecords().stream().map(r -> {
DfRecordSimpleDto dto = BeanCopyUtils.copy(r, DfRecordSimpleDto.class);
if (dto != null) {
dto.setCreateName(userService.userName(dto.getCreateUid()));
dto.setOperators(planOperatorMapper.selectOperatorBySubPlanId(r.getSubPlanId()));
}
return dto;
}).collect(Collectors.toList());
Page<DfRecordSimpleDto> recordSearchDtoPage = new Page<>(page.getCurrent(), page.getSize(),
page.getTotal());
recordSearchDtoPage.setRecords(records);
return recordSearchDtoPage;
} else {
return new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
}
IPage<DfRecordSimpleDto> records = this.getBaseMapper().search(page, searchDto);
records.getRecords().forEach(r -> {
DfRecordSimpleDto dto = BeanCopyUtils.copy(r, DfRecordSimpleDto.class);
if (dto != null) {
dto.setCreateName(userService.userName(dto.getCreateUid()));
dto.setOperators(planOperatorMapper.selectOperatorBySubPlanId(r.getSubPlanId()));
}
});
return records;
}
@Transactional(rollbackFor = Exception.class)

19
shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhPlanService.java

@ -10,21 +10,18 @@ import com.kms.system.service.SysUserService;
import com.kms.yxgh.base.DfException;
import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.common.service.ApprovalBusinessService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.df.domain.DfYhPlan;
import com.kms.yxgh.df.dto.DfYhPlanDetailDto;
import com.kms.yxgh.df.dto.DfYhPlanSearchDto;
import com.kms.yxgh.df.mapper.DfYhPlanMapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
import com.shuili.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@ -36,7 +33,7 @@ import java.util.Optional;
*/
@Service
@AllArgsConstructor
public class DfYhPlanService extends BaseService<DfYhPlanMapper, DfYhPlan> implements ApprovalBusinessService<DfYhPlanSearchDto, DfYhPlanDetailDto> {
public class DfYhPlanService extends DefaultApprovalBusinessService<DfYhPlanMapper, DfYhPlan, DfYhPlanSearchDto, DfYhPlanDetailDto> {
private final SysUserService sysUserService;
@ -133,18 +130,6 @@ public class DfYhPlanService extends BaseService<DfYhPlanMapper, DfYhPlan> imple
return this.getBaseMapper().approvalSearchPage(page, sp.getData());
}
@Override
public List<OperatorDto> getOperatorList(String formId) {
SysUser user = sysUserService.getById("1");
if (user != null) {
OperatorDto operatorDto = new OperatorDto();
operatorDto.setUid(user.getId());
operatorDto.setName(user.getNickName());
return Collections.singletonList(operatorDto);
}
return Collections.emptyList();
}
@Override
public void updateApprovalStatus(String formId, ApprovalStatusEnum status) {
Wrapper<DfYhPlan> wp = Wrappers.<DfYhPlan>lambdaUpdate()

29
shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhRecordService.java

@ -10,7 +10,7 @@ import com.kms.system.service.SysUserService;
import com.kms.yxgh.base.DfException;
import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.common.service.ApprovalBusinessService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.df.domain.DfYhRecord;
import com.kms.yxgh.df.dto.DfYhRecordApprovalDto;
import com.kms.yxgh.df.dto.DfYhRecordDetailDto;
@ -19,7 +19,6 @@ import com.kms.yxgh.df.mapper.DfYhRecordMapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -36,7 +35,7 @@ import java.util.Optional;
*/
@AllArgsConstructor
@Service
public class DfYhRecordService extends BaseService<DfYhRecordMapper, DfYhRecord> implements ApprovalBusinessService<DfYhRecordSearchDto, DfYhRecordApprovalDto> {
public class DfYhRecordService extends DefaultApprovalBusinessService<DfYhRecordMapper, DfYhRecord, DfYhRecordSearchDto, DfYhRecordApprovalDto> {
private final DfYhPlanService dfYhPlanService;
private final SysUserService sysUserService;
@ -53,7 +52,7 @@ public class DfYhRecordService extends BaseService<DfYhRecordMapper, DfYhRecord>
}
return dto;
}
return null;
throw new DfException("源数据不存在,请确认id值是否正确");
}
@Transactional(rollbackFor = Exception.class)
@ -120,8 +119,14 @@ public class DfYhRecordService extends BaseService<DfYhRecordMapper, DfYhRecord>
}
public IPage<DfYhRecordDetailDto> search(SearchParam<DfYhRecordSearchDto> sp) {
Page<DfYhRecordDetailDto> page = new Page<>(sp.getPageNum(), sp.getPageSize());
return this.getBaseMapper().searchPage(page, Optional.ofNullable(sp.getData()).orElse(new DfYhRecordSearchDto()));
IPage<DfYhRecordDetailDto> page = new Page<>(sp.getPageNum(), sp.getPageSize());
page = this.getBaseMapper().searchPage(page, Optional.ofNullable(sp.getData()).orElse(new DfYhRecordSearchDto()));
page.getRecords().forEach(dto -> {
if (dto != null) {
dto.setPlan(dfYhPlanService.getDetailById(dto.getPlanId()));
}
});
return page;
}
///更新状态
@ -138,18 +143,6 @@ public class DfYhRecordService extends BaseService<DfYhRecordMapper, DfYhRecord>
return this.getBaseMapper().approvalSearchPage(page, sp.getData());
}
@Override
public List<OperatorDto> getOperatorList(String formId) {
SysUser user = sysUserService.getById("1");
if (user != null) {
OperatorDto operatorDto = new OperatorDto();
operatorDto.setUid(user.getId());
operatorDto.setName(user.getNickName());
return Collections.singletonList(operatorDto);
}
return Collections.emptyList();
}
@Override
public void updateApprovalStatus(String formId, ApprovalStatusEnum status) {
Wrapper<DfYhRecord> wp = Wrappers.<DfYhRecord>lambdaUpdate()

3
shuili-system/src/main/java/com/kms/yxgh/sz/controller/SzYhRecordController.java

@ -11,6 +11,7 @@ import com.kms.yxgh.sz.service.SzYhRecordService;
import com.shuili.common.annotation.Log;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.enums.BusinessType;
import com.shuili.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,7 +53,7 @@ public class SzYhRecordController extends ApprovalAbstractController<SzYhRecordS
@GetMapping(value = "/{id}")
public Response<SzYhRecordDetailDto> getInfo(@PathVariable("id") String id) {
SzYhRecordDetailDto detailById = szYhRecordService.getDetailById(id);
if (detailById.getPlanId() != null) {
if (detailById != null && StringUtils.isNotEmpty(detailById.getPlanId())) {
detailById.setPlan(szYhPlanService.getDetailById(detailById.getPlanId()));
}
return Response.ok(szYhRecordService.getDetailById(id));

3
shuili-system/src/main/java/com/kms/yxgh/sz/dto/SzYhPlanSearchDto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.sz.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -16,7 +17,7 @@ import java.util.Date;
*/
@Data
@ApiModel("水闸维修养护计划检索")
public class SzYhPlanSearchDto {
public class SzYhPlanSearchDto implements IAdcd {
@ApiModelProperty("id")
private String id;

3
shuili-system/src/main/java/com/kms/yxgh/sz/dto/SzYhRecordSearchDto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.sz.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -18,7 +19,7 @@ import java.util.Date;
@Data
@ApiModel("水闸养护记录查询")
public class SzYhRecordSearchDto {
public class SzYhRecordSearchDto implements IAdcd {
@ApiModelProperty("行政区划")
private String adcd;

5
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhPlanMapper.java

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.ApprovalDetailDto;
import com.kms.yxgh.common.dto.ApprovalSearchDto;
import com.kms.yxgh.common.mapper.handler.DocHandler;
import com.kms.yxgh.common.mapper.handler.ListDocHandler;
import com.kms.yxgh.common.mapper.handler.ListSupplementHandler;
import com.kms.yxgh.common.mapper.handler.OperatorHandler;
import com.kms.yxgh.sz.domain.SzYhPlan;
@ -46,8 +45,8 @@ public interface SzYhPlanMapper extends BaseMapper<SzYhPlan> {
"<if test='dto.name != null'>",
"AND yh.name LIKE CONCAT('%',#{dto.name},'%') ",
"</if>",
"<if test='dto.adcd != null and dto.adcd != \"\"'>",
"AND jb.adcd LIKE CONCAT(#{dto.adcd},'%') ",
"<if test='dto.adcdQx != null and dto.adcdQx != \"\"'>",
"AND jb.adcd LIKE CONCAT(#{dto.adcdQx},'%') ",
"</if>",
"<if test='dto.wagaName != null and dto.wagaName != \"\"'>",
"AND jb.waga_name LIKE CONCAT('%',#{dto.wagaName},'%') ",

4
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhRecordMapper.java

@ -57,8 +57,8 @@ public interface SzYhRecordMapper extends BaseMapper<SzYhRecord> {
"<if test='searchDto.name != null and searchDto.name != \"\"'>" +
"AND jh.name LIKE CONCAT('%',#{searchDto.name},'%') " +
"</if>" +
"<if test='searchDto.adcd != null and searchDto.adcd != \"\"'>" +
"AND df.adcd LIKE CONCAT(#{searchDto.adcd},'%') " +
"<if test='searchDto.adcdQx != null and searchDto.adcdQx != \"\"'>" +
"AND df.adcd LIKE CONCAT(#{searchDto.adcdQx},'%') " +
"</if>" +
"<if test='searchDto.status != null and searchDto.status != \"\"'>" +
"AND yhjl.status = #{searchDto.status} " +

19
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhPlanService.java

@ -12,21 +12,18 @@ import com.kms.yxgh.base.DfException;
import com.kms.yxgh.base.SzException;
import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.common.service.ApprovalBusinessService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.sz.domain.SzYhPlan;
import com.kms.yxgh.sz.dto.SzYhPlanDetailDto;
import com.kms.yxgh.sz.dto.SzYhPlanSearchDto;
import com.kms.yxgh.sz.mapper.SzYhPlanMapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
import com.shuili.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
/**
@ -37,7 +34,7 @@ import java.util.List;
*/
@Service
@AllArgsConstructor
public class SzYhPlanService extends BaseService<SzYhPlanMapper, SzYhPlan> implements ApprovalBusinessService<SzYhPlanSearchDto, SzYhPlanDetailDto> {
public class SzYhPlanService extends DefaultApprovalBusinessService<SzYhPlanMapper, SzYhPlan, SzYhPlanSearchDto, SzYhPlanDetailDto> {
private final BsSgcSzSafeJbxxService bsSgcSzSafeJbxxService;
private final SysUserService sysUserService;
@ -133,18 +130,6 @@ public class SzYhPlanService extends BaseService<SzYhPlanMapper, SzYhPlan> imple
return this.getBaseMapper().approvalSearchPage(page, sp.getData());
}
@Override
public List<OperatorDto> getOperatorList(String formId) {
SysUser user = sysUserService.getById("1");
if (user != null) {
OperatorDto operatorDto = new OperatorDto();
operatorDto.setUid(user.getId());
operatorDto.setName(user.getNickName());
return Collections.singletonList(operatorDto);
}
return Collections.emptyList();
}
@Override
public void updateApprovalStatus(String formId, ApprovalStatusEnum status) {
Wrapper<SzYhPlan> wp = Wrappers.<SzYhPlan>lambdaUpdate()

34
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhRecordService.java

@ -10,8 +10,11 @@ import com.kms.system.service.SysUserService;
import com.kms.yxgh.base.DfException;
import com.kms.yxgh.base.SzException;
import com.kms.yxgh.common.ApprovalStatusEnum;
import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.common.service.ApprovalBusinessService;
import com.kms.yxgh.common.dto.ApprovalDetailDto;
import com.kms.yxgh.common.dto.ApprovalSearchDto;
import com.kms.yxgh.common.dto.DocDto;
import com.kms.yxgh.common.dto.SupplementDto;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.sz.domain.SzYhRecord;
import com.kms.yxgh.sz.dto.SzYhRecordApprovalDto;
import com.kms.yxgh.sz.dto.SzYhRecordDetailDto;
@ -19,13 +22,10 @@ import com.kms.yxgh.sz.dto.SzYhRecordSearchDto;
import com.kms.yxgh.sz.mapper.SzYhRecordMapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@ -37,7 +37,7 @@ import java.util.Optional;
*/
@AllArgsConstructor
@Service
public class SzYhRecordService extends BaseService<SzYhRecordMapper, SzYhRecord> implements ApprovalBusinessService<SzYhRecordSearchDto, SzYhRecordApprovalDto> {
public class SzYhRecordService extends DefaultApprovalBusinessService<SzYhRecordMapper, SzYhRecord, SzYhRecordSearchDto, SzYhRecordApprovalDto> {
private final SzYhPlanService szYhPlanService;
private final SysUserService sysUserService;
@ -69,7 +69,7 @@ public class SzYhRecordService extends BaseService<SzYhRecordMapper, SzYhRecord>
dto.setId(szYhRecord.getId());
return dto;
}
return null;
throw new SzException("源数据不存在,请确认id值是否正确");
}
@ -121,8 +121,12 @@ public class SzYhRecordService extends BaseService<SzYhRecordMapper, SzYhRecord>
}
public IPage<SzYhRecordDetailDto> search(SearchParam<SzYhRecordSearchDto> sp) {
Page<SzYhRecordDetailDto> page = new Page<>(sp.getPageNum(), sp.getPageSize());
return this.getBaseMapper().searchPage(page, Optional.ofNullable(sp.getData()).orElse(new SzYhRecordSearchDto()));
IPage<SzYhRecordDetailDto> page = new Page<>(sp.getPageNum(), sp.getPageSize());
page = this.getBaseMapper().searchPage(page, Optional.ofNullable(sp.getData()).orElse(new SzYhRecordSearchDto()));
page.getRecords().forEach(dto -> {
dto.setPlan(szYhPlanService.getDetailById(dto.getPlanId()));
});
return page;
}
///更新状态
@ -139,18 +143,6 @@ public class SzYhRecordService extends BaseService<SzYhRecordMapper, SzYhRecord>
return this.getBaseMapper().approvalSearchPage(page, sp.getData());
}
@Override
public List<OperatorDto> getOperatorList(String formId) {
SysUser user = sysUserService.getById("1");
if (user != null) {
OperatorDto operatorDto = new OperatorDto();
operatorDto.setUid(user.getId());
operatorDto.setName(user.getNickName());
return Collections.singletonList(operatorDto);
}
return Collections.emptyList();
}
@Override
public void updateApprovalStatus(String formId, ApprovalStatusEnum status) {
Wrapper<SzYhRecord> wp = Wrappers.<SzYhRecord>lambdaUpdate()

364
shuili-system/src/main/resources/mapper/system/SysDeptMapper.xml

@ -1,41 +1,41 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kms.system.mapper.SysDeptMapper">
<resultMap type="com.shuili.common.core.domain.entity.SysDept" id="SysDeptResult">
<id property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="tag" column="tag" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
<result property="createUid" column="create_uid" />
<result property="createTime" column="create_time" />
<result property="updateUid" column="update_uid" />
<result property="updateTime" column="update_time" />
<result property="name" column="name" />
<result property="pcLogo" column="pc_logo" />
<result property="pcBackground" column="pc_background" />
<result property="adminName" column="admin_name" />
<result property="adminLogo" column="admin_logo" />
<result property="isDownload" column="is_download" />
<result property="isComment" column="is_comment" />
<result property="ipStart" column="ip_start" />
<result property="ipEnd" column="ip_end" />
<result property="dataType" column="data_type" />
<result property="beginDate" column="begin_date" />
<result property="endDate" column="end_date" />
</resultMap>
<sql id="selectDeptVo">
<resultMap type="com.shuili.common.core.domain.entity.SysDept" id="SysDeptResult">
<id property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="ancestors" column="ancestors"/>
<result property="deptName" column="dept_name"/>
<result property="orderNum" column="order_num"/>
<result property="leader" column="leader"/>
<result property="phone" column="phone"/>
<result property="email" column="email"/>
<result property="status" column="status"/>
<result property="tag" column="tag"/>
<result property="delFlag" column="del_flag"/>
<result property="parentName" column="parent_name"/>
<result property="createUid" column="create_uid"/>
<result property="createTime" column="create_time"/>
<result property="updateUid" column="update_uid"/>
<result property="updateTime" column="update_time"/>
<result property="name" column="name"/>
<result property="pcLogo" column="pc_logo"/>
<result property="pcBackground" column="pc_background"/>
<result property="adminName" column="admin_name"/>
<result property="adminLogo" column="admin_logo"/>
<result property="isDownload" column="is_download"/>
<result property="isComment" column="is_comment"/>
<result property="ipStart" column="ip_start"/>
<result property="ipEnd" column="ip_end"/>
<result property="dataType" column="data_type"/>
<result property="beginDate" column="begin_date"/>
<result property="endDate" column="end_date"/>
</resultMap>
<sql id="selectDeptVo">
select d.id,d.ip_start,d.ip_end,d.is_download,d.is_comment, d.parent_id, d.ancestors,
d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.tag,
d.del_flag, d.create_uid, d.create_time, d.name, d.pc_logo, d.pc_background,
@ -43,171 +43,173 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="com.shuili.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
<select id="selectDeptList" parameterType="com.shuili.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
<if test="parentId != null and parentId != ''">
AND parent_id = #{parentId}
</if>
<if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%')
</if>
<if test="searchValue != null and searchValue != ''">
AND dept_name =#{searchValue}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by d.parent_id, d.order_num
AND parent_id = #{parentId}
</if>
<if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%')
</if>
<if test="searchValue != null and searchValue != ''">
AND dept_name =#{searchValue}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" parameterType="String" resultType="Integer">
select d.id, d.parent_id
from sys_dept d
left join sys_role_dept rd on d.id = rd.dept_id
select d.id, d.parent_id
from sys_dept d
left join sys_role_dept rd on d.id = rd.dept_id
where rd.role_id = #{roleId}
and d.id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.id = rd.dept_id and rd.role_id = #{roleId})
order by d.parent_id, d.order_num
</select>
and d.id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.id = rd.dept_id and
rd.role_id = #{roleId})
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="String" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where id = #{id}
</select>
<include refid="selectDeptVo"/>
where id = #{id}
</select>
<select id="checkDeptExistUser" parameterType="String" resultType="int">
select count(1) from sys_user where id = #{id} and del_flag = '0'
</select>
select count(1) from sys_user where id = #{id} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="String" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{id} limit 1
</select>
<select id="hasChildByDeptId" parameterType="String" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{id} limit 1
</select>
<select id="selectChildrenDeptById" parameterType="String" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{id}, ancestors)
</select>
<select id="selectChildrenDeptById" parameterType="String" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{id}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="String" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{id}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="String" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{id}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
</select>
<insert id="insertDept" parameterType="com.shuili.common.core.domain.entity.SysDept">
insert into sys_dept(
<if test="id != null and id != ''">id,</if>
<if test="dataType != null and id != ''">data_type,</if>
<if test="beginDate != null and id != ''">begin_date,</if>
<if test="endDate != null and id != ''">end_date,</if>
<if test="ipEnd != null and ipEnd != ''">ip_end,</if>
<if test="ipStart != null and ipStart != ''">ip_start,</if>
<if test="isComment != null and isComment != ''">is_comment,</if>
<if test="isDownload != null and isDownload != ''">is_download,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="leader != null and leader != ''">leader,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
<if test="tag != null">tag,</if>
<if test="createUid != null and createUid != ''">create_uid,</if>
<if test="name != null and name != ''">name,</if>
<if test="pcLogo != null and pcLogo != ''">pc_logo,</if>
<if test="pcBackground != null and pcBackground != ''">pc_background,</if>
<if test="adminName != null and adminName != ''">admin_name,</if>
<if test="adminLogo != null and adminLogo != ''">admin_logo,</if>
<if test="xzqhId != null and adminLogo != ''">xzqh_id,</if>
create_time
)values(
<if test="id != null and id != ''">#{id},</if>
<if test="dataType != null and id != ''">#{dataType},</if>
<if test="beginDate != null and id != ''">#{beginDate},</if>
<if test="endDate != null and id != ''">#{endDate},</if>
<if test="ipEnd != null and ipEnd != ''">#{ipEnd},</if>
<if test="ipStart != null and ipStart != ''">#{ipStart},</if>
<if test="isComment != null and isComment != ''">#{isComment},</if>
<if test="isDownload != null and isDownload != ''">#{isDownload},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="tag != null">#{tag},</if>
<if test="createUid != null and createUid != ''">#{createUid},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="pcLogo != null and pcLogo != ''">#{pcLogo},</if>
<if test="pcBackground != null and pcBackground != ''">#{pcBackground},</if>
<if test="adminName != null and adminName != ''">#{adminName},</if>
<if test="adminLogo != null and adminLogo != ''">#{adminLogo},</if>
<if test="xzqhId != null and adminLogo != ''">#{xzqhId},</if>
sysdate()
)
</insert>
<update id="updateDept" parameterType="com.shuili.common.core.domain.entity.SysDept">
update sys_dept
<set>
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
data_type = #{dataType},begin_date = #{beginDate},end_date = #{endDate},
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="isComment != null and isComment != ''">is_comment = #{isComment},</if>
<if test="isDownload != null and isDownload != ''">is_download = #{isDownload},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="tag != null and tag != ''">tag = #{tag},</if>
<if test="updateUid != null and updateUid != ''">update_uid = #{updateUid},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="pcLogo != null and pcLogo != ''">pc_logo = #{pcLogo},</if>
<if test="pcBackground != null and pcBackground != ''">pc_background = #{pcBackground},</if>
<if test="adminName != null and adminName != ''">admin_name = #{adminName},</if>
<if test="adminLogo != null and adminLogo != ''">admin_logo = #{adminLogo},</if>
<if test="ipEnd != null and ipEnd != ''">ip_end = #{ipEnd},</if>
<if test="ipStart != null and ipStart != ''">ip_start = #{ipStart},</if>
update_time = sysdate()
</set>
where id = #{id}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case id" close="end">
when #{item.id} then #{item.ancestors}
</foreach>
where id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.id}
</foreach>
</update>
<update id="updateDeptStatus" parameterType="com.shuili.common.core.domain.entity.SysDept">
update sys_dept a
<set>
<if test="status != null and status != ''">a.status = #{status},</if>
<if test="updateUid != null and updateUid != ''">a.update_uid = #{updateUid},</if>
a.update_time = sysdate()
insert into sys_dept(
<if test="id != null and id != ''">id,</if>
<if test="dataType != null and id != ''">data_type,</if>
<if test="beginDate != null and id != ''">begin_date,</if>
<if test="endDate != null and id != ''">end_date,</if>
<if test="ipEnd != null and ipEnd != ''">ip_end,</if>
<if test="ipStart != null and ipStart != ''">ip_start,</if>
<if test="isComment != null and isComment != ''">is_comment,</if>
<if test="isDownload != null and isDownload != ''">is_download,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="leader != null and leader != ''">leader,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
<if test="tag != null">tag,</if>
<if test="createUid != null and createUid != ''">create_uid,</if>
<if test="name != null and name != ''">name,</if>
<if test="pcLogo != null and pcLogo != ''">pc_logo,</if>
<if test="pcBackground != null and pcBackground != ''">pc_background,</if>
<if test="adminName != null and adminName != ''">admin_name,</if>
<if test="adminLogo != null and adminLogo != ''">admin_logo,</if>
<if test="xzqhId != null and adminLogo != ''">xzqh_id,</if>
create_time
)values(
<if test="id != null and id != ''">#{id},</if>
<if test="dataType != null and id != ''">#{dataType},</if>
<if test="beginDate != null and id != ''">#{beginDate},</if>
<if test="endDate != null and id != ''">#{endDate},</if>
<if test="ipEnd != null and ipEnd != ''">#{ipEnd},</if>
<if test="ipStart != null and ipStart != ''">#{ipStart},</if>
<if test="isComment != null and isComment != ''">#{isComment},</if>
<if test="isDownload != null and isDownload != ''">#{isDownload},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="tag != null">#{tag},</if>
<if test="createUid != null and createUid != ''">#{createUid},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="pcLogo != null and pcLogo != ''">#{pcLogo},</if>
<if test="pcBackground != null and pcBackground != ''">#{pcBackground},</if>
<if test="adminName != null and adminName != ''">#{adminName},</if>
<if test="adminLogo != null and adminLogo != ''">#{adminLogo},</if>
<if test="xzqhId != null and adminLogo != ''">#{xzqhId},</if>
sysdate()
)
</insert>
<update id="updateDept" parameterType="com.shuili.common.core.domain.entity.SysDept">
update sys_dept
<set>
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
data_type = #{dataType},begin_date = #{beginDate},end_date = #{endDate},
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="isComment != null and isComment != ''">is_comment = #{isComment},</if>
<if test="xzqhId != null and xzqhId != ''">xzqh_id = #{xzqhId},</if>
<if test="isDownload != null and isDownload != ''">is_download = #{isDownload},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="tag != null and tag != ''">tag = #{tag},</if>
<if test="updateUid != null and updateUid != ''">update_uid = #{updateUid},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="pcLogo != null and pcLogo != ''">pc_logo = #{pcLogo},</if>
<if test="pcBackground != null and pcBackground != ''">pc_background = #{pcBackground},</if>
<if test="adminName != null and adminName != ''">admin_name = #{adminName},</if>
<if test="adminLogo != null and adminLogo != ''">admin_logo = #{adminLogo},</if>
<if test="ipEnd != null and ipEnd != ''">ip_end = #{ipEnd},</if>
<if test="ipStart != null and ipStart != ''">ip_start = #{ipStart},</if>
update_time = sysdate()
</set>
where id = #{id}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case id" close="end">
when #{item.id} then #{item.ancestors}
</foreach>
where id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.id}
</foreach>
</update>
<update id="updateDeptStatus" parameterType="com.shuili.common.core.domain.entity.SysDept">
update sys_dept a
<set>
<if test="status != null and status != ''">a.status = #{status},</if>
<if test="updateUid != null and updateUid != ''">a.update_uid = #{updateUid},</if>
a.update_time = sysdate()
</set>
where FIND_IN_SET(a.id,#{ancestors})
</update>
where FIND_IN_SET(a.id,#{ancestors})
</update>
<delete id="deleteDeptById" parameterType="String">
delete from sys_dept where id = #{id}
</delete>
<delete id="deleteDeptById" parameterType="String">
delete from sys_dept where id = #{id}
</delete>
</mapper>

2
shuili-system/src/main/resources/mapper/yxgh/DfYhPlanMapper.xml

@ -35,7 +35,7 @@
SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc,
yh.id yh_id, yh.dike_code dike_code, yh.dike_name dike_name, yh.name plan_name, yh.start_date start_date,
yh.id yh_id, yh.dike_code dike_code, yh.dike_name dike_name, yh.dike_type dike_type, yh.name plan_name, yh.start_date start_date,
yh.end_date
end_date,
yh.supplement supplement, yh.doc doc, yh.engineering_unit engineering_unit, yh.responsible_person

2
shuili-system/src/main/resources/mapper/yxgh/DfYhRecordMapper.xml

@ -33,7 +33,7 @@
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc,
jl.id jl_id, jl.create_time finished_time,
yh.id plan_id,yh.dike_code dike_code, yh.dike_name dike_name, yh.name plan_name, yh.start_date start_date,
yh.id plan_id,jl.dike_code dike_code, jl.dike_name dike_name, jl.dike_type, yh.name plan_name, yh.start_date start_date,
yh.end_date
end_date,
yh.supplement supplement, yh.doc doc, yh.engineering_unit engineering_unit, yh.responsible_person

2
shuili-system/src/main/resources/mapper/yxgh/SzYhPlanMapper.xml

@ -35,7 +35,7 @@
SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc,
yh.id yh_id, yh.waga_code waga_code, yh.waga_name waga_name, yh.name plan_name, yh.start_date start_date,
yh.id yh_id, yh.waga_code waga_code, yh.waga_name waga_name, yh.waga_type waga_type, yh.name plan_name, yh.start_date start_date,
yh.end_date
end_date,
yh.supplement supplement, yh.doc doc, yh.engineering_unit engineering_unit, yh.responsible_person

2
shuili-system/src/main/resources/mapper/yxgh/SzYhRecordMapper.xml

@ -33,7 +33,7 @@
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc,
jl.id jl_id, jl.create_time finished_time,
yh.id plan_id,yh.waga_code waga_code, yh.waga_name waga_name, yh.name plan_name, yh.start_date start_date,
yh.id plan_id,jl.waga_code waga_code, jl.waga_name waga_name,jl.waga_type waga_type, yh.name plan_name, yh.start_date start_date,
yh.end_date
end_date,
yh.supplement supplement, yh.doc doc, yh.engineering_unit engineering_unit, yh.responsible_person

11
sql/sy/v1.4.0/增量脚本/v1.4.0-update.sql

@ -47,6 +47,17 @@ CREATE TABLE `bs_sgc_sp_operator` (
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='审批执行人表';
CREATE TABLE `bs_sgc_sp_objrole` (
`ID` int NOT NULL AUTO_INCREMENT COMMENT '审批对象角色编号',
`ROLE_ID` int NOT NULL COMMENT '角色ID',
`OBJ_TYPE` varchar(50) NOT NULL COMMENT '对象类型',
`CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人',
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='审批对象角色表';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `WAGA_TYPE` int COMMENT '水闸类型';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `TYPE` int DEFAULT NULL COMMENT '维修养护类型';

Loading…
Cancel
Save