diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index 7655e32..cf380d2 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/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 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 + */ + @GetMapping("sys/role/getRoleStringIdsByUserId/{userId}") + Result getRoleStringIdsByUserId(@PathVariable("userId")Long userId); } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index 7ec1c52..b37b48d 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/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 getParentAndAllDept(String depId) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); } + + @Override + public Result getRoleStringIdsByUserId(Long userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getRoleStringIdsByUserId", userId); + } } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/DifficultItemOverseeController.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/DifficultItemOverseeController.java new file mode 100644 index 0000000..e202bb9 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = difficultItemOverseeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DifficultItemOverseeDTO data = difficultItemOverseeService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = difficultItemOverseeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DifficultItemOverseeExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemAnalysisController.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemAnalysisController.java index 5c6261a..5d5d231 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemAnalysisController.java +++ b/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); + } } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/RoleDifficultDeptController.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/controller/RoleDifficultDeptController.java new file mode 100644 index 0000000..ff3a154 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = roleDifficultDeptService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + RoleDifficultDeptDTO data = roleDifficultDeptService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = roleDifficultDeptService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RoleDifficultDeptExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/DifficultItemOverseeDao.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/DifficultItemOverseeDao.java new file mode 100644 index 0000000..ff8e712 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemAnalysisDao.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemAnalysisDao.java index 7abe0dc..c819c38 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemAnalysisDao.java +++ b/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 { List getCategoryCommDaily(@Param("date") String date); List 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 + */ + List 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 + */ + List checkDeptListByRole(@Param("deptId") Long deptId,@Param("roleIStrings") String roleIStrings); } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/RoleDifficultDeptDao.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/dao/RoleDifficultDeptDao.java new file mode 100644 index 0000000..e173455 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/DifficultItemOverseeEntity.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/DifficultItemOverseeEntity.java new file mode 100644 index 0000000..65aea91 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemDifficultConfigEntity.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemDifficultConfigEntity.java new file mode 100644 index 0000000..ae60130 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/RoleDifficultDeptEntity.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/entity/RoleDifficultDeptEntity.java new file mode 100644 index 0000000..1dec6cd --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/DifficultItemOverseeExcel.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/DifficultItemOverseeExcel.java new file mode 100644 index 0000000..5e660ef --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/RoleDifficultDeptExcel.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/excel/RoleDifficultDeptExcel.java new file mode 100644 index 0000000..3c8eb8b --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/DifficultItemOverseeRedis.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/DifficultItemOverseeRedis.java new file mode 100644 index 0000000..18a0c28 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/RoleDifficultDeptRedis.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/redis/RoleDifficultDeptRedis.java new file mode 100644 index 0000000..f7d4266 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/DifficultItemOverseeService.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/DifficultItemOverseeService.java new file mode 100644 index 0000000..2adc583 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-08-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-08-25 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/ItemAnalysisService.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/ItemAnalysisService.java index 36a58e6..8cf5e81 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/ItemAnalysisService.java +++ b/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); } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/RoleDifficultDeptService.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/RoleDifficultDeptService.java new file mode 100644 index 0000000..e13be0d --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-08-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-08-25 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/DifficultItemOverseeServiceImpl.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/DifficultItemOverseeServiceImpl.java new file mode 100644 index 0000000..b32f335 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements DifficultItemOverseeService { + + @Autowired + private DifficultItemOverseeRedis difficultItemOverseeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DifficultItemOverseeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DifficultItemOverseeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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)); + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemAnalysisServiceImpl.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemAnalysisServiceImpl.java index b054a0b..dc21c07 100644 --- a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemAnalysisServiceImpl.java +++ b/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(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 page = getPage(params); List list = baseDao.selectListDifficultItemResultDTO(params); return new PageData<>(list, page.getTotal()); @@ -183,4 +205,55 @@ public class ItemAnalysisServiceImpl extends BaseServiceImpl 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 parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(deptId)); + if (!parentResult.success() || parentResult.getData() == null) { + throw new RenException("获取部门信息失败"); + } + ParentAndAllDeptDTO deptDTO = parentResult.getData(); + //检查该用户的所属角色是否有督办该部门的权限 + Result roleResult = adminFeignClient.getRoleStringIdsByUserId(user.getId()); + if (!roleResult.success()) { + throw new RenException("获取用户角色失败"); + } + List 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("督办成功!"); + } } diff --git a/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/RoleDifficultDeptServiceImpl.java b/epdc-cloud-analysis-pc/src/main/java/com/elink/esua/epdc/modules/item/service/impl/RoleDifficultDeptServiceImpl.java new file mode 100644 index 0000000..9bb75f8 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements RoleDifficultDeptService { + + @Autowired + private RoleDifficultDeptRedis roleDifficultDeptRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RoleDifficultDeptDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RoleDifficultDeptDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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)); + } + +} \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml index c51cb56..bb4b26d 100644 --- a/epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/common/EpdcTableName.xml @@ -5,25 +5,25 @@ - - - - - - - - - + yushan_esua_epdc_admin + yushan_esua_epdc_analysis + yushan_esua_epdc_api + yushan_esua_epdc_custom + yushan_esua_epdc_events + yushan_esua_epdc_group + yushan_esua_epdc_mutuality + yushan_esua_epdc_news + yushan_esua_epdc_user - esua_epdc_admin - esua_epdc_analysis - esua_epdc_api - esua_epdc_custom - esua_epdc_events - esua_epdc_group - esua_epdc_mutuality - esua_epdc_news - esua_epdc_user + + + + + + + + + diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/item/DifficultItemOverseeDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/item/DifficultItemOverseeDao.xml new file mode 100644 index 0000000..cbadce9 --- /dev/null +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/item/DifficultItemOverseeDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/item/ItemAnalysisDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/item/ItemAnalysisDao.xml index b12c263..3e040a2 100644 --- a/epdc-cloud-analysis-pc/src/main/resources/mapper/item/ItemAnalysisDao.xml +++ b/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 .epdc_item_handle_process eihp WHERE eihp.DEL_FLAG = '0' AND eihp.ITEM_ID = ei.ID ) AS takeTime, + if((select id from .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 @@ AND reportFlag = #{reportFlag} + + and (t.takeTime >= #{takeTime} or + t.operatNum >= #{operatNum} or + t.deptNum >= #{deptNum} + ) + + + and t.st=#{overseeName} + @@ -554,4 +566,71 @@ ei.CATEGORY_CODE, street.id + + + + + diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/item/RoleDifficultDeptDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/item/RoleDifficultDeptDao.xml new file mode 100644 index 0000000..dc492af --- /dev/null +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/item/RoleDifficultDeptDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-client-yushan b/epdc-cloud-client-yushan index e3843f5..a87f857 160000 --- a/epdc-cloud-client-yushan +++ b/epdc-cloud-client-yushan @@ -1 +1 @@ -Subproject commit e3843f5c0c1e2958be68573f0876b0a402a6cf81 +Subproject commit a87f857cb65f7fc7a32937c714ae520c79f3a67c