Browse Source

Merge remote-tracking branch 'origin/feature/difficult_oversee'

hotfix/zhy
liuchuang 4 years ago
parent
commit
156a1c353d
  1. 10
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java
  2. 5
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java
  3. 94
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/DifficultItemOverseeController.java
  4. 30
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemAnalysisController.java
  5. 94
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/RoleDifficultDeptController.java
  6. 33
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/DifficultItemOverseeDao.java
  7. 48
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemAnalysisDao.java
  8. 33
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/RoleDifficultDeptDao.java
  9. 103
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/DifficultItemOverseeEntity.java
  10. 53
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemDifficultConfigEntity.java
  11. 48
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/RoleDifficultDeptEntity.java
  12. 83
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/DifficultItemOverseeExcel.java
  13. 62
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/RoleDifficultDeptExcel.java
  14. 47
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/DifficultItemOverseeRedis.java
  15. 47
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/RoleDifficultDeptRedis.java
  16. 96
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/DifficultItemOverseeService.java
  17. 19
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/ItemAnalysisService.java
  18. 96
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/RoleDifficultDeptService.java
  19. 104
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/DifficultItemOverseeServiceImpl.java
  20. 73
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemAnalysisServiceImpl.java
  21. 104
      epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/RoleDifficultDeptServiceImpl.java
  22. 36
      epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml
  23. 26
      epdc-cloud-analysis-pc/src/main/resources/mapper/item/DifficultItemOverseeDao.xml
  24. 79
      epdc-cloud-analysis-pc/src/main/resources/mapper/item/ItemAnalysisDao.xml
  25. 19
      epdc-cloud-analysis-pc/src/main/resources/mapper/item/RoleDifficultDeptDao.xml
  26. 2
      epdc-cloud-client-yushan

10
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java

@ -39,4 +39,14 @@ public interface AdminFeignClient {
*/
@GetMapping("/sys/dept/getParentAndAllDept/{deptId}")
Result<ParentAndAllDeptDTO> getParentAndAllDept(@PathVariable("deptId") String deptId);
/**
* @describe: 根据用户ID查询角色ID用逗号隔开
* @author wangtong
* @date 2021/8/27 15:03
* @params [userId]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.lang.String>
*/
@GetMapping("sys/role/getRoleStringIdsByUserId/{userId}")
Result<String> getRoleStringIdsByUserId(@PathVariable("userId")Long userId);
}

5
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java

@ -26,4 +26,9 @@ public class AdminFeignClientFallback implements AdminFeignClient {
public Result<ParentAndAllDeptDTO> getParentAndAllDept(String depId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId);
}
@Override
public Result<String> getRoleStringIdsByUserId(Long userId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getRoleStringIdsByUserId", userId);
}
}

94
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/DifficultItemOverseeController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.modules.item.excel.DifficultItemOverseeExcel;
import com.elink.esua.epdc.modules.item.service.DifficultItemOverseeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@RestController
@RequestMapping("difficultitemoversee")
public class DifficultItemOverseeController {
@Autowired
private DifficultItemOverseeService difficultItemOverseeService;
@GetMapping("page")
public Result<PageData<DifficultItemOverseeDTO>> page(@RequestParam Map<String, Object> params){
PageData<DifficultItemOverseeDTO> page = difficultItemOverseeService.page(params);
return new Result<PageData<DifficultItemOverseeDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<DifficultItemOverseeDTO> get(@PathVariable("id") String id){
DifficultItemOverseeDTO data = difficultItemOverseeService.get(id);
return new Result<DifficultItemOverseeDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody DifficultItemOverseeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
difficultItemOverseeService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody DifficultItemOverseeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
difficultItemOverseeService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
difficultItemOverseeService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<DifficultItemOverseeDTO> list = difficultItemOverseeService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, DifficultItemOverseeExcel.class);
}
}

30
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemAnalysisController.java

@ -19,13 +19,11 @@ package com.elink.esua.epdc.modules.item.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.result.*;
import com.elink.esua.epdc.modules.item.service.ItemAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@ -134,4 +132,28 @@ public class ItemAnalysisController {
public Result getCategoryOrgDaily(String date) {
return itemAnalysisService.getCategoryOrgDaily(date);
}
/**
* @describe: 督办详情
* @author wangtong
* @date 2021/8/26 10:48
* @params [id]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@GetMapping("difficultItemOversee/{id}")
public Result difficultItemOversee(@PathVariable("id") String id) {
return itemAnalysisService.difficultItemOversee(id);
}
/**
* @describe: 督办
* @author wangtong
* @date 2021/8/26 15:16
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("saveOversee")
public Result saveOversee(@RequestBody DifficultItemOverseeDTO dto) {
return itemAnalysisService.saveOversee(dto);
}
}

94
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/RoleDifficultDeptController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.analysis.pc.item.RoleDifficultDeptDTO;
import com.elink.esua.epdc.modules.item.excel.RoleDifficultDeptExcel;
import com.elink.esua.epdc.modules.item.service.RoleDifficultDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@RestController
@RequestMapping("roledifficultdept")
public class RoleDifficultDeptController {
@Autowired
private RoleDifficultDeptService roleDifficultDeptService;
@GetMapping("page")
public Result<PageData<RoleDifficultDeptDTO>> page(@RequestParam Map<String, Object> params){
PageData<RoleDifficultDeptDTO> page = roleDifficultDeptService.page(params);
return new Result<PageData<RoleDifficultDeptDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<RoleDifficultDeptDTO> get(@PathVariable("id") String id){
RoleDifficultDeptDTO data = roleDifficultDeptService.get(id);
return new Result<RoleDifficultDeptDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody RoleDifficultDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
roleDifficultDeptService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody RoleDifficultDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
roleDifficultDeptService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
roleDifficultDeptService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<RoleDifficultDeptDTO> list = roleDifficultDeptService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, RoleDifficultDeptExcel.class);
}
}

33
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/DifficultItemOverseeDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.item.entity.DifficultItemOverseeEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Mapper
public interface DifficultItemOverseeDao extends BaseDao<DifficultItemOverseeEntity> {
}

48
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemAnalysisDao.java

@ -18,10 +18,13 @@
package com.elink.esua.epdc.modules.item.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.HotItemListFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemAnalysisFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemSurveyFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.result.*;
import com.elink.esua.epdc.modules.item.entity.ItemDifficultConfigEntity;
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -112,4 +115,49 @@ public interface ItemAnalysisDao extends BaseDao<ItemResultDTO> {
List<CategoryOrgDailyResultDTO> getCategoryCommDaily(@Param("date") String date);
List<CategoryOrgDailyResultDTO> getCategoryStreetDaily(@Param("date") String date);
/**
* @describe: 查询评判难点堵点的标准
* @author wangtong
* @date 2021/8/26 10:19
* @params []
* @return com.elink.esua.epdc.modules.item.entity.ItemDifficultConfigEntity
*/
ItemDifficultConfigEntity selectItemDifficultConfig();
/**
* @describe: 督办详情
* @author wangtong
* @date 2021/8/26 10:54
* @params [id]
* @return com.elink.esua.epdc.dto.analysis.pc.item.result.DifficultItemResultDTO
*/
DifficultItemResultDTO difficultItemOversee(@Param("id") String id);
/**
* @describe: 查询督办记录
* @author wangtong
* @date 2021/8/26 13:43
* @params [itemId]
* @return java.util.List<com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO>
*/
List<DifficultItemOverseeDTO> getOverseeListById(@Param("itemId") String itemId);
/**
* @describe:根据项目id查询最新的相关部门
* @author wangtong
* @date 2021/8/27 14:44
* @params [itemId]
* @return java.lang.Long
*/
Long selectDeptByItemId(@Param("itemId") String itemId);
/**
* @describe: 通过角色和部门查询信息
* @author wangtong
* @date 2021/8/27 15:23
* @params [deptId, roleIStrings]
* @return java.util.List<com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity>
*/
List<RoleDifficultDeptEntity> checkDeptListByRole(@Param("deptId") Long deptId,@Param("roleIStrings") String roleIStrings);
}

33
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/RoleDifficultDeptDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Mapper
public interface RoleDifficultDeptDao extends BaseDao<RoleDifficultDeptEntity> {
}

103
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/DifficultItemOverseeEntity.java

@ -0,0 +1,103 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_difficult_item_oversee")
public class DifficultItemOverseeEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 项目ID
*/
private String itemId;
/**
* 督办人ID
*/
private String overseeUserId;
/**
* 督办人姓名
*/
private String overseeUserName;
/**
* 督办人部门ID
*/
private String overseeDeptId;
/**
* 督办人部门名称
*/
private String overseeDeptName;
/**
* 督办时间
*/
private Date overseeTime;
/**
* 督办描述
*/
private String overseeContent;
/**
* 被督办人部门ID
*/
private String beOverseeDept;
/**
* 被督办人部门名称
*/
private String beOverseeDeptName;
/**
* 被督办父所有部门ID
*/
private String parentDeptIds;
/**
* 被督办父所有部门
*/
private String parentDeptNames;
/**
* 被督办所有部门ID
*/
private String allDeptIds;
/**
* 被督办所有部门
*/
private String allDeptNames;
}

53
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemDifficultConfigEntity.java

@ -0,0 +1,53 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 项目难点堵点配置表 项目难点堵点配置表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-12
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_item_difficult_config")
public class ItemDifficultConfigEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 最小耗时 单位小时
*/
private Integer minSpendTime;
/**
* 最小处理次数
*/
private Integer minHandleTotal;
/**
* 最小涉及部门
*/
private Integer minDeptTotal;
}

48
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/RoleDifficultDeptEntity.java

@ -0,0 +1,48 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_role_difficult_dept")
public class RoleDifficultDeptEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 角色ID
*/
private Long roleId;
/**
* 部门ID
*/
private Long deptId;
}

83
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/DifficultItemOverseeExcel.java

@ -0,0 +1,83 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Data
public class DifficultItemOverseeExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "难点堵点ID")
private String difficultId;
@Excel(name = "督办人ID")
private String overseeUserId;
@Excel(name = "督办人姓名")
private String overseeUserName;
@Excel(name = "督办人部门ID")
private String overseeDeptId;
@Excel(name = "督办人部门名称")
private String overseeDeptName;
@Excel(name = "督办时间")
private Date overseeTime;
@Excel(name = "督办描述")
private String overseeContent;
@Excel(name = "被督办人部门ID")
private String beOverseeDept;
@Excel(name = "被督办人部门名称")
private String beOverseeDeptName;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

62
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/RoleDifficultDeptExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Data
public class RoleDifficultDeptExcel {
@Excel(name = "标识号")
private String id;
@Excel(name = "角色ID")
private Long roleId;
@Excel(name = "部门ID")
private Long deptId;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/DifficultItemOverseeRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Component
public class DifficultItemOverseeRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/RoleDifficultDeptRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Component
public class RoleDifficultDeptRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

96
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/DifficultItemOverseeService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.modules.item.entity.DifficultItemOverseeEntity;
import java.util.List;
import java.util.Map;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
public interface DifficultItemOverseeService extends BaseService<DifficultItemOverseeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<DifficultItemOverseeDTO>
* @author generator
* @date 2021-08-25
*/
PageData<DifficultItemOverseeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<DifficultItemOverseeDTO>
* @author generator
* @date 2021-08-25
*/
List<DifficultItemOverseeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return DifficultItemOverseeDTO
* @author generator
* @date 2021-08-25
*/
DifficultItemOverseeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-08-25
*/
void save(DifficultItemOverseeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-08-25
*/
void update(DifficultItemOverseeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-08-25
*/
void delete(String[] ids);
}

19
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/ItemAnalysisService.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.modules.item.service;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.HotItemListFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemAnalysisFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemSurveyFormDTO;
@ -109,4 +110,22 @@ public interface ItemAnalysisService {
* @date 2021/3/23 9:13
*/
Result getCategoryOrgDaily(String date);
/**
* @describe: 督办详情
* @author wangtong
* @date 2021/8/26 10:48
* @params [id]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result difficultItemOversee(String id);
/**
* @describe: 督办
* @author wangtong
* @date 2021/8/26 15:16
* @params [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result saveOversee(DifficultItemOverseeDTO dto);
}

96
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/RoleDifficultDeptService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.analysis.pc.item.RoleDifficultDeptDTO;
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity;
import java.util.List;
import java.util.Map;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
public interface RoleDifficultDeptService extends BaseService<RoleDifficultDeptEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<RoleDifficultDeptDTO>
* @author generator
* @date 2021-08-25
*/
PageData<RoleDifficultDeptDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<RoleDifficultDeptDTO>
* @author generator
* @date 2021-08-25
*/
List<RoleDifficultDeptDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return RoleDifficultDeptDTO
* @author generator
* @date 2021-08-25
*/
RoleDifficultDeptDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-08-25
*/
void save(RoleDifficultDeptDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-08-25
*/
void update(RoleDifficultDeptDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-08-25
*/
void delete(String[] ids);
}

104
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/DifficultItemOverseeServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.modules.item.dao.DifficultItemOverseeDao;
import com.elink.esua.epdc.modules.item.entity.DifficultItemOverseeEntity;
import com.elink.esua.epdc.modules.item.redis.DifficultItemOverseeRedis;
import com.elink.esua.epdc.modules.item.service.DifficultItemOverseeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 难点堵点督办
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Service
public class DifficultItemOverseeServiceImpl extends BaseServiceImpl<DifficultItemOverseeDao, DifficultItemOverseeEntity> implements DifficultItemOverseeService {
@Autowired
private DifficultItemOverseeRedis difficultItemOverseeRedis;
@Override
public PageData<DifficultItemOverseeDTO> page(Map<String, Object> params) {
IPage<DifficultItemOverseeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, DifficultItemOverseeDTO.class);
}
@Override
public List<DifficultItemOverseeDTO> list(Map<String, Object> params) {
List<DifficultItemOverseeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, DifficultItemOverseeDTO.class);
}
private QueryWrapper<DifficultItemOverseeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<DifficultItemOverseeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public DifficultItemOverseeDTO get(String id) {
DifficultItemOverseeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, DifficultItemOverseeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(DifficultItemOverseeDTO dto) {
DifficultItemOverseeEntity entity = ConvertUtils.sourceToTarget(dto, DifficultItemOverseeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(DifficultItemOverseeDTO dto) {
DifficultItemOverseeEntity entity = ConvertUtils.sourceToTarget(dto, DifficultItemOverseeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

73
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemAnalysisServiceImpl.java

@ -1,9 +1,11 @@
package com.elink.esua.epdc.modules.item.service.impl;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
@ -11,11 +13,18 @@ import com.elink.esua.epdc.commons.tools.utils.DateUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.datasources.DataSourceNames;
import com.elink.esua.epdc.datasources.annotation.DataSource;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.HotItemListFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemAnalysisFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.form.ItemSurveyFormDTO;
import com.elink.esua.epdc.dto.analysis.pc.item.result.*;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.item.dao.DifficultItemOverseeDao;
import com.elink.esua.epdc.modules.item.dao.ItemAnalysisDao;
import com.elink.esua.epdc.modules.item.entity.DifficultItemOverseeEntity;
import com.elink.esua.epdc.modules.item.entity.ItemDifficultConfigEntity;
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity;
import com.elink.esua.epdc.modules.item.service.ItemAnalysisService;
import com.elink.esua.epdc.utils.EpmetUtils;
import com.elink.esua.epdc.utils.ScreenDataUtils;
@ -43,6 +52,12 @@ public class ItemAnalysisServiceImpl extends BaseServiceImpl<ItemAnalysisDao, It
@Autowired
private EpmetUtils epmetUtils;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private DifficultItemOverseeDao difficultItemOverseeDao;
/**
* @param params
* @return com.elink.esua.epdc.dto.analysis.pc.item.result.ItemResultDTO
@ -98,6 +113,13 @@ public class ItemAnalysisServiceImpl extends BaseServiceImpl<ItemAnalysisDao, It
return new PageData<>(null, 0);
}
params.put("deptIdList", userDetail.getDeptIdList());
//查询评判难点堵点的标准
ItemDifficultConfigEntity config = baseDao.selectItemDifficultConfig();
if(config != null){
params.put("takeTime",config.getMinSpendTime());
params.put("deptNum",config.getMinDeptTotal());
params.put("operatNum",config.getMinHandleTotal());
}
IPage<DifficultItemResultDTO> page = getPage(params);
List<DifficultItemResultDTO> list = baseDao.selectListDifficultItemResultDTO(params);
return new PageData<>(list, page.getTotal());
@ -183,4 +205,55 @@ public class ItemAnalysisServiceImpl extends BaseServiceImpl<ItemAnalysisDao, It
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_CATEGORY_ORG_DAILY, dataJson);
return new Result();
}
@Override
public Result difficultItemOversee(String id) {
DifficultItemResultDTO result = baseDao.difficultItemOversee(id);
List<DifficultItemOverseeDTO> overseeList = baseDao.getOverseeListById(id);
result.setOverseeList(overseeList);
return new Result().ok(result);
}
@DataSource(name = DataSourceNames.FOURTH)
@Override
public Result saveOversee(DifficultItemOverseeDTO dto) {
UserDetail user = SecurityUser.getUser();
DifficultItemOverseeEntity entity = new DifficultItemOverseeEntity();
entity.setItemId(dto.getId());
entity.setOverseeContent(dto.getOverseeContent());
entity.setOverseeUserId(user.getId().toString());
entity.setOverseeUserName(user.getRealName());
entity.setOverseeDeptId(user.getDeptId().toString());
entity.setOverseeDeptName(user.getDeptName());
entity.setOverseeTime(new Date());
//被督办相关信息
//查询该项目最新相关部门
Long deptId = baseDao.selectDeptByItemId(dto.getId());
if(null == deptId){
return new Result().error("未查到该项目的相关部门");
}
Result<ParentAndAllDeptDTO> parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(deptId));
if (!parentResult.success() || parentResult.getData() == null) {
throw new RenException("获取部门信息失败");
}
ParentAndAllDeptDTO deptDTO = parentResult.getData();
//检查该用户的所属角色是否有督办该部门的权限
Result<String> roleResult = adminFeignClient.getRoleStringIdsByUserId(user.getId());
if (!roleResult.success()) {
throw new RenException("获取用户角色失败");
}
List<RoleDifficultDeptEntity> deptList = baseDao.checkDeptListByRole(deptId,roleResult.getData());
if(CollectionUtils.isEmpty(deptList)){
return new Result().error("您暂时没有督办<"+deptDTO.getGrid()+">的权限");
}
//插入数据
entity.setBeOverseeDept(deptDTO.getGridId().toString());
entity.setBeOverseeDeptName(deptDTO.getGrid());
entity.setAllDeptIds(deptDTO.getAllDeptIds());
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
difficultItemOverseeDao.insert(entity);
return new Result().ok("督办成功!");
}
}

104
epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/RoleDifficultDeptServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dto.analysis.pc.item.RoleDifficultDeptDTO;
import com.elink.esua.epdc.modules.item.dao.RoleDifficultDeptDao;
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity;
import com.elink.esua.epdc.modules.item.redis.RoleDifficultDeptRedis;
import com.elink.esua.epdc.modules.item.service.RoleDifficultDeptService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 角色难点堵点部门关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-08-25
*/
@Service
public class RoleDifficultDeptServiceImpl extends BaseServiceImpl<RoleDifficultDeptDao, RoleDifficultDeptEntity> implements RoleDifficultDeptService {
@Autowired
private RoleDifficultDeptRedis roleDifficultDeptRedis;
@Override
public PageData<RoleDifficultDeptDTO> page(Map<String, Object> params) {
IPage<RoleDifficultDeptEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, RoleDifficultDeptDTO.class);
}
@Override
public List<RoleDifficultDeptDTO> list(Map<String, Object> params) {
List<RoleDifficultDeptEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, RoleDifficultDeptDTO.class);
}
private QueryWrapper<RoleDifficultDeptEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<RoleDifficultDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public RoleDifficultDeptDTO get(String id) {
RoleDifficultDeptEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, RoleDifficultDeptDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(RoleDifficultDeptDTO dto) {
RoleDifficultDeptEntity entity = ConvertUtils.sourceToTarget(dto, RoleDifficultDeptEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(RoleDifficultDeptDTO dto) {
RoleDifficultDeptEntity entity = ConvertUtils.sourceToTarget(dto, RoleDifficultDeptEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

36
epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml

@ -5,25 +5,25 @@
<!--测试库名-->
<!-- <sql id="tb_admin">yushan_esua_epdc_admin</sql>-->
<!-- <sql id="tb_analysis">yushan_esua_epdc_analysis</sql>-->
<!-- <sql id="tb_api">yushan_esua_epdc_api</sql>-->
<!-- <sql id="tb_custom">yushan_esua_epdc_custom</sql>-->
<!-- <sql id="tb_events">yushan_esua_epdc_events</sql>-->
<!-- <sql id="tb_group">yushan_esua_epdc_group</sql>-->
<!-- <sql id="tb_mutuality">yushan_esua_epdc_mutuality</sql>-->
<!-- <sql id="tb_news">yushan_esua_epdc_news</sql>-->
<!-- <sql id="tb_user">yushan_esua_epdc_user</sql>-->
<sql id="tb_admin">yushan_esua_epdc_admin</sql>
<sql id="tb_analysis">yushan_esua_epdc_analysis</sql>
<sql id="tb_api">yushan_esua_epdc_api</sql>
<sql id="tb_custom">yushan_esua_epdc_custom</sql>
<sql id="tb_events">yushan_esua_epdc_events</sql>
<sql id="tb_group">yushan_esua_epdc_group</sql>
<sql id="tb_mutuality">yushan_esua_epdc_mutuality</sql>
<sql id="tb_news">yushan_esua_epdc_news</sql>
<sql id="tb_user">yushan_esua_epdc_user</sql>
<!--生产库名-->
<sql id="tb_admin">esua_epdc_admin</sql>
<sql id="tb_analysis">esua_epdc_analysis</sql>
<sql id="tb_api">esua_epdc_api</sql>
<sql id="tb_custom">esua_epdc_custom</sql>
<sql id="tb_events">esua_epdc_events</sql>
<sql id="tb_group">esua_epdc_group</sql>
<sql id="tb_mutuality">esua_epdc_mutuality</sql>
<sql id="tb_news">esua_epdc_news</sql>
<sql id="tb_user">esua_epdc_user</sql>
<!-- <sql id="tb_admin">esua_epdc_admin</sql>-->
<!-- <sql id="tb_analysis">esua_epdc_analysis</sql>-->
<!-- <sql id="tb_api">esua_epdc_api</sql>-->
<!-- <sql id="tb_custom">esua_epdc_custom</sql>-->
<!-- <sql id="tb_events">esua_epdc_events</sql>-->
<!-- <sql id="tb_group">esua_epdc_group</sql>-->
<!-- <sql id="tb_mutuality">esua_epdc_mutuality</sql>-->
<!-- <sql id="tb_news">esua_epdc_news</sql>-->
<!-- <sql id="tb_user">esua_epdc_user</sql>-->
</mapper>

26
epdc-cloud-analysis-pc/src/main/resources/mapper/item/DifficultItemOverseeDao.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.item.dao.DifficultItemOverseeDao">
<resultMap type="com.elink.esua.epdc.modules.item.entity.DifficultItemOverseeEntity" id="difficultItemOverseeMap">
<result property="id" column="ID"/>
<result property="difficultId" column="DIFFICULT_ID"/>
<result property="overseeUserId" column="OVERSEE_USER_ID"/>
<result property="overseeUserName" column="OVERSEE_USER_NAME"/>
<result property="overseeDeptId" column="OVERSEE_DEPT_ID"/>
<result property="overseeDeptName" column="OVERSEE_DEPT_NAME"/>
<result property="overseeTime" column="OVERSEE_TIME"/>
<result property="overseeContent" column="OVERSEE_CONTENT"/>
<result property="beOverseeDept" column="BE_OVERSEE_DEPT"/>
<result property="beOverseeDeptName" column="BE_OVERSEE_DEPT_NAME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

79
epdc-cloud-analysis-pc/src/main/resources/mapper/item/ItemAnalysisDao.xml

@ -120,6 +120,7 @@
t.ITEM_STATE,
t.processedTime,
t.takeTime,
if(t.st='0','已督办','未督办')as overseeName,
t.ALL_DEPT_NAMES,
t.EVALUATION_SCORE
FROM (
@ -138,6 +139,8 @@
eihp.ITEM_ID = ei.ID AND eihp.STATE IN (5, 10) LIMIT 1 ) AS processedTime,
( SELECT TIMESTAMPDIFF( HOUR, MIN(eihp.CREATED_TIME), MAX(eihp.CREATED_TIME) ) FROM
<include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_handle_process eihp WHERE eihp.DEL_FLAG = '0' AND eihp.ITEM_ID = ei.ID ) AS takeTime,
if((select id from <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_difficult_item_oversee o where ei.id=o.item_id and o.DEL_FLAG='0'
group by o.item_id)!='','0','1') as st,
ei.ALL_DEPT_NAMES,
ei.EVALUATION_SCORE
FROM
@ -190,6 +193,15 @@
<if test="reportFlag != null and reportFlag != ''">
AND reportFlag = #{reportFlag}
</if>
<if test="takeTime != null and takeTime != ''">
and (t.takeTime >= #{takeTime} or
t.operatNum >= #{operatNum} or
t.deptNum >= #{deptNum}
)
</if>
<if test="overseeName != null and overseeName != ''">
and t.st=#{overseeName}
</if>
</select>
<!-- 区域调度-解决中项目列表 -->
@ -554,4 +566,71 @@
ei.CATEGORY_CODE,
street.id
</select>
<select id="selectItemDifficultConfig"
resultType="com.elink.esua.epdc.modules.item.entity.ItemDifficultConfigEntity">
SELECT *
FROM <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_analysis"/>.`epdc_item_difficult_config`
where DEL_FLAG='0'
</select>
<select id="difficultItemOversee" resultType="com.elink.esua.epdc.dto.analysis.pc.item.result.DifficultItemResultDTO">
SELECT
t.ID,
t.ITEM_CONTENT,
t.CREATED_TIME,
t.operatNum,
t.reportFlag,
t.deptNum,
t.ITEM_STATE,
t.processedTime,
t.takeTime,
t.ALL_DEPT_NAMES,
t.EVALUATION_SCORE
FROM (
SELECT
ei.ID,
ei.ITEM_CONTENT,
ei.CREATED_TIME,
( SELECT COUNT( eihp.ID ) FROM <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_handle_process eihp WHERE eihp.DEL_FLAG = '0' AND
eihp.ITEM_ID = ei.ID ) AS operatNum,
( SELECT CASE WHEN COUNT(eigp.ID) > 0 THEN '1' ELSE '0' END FROM <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_grid_platform eigp
WHERE eigp.DEL_FLAG = '0' AND eigp.REFERENCE_ID = ei.ID ) AS reportFlag,
( SELECT COUNT(eid.ID) FROM <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_dept eid WHERE eid.DEL_FLAG = '0' AND eid.ITEM_ID = ei.ID
) AS deptNum,
ei.ITEM_STATE,
( SELECT eihp.CREATED_TIME FROM <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_handle_process eihp WHERE eihp.DEL_FLAG = '0' AND
eihp.ITEM_ID = ei.ID AND eihp.STATE IN (5, 10) LIMIT 1 ) AS processedTime,
( SELECT TIMESTAMPDIFF( HOUR, MIN(eihp.CREATED_TIME), MAX(eihp.CREATED_TIME) ) FROM
<include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_handle_process eihp WHERE eihp.DEL_FLAG = '0' AND eihp.ITEM_ID = ei.ID ) AS takeTime,
ei.ALL_DEPT_NAMES,
ei.EVALUATION_SCORE
FROM
<include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item ei
WHERE
ei.DEL_FLAG = '0') t
WHERE 1=1
and t.id=#{id}
</select>
<select id="getOverseeListById"
resultType="com.elink.esua.epdc.dto.analysis.pc.item.DifficultItemOverseeDTO">
select *
from <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_difficult_item_oversee
where DEL_FLAG='0'
and ITEM_ID=#{itemId}
order by CREATED_TIME desc
</select>
<select id="selectDeptByItemId" resultType="java.lang.Long">
select DEPT_ID
from <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_item_dept
where DEL_FLAG='0'
and ITEM_ID=#{itemId}
order by CREATED_TIME desc
limit 1
</select>
<select id="checkDeptListByRole" resultType="com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity">
select *
from <include refid="com.elink.esua.epdc.modules.common.dao.EpdcTableNameDao.tb_events"/>.epdc_role_difficult_dept
where DEL_FLAG='0'
and FIND_IN_SET(ROLE_ID,#{roleIStrings})
and DEPT_ID=#{deptId}
</select>
</mapper>

19
epdc-cloud-analysis-pc/src/main/resources/mapper/item/RoleDifficultDeptDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.item.dao.RoleDifficultDeptDao">
<resultMap type="com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity" id="roleDifficultDeptMap">
<result property="id" column="ID"/>
<result property="roleId" column="ROLE_ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

2
epdc-cloud-client-yushan

@ -1 +1 @@
Subproject commit e3843f5c0c1e2958be68573f0876b0a402a6cf81
Subproject commit a87f857cb65f7fc7a32937c714ae520c79f3a67c
Loading…
Cancel
Save