diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerCommunityManageUserDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerCommunityManageUserDTO.java new file mode 100755 index 0000000000..83f4278c1a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerCommunityManageUserDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +public class CustomerCommunityManageUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区id + */ + private String communityId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 1:处级干部包联社区2:一线工作组3:党建指导员4:社区书记5:社区副书记6:党委委员 + */ + private String type; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridManageUserDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridManageUserDTO.java new file mode 100755 index 0000000000..271f7ca0ee --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridManageUserDTO.java @@ -0,0 +1,84 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +public class CustomerGridManageUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 人员属性 + */ + private String property; + + /** + * 1:专职网格员2:北上速办专职3:专业网格管理员4:兼职网格管理员 + */ + private String type; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerCommunityManageUserController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerCommunityManageUserController.java new file mode 100755 index 0000000000..5e1e20ca43 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerCommunityManageUserController.java @@ -0,0 +1,88 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerCommunityManageUserDTO; +import com.epmet.excel.CustomerCommunityManageUserExcel; +import com.epmet.service.CustomerCommunityManageUserService; +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 generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@RestController +@RequestMapping("customerCommunityManageUser") +public class CustomerCommunityManageUserController { + + @Autowired + private CustomerCommunityManageUserService customerCommunityManageUserService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerCommunityManageUserService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + CustomerCommunityManageUserDTO data = customerCommunityManageUserService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CustomerCommunityManageUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerCommunityManageUserService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CustomerCommunityManageUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerCommunityManageUserService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerCommunityManageUserService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerCommunityManageUserService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerCommunityManageUserExcel.class); + } + + + + @GetMapping("screen/listForCommnity") + public Result> listForCommnity(String communityId,String type){ + List result = customerCommunityManageUserService.listForCommnity(communityId,type); + return new Result>().ok(result); + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridManageUserController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridManageUserController.java new file mode 100755 index 0000000000..8bd2cd1187 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridManageUserController.java @@ -0,0 +1,89 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerCommunityManageUserDTO; +import com.epmet.dto.CustomerGridManageUserDTO; +import com.epmet.excel.CustomerGridManageUserExcel; +import com.epmet.service.CustomerGridManageUserService; +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 generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@RestController +@RequestMapping("customerGridManageUser") +public class CustomerGridManageUserController { + + @Autowired + private CustomerGridManageUserService customerGridManageUserService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerGridManageUserService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + CustomerGridManageUserDTO data = customerGridManageUserService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody CustomerGridManageUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerGridManageUserService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody CustomerGridManageUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerGridManageUserService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerGridManageUserService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerGridManageUserService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridManageUserExcel.class); + } + + @GetMapping("screen/listForGrid") + public Result> listForGrid(String gridId, String type){ + List result = customerGridManageUserService.listForCommnity(gridId,type); + return new Result>().ok(result); + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerCommunityManageUserDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerCommunityManageUserDao.java new file mode 100755 index 0000000000..8256531ca3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerCommunityManageUserDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerCommunityManageUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Mapper +public interface CustomerCommunityManageUserDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridManageUserDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridManageUserDao.java new file mode 100755 index 0000000000..64185fc8f4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridManageUserDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerGridManageUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Mapper +public interface CustomerGridManageUserDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerCommunityManageUserEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerCommunityManageUserEntity.java new file mode 100755 index 0000000000..caabd3e6e0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerCommunityManageUserEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_community_manage_user") +public class CustomerCommunityManageUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区id + */ + private String communityId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 1:处级干部包联社区2:一线工作组3:党建指导员4:社区书记5:社区副书记6:党委委员 + */ + private String type; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridManageUserEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridManageUserEntity.java new file mode 100755 index 0000000000..c8cf236e2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridManageUserEntity.java @@ -0,0 +1,54 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_grid_manage_user") +public class CustomerGridManageUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 人员属性 + */ + private String property; + + /** + * 1:专职网格员2:北上速办专职3:专业网格管理员4:兼职网格管理员 + */ + private String type; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerCommunityManageUserExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerCommunityManageUserExcel.java new file mode 100755 index 0000000000..d7cacf2509 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerCommunityManageUserExcel.java @@ -0,0 +1,54 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +public class CustomerCommunityManageUserExcel { + + @Excel(name = "ID 唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "社区id") + private String communityId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "1:处级干部包联社区2:一线工作组3:党建指导员4:社区书记5:社区副书记6:党委委员") + private String type; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridManageUserExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridManageUserExcel.java new file mode 100755 index 0000000000..84dcbc0664 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerGridManageUserExcel.java @@ -0,0 +1,57 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Data +public class CustomerGridManageUserExcel { + + @Excel(name = "ID 唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格id") + private String gridId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "人员属性") + private String property; + + @Excel(name = "1:专职网格员2:北上速办专职3:专业网格管理员4:兼职网格管理员") + private String type; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerCommunityManageUserRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerCommunityManageUserRedis.java new file mode 100755 index 0000000000..7ecda6cd2f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerCommunityManageUserRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Component +public class CustomerCommunityManageUserRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridManageUserRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridManageUserRedis.java new file mode 100755 index 0000000000..12916b7c05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerGridManageUserRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Component +public class CustomerGridManageUserRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerCommunityManageUserService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerCommunityManageUserService.java new file mode 100755 index 0000000000..ceba800ea2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerCommunityManageUserService.java @@ -0,0 +1,80 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerCommunityManageUserDTO; +import com.epmet.entity.CustomerCommunityManageUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 社区治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +public interface CustomerCommunityManageUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2023-11-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2023-11-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerCommunityManageUserDTO + * @author generator + * @date 2023-11-27 + */ + CustomerCommunityManageUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-11-27 + */ + void save(CustomerCommunityManageUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2023-11-27 + */ + void update(CustomerCommunityManageUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2023-11-27 + */ + void delete(String[] ids); + + List listForCommnity(String communityId, String type); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridManageUserService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridManageUserService.java new file mode 100755 index 0000000000..bc044ee7ae --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridManageUserService.java @@ -0,0 +1,80 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerGridManageUserDTO; +import com.epmet.entity.CustomerGridManageUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格治理人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +public interface CustomerGridManageUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2023-11-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2023-11-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerGridManageUserDTO + * @author generator + * @date 2023-11-27 + */ + CustomerGridManageUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-11-27 + */ + void save(CustomerGridManageUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2023-11-27 + */ + void update(CustomerGridManageUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2023-11-27 + */ + void delete(String[] ids); + + List listForCommnity(String gridId, String type); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java new file mode 100755 index 0000000000..82876180b8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java @@ -0,0 +1,101 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CustomerCommunityManageUserDao; +import com.epmet.dto.CustomerCommunityManageUserDTO; +import com.epmet.entity.CustomerCommunityManageUserEntity; +import com.epmet.redis.CustomerCommunityManageUserRedis; +import com.epmet.service.CustomerCommunityManageUserService; +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 generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Service +public class CustomerCommunityManageUserServiceImpl extends BaseServiceImpl implements CustomerCommunityManageUserService { + + @Autowired + private CustomerCommunityManageUserRedis customerCommunityManageUserRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerCommunityManageUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerCommunityManageUserDTO.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 CustomerCommunityManageUserDTO get(String id) { + CustomerCommunityManageUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerCommunityManageUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerCommunityManageUserDTO dto) { + CustomerCommunityManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCommunityManageUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerCommunityManageUserDTO dto) { + CustomerCommunityManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCommunityManageUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listForCommnity(String communityId, String type) { + + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerCommunityManageUserEntity::getId, communityId) + .eq(CustomerCommunityManageUserEntity::getType, type); + + List entityList = baseDao.selectList(wrapper); + + return ConvertUtils.sourceToTarget(entityList, CustomerCommunityManageUserDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java new file mode 100755 index 0000000000..7aacd1bbfb --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java @@ -0,0 +1,102 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CustomerGridManageUserDao; +import com.epmet.dto.CustomerCommunityManageUserDTO; +import com.epmet.dto.CustomerGridManageUserDTO; +import com.epmet.entity.CustomerCommunityManageUserEntity; +import com.epmet.entity.CustomerGridManageUserEntity; +import com.epmet.redis.CustomerGridManageUserRedis; +import com.epmet.service.CustomerGridManageUserService; +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 generator generator@elink-cn.com + * @since v1.0.0 2023-11-27 + */ +@Service +public class CustomerGridManageUserServiceImpl extends BaseServiceImpl implements CustomerGridManageUserService { + + @Autowired + private CustomerGridManageUserRedis customerGridManageUserRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerGridManageUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerGridManageUserDTO.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 CustomerGridManageUserDTO get(String id) { + CustomerGridManageUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerGridManageUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerGridManageUserDTO dto) { + CustomerGridManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerGridManageUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerGridManageUserDTO dto) { + CustomerGridManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerGridManageUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listForCommnity(String gridId, String type) { + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridManageUserEntity::getId, gridId) + .eq(CustomerGridManageUserEntity::getType, type); + + List entityList = baseDao.selectList(wrapper); + + return ConvertUtils.sourceToTarget(entityList, CustomerGridManageUserDTO.class); + } + +} \ No newline at end of file