diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomConsultController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomConsultController.java new file mode 100644 index 000000000..9b9bdfc49 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomConsultController.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.CustomConsultService; +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.RestController; + +/** + * @author: qushutong + * @Date: 2020/3/2 16:12 + * @Description: 客服咨询相关 + */ +@RestController +@RequestMapping("custom/consult") +public class ApiCustomConsultController { + + @Autowired + private CustomConsultService customConsultService; + /*** + * 首页咨询入口是否开启 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2020/3/2 16:03 + */ + @GetMapping("checkConsultFlag") + public Result checkConsultFlag(){ + return customConsultService.getSwitchByNewest(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java index 76e0de56e..94b0d5f5b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java @@ -83,4 +83,14 @@ public interface CustomFeignClient { */ @PostMapping(value = "custom/enterpriseinfo/completeRequisiteInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result completeRequisiteInfo(@RequestBody CompleteRequisiteInfoDTO fromDto); + + /*** + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2020/3/2 16:21 + */ + @GetMapping(value = "custom/consultconf/checkConsultFlag", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getSwitchByNewest(); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java index 2cc170f57..65b494f06 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java @@ -49,4 +49,9 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "completeRequisiteInfo", fromDto); } + + @Override + public Result getSwitchByNewest() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "checkConsultFlag"); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomConsultService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomConsultService.java new file mode 100644 index 000000000..ef177a579 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomConsultService.java @@ -0,0 +1,20 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * @author: qushutong + * @Date: 2020/3/2 16:16 + * @Description: 咨询相关 + */ +public interface CustomConsultService { + + /*** + * 咨询公示,首页开关 + * @param + * @return java.lang.String + * @author qushutong + * @date 2020/3/2 15:53 + */ + Result getSwitchByNewest(); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index c1b39f271..266e7562e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -771,7 +771,9 @@ public class AppUserServiceImpl implements AppUserService { UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); userDto.setRealName(ModuleUtils.replaceIllegalCharacter(infoDto.getRealName())); - userDto.setDeptId(infoDto.getGridId()); + Long gridId = infoDto.getGridId(); + gridId = (null == gridId || NumConstant.ZERO_L == gridId) ? tokenDto.getGridId() : gridId; + userDto.setDeptId(gridId); userDto.setId(tokenDto.getUserId()); // 党员提交,验证身份证号 @@ -795,7 +797,7 @@ public class AppUserServiceImpl implements AppUserService { String userState = verifyResult.getData(); userDto.setWxUnionId(getWxUnionId(infoDto.getWxCode(), infoDto.getIv(), infoDto.getEncryptedData())); - UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); + UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(gridId); EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); // 组装对象,准备保存用户信息 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomConsultServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomConsultServiceImpl.java new file mode 100644 index 000000000..656769674 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomConsultServiceImpl.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.CustomFeignClient; +import com.elink.esua.epdc.service.CustomConsultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author: qushutong + * @Date: 2020/3/2 16:16 + * @Description: 咨询相关 + */ +@Service +public class CustomConsultServiceImpl implements CustomConsultService { + @Autowired + private CustomFeignClient customFeignClient; + + @Override + public Result getSwitchByNewest() { + return customFeignClient.getSwitchByNewest(); + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/ConsultConfDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/ConsultConfDTO.java new file mode 100755 index 000000000..46e98685a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/ConsultConfDTO.java @@ -0,0 +1,76 @@ +/** + * 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.dto.consult; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 咨询,网格员信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class ConsultConfDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 是否公示网格员信息 0:否,1:是 + */ + private String gridOperatorFlag; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorDutyCategoryDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorDutyCategoryDTO.java new file mode 100644 index 000000000..1a8a3c34a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorDutyCategoryDTO.java @@ -0,0 +1,76 @@ +/** + * 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.dto.consult; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class GridOperatorDutyCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 权限编码(1.点赞,2.吐槽) + */ + private String dutyCategoryName; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java new file mode 100755 index 000000000..ed063ccbd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java @@ -0,0 +1,146 @@ +/** + * 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.dto.consult; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格员信息 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class GridOperatorInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户姓名 + */ + private String realName; + + /** + * 性别 0女 1男 + */ + private String sex; + + /** + * 排序 + */ + private Integer sort; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 头像访问地址 + */ + private String faceImg; + + /** + * 工作单位 + */ + private String workUnit; + + /** + * 职责类别id + */ + private String dutyCategoryId; + + /** + * 前端收费展示 0否 1是 + */ + private String showFlag; + + /** + * 备注 + */ + private String remark; + + /** + * 居住网格id + */ + private Long deptId; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String[] allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/ConsultConfController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/ConsultConfController.java new file mode 100755 index 000000000..eebf9230f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/ConsultConfController.java @@ -0,0 +1,105 @@ +/** + * 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.consult.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.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.consult.ConsultConfDTO; +import com.elink.esua.epdc.modules.consult.excel.ConsultConfExcel; +import com.elink.esua.epdc.modules.consult.service.ConsultConfService; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@RestController +@RequestMapping("consultconf") +public class ConsultConfController { + + @Autowired + private ConsultConfService consultConfService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = consultConfService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ConsultConfDTO data = consultConfService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ConsultConfDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + consultConfService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ConsultConfDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + consultConfService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + consultConfService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = consultConfService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ConsultConfExcel.class); + } + + /*** + * 首页咨询入口是否开启 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2020/3/2 16:03 + */ + @GetMapping("checkConsultFlag") + public Result checkConsultFlag(){ + return new Result().ok(consultConfService.getSwitchByNewest()); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorDutyCategoryController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorDutyCategoryController.java new file mode 100644 index 000000000..1072ca8ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorDutyCategoryController.java @@ -0,0 +1,99 @@ +/** + * 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.consult.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.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.consult.GridOperatorDutyCategoryDTO; +import com.elink.esua.epdc.modules.consult.excel.GridOperatorDutyCategoryExcel; +import com.elink.esua.epdc.modules.consult.service.GridOperatorDutyCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@RestController +@RequestMapping("gridoperatordutycategory") +public class GridOperatorDutyCategoryController { + + @Autowired + private GridOperatorDutyCategoryService gridOperatorDutyCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridOperatorDutyCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridOperatorDutyCategoryDTO data = gridOperatorDutyCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridOperatorDutyCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridOperatorDutyCategoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridOperatorDutyCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridOperatorDutyCategoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridOperatorDutyCategoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridOperatorDutyCategoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridOperatorDutyCategoryExcel.class); + } + @GetMapping("getAllDutyCat") + public Result> getAllDutyCat(){ + List list = gridOperatorDutyCategoryService.list(new HashMap<>()); + return new Result>().ok(list); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java new file mode 100755 index 000000000..70d628d47 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java @@ -0,0 +1,101 @@ +/** + * 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.consult.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.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.consult.GridOperatorInfoDTO; +import com.elink.esua.epdc.modules.consult.excel.GridOperatorInfoExcel; +import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@RestController +@RequestMapping("gridoperatorinfo") +public class GridOperatorInfoController { + + @Autowired + private GridOperatorInfoService gridOperatorInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridOperatorInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridOperatorInfoDTO data = gridOperatorInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridOperatorInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setShowFlag("0"); + gridOperatorInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridOperatorInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridOperatorInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridOperatorInfoService.delete(ids); + return new Result(); + } + @PostMapping("changeShowFlag") + public Result changeShowFlag(@RequestBody GridOperatorInfoDTO dto){ + gridOperatorInfoService.changeShowFlag(dto); + return new Result(); + } + + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridOperatorInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridOperatorInfoExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/ConsultConfDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/ConsultConfDao.java new file mode 100755 index 000000000..3626c52da --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/ConsultConfDao.java @@ -0,0 +1,41 @@ +/** + * 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.consult.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.consult.entity.ConsultConfEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 咨询,网格员信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Mapper +public interface ConsultConfDao extends BaseDao { + + /*** + * 咨询公示,首页开关 + * @param + * @return + * @author qushutong + * @date 2020/3/2 15:56 + */ + String selectOneSwitchByNewest(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorDutyCategoryDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorDutyCategoryDao.java new file mode 100644 index 000000000..cc73799f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorDutyCategoryDao.java @@ -0,0 +1,32 @@ +/** + * 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.consult.dao; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorDutyCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Mapper +public interface GridOperatorDutyCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorInfoDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorInfoDao.java new file mode 100755 index 000000000..785b07ce6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/dao/GridOperatorInfoDao.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.consult.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格员信息 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Mapper +public interface GridOperatorInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/ConsultConfEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/ConsultConfEntity.java new file mode 100755 index 000000000..60fbb0d07 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/ConsultConfEntity.java @@ -0,0 +1,46 @@ +/** + * 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.consult.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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_consult_conf") +public class ConsultConfEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 是否公示网格员信息 0:否,1:是 + */ + private String gridOperatorFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorDutyCategoryEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorDutyCategoryEntity.java new file mode 100644 index 000000000..70c3406aa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorDutyCategoryEntity.java @@ -0,0 +1,46 @@ +/** + * 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.consult.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 elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_grid_operator_duty_category") +public class GridOperatorDutyCategoryEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 权限编码(1.点赞,2.吐槽) + */ + private String dutyCategoryName; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorInfoEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorInfoEntity.java new file mode 100755 index 000000000..9229c4c8a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/GridOperatorInfoEntity.java @@ -0,0 +1,116 @@ +/** + * 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.consult.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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_grid_operator_info") +public class GridOperatorInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户姓名 + */ + private String realName; + + /** + * 性别 0女 1男 + */ + private String sex; + + /** + * 排序 + */ + private Integer sort; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 头像访问地址 + */ + private String faceImg; + + /** + * 工作单位 + */ + private String workUnit; + + /** + * 职责类别id + */ + private String dutyCategoryId; + + /** + * 前端是否展示 0否 1是 + */ + private String showFlag; + + /** + * 备注 + */ + private String remark; + + /** + * 居住网格id + */ + private Long deptId; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/epdc.gitkeep b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/epdc.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/ConsultConfExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/ConsultConfExcel.java new file mode 100755 index 000000000..cd9ab13b4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/ConsultConfExcel.java @@ -0,0 +1,59 @@ +/** + * 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.consult.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 咨询,网格员信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class ConsultConfExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "是否公示网格员信息 0:否,1:是") + private String gridOperatorFlag; + + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorDutyCategoryExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorDutyCategoryExcel.java new file mode 100644 index 000000000..2db3186a1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorDutyCategoryExcel.java @@ -0,0 +1,59 @@ +/** + * 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.consult.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class GridOperatorDutyCategoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "权限编码(1.点赞,2.吐槽)") + private String dutyCategoryName; + + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorInfoExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorInfoExcel.java new file mode 100755 index 000000000..7758ef19f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/excel/GridOperatorInfoExcel.java @@ -0,0 +1,101 @@ +/** + * 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.consult.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格员信息 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Data +public class GridOperatorInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户姓名") + private String realName; + + @Excel(name = "性别 0女 1男") + private String sex; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "联系电话") + private String mobile; + + @Excel(name = "身份证号") + private String identityNo; + + @Excel(name = "头像访问地址") + private String faceImg; + + @Excel(name = "工作单位") + private String workUnit; + + @Excel(name = "职责类别id") + private String dutyCategoryId; + + @Excel(name = "前端收费展示 0否 1是") + private String showFlag; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "居住网格id") + private Long deptId; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识 0:否,1:是") + private String delFlag; + + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/ConsultConfRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/ConsultConfRedis.java new file mode 100755 index 000000000..6fdbabdc8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/ConsultConfRedis.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.consult.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 咨询,网格员信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Component +public class ConsultConfRedis { + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorDutyCategoryRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorDutyCategoryRedis.java new file mode 100644 index 000000000..299e0169d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorDutyCategoryRedis.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.consult.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Component +public class GridOperatorDutyCategoryRedis { + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.java new file mode 100755 index 000000000..4acf8d2cb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.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.consult.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格员信息 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Component +public class GridOperatorInfoRedis { + @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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/ConsultConfService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/ConsultConfService.java new file mode 100755 index 000000000..38bbbe786 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/ConsultConfService.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.consult.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.consult.ConsultConfDTO; +import com.elink.esua.epdc.modules.consult.entity.ConsultConfEntity; + +import java.util.List; +import java.util.Map; + +/** + * 咨询,网格员信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +public interface ConsultConfService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ConsultConfDTO + * @author generator + * @date 2020-03-02 + */ + ConsultConfDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void save(ConsultConfDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void update(ConsultConfDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-02 + */ + void delete(String[] ids); + + /*** + * 咨询公示,首页开关 + * @param + * @return java.lang.String + * @author qushutong + * @date 2020/3/2 15:53 + */ + String getSwitchByNewest(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorDutyCategoryService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorDutyCategoryService.java new file mode 100644 index 000000000..262d13849 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorDutyCategoryService.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.consult.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.consult.GridOperatorDutyCategoryDTO; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorDutyCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 职责分类管理 + * + * @author qu elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +public interface GridOperatorDutyCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridOperatorDutyCategoryDTO + * @author generator + * @date 2020-03-02 + */ + GridOperatorDutyCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void save(GridOperatorDutyCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void update(GridOperatorDutyCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.java new file mode 100755 index 000000000..a443b769d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/GridOperatorInfoService.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.consult.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.consult.GridOperatorInfoDTO; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格员信息 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +public interface GridOperatorInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridOperatorInfoDTO + * @author generator + * @date 2020-03-02 + */ + GridOperatorInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void save(GridOperatorInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-02 + */ + void update(GridOperatorInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-02 + */ + void delete(String[] ids); + /** + * @Description 是否展示 + * @Author songyunpeng + * @Date 2020/3/2 + * @Param [dto] + * @return void + **/ + void changeShowFlag(GridOperatorInfoDTO dto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/ConsultConfServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/ConsultConfServiceImpl.java new file mode 100755 index 000000000..df2f0a6fb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/ConsultConfServiceImpl.java @@ -0,0 +1,109 @@ +/** + * 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.consult.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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.consult.ConsultConfDTO; +import com.elink.esua.epdc.modules.consult.dao.ConsultConfDao; +import com.elink.esua.epdc.modules.consult.entity.ConsultConfEntity; +import com.elink.esua.epdc.modules.consult.redis.ConsultConfRedis; +import com.elink.esua.epdc.modules.consult.service.ConsultConfService; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Service +public class ConsultConfServiceImpl extends BaseServiceImpl implements ConsultConfService { + + @Autowired + private ConsultConfRedis consultConfRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ConsultConfDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ConsultConfDTO.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 ConsultConfDTO get(String id) { + ConsultConfEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ConsultConfDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ConsultConfDTO dto) { + ConsultConfEntity entity = ConvertUtils.sourceToTarget(dto, ConsultConfEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ConsultConfDTO dto) { + ConsultConfEntity entity = ConvertUtils.sourceToTarget(dto, ConsultConfEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public String getSwitchByNewest() { + return baseDao.selectOneSwitchByNewest(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorDutyCategoryServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorDutyCategoryServiceImpl.java new file mode 100644 index 000000000..9f6b45002 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorDutyCategoryServiceImpl.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.consult.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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.consult.GridOperatorDutyCategoryDTO; +import com.elink.esua.epdc.modules.consult.dao.GridOperatorDutyCategoryDao; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorDutyCategoryEntity; +import com.elink.esua.epdc.modules.consult.redis.GridOperatorDutyCategoryRedis; +import com.elink.esua.epdc.modules.consult.service.GridOperatorDutyCategoryService; +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 elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Service +public class GridOperatorDutyCategoryServiceImpl extends BaseServiceImpl implements GridOperatorDutyCategoryService { + + @Autowired + private GridOperatorDutyCategoryRedis gridOperatorDutyCategoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridOperatorDutyCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridOperatorDutyCategoryDTO.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 GridOperatorDutyCategoryDTO get(String id) { + GridOperatorDutyCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridOperatorDutyCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridOperatorDutyCategoryDTO dto) { + GridOperatorDutyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorDutyCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridOperatorDutyCategoryDTO dto) { + GridOperatorDutyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorDutyCategoryEntity.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/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java new file mode 100755 index 000000000..a5a4e5a05 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java @@ -0,0 +1,152 @@ +/** + * 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.consult.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.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.consult.GridOperatorInfoDTO; +import com.elink.esua.epdc.modules.consult.dao.GridOperatorInfoDao; +import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; +import com.elink.esua.epdc.modules.consult.redis.GridOperatorInfoRedis; +import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-03-02 + */ +@Service +public class GridOperatorInfoServiceImpl extends BaseServiceImpl implements GridOperatorInfoService { + + @Autowired + private GridOperatorInfoRedis gridOperatorInfoRedis; + + @Autowired + private AdminFeignClient adminFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridOperatorInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridOperatorInfoDTO.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 GridOperatorInfoDTO get(String id) { + GridOperatorInfoEntity entity = baseDao.selectById(id); + GridOperatorInfoDTO gridOperatorInfoDTO = ConvertUtils.sourceToTarget(entity, GridOperatorInfoDTO.class); + if(StringUtils.isNotBlank(entity.getAllDeptIds())){ + String depts[] = entity.getAllDeptIds().split(","); + gridOperatorInfoDTO.setAllDeptIds(depts); + } + return gridOperatorInfoDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridOperatorInfoDTO dto) { + GridOperatorInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorInfoEntity.class); + Result parentResult = null; + if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { + parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); + } + if (parentResult != null) { + if (!parentResult.success() || parentResult.getData() == null) { + throw new RenException("获取部门信息失败"); + } else { + ParentAndAllDeptDTO deptDTO = parentResult.getData(); + entity.setAllDeptIds(deptDTO.getAllDeptIds()); + entity.setAllDeptNames(deptDTO.getAllDeptNames()); + entity.setParentDeptIds(deptDTO.getParentDeptIds()); + entity.setParentDeptNames(deptDTO.getParentDeptNames()); + entity.setDeptId(Long.valueOf(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1])); + } + } + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridOperatorInfoDTO dto) { + GridOperatorInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorInfoEntity.class); + String[] allDeptIds = dto.getAllDeptIds(); + Result parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(allDeptIds[allDeptIds.length - 1])); + if (!parentResult.success() || parentResult.getData() == null) { + throw new RenException("获取部门信息失败"); + } else { + ParentAndAllDeptDTO deptDTO = parentResult.getData(); + entity.setAllDeptIds(deptDTO.getAllDeptIds()); + entity.setAllDeptNames(deptDTO.getAllDeptNames()); + entity.setParentDeptIds(deptDTO.getParentDeptIds()); + entity.setParentDeptNames(deptDTO.getParentDeptNames()); + } + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void changeShowFlag(GridOperatorInfoDTO dto) { + GridOperatorInfoEntity gridOperatorInfoEntity = new GridOperatorInfoEntity(); + gridOperatorInfoEntity.setId(dto.getId()); + gridOperatorInfoEntity.setShowFlag(dto.getShowFlag()); + updateById(gridOperatorInfoEntity); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java index 512872531..043e46c4e 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.modules.enterprise.controller; +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; 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; @@ -53,6 +54,7 @@ public class EnterpriseInfoController { private EnterpriseInfoService enterpriseInfoService; @GetMapping("page") + @DataFilter(tableAlias = "t", prefix = "AND", isPendingCreator = false) public Result> page(@RequestParam Map params) { PageData page = enterpriseInfoService.getEnterpriseInfoPageFromPc(params); return new Result>().ok(page); @@ -89,6 +91,7 @@ public class EnterpriseInfoController { } @GetMapping("export") + @DataFilter(tableAlias = "t", prefix = "AND", isPendingCreator = false) public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = enterpriseInfoService.listExport(params); ExcelUtils.exportExcelToTarget(response, null, list, EnterpriseInfoExcel.class); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/ConsultConfDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/ConsultConfDao.xml new file mode 100755 index 000000000..f4fdb9ad4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/ConsultConfDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorDutyCategoryDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorDutyCategoryDao.xml new file mode 100644 index 000000000..5f4e3a5f2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorDutyCategoryDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorInfoDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorInfoDao.xml new file mode 100755 index 000000000..fd9d9f6cd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/consult/GridOperatorInfoDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml index 40a77ce8f..eec3eef9f 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml @@ -41,7 +41,7 @@ where t.USER_ID = #{userId}