diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java new file mode 100644 index 0000000000..b4703e9d21 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java @@ -0,0 +1,115 @@ +package com.epmet.resi.partymember.dto.partyOrg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党组织的上级ID,没有上级时为0 + */ + private String orgPid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + private String partyOrgType; + + /** + * 组织名称 + */ + private String partyOrgName; + + /** + * 组织编码 + */ + private String partyOrgCode; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 党组织介绍 + */ + private String introduction; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java new file mode 100644 index 0000000000..5b6c3937c8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java @@ -0,0 +1,82 @@ +package com.epmet.modules.partyOrg.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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +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 2022-05-17 + */ +@RestController +@RequestMapping("icPartyOrg") +public class IcPartyOrgController { + + @Autowired + private IcPartyOrgService icPartyOrgService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icPartyOrgService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcPartyOrgDTO data = icPartyOrgService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcPartyOrgDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icPartyOrgService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcPartyOrgDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icPartyOrgService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icPartyOrgService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icPartyOrgService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcPartyOrgExcel.class); + } + + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java new file mode 100644 index 0000000000..71e36d6036 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.partyOrg.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Mapper +public interface IcPartyOrgDao extends BaseDao { + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java new file mode 100644 index 0000000000..e9ea2f210c --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java @@ -0,0 +1,81 @@ +package com.epmet.modules.partyOrg.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_party_org") +public class IcPartyOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 党组织的上级ID,没有上级时为0 + */ + private String orgPid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + private String partyOrgType; + + /** + * 组织名称 + */ + private String partyOrgName; + + /** + * 组织编码 + */ + private String partyOrgCode; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 党组织介绍 + */ + private String introduction; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java new file mode 100644 index 0000000000..f57f8cb7c5 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/excel/IcPartyOrgExcel.java @@ -0,0 +1,75 @@ +package com.epmet.modules.partyOrg.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 2022-05-17 + */ +@Data +public class IcPartyOrgExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id (customer.id)") + private String customerId; + + @Excel(name = "党组织的上级ID,没有上级时为0") + private String orgPid; + + @Excel(name = "党组织的所有上级ID,没有上级时为0") + private String orgPids; + + @Excel(name = "行政组织 机关ID") + private String agencyId; + + @Excel(name = "行政组织 机关ID") + private String agencyPids; + + @Excel(name = "党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部") + private String partyOrgType; + + @Excel(name = "组织名称") + private String partyOrgName; + + @Excel(name = "组织编码") + private String partyOrgCode; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "党组织介绍") + private String introduction; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer 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; + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java new file mode 100644 index 0000000000..158dc60fcc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/redis/IcPartyOrgRedis.java @@ -0,0 +1,30 @@ +package com.epmet.modules.partyOrg.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 2022-05-17 + */ +@Component +public class IcPartyOrgRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java new file mode 100644 index 0000000000..5de6135f20 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -0,0 +1,78 @@ +package com.epmet.modules.partyOrg.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +public interface IcPartyOrgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcPartyOrgDTO + * @author generator + * @date 2022-05-17 + */ + IcPartyOrgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void save(IcPartyOrgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-17 + */ + void update(IcPartyOrgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-17 + */ + void delete(String[] ids); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java new file mode 100644 index 0000000000..dcae7448f5 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.modules.partyOrg.service.impl; + +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +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 2022-05-17 + */ +@Service +public class IcPartyOrgServiceImpl extends BaseServiceImpl implements IcPartyOrgService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcPartyOrgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcPartyOrgDTO.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 IcPartyOrgDTO get(String id) { + IcPartyOrgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcPartyOrgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcPartyOrgDTO dto) { + IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcPartyOrgDTO dto) { + IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml new file mode 100644 index 0000000000..cb955631e0 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +