From 211d0831278d4305bc271a1771f4f1b3902d0b4e Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 10:10:26 +0800 Subject: [PATCH 001/108] =?UTF-8?q?=E6=AD=BB=E4=BA=A1=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentDeathDTO.java | 109 +++++++++++++++ .../rent/controller/RentDeathController.java | 81 +++++++++++ .../power/modules/rent/dao/RentDeathDao.java | 16 +++ .../modules/rent/entity/RentDeathEntity.java | 79 +++++++++++ .../modules/rent/excel/RentDeathExcel.java | 72 ++++++++++ .../modules/rent/redis/RentDeathRedis.java | 30 +++++ .../rent/service/RentDeathService.java | 79 +++++++++++ .../service/impl/RentDeathServiceImpl.java | 127 ++++++++++++++++++ .../resources/mapper/rent/RentDeathDao.xml | 28 ++++ 9 files changed, 621 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java new file mode 100644 index 0000000..7b1e1cf --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java @@ -0,0 +1,109 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 死亡名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-05 + */ +@Data +public class RentDeathDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 0 租客 1 房东 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java new file mode 100644 index 0000000..a519f60 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java @@ -0,0 +1,81 @@ +package com.epmet.plugin.power.modules.rent.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.plugin.power.dto.rent.RentDeathDTO; +import com.epmet.plugin.power.modules.rent.excel.RentDeathExcel; +import com.epmet.plugin.power.modules.rent.service.RentDeathService; +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-05 + */ +@RestController +@RequestMapping("rentDeath") +public class RentDeathController { + + @Autowired + private RentDeathService rentDeathService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentDeathService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentDeathDTO data = rentDeathService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentDeathDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return rentDeathService.save(dto); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentDeathDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentDeathService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentDeathService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentDeathService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentDeathExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java new file mode 100644 index 0000000..a9df131 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 死亡名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-05 + */ +@Mapper +public interface RentDeathDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java new file mode 100644 index 0000000..a4cdff1 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java @@ -0,0 +1,79 @@ +package com.epmet.plugin.power.modules.rent.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 2022-05-05 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_death") +public class RentDeathEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 0 租客 1 房东 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java new file mode 100644 index 0000000..f52a33d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java @@ -0,0 +1,72 @@ +package com.epmet.plugin.power.modules.rent.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-05 + */ +@Data +public class RentDeathExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "epmet用户主键") + private String userId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别 0女 1男") + private String gender; + + @Excel(name = "类型 0 租客 1 房东") + private String type; + + @Excel(name = "加入时间") + private String joinDate; + + @Excel(name = "加入原因") + private String joinReason; + + @Excel(name = "移除时间") + private String removeDate; + + @Excel(name = "移除原因") + private String removeReason; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java new file mode 100644 index 0000000..18ba5b6 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.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-05 + */ +@Component +public class RentDeathRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java new file mode 100644 index 0000000..23935f8 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java @@ -0,0 +1,79 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.plugin.power.dto.rent.RentDeathDTO; +import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; + +import java.util.List; +import java.util.Map; + +/** + * 死亡名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-05 + */ +public interface RentDeathService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-05 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-05 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentDeathDTO + * @author generator + * @date 2022-05-05 + */ + RentDeathDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-05 + */ + Result save(RentDeathDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-05 + */ + void update(RentDeathDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-05 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java new file mode 100644 index 0000000..88f4492 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java @@ -0,0 +1,127 @@ +package com.epmet.plugin.power.modules.rent.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.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.form.RentTenantDataFormDTO; +import com.epmet.dto.result.RentTenantDataResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.plugin.power.dto.rent.RentDeathDTO; +import com.epmet.plugin.power.modules.rent.dao.RentDeathDao; +import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; +import com.epmet.plugin.power.modules.rent.redis.RentDeathRedis; +import com.epmet.plugin.power.modules.rent.service.RentDeathService; +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.*; + +/** + * 死亡名单表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-05 + */ +@Service +public class RentDeathServiceImpl extends BaseServiceImpl implements RentDeathService { + + @Autowired + private RentDeathRedis rentDeathRedis; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentDeathDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentDeathDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String) params.get(FieldConstant.ID_HUMP); + String name = (String) params.get("name"); + String idCard = (String) params.get("idCard"); + String mobile = (String) params.get("mobile"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); + + return wrapper; + } + + @Override + public RentDeathDTO get(String id) { + RentDeathEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentDeathDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(RentDeathDTO dto) { + RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); + formDTO.setUserId(dto.getUserId()); + formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + Result result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); + + dto.setIdCard(result.getData().getIdCard()); + dto.setMobile(result.getData().getMobile()); + Map params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + return new Result().error("该人员已经迁入死亡人口"); + } + + dto.setJoinDate(DateUtils.format(new Date())); + RentDeathEntity entity = ConvertUtils.sourceToTarget(dto, RentDeathEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + insert(entity); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentDeathDTO dto) { + RentDeathEntity entity = ConvertUtils.sourceToTarget(dto, RentDeathEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml new file mode 100644 index 0000000..6db3b9b --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4bb3ed42e3bcd566b7065309462954a5b54c4501 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 10:55:58 +0800 Subject: [PATCH 002/108] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=97=B6=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E4=BF=9D=E5=AD=98=E7=BD=91=E6=A0=BCID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentBlacklistDTO.java | 5 ++++ .../plugin/power/dto/rent/RentDeathDTO.java | 27 ++++++++++++++----- .../rent/entity/RentBlacklistEntity.java | 5 ++++ .../modules/rent/entity/RentDeathEntity.java | 5 ++++ .../impl/RentBlacklistServiceImpl.java | 1 + .../service/impl/RentDeathServiceImpl.java | 1 + 6 files changed, 37 insertions(+), 7 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java index f0ff8cb..4a10bb4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java @@ -28,6 +28,11 @@ public class RentBlacklistDTO implements Serializable { @NotBlank(message = "用户ID不能为空") private String userId; + /** + * epmet网格ID + */ + private String gridId; + /** * 姓名 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java index 7b1e1cf..d951de6 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java @@ -4,6 +4,8 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; +import javax.validation.constraints.NotBlank; + /** * 死亡名单表 @@ -16,40 +18,51 @@ public class RentDeathDTO implements Serializable { private static final long serialVersionUID = 1L; + /** * 主键 */ - private String id; + private String id; /** * epmet用户主键 */ - private String userId; + @NotBlank(message = "用户ID不能为空") + private String userId; + + /** + * epmet网格ID + */ + private String gridId; /** * 姓名 */ - private String name; + @NotBlank(message = "姓名不能为空") + private String name; /** * 身份证 */ - private String idCard; + @NotBlank(message = "身份证不能为空") + private String idCard; /** * 手机号 */ - private String mobile; + @NotBlank(message = "手机号不能为空") + private String mobile; /** * 性别 0女 1男 */ - private String gender; + @NotBlank(message = "性别不能为空") + private String gender; /** * 类型 0 租客 1 房东 */ - private String type; + private String type; /** * 加入时间 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java index a9bb81e..9f851ae 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java @@ -26,6 +26,11 @@ public class RentBlacklistEntity extends BaseEpmetEntity { */ private String userId; + /** + * epmet网格ID + */ + private String gridId; + /** * 姓名 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java index a4cdff1..13302b1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java @@ -26,6 +26,11 @@ public class RentDeathEntity extends BaseEpmetEntity { */ private String userId; + /** + * epmet网格ID + */ + private String gridId; + /** * 姓名 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java index 8a2c413..352fd81 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -97,6 +97,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); if (!list(params).isEmpty()) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java index 88f4492..53704f8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java @@ -97,6 +97,7 @@ public class RentDeathServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); if (!list(params).isEmpty()) { From 87f1a12c04dc70d5ca4fd50bbaf39bfe4aeb10f7 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 14:11:25 +0800 Subject: [PATCH 003/108] =?UTF-8?q?=E6=88=BF=E4=B8=9C=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentTenantInfoDTO.java | 10 ++++ .../controller/RentTenantInfoController.java | 14 +++++ .../modules/rent/dao/RentTenantInfoDao.java | 12 +++++ .../rent/entity/RentTenantInfoEntity.java | 10 ++++ .../rent/service/RentTenantInfoService.java | 22 +++++++- .../impl/RentContractInfoServiceImpl.java | 1 - .../impl/RentTenantInfoServiceImpl.java | 51 +++++++++++++++++-- .../mapper/rent/RentTenantInfoDao.xml | 31 +++++++++++ 8 files changed, 144 insertions(+), 7 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index e7ffb7b..14a5eb1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -58,6 +58,16 @@ public class RentTenantInfoDTO implements Serializable { @NotBlank(message = "人员类型不能为空") private String type; + /** + * 审核状态 0:未审核 1:已审核(房东审核使用) + */ + private String state; + + /** + * 审核-原因 + */ + private String reason; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 7fdd761..082e14e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -39,6 +39,12 @@ public class RentTenantInfoController { return new Result>().ok(page); } + @RequestMapping("landlord/page") + public Result> page4Landlord(@RequestParam Map params) { + PageData page = rentTenantInfoService.page4Landlord(params); + return new Result>().ok(page); + } + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) public Result get(@PathVariable("id") String id) { RentTenantInfoDTO data = rentTenantInfoService.get(id); @@ -53,6 +59,14 @@ public class RentTenantInfoController { return rentTenantInfoService.save(dto); } + @NoRepeatSubmit + @PostMapping("landlord/review") + public Result review(@RequestBody RentTenantInfoDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return rentTenantInfoService.review(dto); + } + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody RentTenantInfoDTO dto) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java index 29cc2c7..443b2b7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java @@ -1,9 +1,11 @@ package com.epmet.plugin.power.modules.rent.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; import java.util.Map; /** @@ -25,4 +27,14 @@ public interface RentTenantInfoDao extends BaseDao { */ void deletePhysical(Map params); + /** + * 查询房东列表 + * + * @param params + * @return java.util.List + * @author zhy + * @date 2022/5/5 13:57 + */ + List getLandlordList(Map params); + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 5aec950..4f7e9e0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -54,6 +54,16 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { */ private String type; + /** + * 审核状态 0:未审核 1:已审核(房东审核使用) + */ + private String state; + + /** + * 审核-原因 + */ + private String reason; + /** * 客户ID */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java index bbe0401..8d548d4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java @@ -27,6 +27,16 @@ public interface RentTenantInfoService extends BaseService */ PageData page(Map params); + /** + * 房东分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-04-22 + */ + PageData page4Landlord(Map params); + /** * 默认查询 * @@ -48,7 +58,7 @@ public interface RentTenantInfoService extends BaseService RentTenantInfoDTO get(String id); /** - * 默认保存 + * 默认保存-房东信息 * * @param dto * @return void @@ -57,6 +67,16 @@ public interface RentTenantInfoService extends BaseService */ Result save(RentTenantInfoDTO dto); + /** + * 审核 + * + * @param dto + * @return void + * @author generator + * @date 2022-04-22 + */ + Result review(RentTenantInfoDTO dto); + /** * 默认更新 * diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 6db1756..e90f359 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -69,7 +69,6 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page = getPage(params); List list = baseDao.getContractInfoList(params); return new PageData<>(list, page.getTotal()); - } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 80eb329..05700f3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -56,6 +56,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl page4Landlord(Map params) { + IPage page = getPage(params); + List list = baseDao.getLandlordList(params); + return new PageData<>(list, page.getTotal()); + } + @Override public List list(Map params) { List entityList = baseDao.selectList(getWrapper(params)); @@ -89,17 +96,19 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); + params.put("state", NumConstant.ONE_STR); if (!list(params).isEmpty()) { - return new Result().error("用户已存在"); + return new Result().error("用户已通过审核"); } - List images = new ArrayList<>(); +// List images = new ArrayList<>(); // 处理头像 if (null == dto.getImgList() || dto.getImgList().isEmpty()) { return new Result().error("照片不能为空"); } else { RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + entity.setState(NumConstant.ZERO_STR); insert(entity); List imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); @@ -112,12 +121,44 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + params.put("state", NumConstant.ONE_STR); + if (!list(params).isEmpty()) { + return new Result().error("用户已通过审核"); + } + + List images = new ArrayList<>(); + // 处理头像 + if (null == dto.getImgList() || dto.getImgList().isEmpty()) { + return new Result().error("照片不能为空"); + } else { + RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); + updateById(entity); + + // 如果是房东信息通过了审核,立马去更新照片 + if (NumConstant.ZERO_STR.equals(dto.getType()) && NumConstant.ONE_STR.equals(dto.getState())) { RentTenantFormDTO formDTO = new RentTenantFormDTO(); formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); formDTO.setIdCard(dto.getIdCard()); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index 08f588a..48dfab1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -11,6 +11,7 @@ + @@ -32,4 +33,34 @@ + + \ No newline at end of file From 9074321af53e9005d7cf183e03441186b26975be Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 14:43:24 +0800 Subject: [PATCH 004/108] =?UTF-8?q?=E6=88=BF=E4=B8=9C=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RentContractInfoServiceImpl.java | 17 +++++++++-------- .../service/impl/RentTenantInfoServiceImpl.java | 11 ++++++++++- .../resources/mapper/rent/RentTenantInfoDao.xml | 3 +++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index e90f359..3ea39be 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -122,26 +122,27 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("contractId", id); - - // 取出租客信息 List tenantList = rentTenantInfoService.list(params); tenantList.forEach(item -> { // 租客信息补充照片信息 - params.put("referenceId", item.getId()); - params.put("fileType", NumConstant.ZERO_STR); - List imgList = rentContractFileService.list(params); + Map imgParams = new HashMap<>(4); + imgParams.put("referenceId", item.getId()); + imgParams.put("fileType", NumConstant.ZERO_STR); + List imgList = rentContractFileService.list(imgParams); item.setImgList(imgList); }); dto.setTenantList(tenantList); dto.setTenantNum(tenantList.size()); - params.put("referenceId", dto.getId()); - params.put("fileType", NumConstant.ONE_STR); // 取出合同文件信息 - List fileList = rentContractFileService.list(params); + Map fileParams = new HashMap<>(4); + fileParams.put("referenceId", dto.getId()); + fileParams.put("fileType", NumConstant.ONE_STR); + List fileList = rentContractFileService.list(fileParams); dto.setFileList(fileList); return dto; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 05700f3..1bf647c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.form.RentTenantFormDTO; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.plugin.power.dto.rent.RentContractFileDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao; import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; @@ -87,8 +88,16 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("referenceId", id); + params.put("fileType", NumConstant.ZERO_STR); + List imgList = rentContractFileService.list(params); + dto.setImgList(imgList); + return dto; } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index 48dfab1..8c84061 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -62,5 +62,8 @@ AND ID_CARD LIKE concat('%', #{idCard}, '%') + ORDER BY + UPDATED_TIME DESC, + CREATED_TIME DESC \ No newline at end of file From 3cb5ac62d3195fb414fc92cc3b57af581c17bcc4 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 15:26:35 +0800 Subject: [PATCH 005/108] sqlbug --- .../java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java | 2 +- .../plugin/power/modules/rent/entity/RentTenantInfoEntity.java | 2 +- .../src/main/resources/mapper/rent/RentTenantInfoDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 14a5eb1..4268d4f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -59,7 +59,7 @@ public class RentTenantInfoDTO implements Serializable { private String type; /** - * 审核状态 0:未审核 1:已审核(房东审核使用) + * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用) */ private String state; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 4f7e9e0..1e9c599 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -55,7 +55,7 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { private String type; /** - * 审核状态 0:未审核 1:已审核(房东审核使用) + * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用) */ private String state; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index 8c84061..6c16af5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -34,7 +34,7 @@ - SELECT ID, NAME, From d44c8840ff285ed0f9fde17bc62d70ddfa702d19 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 15:31:43 +0800 Subject: [PATCH 006/108] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentTenantInfoServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 1bf647c..d68a05f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -76,12 +76,14 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(contractId), "CONTRACT_ID", contractId); wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); wrapper.eq(StringUtils.isNotBlank(type), "TYPE", type); + wrapper.eq(StringUtils.isNotBlank(state), "STATE", state); return wrapper; } From 9ea91ee28c16683682b7033a41e77d6ef0c858b7 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 17:13:38 +0800 Subject: [PATCH 007/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentTenantInfoDTO.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 4268d4f..8fb17d8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -1,10 +1,12 @@ package com.epmet.plugin.power.dto.rent; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import java.io.Serializable; +import java.util.Date; import java.util.List; @@ -68,6 +70,18 @@ public class RentTenantInfoDTO implements Serializable { */ private String reason; + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createdTime; + + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date updatedTime; + /** * 头像列表 */ From 70764dae71ff0a3842eb64319864bafa7852bbd9 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 5 May 2022 17:27:55 +0800 Subject: [PATCH 008/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=BA=93=E5=A4=B4=E5=83=8F=E6=9B=B4=E6=96=B0=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentTenantInfoServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index d68a05f..43c5de9 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -170,6 +170,15 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); + imgList.forEach(img -> { + // 更新基础库的人员头像 + IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO(); + image.setAttachmentUrl(img.getFileUrl()); + image.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + images.add(image); + }); + RentTenantFormDTO formDTO = new RentTenantFormDTO(); formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); formDTO.setIdCard(dto.getIdCard()); From fa1ef4a5781ad098a63bf7bcab53718f7534e315 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 6 May 2022 16:59:59 +0800 Subject: [PATCH 009/108] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E5=BD=92=E7=B1=BB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangeDeathDTO.java} | 4 +- .../power/dto/change/ChangeRelocationDTO.java | 164 ++++++++++++++++++ .../controller/ChangeDeathController.java} | 38 ++-- .../ChangeRelocationController.java | 82 +++++++++ .../dao/ChangeDeathDao.java} | 6 +- .../change/dao/ChangeRelocationDao.java | 16 ++ .../entity/ChangeDeathEntity.java} | 6 +- .../change/entity/ChangeRelocationEntity.java | 134 ++++++++++++++ .../excel/ChangeDeathExcel.java} | 4 +- .../change/excel/ChangeRelocationExcel.java | 105 +++++++++++ .../redis/ChangeDeathRedis.java} | 4 +- .../change/redis/ChangeRelocationRedis.java | 30 ++++ .../service/ChangeDeathService.java} | 24 +-- .../service/ChangeRelocationService.java | 78 +++++++++ .../service/impl/ChangeDeathServiceImpl.java} | 46 ++--- .../impl/ChangeRelocationServiceImpl.java | 87 ++++++++++ .../ChangeDeathDao.xml} | 4 +- .../mapper/change/ChangeRelocationDao.xml | 39 +++++ 18 files changed, 803 insertions(+), 68 deletions(-) rename epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/{rent/RentDeathDTO.java => change/ChangeDeathDTO.java} (94%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/controller/RentDeathController.java => change/controller/ChangeDeathController.java} (60%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/dao/RentDeathDao.java => change/dao/ChangeDeathDao.java} (51%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/entity/RentDeathEntity.java => change/entity/ChangeDeathEntity.java} (88%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/excel/RentDeathExcel.java => change/excel/ChangeDeathExcel.java} (94%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/redis/RentDeathRedis.java => change/redis/ChangeDeathRedis.java} (84%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/service/RentDeathService.java => change/service/ChangeDeathService.java} (63%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/{rent/service/impl/RentDeathServiceImpl.java => change/service/impl/ChangeDeathServiceImpl.java} (69%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java rename epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/{rent/RentDeathDao.xml => change/ChangeDeathDao.xml} (86%) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java similarity index 94% rename from epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java rename to epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java index d951de6..db71687 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentDeathDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.dto.rent; +package com.epmet.plugin.power.dto.change; import java.io.Serializable; import java.util.Date; @@ -14,7 +14,7 @@ import javax.validation.constraints.NotBlank; * @since v1.0.0 2022-05-05 */ @Data -public class RentDeathDTO implements Serializable { +public class ChangeDeathDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java new file mode 100644 index 0000000..88c8159 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java @@ -0,0 +1,164 @@ +package com.epmet.plugin.power.dto.change; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-06 + */ +@Data +public class ChangeRelocationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 姓名 + */ + private String name; + + /** + * 性别 + */ + private String gender; + + /** + * 年龄 + */ + private String age; + + /** + * 组织PID + */ + private String pid; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 外迁详细地址 + */ + private String address; + + /** + * 操作类型【客户外out,客户内in】 + */ + private String type; + + /** + * 原房主姓名 + */ + private String ownerName; + + /** + * 原网格信息 + */ + private String oldDept; + + /** + * 原房屋信息 + */ + private String oldAddress; + + /** + * 原房间号 + */ + private String oldHome; + + /** + * 浅出原因 + */ + private String reason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java similarity index 60% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java index a519f60..6320bf3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentDeathController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.modules.rent.controller; +package com.epmet.plugin.power.modules.change.controller; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; @@ -9,9 +9,9 @@ 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.plugin.power.dto.rent.RentDeathDTO; -import com.epmet.plugin.power.modules.rent.excel.RentDeathExcel; -import com.epmet.plugin.power.modules.rent.service.RentDeathService; +import com.epmet.plugin.power.dto.change.ChangeDeathDTO; +import com.epmet.plugin.power.modules.change.excel.ChangeDeathExcel; +import com.epmet.plugin.power.modules.change.service.ChangeDeathService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -28,37 +28,37 @@ import java.util.Map; */ @RestController @RequestMapping("rentDeath") -public class RentDeathController { +public class ChangeDeathController { @Autowired - private RentDeathService rentDeathService; + private ChangeDeathService changeDeathService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = rentDeathService.page(params); - return new Result>().ok(page); + public Result> page(@RequestParam Map params){ + PageData page = changeDeathService.page(params); + return new Result>().ok(page); } @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - RentDeathDTO data = rentDeathService.get(id); - return new Result().ok(data); + public Result get(@PathVariable("id") String id){ + ChangeDeathDTO data = changeDeathService.get(id); + return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody RentDeathDTO dto){ + public Result save(@RequestBody ChangeDeathDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return rentDeathService.save(dto); + return changeDeathService.save(dto); } @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody RentDeathDTO dto){ + public Result update(@RequestBody ChangeDeathDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - rentDeathService.update(dto); + changeDeathService.update(dto); return new Result(); } @@ -66,14 +66,14 @@ public class RentDeathController { public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - rentDeathService.delete(ids); + changeDeathService.delete(ids); return new Result(); } @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = rentDeathService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, RentDeathExcel.class); + List list = changeDeathService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ChangeDeathExcel.class); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java new file mode 100644 index 0000000..24b9adc --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.change.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.plugin.power.dto.change.ChangeRelocationDTO; +import com.epmet.plugin.power.modules.change.excel.ChangeRelocationExcel; +import com.epmet.plugin.power.modules.change.service.ChangeRelocationService; +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-06 + */ +@RestController +@RequestMapping("changeRelocation") +public class ChangeRelocationController { + + @Autowired + private ChangeRelocationService changeRelocationService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = changeRelocationService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + ChangeRelocationDTO data = changeRelocationService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody ChangeRelocationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + changeRelocationService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody ChangeRelocationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + changeRelocationService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + changeRelocationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = changeRelocationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ChangeRelocationExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java similarity index 51% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java index a9df131..ede0b21 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentDeathDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java @@ -1,7 +1,7 @@ -package com.epmet.plugin.power.modules.rent.dao; +package com.epmet.plugin.power.modules.change.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; +import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2022-05-05 */ @Mapper -public interface RentDeathDao extends BaseDao { +public interface ChangeDeathDao extends BaseDao { } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java new file mode 100644 index 0000000..e49c9bb --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.change.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-06 + */ +@Mapper +public interface ChangeRelocationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java similarity index 88% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java index 13302b1..a0ed967 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentDeathEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.modules.rent.entity; +package com.epmet.plugin.power.modules.change.entity; import com.baomidou.mybatisplus.annotation.TableName; @@ -16,8 +16,8 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("pli_rent_death") -public class RentDeathEntity extends BaseEpmetEntity { +@TableName("pli_change_death") +public class ChangeDeathEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java new file mode 100644 index 0000000..21e598a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java @@ -0,0 +1,134 @@ +package com.epmet.plugin.power.modules.change.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 2022-05-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_change_relocation") +public class ChangeRelocationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + private String name; + + /** + * 性别 + */ + private String gender; + + /** + * 年龄 + */ + private String age; + + /** + * 组织PID + */ + private String pid; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 外迁详细地址 + */ + private String address; + + /** + * 操作类型【客户外out,客户内in】 + */ + private String type; + + /** + * 原房主姓名 + */ + private String ownerName; + + /** + * 原网格信息 + */ + private String oldDept; + + /** + * 原房屋信息 + */ + private String oldAddress; + + /** + * 原房间号 + */ + private String oldHome; + + /** + * 浅出原因 + */ + private String reason; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java similarity index 94% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java index f52a33d..01d0fe3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentDeathExcel.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.modules.rent.excel; +package com.epmet.plugin.power.modules.change.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; @@ -12,7 +12,7 @@ import java.util.Date; * @since v1.0.0 2022-05-05 */ @Data -public class RentDeathExcel { +public class ChangeDeathExcel { @Excel(name = "主键") private String id; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java new file mode 100644 index 0000000..287280f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java @@ -0,0 +1,105 @@ +package com.epmet.plugin.power.modules.change.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-06 + */ +@Data +public class ChangeRelocationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "年龄") + private String age; + + @Excel(name = "组织PID") + private String pid; + + @Excel(name = "组织ID") + private String agencyId; + + @Excel(name = "组织名") + private String agencyName; + + @Excel(name = "房屋小区ID") + private String villageId; + + @Excel(name = "房屋小区") + private String villageName; + + @Excel(name = "楼号ID") + private String buildId; + + @Excel(name = "楼号") + private String buildName; + + @Excel(name = "单元ID") + private String unitId; + + @Excel(name = "单元") + private String unitName; + + @Excel(name = "房屋ID") + private String homeId; + + @Excel(name = "房屋") + private String homeName; + + @Excel(name = "外迁详细地址") + private String address; + + @Excel(name = "操作类型【客户外out,客户内in】") + private String type; + + @Excel(name = "原房主姓名") + private String ownerName; + + @Excel(name = "原网格信息") + private String oldDept; + + @Excel(name = "原房屋信息") + private String oldAddress; + + @Excel(name = "原房间号") + private String oldHome; + + @Excel(name = "浅出原因") + private String reason; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java similarity index 84% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java index 18ba5b6..4d0cebe 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentDeathRedis.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.modules.rent.redis; +package com.epmet.plugin.power.modules.change.redis; import com.epmet.commons.tools.redis.RedisUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -11,7 +11,7 @@ import org.springframework.stereotype.Component; * @since v1.0.0 2022-05-05 */ @Component -public class RentDeathRedis { +public class ChangeDeathRedis { @Autowired private RedisUtils redisUtils; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java new file mode 100644 index 0000000..09374eb --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.change.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-06 + */ +@Component +public class ChangeRelocationRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java similarity index 63% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java index 23935f8..5eb010c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentDeathService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java @@ -1,10 +1,10 @@ -package com.epmet.plugin.power.modules.rent.service; +package com.epmet.plugin.power.modules.change.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.rent.RentDeathDTO; -import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; +import com.epmet.plugin.power.dto.change.ChangeDeathDTO; +import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; import java.util.List; import java.util.Map; @@ -15,37 +15,37 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2022-05-05 */ -public interface RentDeathService extends BaseService { +public interface ChangeDeathService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator * @date 2022-05-05 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator * @date 2022-05-05 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return RentDeathDTO + * @return ChangeDeathDTO * @author generator * @date 2022-05-05 */ - RentDeathDTO get(String id); + ChangeDeathDTO get(String id); /** * 默认保存 @@ -55,7 +55,7 @@ public interface RentDeathService extends BaseService { * @author generator * @date 2022-05-05 */ - Result save(RentDeathDTO dto); + Result save(ChangeDeathDTO dto); /** * 默认更新 @@ -65,7 +65,7 @@ public interface RentDeathService extends BaseService { * @author generator * @date 2022-05-05 */ - void update(RentDeathDTO dto); + void update(ChangeDeathDTO dto); /** * 批量删除 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java new file mode 100644 index 0000000..eb4eac1 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.change.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.change.ChangeRelocationDTO; +import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 合同表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-06 + */ +public interface ChangeRelocationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ChangeRelocationDTO + * @author generator + * @date 2022-05-06 + */ + ChangeRelocationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-06 + */ + void save(ChangeRelocationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-06 + */ + void update(ChangeRelocationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java similarity index 69% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java index 53704f8..1e4c7c8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentDeathServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.plugin.power.modules.rent.service.impl; +package com.epmet.plugin.power.modules.change.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -15,11 +15,11 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.result.RentTenantDataResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.plugin.power.dto.rent.RentDeathDTO; -import com.epmet.plugin.power.modules.rent.dao.RentDeathDao; -import com.epmet.plugin.power.modules.rent.entity.RentDeathEntity; -import com.epmet.plugin.power.modules.rent.redis.RentDeathRedis; -import com.epmet.plugin.power.modules.rent.service.RentDeathService; +import com.epmet.plugin.power.dto.change.ChangeDeathDTO; +import com.epmet.plugin.power.modules.change.dao.ChangeDeathDao; +import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; +import com.epmet.plugin.power.modules.change.redis.ChangeDeathRedis; +import com.epmet.plugin.power.modules.change.service.ChangeDeathService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,10 +34,10 @@ import java.util.*; * @since v1.0.0 2022-05-05 */ @Service -public class RentDeathServiceImpl extends BaseServiceImpl implements RentDeathService { +public class ChangeDeathServiceImpl extends BaseServiceImpl implements ChangeDeathService { @Autowired - private RentDeathRedis rentDeathRedis; + private ChangeDeathRedis changeDeathRedis; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -46,22 +46,22 @@ public class RentDeathServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( + public PageData page(Map params) { + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, RentDeathDTO.class); + return getPageData(page, ChangeDeathDTO.class); } @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - return ConvertUtils.sourceToTarget(entityList, RentDeathDTO.class); + return ConvertUtils.sourceToTarget(entityList, ChangeDeathDTO.class); } - private QueryWrapper getWrapper(Map params){ + private QueryWrapper getWrapper(Map params){ String id = (String) params.get(FieldConstant.ID_HUMP); String name = (String) params.get("name"); String idCard = (String) params.get("idCard"); @@ -69,7 +69,7 @@ public class RentDeathServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); @@ -81,14 +81,14 @@ public class RentDeathServiceImpl extends BaseServiceImpl implements ChangeRelocationService { + + @Autowired + private ChangeRelocationRedis changeRelocationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ChangeRelocationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ChangeRelocationDTO.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 ChangeRelocationDTO get(String id) { + ChangeRelocationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ChangeRelocationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ChangeRelocationDTO dto) { + ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ChangeRelocationDTO dto) { + ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml similarity index 86% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml rename to epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml index 6db3b9b..40db6d7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentDeathDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml @@ -1,9 +1,9 @@ - + - + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml new file mode 100644 index 0000000..cb7657c --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 25834595f9e27c630c345af5338c839efd1856c4 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Sat, 7 May 2022 18:01:43 +0800 Subject: [PATCH 010/108] =?UTF-8?q?=E8=BF=81=E5=87=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/change/ChangeRelocationDTO.java | 37 +- .../plugin/power/utils/IdentityNoUtils.java | 355 ++++++++++++++++++ .../ChangeRelocationController.java | 15 +- .../change/entity/ChangeRelocationEntity.java | 16 +- .../change/excel/ChangeDeathExcel.java | 60 +-- .../change/excel/ChangeRelocationExcel.java | 128 ++++--- .../service/ChangeRelocationService.java | 12 +- .../impl/ChangeRelocationServiceImpl.java | 66 +++- .../impl/RentContractInfoServiceImpl.java | 2 +- 9 files changed, 599 insertions(+), 92 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java index 88c8159..3210514 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java @@ -1,8 +1,10 @@ package com.epmet.plugin.power.dto.change; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -51,6 +53,16 @@ public class ChangeRelocationDTO implements Serializable { */ private String agencyName; + /** + * 组织ID + */ + private String gridId; + + /** + * 组织名 + */ + private String gridName; + /** * 房屋小区ID */ @@ -161,4 +173,25 @@ public class ChangeRelocationDTO implements Serializable { */ private String customerId; -} \ No newline at end of file + /** + * 迁出时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date outOfTime; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * epmet用户主键 + */ + private String icUserId; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java new file mode 100644 index 0000000..661d263 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java @@ -0,0 +1,355 @@ +package com.epmet.plugin.power.utils; + +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.Date; +import java.util.Hashtable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 身份证号工具 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/7 13:11 + */ +public class IdentityNoUtils implements Serializable { + + /** + * 15位身份证号 + */ + private static final Integer FIFTEEN_ID_CARD = 15; + /** + * 18位身份证号 + */ + private static final Integer EIGHTEEN_ID_CARD = 18; + /** + * 数字格式校验 + */ + private static Pattern NUMBER_PATTERN = Pattern.compile("[0-9]*"); + /** + * 日期格式校验 + */ + private static Pattern DATE_PATTERN = Pattern.compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); + /** + * 18位身份证中最后一位校验码 + */ + private final static char[] VERIFY_CODE = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; + /** + * 18位身份证中,各个数字的生成校验码时的权值 + */ + private final static int[] VERIFY_CODE_WEIGHT = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; + + /** + * 根据身份证号获取性别 0女;1男 + * + * @param IDCard 完整身份证号码 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/9/20 14:26 + */ + public static String getSex(String IDCard) { + if (StringUtils.isNotBlank(IDCard)) { + if (IDCard.length() == FIFTEEN_ID_CARD) { + if (Integer.parseInt(IDCard.substring(14, 15)) % 2 == 0) { + return sexEnum.FEMALE.value; + } else { + return sexEnum.MALE.value; + } + } else if (IDCard.length() == EIGHTEEN_ID_CARD) { + if (Integer.parseInt(IDCard.substring(16).substring(0, 1)) % 2 == 0) { + return sexEnum.FEMALE.value; + } else { + return sexEnum.MALE.value; + } + } + } + return null; + } + + /** + * 根据身份证号获取年龄 + * + * @param IDCard 完整身份证号码 + * @return java.lang.Integer + * @author work@yujt.net.cn + * @date 2019/9/20 14:26 + */ + public static Integer getAge(String IDCard) { + int age; + LocalDate now = LocalDate.now(); + int nowYear = now.getYear(); + int nowMonth = now.getMonthValue(); + int cardYear = 0; + int cardMonth = 0; + if (StringUtils.isNotBlank(IDCard) && isValid(IDCard)) { + if (IDCard.length() == FIFTEEN_ID_CARD) { + // 身份证上的年份(15位身份证为1980年前的) + String uyear = "19" + IDCard.substring(6, 8); + cardYear = Integer.parseInt(uyear); + // 身份证上的月份 + String uyue = IDCard.substring(8, 10); + cardMonth = Integer.parseInt(uyue); + } else if (IDCard.length() == EIGHTEEN_ID_CARD) { + // 身份证上的年份 + String year = IDCard.substring(6).substring(0, 4); + cardYear = Integer.parseInt(year); + // 身份证上的月份 + String yue = IDCard.substring(10).substring(0, 2); + cardMonth = Integer.parseInt(yue); + } + } + // 当前月份大于用户出身的月份表示已过生日 + if (cardMonth <= nowMonth) { + age = nowYear - cardYear + 1; + // 当前用户还没过生 + } else { + age = nowYear - cardYear; + } + return age; + } + + /** + * 根据身份证号获取出生日期 + * + * @param IDCard 完整身份证号码 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/9/20 14:26 + */ + public static String getBirthday(String IDCard) { + String year = ""; + String month = ""; + String day = ""; + if (StringUtils.isNotBlank(IDCard)) { + //15位身份证号 + if (IDCard.length() == FIFTEEN_ID_CARD) { + // 身份证上的年份(15位身份证为1980年前的) + year = "19" + IDCard.substring(6, 8); + //身份证上的月份 + month = IDCard.substring(8, 10); + //身份证上的日期 + day = IDCard.substring(10, 12); + //18位身份证号 + } else if (IDCard.length() == EIGHTEEN_ID_CARD) { + // 身份证上的年份 + year = IDCard.substring(6).substring(0, 4); + // 身份证上的月份 + month = IDCard.substring(10).substring(0, 2); + //身份证上的日期 + day = IDCard.substring(12).substring(0, 2); + } + } + return year + "-" + month + "-" + day; + } + + /** + * 身份证验证是否有效 + * + * @param id 号码内容 + * @return boolean + * @author + * @date + */ + public static boolean isValid(String id) { + Boolean validResult = true; + //校验长度只能为15或18 + int len = id.length(); + if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD) { + validResult = false; + } + //校验生日 + if (!validDate(id)) { + validResult = false; + } + return validResult; + } + + /** + * 校验生日 + * + * @param id + * @return + */ + private static boolean validDate(String id) { + try { + String birth = id.length() == FIFTEEN_ID_CARD ? "19" + id.substring(6, 12) : id.substring(6, 14); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + Date birthDate = sdf.parse(birth); + if (!birth.equals(sdf.format(birthDate))) { + return false; + } + } catch (ParseException e) { + return false; + } + return true; + } + + /** + * 验证身份证号码,验证通过返回null + * + * @param idStr 完整身份证号码 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/9/20 14:26 + */ + public static String IdentityNoVerification(String idStr) { + String iDCardNo = null; + //判断号码的长度 15位或18位 + if (idStr.length() != FIFTEEN_ID_CARD && idStr.length() != EIGHTEEN_ID_CARD) { + return "身份证号码长度应该为15位或18位"; + } + if (idStr.length() == EIGHTEEN_ID_CARD) { + iDCardNo = idStr.substring(0, 17); + } else if (idStr.length() == FIFTEEN_ID_CARD) { + iDCardNo = idStr.substring(0, 6) + "19" + idStr.substring(6, 15); + } + if (isStrNum(iDCardNo) == false) { + return "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字"; + } + //判断出生年月 + int year = Integer.parseInt(iDCardNo.substring(6, 10)); + String strMonth = iDCardNo.substring(10, 12); + String strDay = iDCardNo.substring(12, 14); + + String birthDay = year + "-" + strMonth + "-" + strDay; + if (isStrDate(birthDay) == false) { + return "身份证生日无效"; + } + LocalDate now = LocalDate.now(); + if ((now.getYear() - year) > 150 || now.isBefore(LocalDate.parse(birthDay))) { + return "身份证生日不在有效范围"; + } + int month = Integer.parseInt(strMonth); + if (month > 12 || month == 0) { + return "身份证月份无效"; + } + int day = Integer.parseInt(strDay); + if (day > 31 || day == 0) { + return "身份证日期无效"; + } + //判断地区码 + Hashtable h = GetAreaCode(); + if (h.get(iDCardNo.substring(0, 2)) == null) { + return "身份证地区编码错误"; + } + //判断最后一位 + int theLastOne = 0; + for (int i = 0; i < 17; i++) { + theLastOne = theLastOne + Integer.parseInt(String.valueOf(iDCardNo.charAt(i))) * VERIFY_CODE_WEIGHT[i]; + } + int modValue = theLastOne % 11; + char strVerifyCode = VERIFY_CODE[modValue]; + iDCardNo = iDCardNo + strVerifyCode; + if (idStr.length() == EIGHTEEN_ID_CARD && !iDCardNo.equals(idStr)) { + return "身份证无效,不是合法的身份证号码"; + } + return null; + } + + /** + * 地区代码 + * + * @return Hashtable + */ + private static Hashtable GetAreaCode() { + Hashtable hashtable = new Hashtable<>(); + hashtable.put("11", "北京"); + hashtable.put("12", "天津"); + hashtable.put("13", "河北"); + hashtable.put("14", "山西"); + hashtable.put("15", "内蒙古"); + hashtable.put("21", "辽宁"); + hashtable.put("22", "吉林"); + hashtable.put("23", "黑龙江"); + hashtable.put("31", "上海"); + hashtable.put("32", "江苏"); + hashtable.put("33", "浙江"); + hashtable.put("34", "安徽"); + hashtable.put("35", "福建"); + hashtable.put("36", "江西"); + hashtable.put("37", "山东"); + hashtable.put("41", "河南"); + hashtable.put("42", "湖北"); + hashtable.put("43", "湖南"); + hashtable.put("44", "广东"); + hashtable.put("45", "广西"); + hashtable.put("46", "海南"); + hashtable.put("50", "重庆"); + hashtable.put("51", "四川"); + hashtable.put("52", "贵州"); + hashtable.put("53", "云南"); + hashtable.put("54", "西藏"); + hashtable.put("61", "陕西"); + hashtable.put("62", "甘肃"); + hashtable.put("63", "青海"); + hashtable.put("64", "宁夏"); + hashtable.put("65", "新疆"); + hashtable.put("71", "台湾"); + hashtable.put("81", "香港"); + hashtable.put("82", "澳门"); + hashtable.put("91", "国外"); + return hashtable; + } + + /** + * 判断字符串是否为数字 + * + * @param str + * @return boolean + * @author work@yujt.net.cn + * @date 2019/9/20 13:58 + */ + private static boolean isStrNum(String str) { + Matcher isNum = NUMBER_PATTERN.matcher(str); + if (isNum.matches()) { + return true; + } else { + return false; + } + } + + /** + * 判断字符串是否为日期格式 + * + * @param strDate + * @return boolean + * @author work@yujt.net.cn + * @date 2019/9/20 13:57 + */ + public static boolean isStrDate(String strDate) { + Matcher m = DATE_PATTERN.matcher(strDate); + if (m.matches()) { + return true; + } else { + return false; + } + } + + enum sexEnum { + /** + * 暂停 + */ + FEMALE("0"), + /** + * 正常 + */ + MALE("1"); + + private String value; + + sexEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java index 24b9adc..f020250 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java @@ -77,6 +77,19 @@ public class ChangeRelocationController { ExcelUtils.exportExcelToTarget(response, null, list, ChangeRelocationExcel.class); } - + /** + * @describe: 保存迁出信息 + * @author wangtong + * @date 2022/5/7 9:49 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @NoRepeatSubmit + @PostMapping("saveOutOfInfo") + public Result saveOutOfInfo(@RequestBody ChangeRelocationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return changeRelocationService.saveOutOfInfo(dto); + } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java index 21e598a..12a2f92 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java @@ -1,7 +1,6 @@ package com.epmet.plugin.power.modules.change.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -131,4 +130,19 @@ public class ChangeRelocationEntity extends BaseEpmetEntity { */ private String customerId; + /** + * 迁出时间 + */ + private Date outOfTime; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java index 01d0fe3..4839e38 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java @@ -14,11 +14,11 @@ import java.util.Date; @Data public class ChangeDeathExcel { - @Excel(name = "主键") - private String id; +// @Excel(name = "主键") +// private String id; - @Excel(name = "epmet用户主键") - private String userId; +// @Excel(name = "epmet用户主键") +// private String userId; @Excel(name = "姓名") private String name; @@ -29,10 +29,10 @@ public class ChangeDeathExcel { @Excel(name = "手机号") private String mobile; - @Excel(name = "性别 0女 1男") + @Excel(name = "性别",replace = { "男_1", "女_0"} ) private String gender; - @Excel(name = "类型 0 租客 1 房东") + @Excel(name = "类型",replace = { "房东_1", "租客_0"} ) private String type; @Excel(name = "加入时间") @@ -41,32 +41,32 @@ public class ChangeDeathExcel { @Excel(name = "加入原因") private String joinReason; - @Excel(name = "移除时间") - private String removeDate; - - @Excel(name = "移除原因") - private String removeReason; - - @Excel(name = "删除标记 0:未删除,1:已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") +// @Excel(name = "移除时间") +// private String removeDate; +// +// @Excel(name = "移除原因") +// private String removeReason; + +// @Excel(name = "删除标记 0:未删除,1:已删除") +// private String delFlag; +// +// @Excel(name = "乐观锁") +// private Integer revision; +// +// @Excel(name = "创建人") +// private String createdBy; + + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") private Date createdTime; - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime; +// @Excel(name = "更新人") +// private String updatedBy; +// +// @Excel(name = "更新时间") +// private Date updatedTime; - @Excel(name = "客户ID") - private String customerId; +// @Excel(name = "客户ID") +// private String customerId; -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java index 287280f..a750525 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java @@ -14,92 +14,114 @@ import java.util.Date; @Data public class ChangeRelocationExcel { - @Excel(name = "主键") - private String id; +// @Excel(name = "主键") +// private String id; @Excel(name = "姓名") private String name; + @Excel(name = "所属网格") + private String agencyName; + + @Excel(name = "所属房屋") + private String oldAddress; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String idCard; + @Excel(name = "性别") private String gender; @Excel(name = "年龄") private String age; - @Excel(name = "组织PID") - private String pid; + @Excel(name = "迁出时间", format = "yyyy-MM-dd") + private Date outOfTime; - @Excel(name = "组织ID") - private String agencyId; + @Excel(name = "迁出原因") + private String reason; - @Excel(name = "组织名") - private String agencyName; + @Excel(name = "迁往何地") + private String address; - @Excel(name = "房屋小区ID") - private String villageId; + @Excel(name = "户主姓名") + private String ownerName; - @Excel(name = "房屋小区") - private String villageName; - @Excel(name = "楼号ID") - private String buildId; - @Excel(name = "楼号") - private String buildName; +// @Excel(name = "组织PID") +// private String pid; - @Excel(name = "单元ID") - private String unitId; +// @Excel(name = "组织ID") +// private String agencyId; - @Excel(name = "单元") - private String unitName; - @Excel(name = "房屋ID") - private String homeId; - @Excel(name = "房屋") - private String homeName; +// @Excel(name = "房屋小区ID") +// private String villageId; - @Excel(name = "外迁详细地址") - private String address; +// @Excel(name = "房屋小区") +// private String villageName; - @Excel(name = "操作类型【客户外out,客户内in】") - private String type; +// @Excel(name = "楼号ID") +// private String buildId; - @Excel(name = "原房主姓名") - private String ownerName; +// @Excel(name = "楼号") +// private String buildName; - @Excel(name = "原网格信息") - private String oldDept; +// @Excel(name = "单元ID") +// private String unitId; - @Excel(name = "原房屋信息") - private String oldAddress; +// @Excel(name = "单元") +// private String unitName; - @Excel(name = "原房间号") - private String oldHome; +// @Excel(name = "房屋ID") +// private String homeId; - @Excel(name = "浅出原因") - private String reason; +// @Excel(name = "房屋") +// private String homeName; + + +// @Excel(name = "操作类型",replace = { "客户外_out", "客户内_in"} ) +// private String type; +// +// +// +// @Excel(name = "原网格信息") +// private String oldDept; +// + + +// @Excel(name = "原房间号") +// private String oldHome; - @Excel(name = "删除标记 0:未删除,1:已删除") - private String delFlag; - @Excel(name = "乐观锁") - private Integer revision; - @Excel(name = "创建人") - private String createdBy; +// @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; +// @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") +// private Date createdTime; - @Excel(name = "客户ID") - private String customerId; +// @Excel(name = "更新人") +// private String updatedBy; +// +// @Excel(name = "更新时间") +// private Date updatedTime; +// +// @Excel(name = "客户ID") +// private String customerId; -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java index eb4eac1..bdbfc02 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.modules.change.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.change.ChangeRelocationDTO; import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; @@ -75,4 +76,13 @@ public interface ChangeRelocationService extends BaseService page(Map params) { IPage page = baseDao.selectPage( @@ -50,9 +65,32 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String name = (String) params.get("name"); + String idCard = (String) params.get("idCard"); + String mobile = (String) params.get("mobile"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); + + String gridId = (String) params.get("gridId"); + String villageId = (String) params.get("villageId"); + String buildId = (String) params.get("buildId"); + String unitId = (String) params.get("unitId"); + String homeId = (String) params.get("homeId"); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.ge(StringUtils.isNotBlank(startTime), "OUT_OF_TIME", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "OUT_OF_TIME", endTime); + + wrapper.eq(StringUtils.isNotBlank(gridId), "AGENCY_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); + wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); + wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); + wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); return wrapper; } @@ -84,4 +122,26 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); + + dto.setIdCard(result.getData().getIdCard()); + dto.setMobile(result.getData().getMobile()); + + ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.class); + entity.setPid(dto.getAgencyId()); + entity.setAgencyId(dto.getGridId()); + entity.setAgencyName(dto.getGridName()); + entity.setAge(IdentityNoUtils.getAge(result.getData().getIdCard()).toString()); + entity.setAddress(dto.getVillageName()+dto.getBuildName()+dto.getUnitName()+dto.getHomeName()); + insert(entity); + return new Result(); + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 3ea39be..94d1de1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -292,4 +292,4 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Mon, 9 May 2022 09:51:50 +0800 Subject: [PATCH 011/108] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/change/ChangeWelfareDTO.java | 114 ++++++++++++++++++ .../plugin/power/dto/change/form/.gitkeep | 0 .../plugin/power/dto/change/result/.gitkeep | 0 .../controller/ChangeWelfareController.java | 82 +++++++++++++ .../modules/change/dao/ChangeWelfareDao.java | 16 +++ .../change/entity/ChangeWelfareEntity.java | 84 +++++++++++++ .../change/excel/ChangeWelfareExcel.java | 75 ++++++++++++ .../change/redis/ChangeWelfareRedis.java | 30 +++++ .../change/service/ChangeWelfareService.java | 78 ++++++++++++ .../impl/ChangeWelfareServiceImpl.java | 87 +++++++++++++ .../mapper/change/ChangeWelfareDao.xml | 29 +++++ 11 files changed, 595 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java new file mode 100644 index 0000000..43f9d38 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java @@ -0,0 +1,114 @@ +package com.epmet.plugin.power.dto.change; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 福利表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Data +public class ChangeWelfareDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * epmet网格ID + */ + private String gridId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java new file mode 100644 index 0000000..821f23b --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.change.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.plugin.power.dto.change.ChangeWelfareDTO; +import com.epmet.plugin.power.modules.change.excel.ChangeWelfareExcel; +import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; +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-09 + */ +@RestController +@RequestMapping("changeWelfare") +public class ChangeWelfareController { + + @Autowired + private ChangeWelfareService changeWelfareService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = changeWelfareService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + ChangeWelfareDTO data = changeWelfareService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody ChangeWelfareDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + changeWelfareService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody ChangeWelfareDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + changeWelfareService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + changeWelfareService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = changeWelfareService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ChangeWelfareExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java new file mode 100644 index 0000000..44a0afe --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.change.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 福利表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Mapper +public interface ChangeWelfareDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java new file mode 100644 index 0000000..04242c0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java @@ -0,0 +1,84 @@ +package com.epmet.plugin.power.modules.change.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 2022-05-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_change_welfare") +public class ChangeWelfareEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * epmet用户主键 + */ + private String userId; + + /** + * epmet网格ID + */ + private String gridId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 0女 1男 + */ + private String gender; + + /** + * 类型 + */ + private String type; + + /** + * 加入时间 + */ + private String joinDate; + + /** + * 加入原因 + */ + private String joinReason; + + /** + * 移除时间 + */ + private String removeDate; + + /** + * 移除原因 + */ + private String removeReason; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java new file mode 100644 index 0000000..7fe21f0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java @@ -0,0 +1,75 @@ +package com.epmet.plugin.power.modules.change.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-09 + */ +@Data +public class ChangeWelfareExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "epmet用户主键") + private String userId; + + @Excel(name = "epmet网格ID") + private String gridId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别 0女 1男") + private String gender; + + @Excel(name = "类型") + private String type; + + @Excel(name = "加入时间") + private String joinDate; + + @Excel(name = "加入原因") + private String joinReason; + + @Excel(name = "移除时间") + private String removeDate; + + @Excel(name = "移除原因") + private String removeReason; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java new file mode 100644 index 0000000..31a4c26 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.change.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-09 + */ +@Component +public class ChangeWelfareRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java new file mode 100644 index 0000000..8c5efbf --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.change.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; +import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; + +import java.util.List; +import java.util.Map; + +/** + * 福利表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +public interface ChangeWelfareService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ChangeWelfareDTO + * @author generator + * @date 2022-05-09 + */ + ChangeWelfareDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-09 + */ + void save(ChangeWelfareDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-09 + */ + void update(ChangeWelfareDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java new file mode 100644 index 0000000..a4c9137 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.modules.change.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.change.dao.ChangeWelfareDao; +import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; +import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; +import com.epmet.plugin.power.modules.change.redis.ChangeWelfareRedis; +import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; +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-09 + */ +@Service +public class ChangeWelfareServiceImpl extends BaseServiceImpl implements ChangeWelfareService { + + @Autowired + private ChangeWelfareRedis changeWelfareRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ChangeWelfareDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ChangeWelfareDTO.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 ChangeWelfareDTO get(String id) { + ChangeWelfareEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ChangeWelfareDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ChangeWelfareDTO dto) { + ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ChangeWelfareDTO dto) { + ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml new file mode 100644 index 0000000..079a5c2 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From fd37e5258f11d1d4109d1ddbcd3282cc8b57aba3 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Mon, 9 May 2022 10:02:43 +0800 Subject: [PATCH 012/108] =?UTF-8?q?=E8=BF=81=E5=87=BA=E6=B7=BB=E5=8A=A0epm?= =?UTF-8?q?et=E7=94=A8=E6=88=B7=E4=B8=BB=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/modules/change/entity/ChangeRelocationEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java index 12a2f92..ed9cfb3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java @@ -145,4 +145,9 @@ public class ChangeRelocationEntity extends BaseEpmetEntity { */ private String mobile; + /** + * epmet用户主键 + */ + private String icUserId; + } From 0351a453e8993036d89d9cffa8265622320cf3db Mon Sep 17 00:00:00 2001 From: HAHA Date: Mon, 9 May 2022 14:27:26 +0800 Subject: [PATCH 013/108] =?UTF-8?q?message:=20=E4=B8=BA=E5=85=9A=E5=91=98?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=88=B7=E5=9D=90=E6=A0=87=E9=9B=86=E5=90=88?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3=20=E4=B8=BA=E5=85=9A?= =?UTF-8?q?=E5=91=98=E4=B8=AD=E5=BF=83=E6=88=B7=E6=95=B0=E5=92=8C=E5=85=9A?= =?UTF-8?q?=E7=BE=A4=E6=9C=8D=E5=8A=A1=E7=AB=99=E6=95=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PowerAxisDataVisualController.java | 3 +- .../modules/axis/dao/PowerAxisStructDao.java | 10 +- .../impl/PowerAxisStructServiceImpl.java | 4 +- .../mapper/poweraxis/PowerAxisStructDao.xml | 106 ++++++++++-------- 4 files changed, 69 insertions(+), 54 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index d1c1615..63c9820 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -14,6 +14,7 @@ import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; /*** @@ -129,7 +130,7 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("kernelHousehold/listPosition") - public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { + public Result> getListPosition(@Valid @RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(powerKernelHouseholdService.getListPosition(form)); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index 401925c..33f6571 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -75,19 +75,19 @@ public interface PowerAxisStructDao extends BaseDao { List getIdsByAgencyId(String agencyId, String customerId); - int queryGridParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("gridCateGoryCode") String gridCateGoryCode); + int queryGridParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("gridCateGoryCode") String gridCateGoryCode); - int queryGroupParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("groupCateGoryCode") String groupCateGoryCode); + int queryGroupParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("groupCateGoryCode") String groupCateGoryCode); - int getKernelHouseHold(PowerAxisStructViewFormDTO form); + int getKernelHouseHold(@Param("agencyId") String agencyId, @Param("customerId") String customerId); - int getServiceStation(PowerAxisStructViewFormDTO form); + int getServiceStation(@Param("agencyId") String agencyId,@Param("customerId") String customerId); List getStructTree(PowerAxisStructStructTreeFormDTO form); String queryCategoryCode(PowerAxisListPositionFormDTO form); - List querylistPosition(@Param("customerId") String customerId,@Param("code") String code ,@Param("agencyId") String agencyId); + List querylistPosition(@Param("customerId") String customerId, @Param("code") String code, @Param("agencyId") String agencyId); /** * 根据节点接报,组装其上级节点树 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index cddd027..5e14c34 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -237,9 +237,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl select - s.ID, - s.NAME, - s.PID, - s.PIDS, - s.CATEGORY_CODE, - s.SORT, - s.CREATED_TIME, - sl.LEADER_ID, - l.NAME as LEADER_NAME, - l.MOBILE as LEADER_MOBILE, - t.STRUCT_LEVEL + s.ID, + s.NAME, + s.PID, + s.PIDS, + s.CATEGORY_CODE, + s.SORT, + s.CREATED_TIME, + sl.LEADER_ID, + l.NAME as LEADER_NAME, + l.MOBILE as LEADER_MOBILE, + t.STRUCT_LEVEL from pli_power_axis_struct s left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0' left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' @@ -66,16 +66,16 @@ - SELECT - count( DISTINCT HOUSE_ID ) + count(*) FROM - pli_power_kernel_household + pli_power_service_station WHERE del_flag = '0' - - + \ No newline at end of file From b924cc2c7c7dda6ed2bee0e1ee81b1114803ad74 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Mon, 9 May 2022 15:52:58 +0800 Subject: [PATCH 014/108] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/change/ChangeDeathDTO.java | 11 ++- .../power/dto/change/ChangeRelocationDTO.java | 11 ++- .../dto/change/CheckWelfareByIdCardDTO.java | 20 +++++ .../controller/ChangeWelfareController.java | 33 ++++++- .../modules/change/dao/ChangeWelfareDao.java | 23 ++++- .../change/service/ChangeWelfareService.java | 33 ++++++- .../service/impl/ChangeDeathServiceImpl.java | 21 ++++- .../impl/ChangeRelocationServiceImpl.java | 26 +++++- .../impl/ChangeWelfareServiceImpl.java | 88 +++++++++++++++++-- .../mapper/change/ChangeWelfareDao.xml | 14 ++- 10 files changed, 257 insertions(+), 23 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java index db71687..7a50fc3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java @@ -1,10 +1,10 @@ package com.epmet.plugin.power.dto.change; -import java.io.Serializable; -import java.util.Date; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; /** @@ -119,4 +119,9 @@ public class ChangeDeathDTO implements Serializable { */ private String customerId; -} \ No newline at end of file + /** + * 是否保存为福利人员 + */ + private Boolean welfareFlag; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java index 3210514..d158b81 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java @@ -1,7 +1,8 @@ package com.epmet.plugin.power.dto.change; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; @@ -176,7 +177,8 @@ public class ChangeRelocationDTO implements Serializable { /** * 迁出时间 */ - @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + @JSONField(format = "yyyy-MM-dd") private Date outOfTime; /** @@ -194,4 +196,9 @@ public class ChangeRelocationDTO implements Serializable { */ private String icUserId; + /** + * 是否保存为福利人员 + */ + private Boolean welfareFlag; + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java new file mode 100644 index 0000000..243e683 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java @@ -0,0 +1,20 @@ +package com.epmet.plugin.power.dto.change; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @program: epmet-plugins + * @description: + * @author: wangtong + * @create: 2022-05-09 13:52 + **/ +@Data +public class CheckWelfareByIdCardDTO implements Serializable { + + + @NotBlank(message = "身份证不能为空") + private String idCard; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java index 821f23b..c3dc39c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java @@ -7,9 +7,10 @@ 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.commons.tools.validator.group.UpdateGroup; import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; +import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO; import com.epmet.plugin.power.modules.change.excel.ChangeWelfareExcel; import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; import org.springframework.beans.factory.annotation.Autowired; @@ -50,8 +51,7 @@ public class ChangeWelfareController { public Result save(@RequestBody ChangeWelfareDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - changeWelfareService.save(dto); - return new Result(); + return changeWelfareService.save(dto); } @NoRepeatSubmit @@ -77,6 +77,33 @@ public class ChangeWelfareController { ExcelUtils.exportExcelToTarget(response, null, list, ChangeWelfareExcel.class); } + /** + * @describe: 移除福利人员 + * @author wangtong + * @date 2022/5/9 11:11 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @NoRepeatSubmit + @PostMapping("removeWelfare") + public Result removeWelfare(@RequestBody ChangeWelfareDTO dto){ + return changeWelfareService.removeWelfare(dto); + } + + /** + * @describe: 通过身份证号查询是否属于福利人员,是-true,否-false + * @author wangtong + * @date 2022/5/9 13:52 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @NoRepeatSubmit + @GetMapping("checkWelfareByIdCard") + public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return changeWelfareService.checkWelfareByIdCard(dto); + } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java index 44a0afe..c55ff77 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java @@ -1,8 +1,10 @@ package com.epmet.plugin.power.modules.change.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 福利表 @@ -12,5 +14,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ChangeWelfareDao extends BaseDao { - -} \ No newline at end of file + + /** + * @describe: 通过身份证号查询福利人员 + * @author wangtong + * @date 2022/5/9 13:59 + * @params [idCard] + * @return com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity + */ + ChangeWelfareEntity selectByIdCard(@Param("idCard") String idCard); + + /** + * @describe: 移除福利人员 + * @author wangtong + * @date 2022/5/9 14:36 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + void removeWelfare(ChangeWelfareDTO dto); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java index 8c5efbf..539b35d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java @@ -2,7 +2,9 @@ package com.epmet.plugin.power.modules.change.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; +import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO; import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; import java.util.List; @@ -54,7 +56,7 @@ public interface ChangeWelfareService extends BaseService { * @author generator * @date 2022-05-09 */ - void save(ChangeWelfareDTO dto); + Result save(ChangeWelfareDTO dto); /** * 默认更新 @@ -75,4 +77,31 @@ public interface ChangeWelfareService extends BaseService { * @date 2022-05-09 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * @describe: 移除福利人员 + * @author wangtong + * @date 2022/5/9 11:11 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result removeWelfare(ChangeWelfareDTO dto); + + /** + * @describe: 通过身份证号查询是否属于福利人员,是-true,否-false + * @author wangtong + * @date 2022/5/9 13:54 + * @params [dto] + * @return java.lang.Boolean + */ + Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto); + + /** + * @describe: 保存福利人员 + * @author wangtong + * @date 2022/5/9 14:10 + * @params [] + * @return com.epmet.commons.tools.utils.Result + */ + Result saveWelfareInfo(ChangeWelfareDTO dto); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java index 1e4c7c8..6afdd7a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java @@ -16,10 +16,12 @@ import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.result.RentTenantDataResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.plugin.power.dto.change.ChangeDeathDTO; +import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; import com.epmet.plugin.power.modules.change.dao.ChangeDeathDao; import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; import com.epmet.plugin.power.modules.change.redis.ChangeDeathRedis; import com.epmet.plugin.power.modules.change.service.ChangeDeathService; +import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -45,6 +47,9 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -108,6 +113,20 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -124,7 +129,6 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -49,10 +63,20 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + String id = (String) params.get(FieldConstant.ID_HUMP); + String name = (String) params.get("name"); + String idCard = (String) params.get("idCard"); + String mobile = (String) params.get("mobile"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); return wrapper; } @@ -65,9 +89,28 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); + + dto.setIdCard(result.getData().getIdCard()); + dto.setMobile(result.getData().getMobile()); + dto.setGridId(result.getData().getGridId()); + Map params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + return new Result().error("该人员已经迁入福利人口"); + } + dto.setJoinDate(DateUtils.format(new Date())); ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); insert(entity); + return new Result(); } @Override @@ -84,4 +127,33 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl params = new HashMap<>(4); + params.put("idCard", dto.getIdCard()); + if (!list(params).isEmpty()) { + return new Result().error("该人员已经迁入福利人口"); + } + dto.setJoinDate(DateUtils.format(new Date())); + ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); + insert(entity); + return new Result(); + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml index 079a5c2..b0afb3c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml @@ -24,6 +24,18 @@ + + + update pli_change_welfare + set REMOVE_DATE=#{removeDate}, + REMOVE_REASON=#{removeReason}, + del_flag='1' + where id=#{id} + - \ No newline at end of file + From 41ff99cedb97a6caaa4dd40ca3efeb5541bc22c3 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 11 May 2022 09:20:06 +0800 Subject: [PATCH 015/108] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=A7=9F=E6=88=BF?= =?UTF-8?q?=E5=90=88=E5=90=8C=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 94d1de1..79d7d0b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -242,12 +242,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); if (tenantList.size() != idCardNum) { - return new Result().error("租客身份证重复"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"租客身份证重复"); } tenantList.forEach(tenant -> { @@ -279,7 +279,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { From a5002f1379c08fa7520a8e06232e9a008d83114f Mon Sep 17 00:00:00 2001 From: YUJT Date: Wed, 11 May 2022 09:45:56 +0800 Subject: [PATCH 016/108] update --- .../axis/form/PowerAxisStructViewFormDTO.java | 3 +++ .../form/PowerKernelListPostitionFormDTO.java | 2 +- .../result/PowerAxisStructViewResultDTO.java | 4 ++-- .../PowerAxisDataVisualController.java | 6 ++++-- .../impl/PowerAxisStructServiceImpl.java | 17 +++++++++-------- .../impl/PowerKernelHouseholdServiceImpl.java | 7 ++++++- .../mapper/poweraxis/PowerAxisStructDao.xml | 2 ++ 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java index c22c881..a597f68 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data @@ -11,10 +12,12 @@ public class PowerAxisStructViewFormDTO implements Serializable { /** * 客户id */ + @NotBlank(message = "所属客户不能为空") private String customerId; /** * 组织id */ + @NotBlank(message = "所属组织不能为空") private String agencyId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java index b2eb8ee..72923d7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java @@ -19,7 +19,7 @@ public class PowerKernelListPostitionFormDTO implements Serializable { /** * 条数 */ - private int limit; + private Integer limit; /** * 客户id diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java index 5944990..fafb304 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java @@ -22,7 +22,7 @@ public class PowerAxisStructViewResultDTO implements Serializable { /** * 党员数 */ - private int partyMemberNum; +// private int partyMemberNum; /** * 党员中心户数 @@ -37,5 +37,5 @@ public class PowerAxisStructViewResultDTO implements Serializable { /** * 志愿队伍数 */ - private int volunteerTeamNum; +// private int volunteerTeamNum; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index 63c9820..a9de19f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -60,7 +60,9 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("axis/statistics") - public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form) { + public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form); return new Result().ok(result); } @@ -130,7 +132,7 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("kernelHousehold/listPosition") - public Result> getListPosition(@Valid @RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { + public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(powerKernelHouseholdService.getListPosition(form)); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 5e14c34..df6c554 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.validation.constraints.NotBlank; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -227,19 +228,19 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl getListPosition(PowerKernelListPostitionFormDTO form) { - return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), form.getLimit()); + Integer limit = form.getLimit(); + if (null == limit || NumConstant.ZERO_L == limit) { + limit = 999; + } + return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), limit); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 7b8d66f..a3e9c5e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -131,6 +131,7 @@ CATEGORY_CODE = #{gridCateGoryCode} AND customer_id = #{customerId} + AND del_flag = '0' From fa9129860cdc6196026a4c9090f5b99da45a31a8 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 11 May 2022 10:35:57 +0800 Subject: [PATCH 018/108] =?UTF-8?q?=E8=B4=AD=E6=88=BF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 190 ++++++++++++++++++ .../rent/controller/RentHouseController.java | 82 ++++++++ .../power/modules/rent/dao/RentHouseDao.java | 16 ++ .../modules/rent/entity/RentHouseEntity.java | 160 +++++++++++++++ .../modules/rent/excel/RentHouseExcel.java | 121 +++++++++++ .../modules/rent/redis/RentHouseRedis.java | 30 +++ .../rent/service/RentHouseService.java | 78 +++++++ .../service/impl/RentHouseServiceImpl.java | 87 ++++++++ .../resources/mapper/rent/RentHouseDao.xml | 44 ++++ 9 files changed, 808 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java new file mode 100644 index 0000000..9074d52 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -0,0 +1,190 @@ +package com.epmet.plugin.power.dto.rent; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +public class RentHouseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 房屋主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1:出租 0:自住 2:闲置 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 购房日期 + */ + private String purchaseDate; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java new file mode 100644 index 0000000..bf9481d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.rent.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.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.excel.RentHouseExcel; +import com.epmet.plugin.power.modules.rent.service.RentHouseService; +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-11 + */ +@RestController +@RequestMapping("rentHouse") +public class RentHouseController { + + @Autowired + private RentHouseService rentHouseService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = rentHouseService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + RentHouseDTO data = rentHouseService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody RentHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentHouseService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody RentHouseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + rentHouseService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + rentHouseService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = rentHouseService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, RentHouseExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java new file mode 100644 index 0000000..2975d72 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.rent.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Mapper +public interface RentHouseDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java new file mode 100644 index 0000000..9a465d3 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java @@ -0,0 +1,160 @@ +package com.epmet.plugin.power.modules.rent.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_rent_house") +public class RentHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1:出租 0:自住 2:闲置 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区 + */ + private String communityName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 + */ + private String gridName; + + /** + * 房屋小区ID + */ + private String villageId; + + /** + * 房屋小区 + */ + private String villageName; + + /** + * 楼号ID + */ + private String buildId; + + /** + * 楼号 + */ + private String buildName; + + /** + * 单元ID + */ + private String unitId; + + /** + * 单元 + */ + private String unitName; + + /** + * 房屋ID + */ + private String homeId; + + /** + * 房屋 + */ + private String homeName; + + /** + * 购房日期 + */ + private String purchaseDate; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java new file mode 100644 index 0000000..41aead0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java @@ -0,0 +1,121 @@ +package com.epmet.plugin.power.modules.rent.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +@Data +public class RentHouseExcel { + + @Excel(name = "房屋主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "小区id") + private String neighborHoodId; + + @Excel(name = "片区id,neighbor_hood_part.id,可为空。") + private String partId; + + @Excel(name = "所属楼栋id") + private String buildingId; + + @Excel(name = "所属单元id") + private String buildingUnitId; + + @Excel(name = "房屋名字后台插入时生成") + private String houseName; + + @Excel(name = "门牌号") + private String doorName; + + @Excel(name = "房屋类型,1楼房,2平房,3别墅") + private String houseType; + + @Excel(name = "存储字典value") + private String purpose; + + @Excel(name = "1:出租 0:自住 2:闲置") + private Integer rentFlag; + + @Excel(name = "房主姓名") + private String ownerName; + + @Excel(name = "房主电话") + private String ownerPhone; + + @Excel(name = "房主身份证号") + private String ownerIdCard; + + @Excel(name = "排序") + private BigDecimal sort; + + @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; + + @Excel(name = "社区ID") + private String communityId; + + @Excel(name = "社区") + private String communityName; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "网格") + private String gridName; + + @Excel(name = "房屋小区ID") + private String villageId; + + @Excel(name = "房屋小区") + private String villageName; + + @Excel(name = "楼号ID") + private String buildId; + + @Excel(name = "楼号") + private String buildName; + + @Excel(name = "单元ID") + private String unitId; + + @Excel(name = "单元") + private String unitName; + + @Excel(name = "房屋ID") + private String homeId; + + @Excel(name = "房屋") + private String homeName; + + @Excel(name = "购房日期") + private String purchaseDate; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java new file mode 100644 index 0000000..4165a7e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.rent.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-11 + */ +@Component +public class RentHouseRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java new file mode 100644 index 0000000..27caab0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentHouseService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.rent.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; + +import java.util.List; +import java.util.Map; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-11 + */ +public interface RentHouseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return RentHouseDTO + * @author generator + * @date 2022-05-11 + */ + RentHouseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-11 + */ + void save(RentHouseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-11 + */ + void update(RentHouseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-11 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java new file mode 100644 index 0000000..e4cef4d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.modules.rent.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; +import com.epmet.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; +import com.epmet.plugin.power.modules.rent.redis.RentHouseRedis; +import com.epmet.plugin.power.modules.rent.service.RentHouseService; +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-11 + */ +@Service +public class RentHouseServiceImpl extends BaseServiceImpl implements RentHouseService { + + @Autowired + private RentHouseRedis rentHouseRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, RentHouseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.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 RentHouseDTO get(String id) { + RentHouseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, RentHouseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(RentHouseDTO dto) { + RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(RentHouseDTO dto) { + RentHouseEntity entity = ConvertUtils.sourceToTarget(dto, RentHouseEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml new file mode 100644 index 0000000..af389c5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentHouseDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 9cc8cb2452a0d8721955493e9f699c6d5c42ad62 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 11 May 2022 13:37:35 +0800 Subject: [PATCH 019/108] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E5=90=88=E5=90=8C?= =?UTF-8?q?=E7=AD=BE=E8=AE=A2=E6=9B=B4=E6=96=B0=E6=88=BF=E5=B1=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E6=88=BF=E5=B1=8B=E8=B4=AD=E4=B9=B0=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=BF=E5=B1=8B=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 5 +++ .../impl/RentContractInfoServiceImpl.java | 16 ++++++-- .../service/impl/RentHouseServiceImpl.java | 41 +++++++++++++++++-- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java index 9074d52..de045e1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -187,4 +187,9 @@ public class RentHouseDTO implements Serializable { */ private String purchaseDate; + /** + * 是否更新 + */ + private String flag; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 79d7d0b..97f41ae 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -13,8 +13,10 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.IdCardNoValidatorUtils; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.IcHouseDTO; import com.epmet.dto.IcResiUserAttachmentDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.IcHouseAddFormDTO; import com.epmet.dto.form.RentTenantFormDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; @@ -162,7 +164,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); + IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); + formDTO.setRentFlag(NumConstant.ONE); + govOrgOpenFeignClient.houseUpdate(formDTO); } } @@ -242,12 +250,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantList = ConvertUtils.sourceToTarget(dto.getTenantList(), RentTenantInfoEntity.class); long idCardNum = tenantList.stream().map(RentTenantInfoEntity::getIdCard).collect(Collectors.toList()).stream().distinct().count(); if (tenantList.size() != idCardNum) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"租客身份证重复"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客身份证重复"); } tenantList.forEach(tenant -> { @@ -279,7 +287,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl fileList = ConvertUtils.sourceToTarget(dto.getFileList(), RentContractFileEntity.class); fileList.forEach(item -> { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index e4cef4d..2a355f6 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -3,11 +3,13 @@ package com.epmet.plugin.power.modules.rent.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.commons.tools.constant.FieldConstant; -import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; +import com.epmet.dto.form.IcHouseAddFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.rent.RentHouseDTO; +import com.epmet.plugin.power.modules.rent.dao.RentHouseDao; import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity; import com.epmet.plugin.power.modules.rent.redis.RentHouseRedis; import com.epmet.plugin.power.modules.rent.service.RentHouseService; @@ -32,6 +34,9 @@ public class RentHouseServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -48,11 +53,33 @@ public class RentHouseServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String gridId = (String) params.get("gridId"); + String villageId = (String) params.get("villageId"); + String buildId = (String) params.get("buildId"); + String unitId = (String) params.get("unitId"); + String homeId = (String) params.get("homeId"); + String ownerName = (String) params.get("ownerName"); + String ownerPhone = (String) params.get("ownerPhone"); + String ownerIdCard = (String) params.get("ownerIdCard"); + String rentFlag = (String) params.get("rentFlag"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); + wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); + wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); + wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); + wrapper.eq(StringUtils.isNotBlank(ownerName), "OWNER_NAME", ownerName); + wrapper.eq(StringUtils.isNotBlank(ownerPhone), "OWNER_PHONE", ownerPhone); + wrapper.eq(StringUtils.isNotBlank(ownerIdCard), "OWNER_ID_CARD", ownerIdCard); + wrapper.eq(StringUtils.isNotBlank(rentFlag), "RENT_FLAG", rentFlag); + wrapper.ge(StringUtils.isNotBlank(startTime), "PURCHASE_DATE", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "PURCHASE_DATE", endTime); return wrapper; } @@ -68,6 +95,12 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Wed, 11 May 2022 15:14:48 +0800 Subject: [PATCH 020/108] update --- .../power/dto/axis/form/PowerKernelListPostitionFormDTO.java | 1 + .../modules/axis/controller/PowerAxisDataVisualController.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java index 72923d7..3468172 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java @@ -24,5 +24,6 @@ public class PowerKernelListPostitionFormDTO implements Serializable { /** * 客户id */ + @NotBlank(message = "所属客户不能为空") private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index a9de19f..34a69fe 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -133,8 +133,8 @@ public class PowerAxisDataVisualController { */ @PostMapping("kernelHousehold/listPosition") public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { - ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); return new Result().ok(powerKernelHouseholdService.getListPosition(form)); } From 98f17903dfbb05847079001f51fc0ff1353fce16 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 11 May 2022 15:16:46 +0800 Subject: [PATCH 021/108] =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E6=88=BF=E5=B1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentHouseDTO.java | 2 +- .../modules/rent/excel/RentHouseExcel.java | 98 +++---------------- .../service/impl/RentHouseServiceImpl.java | 2 +- 3 files changed, 13 insertions(+), 89 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java index de045e1..34008cb 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java @@ -190,6 +190,6 @@ public class RentHouseDTO implements Serializable { /** * 是否更新 */ - private String flag; + private Boolean needUpdate; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java index 41aead0..bea060e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java @@ -3,9 +3,6 @@ package com.epmet.plugin.power.modules.rent.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.math.BigDecimal; -import java.util.Date; - /** * 房屋信息 * @@ -15,37 +12,25 @@ import java.util.Date; @Data public class RentHouseExcel { - @Excel(name = "房屋主键") - private String id; - - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "小区id") - private String neighborHoodId; - - @Excel(name = "片区id,neighbor_hood_part.id,可为空。") - private String partId; - - @Excel(name = "所属楼栋id") - private String buildingId; + @Excel(name = "所属小区") + private String villageName; - @Excel(name = "所属单元id") - private String buildingUnitId; + @Excel(name = "所属楼栋") + private String buildName; - @Excel(name = "房屋名字后台插入时生成") - private String houseName; + @Excel(name = "单元号") + private String unitName; @Excel(name = "门牌号") - private String doorName; + private String homeName; - @Excel(name = "房屋类型,1楼房,2平房,3别墅") + @Excel(name = "类型", replace = {"楼房_1", "平房_2", "别墅_3"}) private String houseType; - @Excel(name = "存储字典value") + @Excel(name = "用途", replace = {"住宅_1", "商业_2", "办公_3", "工业_4", "仓储_5", "商住混用_6", "其他_7"}) private String purpose; - @Excel(name = "1:出租 0:自住 2:闲置") + @Excel(name = "房屋状态", replace = {"出租_1", "闲置_2", "自住_0"}) private Integer rentFlag; @Excel(name = "房主姓名") @@ -54,68 +39,7 @@ public class RentHouseExcel { @Excel(name = "房主电话") private String ownerPhone; - @Excel(name = "房主身份证号") + @Excel(name = "房主身份证") private String ownerIdCard; - @Excel(name = "排序") - private BigDecimal sort; - - @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; - - @Excel(name = "社区ID") - private String communityId; - - @Excel(name = "社区") - private String communityName; - - @Excel(name = "网格ID") - private String gridId; - - @Excel(name = "网格") - private String gridName; - - @Excel(name = "房屋小区ID") - private String villageId; - - @Excel(name = "房屋小区") - private String villageName; - - @Excel(name = "楼号ID") - private String buildId; - - @Excel(name = "楼号") - private String buildName; - - @Excel(name = "单元ID") - private String unitId; - - @Excel(name = "单元") - private String unitName; - - @Excel(name = "房屋ID") - private String homeId; - - @Excel(name = "房屋") - private String homeName; - - @Excel(name = "购房日期") - private String purchaseDate; - - } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index 2a355f6..d945038 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -97,7 +97,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Wed, 11 May 2022 15:51:51 +0800 Subject: [PATCH 022/108] =?UTF-8?q?message:=E4=BF=AE=E6=94=B9=E5=85=9A?= =?UTF-8?q?=E5=91=98=E4=B8=AD=E5=BF=83=E6=88=B7=E5=9D=90=E6=A0=87=E9=9B=86?= =?UTF-8?q?=E5=90=88=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/form/PowerKernelListPostitionFormDTO.java | 4 +++- .../modules/axis/dao/PowerKernelHouseholdDao.java | 2 ++ .../service/impl/PowerKernelHouseholdServiceImpl.java | 8 +++++++- .../mapper/poweraxis/PowerKernelHouseholdDao.xml | 11 +++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java index 3468172..3486538 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java @@ -13,7 +13,6 @@ public class PowerKernelListPostitionFormDTO implements Serializable { /** * 动力主轴id */ - @NotBlank(message = "动力主轴节点不能为空") private String axisStructId; /** @@ -26,4 +25,7 @@ public class PowerKernelListPostitionFormDTO implements Serializable { */ @NotBlank(message = "所属客户不能为空") private String customerId; + + @NotBlank(message = "所属组织不能为空") + private String agencyId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java index 1509ff5..d77247e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java @@ -54,4 +54,6 @@ public interface PowerKernelHouseholdDao extends BaseDao getPage(Map params); + String queryAxisStructId(@Param("agencyId") String agencyId, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java index 198ead8..453bd88 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.validation.constraints.NotBlank; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -144,7 +145,12 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl + \ No newline at end of file From dd358864f999d0bcbf8bfcbeb272188c43cf0e34 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 12 May 2022 10:08:12 +0800 Subject: [PATCH 023/108] =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84post=E5=92=8Cdelete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/controller/RentContractFileController.java | 2 +- .../power/modules/rent/controller/RentTenantInfoController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java index 7ea49af..67f4f08 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java @@ -63,7 +63,7 @@ public class RentContractFileController { return new Result(); } - @PostMapping("delete") + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 082e14e..2b664f8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -76,7 +76,7 @@ public class RentTenantInfoController { return new Result(); } - @PostMapping("delete") + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); From 2bb4005ad1865a831e29c5e8e5218b8e8fc9888b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 12 May 2022 10:10:15 +0800 Subject: [PATCH 024/108] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=BF=81=E5=87=BA?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=AD=BB=E4=BA=A1=E7=9B=B8=E5=85=B3=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/change/ChangeDeathDTO.java | 127 ----------- .../power/dto/change/ChangeRelocationDTO.java | 204 ------------------ .../power/dto/change/ChangeWelfareDTO.java | 114 ---------- .../dto/change/CheckWelfareByIdCardDTO.java | 20 -- .../plugin/power/dto/change/form/.gitkeep | 0 .../plugin/power/dto/change/result/.gitkeep | 0 .../controller/ChangeDeathController.java | 81 ------- .../ChangeRelocationController.java | 95 -------- .../controller/ChangeWelfareController.java | 109 ---------- .../modules/change/dao/ChangeDeathDao.java | 16 -- .../change/dao/ChangeRelocationDao.java | 16 -- .../modules/change/dao/ChangeWelfareDao.java | 35 --- .../change/entity/ChangeDeathEntity.java | 84 -------- .../change/entity/ChangeRelocationEntity.java | 153 ------------- .../change/entity/ChangeWelfareEntity.java | 84 -------- .../change/excel/ChangeDeathExcel.java | 72 ------- .../change/excel/ChangeRelocationExcel.java | 127 ----------- .../change/excel/ChangeWelfareExcel.java | 75 ------- .../change/redis/ChangeDeathRedis.java | 30 --- .../change/redis/ChangeRelocationRedis.java | 30 --- .../change/redis/ChangeWelfareRedis.java | 30 --- .../change/service/ChangeDeathService.java | 79 ------- .../service/ChangeRelocationService.java | 88 -------- .../change/service/ChangeWelfareService.java | 107 --------- .../service/impl/ChangeDeathServiceImpl.java | 147 ------------- .../impl/ChangeRelocationServiceImpl.java | 171 --------------- .../impl/ChangeWelfareServiceImpl.java | 159 -------------- .../mapper/change/ChangeDeathDao.xml | 28 --- .../mapper/change/ChangeRelocationDao.xml | 39 ---- .../mapper/change/ChangeWelfareDao.xml | 41 ---- 30 files changed, 2361 deletions(-) delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java deleted file mode 100644 index 7a50fc3..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.epmet.plugin.power.dto.change; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; -import java.util.Date; - - -/** - * 死亡名单表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-05 - */ -@Data -public class ChangeDeathDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - - /** - * 主键 - */ - private String id; - - /** - * epmet用户主键 - */ - @NotBlank(message = "用户ID不能为空") - private String userId; - - /** - * epmet网格ID - */ - private String gridId; - - /** - * 姓名 - */ - @NotBlank(message = "姓名不能为空") - private String name; - - /** - * 身份证 - */ - @NotBlank(message = "身份证不能为空") - private String idCard; - - /** - * 手机号 - */ - @NotBlank(message = "手机号不能为空") - private String mobile; - - /** - * 性别 0女 1男 - */ - @NotBlank(message = "性别不能为空") - private String gender; - - /** - * 类型 0 租客 1 房东 - */ - private String type; - - /** - * 加入时间 - */ - private String joinDate; - - /** - * 加入原因 - */ - private String joinReason; - - /** - * 移除时间 - */ - private String removeDate; - - /** - * 移除原因 - */ - private String removeReason; - - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - - /** - * 客户ID - */ - private String customerId; - - /** - * 是否保存为福利人员 - */ - private Boolean welfareFlag; - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java deleted file mode 100644 index d158b81..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.epmet.plugin.power.dto.change; - -import com.alibaba.fastjson.annotation.JSONField; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - - -/** - * 合同表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-06 - */ -@Data -public class ChangeRelocationDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - private String id; - - /** - * 姓名 - */ - private String name; - - /** - * 性别 - */ - private String gender; - - /** - * 年龄 - */ - private String age; - - /** - * 组织PID - */ - private String pid; - - /** - * 组织ID - */ - private String agencyId; - - /** - * 组织名 - */ - private String agencyName; - - /** - * 组织ID - */ - private String gridId; - - /** - * 组织名 - */ - private String gridName; - - /** - * 房屋小区ID - */ - private String villageId; - - /** - * 房屋小区 - */ - private String villageName; - - /** - * 楼号ID - */ - private String buildId; - - /** - * 楼号 - */ - private String buildName; - - /** - * 单元ID - */ - private String unitId; - - /** - * 单元 - */ - private String unitName; - - /** - * 房屋ID - */ - private String homeId; - - /** - * 房屋 - */ - private String homeName; - - /** - * 外迁详细地址 - */ - private String address; - - /** - * 操作类型【客户外out,客户内in】 - */ - private String type; - - /** - * 原房主姓名 - */ - private String ownerName; - - /** - * 原网格信息 - */ - private String oldDept; - - /** - * 原房屋信息 - */ - private String oldAddress; - - /** - * 原房间号 - */ - private String oldHome; - - /** - * 浅出原因 - */ - private String reason; - - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - - /** - * 客户ID - */ - private String customerId; - - /** - * 迁出时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") - @JSONField(format = "yyyy-MM-dd") - private Date outOfTime; - - /** - * 身份证号 - */ - private String idCard; - - /** - * 手机号 - */ - private String mobile; - - /** - * epmet用户主键 - */ - private String icUserId; - - /** - * 是否保存为福利人员 - */ - private Boolean welfareFlag; - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java deleted file mode 100644 index 43f9d38..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeWelfareDTO.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.epmet.plugin.power.dto.change; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 福利表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-09 - */ -@Data -public class ChangeWelfareDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - private String id; - - /** - * epmet用户主键 - */ - private String userId; - - /** - * epmet网格ID - */ - private String gridId; - - /** - * 姓名 - */ - private String name; - - /** - * 身份证 - */ - private String idCard; - - /** - * 手机号 - */ - private String mobile; - - /** - * 性别 0女 1男 - */ - private String gender; - - /** - * 类型 - */ - private String type; - - /** - * 加入时间 - */ - private String joinDate; - - /** - * 加入原因 - */ - private String joinReason; - - /** - * 移除时间 - */ - private String removeDate; - - /** - * 移除原因 - */ - private String removeReason; - - /** - * 删除标记 0:未删除,1:已删除 - */ - private String delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - - /** - * 客户ID - */ - private String customerId; - -} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java deleted file mode 100644 index 243e683..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.epmet.plugin.power.dto.change; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @program: epmet-plugins - * @description: - * @author: wangtong - * @create: 2022-05-09 13:52 - **/ -@Data -public class CheckWelfareByIdCardDTO implements Serializable { - - - @NotBlank(message = "身份证不能为空") - private String idCard; -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/form/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/result/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java deleted file mode 100644 index 6320bf3..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeDeathController.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.plugin.power.dto.change.ChangeDeathDTO; -import com.epmet.plugin.power.modules.change.excel.ChangeDeathExcel; -import com.epmet.plugin.power.modules.change.service.ChangeDeathService; -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-05 - */ -@RestController -@RequestMapping("rentDeath") -public class ChangeDeathController { - - @Autowired - private ChangeDeathService changeDeathService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = changeDeathService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - ChangeDeathDTO data = changeDeathService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody ChangeDeathDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return changeDeathService.save(dto); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody ChangeDeathDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - changeDeathService.update(dto); - return new Result(); - } - - @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - changeDeathService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = changeDeathService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ChangeDeathExcel.class); - } - - - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java deleted file mode 100644 index f020250..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeRelocationController.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.plugin.power.dto.change.ChangeRelocationDTO; -import com.epmet.plugin.power.modules.change.excel.ChangeRelocationExcel; -import com.epmet.plugin.power.modules.change.service.ChangeRelocationService; -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-06 - */ -@RestController -@RequestMapping("changeRelocation") -public class ChangeRelocationController { - - @Autowired - private ChangeRelocationService changeRelocationService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = changeRelocationService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - ChangeRelocationDTO data = changeRelocationService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody ChangeRelocationDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - changeRelocationService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody ChangeRelocationDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - changeRelocationService.update(dto); - return new Result(); - } - - @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - changeRelocationService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = changeRelocationService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ChangeRelocationExcel.class); - } - - /** - * @describe: 保存迁出信息 - * @author wangtong - * @date 2022/5/7 9:49 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - @NoRepeatSubmit - @PostMapping("saveOutOfInfo") - public Result saveOutOfInfo(@RequestBody ChangeRelocationDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return changeRelocationService.saveOutOfInfo(dto); - } - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java deleted file mode 100644 index c3dc39c..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO; -import com.epmet.plugin.power.modules.change.excel.ChangeWelfareExcel; -import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; -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-09 - */ -@RestController -@RequestMapping("changeWelfare") -public class ChangeWelfareController { - - @Autowired - private ChangeWelfareService changeWelfareService; - - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = changeWelfareService.page(params); - return new Result>().ok(page); - } - - @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - ChangeWelfareDTO data = changeWelfareService.get(id); - return new Result().ok(data); - } - - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody ChangeWelfareDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return changeWelfareService.save(dto); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody ChangeWelfareDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - changeWelfareService.update(dto); - return new Result(); - } - - @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - changeWelfareService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = changeWelfareService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ChangeWelfareExcel.class); - } - - /** - * @describe: 移除福利人员 - * @author wangtong - * @date 2022/5/9 11:11 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - @NoRepeatSubmit - @PostMapping("removeWelfare") - public Result removeWelfare(@RequestBody ChangeWelfareDTO dto){ - return changeWelfareService.removeWelfare(dto); - } - - - /** - * @describe: 通过身份证号查询是否属于福利人员,是-true,否-false - * @author wangtong - * @date 2022/5/9 13:52 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - @NoRepeatSubmit - @GetMapping("checkWelfareByIdCard") - public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - return changeWelfareService.checkWelfareByIdCard(dto); - } - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java deleted file mode 100644 index ede0b21..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeDeathDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.plugin.power.modules.change.dao; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 死亡名单表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-05 - */ -@Mapper -public interface ChangeDeathDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java deleted file mode 100644 index e49c9bb..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeRelocationDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.plugin.power.modules.change.dao; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 合同表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-06 - */ -@Mapper -public interface ChangeRelocationDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java deleted file mode 100644 index c55ff77..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.epmet.plugin.power.modules.change.dao; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - * 福利表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-09 - */ -@Mapper -public interface ChangeWelfareDao extends BaseDao { - - /** - * @describe: 通过身份证号查询福利人员 - * @author wangtong - * @date 2022/5/9 13:59 - * @params [idCard] - * @return com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity - */ - ChangeWelfareEntity selectByIdCard(@Param("idCard") String idCard); - - /** - * @describe: 移除福利人员 - * @author wangtong - * @date 2022/5/9 14:36 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - void removeWelfare(ChangeWelfareDTO dto); -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java deleted file mode 100644 index a0ed967..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeDeathEntity.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.epmet.plugin.power.modules.change.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 2022-05-05 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("pli_change_death") -public class ChangeDeathEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * epmet用户主键 - */ - private String userId; - - /** - * epmet网格ID - */ - private String gridId; - - /** - * 姓名 - */ - private String name; - - /** - * 身份证 - */ - private String idCard; - - /** - * 手机号 - */ - private String mobile; - - /** - * 性别 0女 1男 - */ - private String gender; - - /** - * 类型 0 租客 1 房东 - */ - private String type; - - /** - * 加入时间 - */ - private String joinDate; - - /** - * 加入原因 - */ - private String joinReason; - - /** - * 移除时间 - */ - private String removeDate; - - /** - * 移除原因 - */ - private String removeReason; - - /** - * 客户ID - */ - private String customerId; - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java deleted file mode 100644 index ed9cfb3..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeRelocationEntity.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.epmet.plugin.power.modules.change.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 2022-05-06 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("pli_change_relocation") -public class ChangeRelocationEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 姓名 - */ - private String name; - - /** - * 性别 - */ - private String gender; - - /** - * 年龄 - */ - private String age; - - /** - * 组织PID - */ - private String pid; - - /** - * 组织ID - */ - private String agencyId; - - /** - * 组织名 - */ - private String agencyName; - - /** - * 房屋小区ID - */ - private String villageId; - - /** - * 房屋小区 - */ - private String villageName; - - /** - * 楼号ID - */ - private String buildId; - - /** - * 楼号 - */ - private String buildName; - - /** - * 单元ID - */ - private String unitId; - - /** - * 单元 - */ - private String unitName; - - /** - * 房屋ID - */ - private String homeId; - - /** - * 房屋 - */ - private String homeName; - - /** - * 外迁详细地址 - */ - private String address; - - /** - * 操作类型【客户外out,客户内in】 - */ - private String type; - - /** - * 原房主姓名 - */ - private String ownerName; - - /** - * 原网格信息 - */ - private String oldDept; - - /** - * 原房屋信息 - */ - private String oldAddress; - - /** - * 原房间号 - */ - private String oldHome; - - /** - * 浅出原因 - */ - private String reason; - - /** - * 客户ID - */ - private String customerId; - - /** - * 迁出时间 - */ - private Date outOfTime; - - /** - * 身份证号 - */ - private String idCard; - - /** - * 手机号 - */ - private String mobile; - - /** - * epmet用户主键 - */ - private String icUserId; - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java deleted file mode 100644 index 04242c0..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/entity/ChangeWelfareEntity.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.epmet.plugin.power.modules.change.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 2022-05-09 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("pli_change_welfare") -public class ChangeWelfareEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * epmet用户主键 - */ - private String userId; - - /** - * epmet网格ID - */ - private String gridId; - - /** - * 姓名 - */ - private String name; - - /** - * 身份证 - */ - private String idCard; - - /** - * 手机号 - */ - private String mobile; - - /** - * 性别 0女 1男 - */ - private String gender; - - /** - * 类型 - */ - private String type; - - /** - * 加入时间 - */ - private String joinDate; - - /** - * 加入原因 - */ - private String joinReason; - - /** - * 移除时间 - */ - private String removeDate; - - /** - * 移除原因 - */ - private String removeReason; - - /** - * 客户ID - */ - private String customerId; - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java deleted file mode 100644 index 4839e38..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeDeathExcel.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-05 - */ -@Data -public class ChangeDeathExcel { - -// @Excel(name = "主键") -// private String id; - -// @Excel(name = "epmet用户主键") -// private String userId; - - @Excel(name = "姓名") - private String name; - - @Excel(name = "身份证") - private String idCard; - - @Excel(name = "手机号") - private String mobile; - - @Excel(name = "性别",replace = { "男_1", "女_0"} ) - private String gender; - - @Excel(name = "类型",replace = { "房东_1", "租客_0"} ) - private String type; - - @Excel(name = "加入时间") - private String joinDate; - - @Excel(name = "加入原因") - private String joinReason; - -// @Excel(name = "移除时间") -// private String removeDate; -// -// @Excel(name = "移除原因") -// private String removeReason; - -// @Excel(name = "删除标记 0:未删除,1:已删除") -// private String delFlag; -// -// @Excel(name = "乐观锁") -// private Integer revision; -// -// @Excel(name = "创建人") -// private String createdBy; - - @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") - private Date createdTime; - -// @Excel(name = "更新人") -// private String updatedBy; -// -// @Excel(name = "更新时间") -// private Date updatedTime; - -// @Excel(name = "客户ID") -// private String customerId; - - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java deleted file mode 100644 index a750525..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeRelocationExcel.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-06 - */ -@Data -public class ChangeRelocationExcel { - -// @Excel(name = "主键") -// private String id; - - @Excel(name = "姓名") - private String name; - - @Excel(name = "所属网格") - private String agencyName; - - @Excel(name = "所属房屋") - private String oldAddress; - - @Excel(name = "手机号") - private String mobile; - - @Excel(name = "身份证号") - private String idCard; - - @Excel(name = "性别") - private String gender; - - @Excel(name = "年龄") - private String age; - - @Excel(name = "迁出时间", format = "yyyy-MM-dd") - private Date outOfTime; - - @Excel(name = "迁出原因") - private String reason; - - @Excel(name = "迁往何地") - private String address; - - @Excel(name = "户主姓名") - private String ownerName; - - - -// @Excel(name = "组织PID") -// private String pid; - -// @Excel(name = "组织ID") -// private String agencyId; - - - -// @Excel(name = "房屋小区ID") -// private String villageId; - -// @Excel(name = "房屋小区") -// private String villageName; - -// @Excel(name = "楼号ID") -// private String buildId; - -// @Excel(name = "楼号") -// private String buildName; - -// @Excel(name = "单元ID") -// private String unitId; - -// @Excel(name = "单元") -// private String unitName; - -// @Excel(name = "房屋ID") -// private String homeId; - -// @Excel(name = "房屋") -// private String homeName; - - -// @Excel(name = "操作类型",replace = { "客户外_out", "客户内_in"} ) -// private String type; -// -// -// -// @Excel(name = "原网格信息") -// private String oldDept; -// - - -// @Excel(name = "原房间号") -// private String oldHome; - - - -// @Excel(name = "删除标记 0:未删除,1:已删除") -// private String delFlag; -// -// @Excel(name = "乐观锁") -// private Integer revision; -// -// @Excel(name = "创建人") -// private String createdBy; - - - -// @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") -// private Date createdTime; - -// @Excel(name = "更新人") -// private String updatedBy; -// -// @Excel(name = "更新时间") -// private Date updatedTime; -// -// @Excel(name = "客户ID") -// private String customerId; - - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java deleted file mode 100644 index 7fe21f0..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/excel/ChangeWelfareExcel.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-09 - */ -@Data -public class ChangeWelfareExcel { - - @Excel(name = "主键") - private String id; - - @Excel(name = "epmet用户主键") - private String userId; - - @Excel(name = "epmet网格ID") - private String gridId; - - @Excel(name = "姓名") - private String name; - - @Excel(name = "身份证") - private String idCard; - - @Excel(name = "手机号") - private String mobile; - - @Excel(name = "性别 0女 1男") - private String gender; - - @Excel(name = "类型") - private String type; - - @Excel(name = "加入时间") - private String joinDate; - - @Excel(name = "加入原因") - private String joinReason; - - @Excel(name = "移除时间") - private String removeDate; - - @Excel(name = "移除原因") - private String removeReason; - - @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; - - @Excel(name = "客户ID") - private String customerId; - - -} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java deleted file mode 100644 index 4d0cebe..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeDeathRedis.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-05 - */ -@Component -public class ChangeDeathRedis { - @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java deleted file mode 100644 index 09374eb..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeRelocationRedis.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-06 - */ -@Component -public class ChangeRelocationRedis { - @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java deleted file mode 100644 index 31a4c26..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/redis/ChangeWelfareRedis.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.epmet.plugin.power.modules.change.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-09 - */ -@Component -public class ChangeWelfareRedis { - @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java deleted file mode 100644 index 5eb010c..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeDeathService.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.epmet.plugin.power.modules.change.service; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.change.ChangeDeathDTO; -import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; - -import java.util.List; -import java.util.Map; - -/** - * 死亡名单表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-05 - */ -public interface ChangeDeathService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-05-05 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-05-05 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return ChangeDeathDTO - * @author generator - * @date 2022-05-05 - */ - ChangeDeathDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-05 - */ - Result save(ChangeDeathDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-05 - */ - void update(ChangeDeathDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-05-05 - */ - void delete(String[] ids); -} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java deleted file mode 100644 index bdbfc02..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeRelocationService.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.epmet.plugin.power.modules.change.service; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.change.ChangeRelocationDTO; -import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; - -import java.util.List; -import java.util.Map; - -/** - * 合同表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-06 - */ -public interface ChangeRelocationService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-05-06 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-05-06 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return ChangeRelocationDTO - * @author generator - * @date 2022-05-06 - */ - ChangeRelocationDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-06 - */ - void save(ChangeRelocationDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-06 - */ - void update(ChangeRelocationDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-05-06 - */ - void delete(String[] ids); - - /** - * @describe: 保存迁出信息 - * @author wangtong - * @date 2022/5/7 9:49 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - Result saveOutOfInfo(ChangeRelocationDTO dto); -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java deleted file mode 100644 index 539b35d..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.epmet.plugin.power.modules.change.service; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO; -import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; - -import java.util.List; -import java.util.Map; - -/** - * 福利表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-09 - */ -public interface ChangeWelfareService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2022-05-09 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2022-05-09 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return ChangeWelfareDTO - * @author generator - * @date 2022-05-09 - */ - ChangeWelfareDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-09 - */ - Result save(ChangeWelfareDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-05-09 - */ - void update(ChangeWelfareDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-05-09 - */ - void delete(String[] ids); - - /** - * @describe: 移除福利人员 - * @author wangtong - * @date 2022/5/9 11:11 - * @params [dto] - * @return com.epmet.commons.tools.utils.Result - */ - Result removeWelfare(ChangeWelfareDTO dto); - - /** - * @describe: 通过身份证号查询是否属于福利人员,是-true,否-false - * @author wangtong - * @date 2022/5/9 13:54 - * @params [dto] - * @return java.lang.Boolean - */ - Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto); - - /** - * @describe: 保存福利人员 - * @author wangtong - * @date 2022/5/9 14:10 - * @params [] - * @return com.epmet.commons.tools.utils.Result - */ - Result saveWelfareInfo(ChangeWelfareDTO dto); -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java deleted file mode 100644 index 6afdd7a..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.form.RentTenantDataFormDTO; -import com.epmet.dto.result.RentTenantDataResultDTO; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.plugin.power.dto.change.ChangeDeathDTO; -import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.modules.change.dao.ChangeDeathDao; -import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; -import com.epmet.plugin.power.modules.change.redis.ChangeDeathRedis; -import com.epmet.plugin.power.modules.change.service.ChangeDeathService; -import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; -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.*; - -/** - * 死亡名单表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-05 - */ -@Service -public class ChangeDeathServiceImpl extends BaseServiceImpl implements ChangeDeathService { - - @Autowired - private ChangeDeathRedis changeDeathRedis; - - @Autowired - private EpmetUserOpenFeignClient epmetUserOpenFeignClient; - - @Autowired - LoginUserUtil loginUserUtil; - - @Autowired - private ChangeWelfareService changeWelfareService; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ChangeDeathDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ChangeDeathDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String) params.get(FieldConstant.ID_HUMP); - String name = (String) params.get("name"); - String idCard = (String) params.get("idCard"); - String mobile = (String) params.get("mobile"); - String startTime = (String) params.get("startTime"); - String endTime = (String) params.get("endTime"); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); - wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); - wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); - wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); - wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); - - return wrapper; - } - - @Override - public ChangeDeathDTO get(String id) { - ChangeDeathEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ChangeDeathDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result save(ChangeDeathDTO dto) { - RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); - formDTO.setUserId(dto.getUserId()); - formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); - Result result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); - - dto.setIdCard(result.getData().getIdCard()); - dto.setMobile(result.getData().getMobile()); - dto.setGridId(result.getData().getGridId()); - Map params = new HashMap<>(4); - params.put("idCard", dto.getIdCard()); - if (!list(params).isEmpty()) { - return new Result().error("该人员已经迁入死亡人口"); - } - - dto.setJoinDate(DateUtils.format(new Date())); - ChangeDeathEntity entity = ConvertUtils.sourceToTarget(dto, ChangeDeathEntity.class); - entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - insert(entity); - - if(dto.getWelfareFlag() != null && dto.getWelfareFlag()){ - ChangeWelfareDTO formDto = new ChangeWelfareDTO(); - formDto.setUserId(dto.getUserId()); - formDto.setName(dto.getName()); - formDto.setIdCard(result.getData().getIdCard()); - formDto.setMobile(result.getData().getMobile()); - formDto.setGridId(result.getData().getGridId()); - formDto.setGender(dto.getGender()); - formDto.setJoinReason("迁入死亡人口选定"); - formDto.setCustomerId(dto.getCustomerId()); - formDto.setCustomerId(formDTO.getCustomerId()); - changeWelfareService.saveWelfareInfo(formDto); - } - return new Result(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ChangeDeathDTO dto) { - ChangeDeathEntity entity = ConvertUtils.sourceToTarget(dto, ChangeDeathEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java deleted file mode 100644 index 29becf1..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.form.RentTenantDataFormDTO; -import com.epmet.dto.result.RentTenantDataResultDTO; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.plugin.power.dto.change.ChangeRelocationDTO; -import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.modules.change.dao.ChangeRelocationDao; -import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; -import com.epmet.plugin.power.modules.change.redis.ChangeRelocationRedis; -import com.epmet.plugin.power.modules.change.service.ChangeRelocationService; -import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; -import com.epmet.plugin.power.utils.IdentityNoUtils; -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-06 - */ -@Service -public class ChangeRelocationServiceImpl extends BaseServiceImpl implements ChangeRelocationService { - - @Autowired - private ChangeRelocationRedis changeRelocationRedis; - - @Autowired - LoginUserUtil loginUserUtil; - - @Autowired - private EpmetUserOpenFeignClient epmetUserOpenFeignClient; - - @Autowired - private ChangeWelfareService changeWelfareService; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ChangeRelocationDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ChangeRelocationDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - String name = (String) params.get("name"); - String idCard = (String) params.get("idCard"); - String mobile = (String) params.get("mobile"); - String startTime = (String) params.get("startTime"); - String endTime = (String) params.get("endTime"); - - String gridId = (String) params.get("gridId"); - String villageId = (String) params.get("villageId"); - String buildId = (String) params.get("buildId"); - String unitId = (String) params.get("unitId"); - String homeId = (String) params.get("homeId"); - - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); - wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); - wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); - wrapper.ge(StringUtils.isNotBlank(startTime), "OUT_OF_TIME", startTime); - wrapper.le(StringUtils.isNotBlank(endTime), "OUT_OF_TIME", endTime); - - wrapper.eq(StringUtils.isNotBlank(gridId), "AGENCY_ID", gridId); - wrapper.eq(StringUtils.isNotBlank(villageId), "VILLAGE_ID", villageId); - wrapper.eq(StringUtils.isNotBlank(buildId), "BUILD_ID", buildId); - wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); - wrapper.eq(StringUtils.isNotBlank(homeId), "HOME_ID", homeId); - - return wrapper; - } - - @Override - public ChangeRelocationDTO get(String id) { - ChangeRelocationEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ChangeRelocationDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ChangeRelocationDTO dto) { - ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ChangeRelocationDTO dto) { - ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public Result saveOutOfInfo(ChangeRelocationDTO dto) { - RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); - formDTO.setUserId(dto.getIcUserId()); - formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); - Result result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); - - dto.setIdCard(result.getData().getIdCard()); - dto.setMobile(result.getData().getMobile()); - - ChangeRelocationEntity entity = ConvertUtils.sourceToTarget(dto, ChangeRelocationEntity.class); - entity.setPid(dto.getAgencyId()); - entity.setAgencyId(dto.getGridId()); - entity.setAgencyName(dto.getGridName()); - entity.setAge(IdentityNoUtils.getAge(result.getData().getIdCard()).toString()); - entity.setAddress(dto.getVillageName()+dto.getBuildName()+dto.getUnitName()+dto.getHomeName()); - insert(entity); - - if(dto.getWelfareFlag() != null && dto.getWelfareFlag()){ - ChangeWelfareDTO formDto = new ChangeWelfareDTO(); - formDto.setUserId(dto.getIcUserId()); - formDto.setName(dto.getName()); - formDto.setIdCard(result.getData().getIdCard()); - formDto.setMobile(result.getData().getMobile()); - formDto.setGridId(result.getData().getGridId()); - if(StringUtils.isNotBlank(dto.getGender())){ - if("女".equals(dto.getGender())){ - formDto.setGender("0"); - }else if("男".equals(dto.getGender())){ - formDto.setGender("1"); - } - } - formDto.setJoinReason("迁出人员选定"); - formDto.setCustomerId(dto.getCustomerId()); - formDto.setCustomerId(formDTO.getCustomerId()); - changeWelfareService.saveWelfareInfo(formDto); - } - return new Result(); - } - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java deleted file mode 100644 index 671d8d7..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.epmet.plugin.power.modules.change.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.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.dto.form.RentTenantDataFormDTO; -import com.epmet.dto.result.RentTenantDataResultDTO; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; -import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO; -import com.epmet.plugin.power.modules.change.dao.ChangeWelfareDao; -import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; -import com.epmet.plugin.power.modules.change.redis.ChangeWelfareRedis; -import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; -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.*; - -/** - * 福利表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-05-09 - */ -@Service -public class ChangeWelfareServiceImpl extends BaseServiceImpl implements ChangeWelfareService { - - @Autowired - private ChangeWelfareRedis changeWelfareRedis; - - @Autowired - LoginUserUtil loginUserUtil; - - @Autowired - private EpmetUserOpenFeignClient epmetUserOpenFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ChangeWelfareDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ChangeWelfareDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String) params.get(FieldConstant.ID_HUMP); - String name = (String) params.get("name"); - String idCard = (String) params.get("idCard"); - String mobile = (String) params.get("mobile"); - String startTime = (String) params.get("startTime"); - String endTime = (String) params.get("endTime"); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); - wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); - wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); - wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime); - wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime); - - return wrapper; - } - - @Override - public ChangeWelfareDTO get(String id) { - ChangeWelfareEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ChangeWelfareDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result save(ChangeWelfareDTO dto) { - - - RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); - formDTO.setUserId(dto.getUserId()); - formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); - Result result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO); - - dto.setIdCard(result.getData().getIdCard()); - dto.setMobile(result.getData().getMobile()); - dto.setGridId(result.getData().getGridId()); - Map params = new HashMap<>(4); - params.put("idCard", dto.getIdCard()); - if (!list(params).isEmpty()) { - return new Result().error("该人员已经迁入福利人口"); - } - dto.setJoinDate(DateUtils.format(new Date())); - ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); - entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - insert(entity); - return new Result(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ChangeWelfareDTO dto) { - ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public Result removeWelfare(ChangeWelfareDTO dto) { - if(StringUtils.isBlank(dto.getId())){ - return new Result().error("id不可为空"); - } - dto.setRemoveDate(DateUtils.format(new Date())); - baseDao.removeWelfare(dto); - return new Result().ok("移除成功"); - } - - @Override - public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto) { - ChangeWelfareEntity entity = baseDao.selectByIdCard(dto.getIdCard()); - return entity == null? false: true; - } - - @Override - public Result saveWelfareInfo(ChangeWelfareDTO dto) { - Map params = new HashMap<>(4); - params.put("idCard", dto.getIdCard()); - if (!list(params).isEmpty()) { - return new Result().error("该人员已经迁入福利人口"); - } - dto.setJoinDate(DateUtils.format(new Date())); - ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); - insert(entity); - return new Result(); - } - -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml deleted file mode 100644 index 40db6d7..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeDeathDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml deleted file mode 100644 index cb7657c..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeRelocationDao.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml deleted file mode 100644 index b0afb3c..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - update pli_change_welfare - set REMOVE_DATE=#{removeDate}, - REMOVE_REASON=#{removeReason}, - del_flag='1' - where id=#{id} - - - - From 3dd73f9488bc2359f2339feb7eca89b3565090c0 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 12 May 2022 10:18:03 +0800 Subject: [PATCH 025/108] =?UTF-8?q?=E8=8D=A3=E8=AA=89=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/utils/IdentityNoUtils.java | 355 ------------------ 1 file changed, 355 deletions(-) delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java deleted file mode 100644 index 661d263..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/utils/IdentityNoUtils.java +++ /dev/null @@ -1,355 +0,0 @@ -package com.epmet.plugin.power.utils; - -import org.apache.commons.lang3.StringUtils; - -import java.io.Serializable; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.Date; -import java.util.Hashtable; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * 身份证号工具 - * - * @author yujintao - * @email yujintao@elink-cn.com - * @date 2019/9/7 13:11 - */ -public class IdentityNoUtils implements Serializable { - - /** - * 15位身份证号 - */ - private static final Integer FIFTEEN_ID_CARD = 15; - /** - * 18位身份证号 - */ - private static final Integer EIGHTEEN_ID_CARD = 18; - /** - * 数字格式校验 - */ - private static Pattern NUMBER_PATTERN = Pattern.compile("[0-9]*"); - /** - * 日期格式校验 - */ - private static Pattern DATE_PATTERN = Pattern.compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); - /** - * 18位身份证中最后一位校验码 - */ - private final static char[] VERIFY_CODE = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; - /** - * 18位身份证中,各个数字的生成校验码时的权值 - */ - private final static int[] VERIFY_CODE_WEIGHT = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; - - /** - * 根据身份证号获取性别 0女;1男 - * - * @param IDCard 完整身份证号码 - * @return java.lang.String - * @author work@yujt.net.cn - * @date 2019/9/20 14:26 - */ - public static String getSex(String IDCard) { - if (StringUtils.isNotBlank(IDCard)) { - if (IDCard.length() == FIFTEEN_ID_CARD) { - if (Integer.parseInt(IDCard.substring(14, 15)) % 2 == 0) { - return sexEnum.FEMALE.value; - } else { - return sexEnum.MALE.value; - } - } else if (IDCard.length() == EIGHTEEN_ID_CARD) { - if (Integer.parseInt(IDCard.substring(16).substring(0, 1)) % 2 == 0) { - return sexEnum.FEMALE.value; - } else { - return sexEnum.MALE.value; - } - } - } - return null; - } - - /** - * 根据身份证号获取年龄 - * - * @param IDCard 完整身份证号码 - * @return java.lang.Integer - * @author work@yujt.net.cn - * @date 2019/9/20 14:26 - */ - public static Integer getAge(String IDCard) { - int age; - LocalDate now = LocalDate.now(); - int nowYear = now.getYear(); - int nowMonth = now.getMonthValue(); - int cardYear = 0; - int cardMonth = 0; - if (StringUtils.isNotBlank(IDCard) && isValid(IDCard)) { - if (IDCard.length() == FIFTEEN_ID_CARD) { - // 身份证上的年份(15位身份证为1980年前的) - String uyear = "19" + IDCard.substring(6, 8); - cardYear = Integer.parseInt(uyear); - // 身份证上的月份 - String uyue = IDCard.substring(8, 10); - cardMonth = Integer.parseInt(uyue); - } else if (IDCard.length() == EIGHTEEN_ID_CARD) { - // 身份证上的年份 - String year = IDCard.substring(6).substring(0, 4); - cardYear = Integer.parseInt(year); - // 身份证上的月份 - String yue = IDCard.substring(10).substring(0, 2); - cardMonth = Integer.parseInt(yue); - } - } - // 当前月份大于用户出身的月份表示已过生日 - if (cardMonth <= nowMonth) { - age = nowYear - cardYear + 1; - // 当前用户还没过生 - } else { - age = nowYear - cardYear; - } - return age; - } - - /** - * 根据身份证号获取出生日期 - * - * @param IDCard 完整身份证号码 - * @return java.lang.String - * @author work@yujt.net.cn - * @date 2019/9/20 14:26 - */ - public static String getBirthday(String IDCard) { - String year = ""; - String month = ""; - String day = ""; - if (StringUtils.isNotBlank(IDCard)) { - //15位身份证号 - if (IDCard.length() == FIFTEEN_ID_CARD) { - // 身份证上的年份(15位身份证为1980年前的) - year = "19" + IDCard.substring(6, 8); - //身份证上的月份 - month = IDCard.substring(8, 10); - //身份证上的日期 - day = IDCard.substring(10, 12); - //18位身份证号 - } else if (IDCard.length() == EIGHTEEN_ID_CARD) { - // 身份证上的年份 - year = IDCard.substring(6).substring(0, 4); - // 身份证上的月份 - month = IDCard.substring(10).substring(0, 2); - //身份证上的日期 - day = IDCard.substring(12).substring(0, 2); - } - } - return year + "-" + month + "-" + day; - } - - /** - * 身份证验证是否有效 - * - * @param id 号码内容 - * @return boolean - * @author - * @date - */ - public static boolean isValid(String id) { - Boolean validResult = true; - //校验长度只能为15或18 - int len = id.length(); - if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD) { - validResult = false; - } - //校验生日 - if (!validDate(id)) { - validResult = false; - } - return validResult; - } - - /** - * 校验生日 - * - * @param id - * @return - */ - private static boolean validDate(String id) { - try { - String birth = id.length() == FIFTEEN_ID_CARD ? "19" + id.substring(6, 12) : id.substring(6, 14); - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - Date birthDate = sdf.parse(birth); - if (!birth.equals(sdf.format(birthDate))) { - return false; - } - } catch (ParseException e) { - return false; - } - return true; - } - - /** - * 验证身份证号码,验证通过返回null - * - * @param idStr 完整身份证号码 - * @return java.lang.String - * @author work@yujt.net.cn - * @date 2019/9/20 14:26 - */ - public static String IdentityNoVerification(String idStr) { - String iDCardNo = null; - //判断号码的长度 15位或18位 - if (idStr.length() != FIFTEEN_ID_CARD && idStr.length() != EIGHTEEN_ID_CARD) { - return "身份证号码长度应该为15位或18位"; - } - if (idStr.length() == EIGHTEEN_ID_CARD) { - iDCardNo = idStr.substring(0, 17); - } else if (idStr.length() == FIFTEEN_ID_CARD) { - iDCardNo = idStr.substring(0, 6) + "19" + idStr.substring(6, 15); - } - if (isStrNum(iDCardNo) == false) { - return "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字"; - } - //判断出生年月 - int year = Integer.parseInt(iDCardNo.substring(6, 10)); - String strMonth = iDCardNo.substring(10, 12); - String strDay = iDCardNo.substring(12, 14); - - String birthDay = year + "-" + strMonth + "-" + strDay; - if (isStrDate(birthDay) == false) { - return "身份证生日无效"; - } - LocalDate now = LocalDate.now(); - if ((now.getYear() - year) > 150 || now.isBefore(LocalDate.parse(birthDay))) { - return "身份证生日不在有效范围"; - } - int month = Integer.parseInt(strMonth); - if (month > 12 || month == 0) { - return "身份证月份无效"; - } - int day = Integer.parseInt(strDay); - if (day > 31 || day == 0) { - return "身份证日期无效"; - } - //判断地区码 - Hashtable h = GetAreaCode(); - if (h.get(iDCardNo.substring(0, 2)) == null) { - return "身份证地区编码错误"; - } - //判断最后一位 - int theLastOne = 0; - for (int i = 0; i < 17; i++) { - theLastOne = theLastOne + Integer.parseInt(String.valueOf(iDCardNo.charAt(i))) * VERIFY_CODE_WEIGHT[i]; - } - int modValue = theLastOne % 11; - char strVerifyCode = VERIFY_CODE[modValue]; - iDCardNo = iDCardNo + strVerifyCode; - if (idStr.length() == EIGHTEEN_ID_CARD && !iDCardNo.equals(idStr)) { - return "身份证无效,不是合法的身份证号码"; - } - return null; - } - - /** - * 地区代码 - * - * @return Hashtable - */ - private static Hashtable GetAreaCode() { - Hashtable hashtable = new Hashtable<>(); - hashtable.put("11", "北京"); - hashtable.put("12", "天津"); - hashtable.put("13", "河北"); - hashtable.put("14", "山西"); - hashtable.put("15", "内蒙古"); - hashtable.put("21", "辽宁"); - hashtable.put("22", "吉林"); - hashtable.put("23", "黑龙江"); - hashtable.put("31", "上海"); - hashtable.put("32", "江苏"); - hashtable.put("33", "浙江"); - hashtable.put("34", "安徽"); - hashtable.put("35", "福建"); - hashtable.put("36", "江西"); - hashtable.put("37", "山东"); - hashtable.put("41", "河南"); - hashtable.put("42", "湖北"); - hashtable.put("43", "湖南"); - hashtable.put("44", "广东"); - hashtable.put("45", "广西"); - hashtable.put("46", "海南"); - hashtable.put("50", "重庆"); - hashtable.put("51", "四川"); - hashtable.put("52", "贵州"); - hashtable.put("53", "云南"); - hashtable.put("54", "西藏"); - hashtable.put("61", "陕西"); - hashtable.put("62", "甘肃"); - hashtable.put("63", "青海"); - hashtable.put("64", "宁夏"); - hashtable.put("65", "新疆"); - hashtable.put("71", "台湾"); - hashtable.put("81", "香港"); - hashtable.put("82", "澳门"); - hashtable.put("91", "国外"); - return hashtable; - } - - /** - * 判断字符串是否为数字 - * - * @param str - * @return boolean - * @author work@yujt.net.cn - * @date 2019/9/20 13:58 - */ - private static boolean isStrNum(String str) { - Matcher isNum = NUMBER_PATTERN.matcher(str); - if (isNum.matches()) { - return true; - } else { - return false; - } - } - - /** - * 判断字符串是否为日期格式 - * - * @param strDate - * @return boolean - * @author work@yujt.net.cn - * @date 2019/9/20 13:57 - */ - public static boolean isStrDate(String strDate) { - Matcher m = DATE_PATTERN.matcher(strDate); - if (m.matches()) { - return true; - } else { - return false; - } - } - - enum sexEnum { - /** - * 暂停 - */ - FEMALE("0"), - /** - * 正常 - */ - MALE("1"); - - private String value; - - sexEnum(String value) { - this.value = value; - } - - public String value() { - return value; - } - } - -} From 85811157ef4ef26950eadc969d75148c68093f80 Mon Sep 17 00:00:00 2001 From: YUJT Date: Thu, 12 May 2022 10:46:57 +0800 Subject: [PATCH 026/108] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/commons/utils/NumUtils.java | 30 +++++++++++++++++++ .../form/PowerAxisServiceStationFormDTO.java | 9 +++++- .../PowerKernelHouseHoldViewListFormDTO.java | 15 ++++++++-- .../PowerAxisDataVisualController.java | 9 ++++-- .../PowerServiceStationController.java | 5 +++- .../modules/axis/dao/PowerAxisStructDao.java | 16 +++++++++- .../axis/dao/PowerKernelHouseholdDao.java | 2 -- .../axis/service/PowerAxisStructService.java | 15 ++++++++-- .../impl/PowerAxisStructServiceImpl.java | 23 +++++++------- .../impl/PowerKernelHouseholdServiceImpl.java | 28 +++++++++-------- .../impl/PowerServiceStationServiceImpl.java | 18 ++++++----- .../mapper/poweraxis/PowerAxisStructDao.xml | 13 ++++++++ .../poweraxis/PowerKernelHouseholdDao.xml | 15 ++-------- 13 files changed, 142 insertions(+), 56 deletions(-) create mode 100644 epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java new file mode 100644 index 0000000..58dfec3 --- /dev/null +++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.commons.utils; + +import com.epmet.commons.tools.constant.NumConstant; + +/*** + * 数字处理相关通用方法 + * @author work@yujt.net.cn + * @date 2022/5/12/0012 10:02 + */ +public class NumUtils { + + public final static int ONE_THOUSAND = 1000; + + /** + * 获取数值 + * + * @param number 数值,可能为空 + * @param excludeZero 数字不能为0 + * @param defaultNumber 默认值(数字为空值时 或 数值为0但excludeZero == true 时,使用默认值) + * @return int + * @author work@yujt.net.cn + * @date 2022/5/12/0012 10:11 + */ + public static int getNumberInt(Integer number, boolean excludeZero, int defaultNumber) { + if (null == number || (excludeZero && NumConstant.ZERO == number)) { + return defaultNumber; + } + return number; + } +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java index eb088e2..86cd108 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data @@ -9,7 +10,7 @@ public class PowerAxisServiceStationFormDTO implements Serializable { private static final long serialVersionUID = -8446905334792655596L; /** - *动力主轴节点id + * 动力主轴节点id */ private String axisStructId; /** @@ -19,5 +20,11 @@ public class PowerAxisServiceStationFormDTO implements Serializable { /** * 客户id */ + @NotBlank(message = "所属客户不能为空") private String customerId; + /** + * 组织id + */ + @NotBlank(message = "所属组织不能为空") + private String agencyId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java index c6ef16e..6f68885 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java @@ -2,6 +2,8 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @Data @@ -17,15 +19,24 @@ public class PowerKernelHouseHoldViewListFormDTO implements Serializable { /** * 页码 */ - private int pageNo; + @NotNull(message = "页码不能为空") + private Integer pageNo; /** * 条数 */ - private int pageSize; + @NotNull(message = "页容量不能为空") + private Integer pageSize; + + /** + * 组织id + */ + @NotBlank(message = "所属组织不能为空") + private String agencyId; /** * 客户id */ + @NotBlank(message = "所属客户不能为空") private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index 34a69fe..8242c23 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -14,7 +14,6 @@ import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; import java.util.List; /*** @@ -47,7 +46,9 @@ public class PowerAxisDataVisualController { * @date 2022/4/22 19:53 */ @PostMapping("serviceStation/listPosition") - public Result> getListPostition(@RequestBody PowerAxisServiceStationFormDTO form) { + public Result> getListPostition(@RequestBody PowerAxisServiceStationFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); return new Result().ok(powerServiceStationService.getListPosition(form)); } @@ -118,7 +119,9 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("kernelHousehold/list") - public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form) { + public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); List dto = powerKernelHouseholdService.getList(form); return ResultDTO.success("查询成功", dto, powerKernelHouseholdService.getTotal(form)); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java index cc183e1..61d5ba9 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java @@ -1,8 +1,10 @@ package com.epmet.plugin.power.modules.axis.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -48,7 +50,8 @@ public class PowerServiceStationController { @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody PowerServiceStationDTO dto){ + public Result save(@RequestBody PowerServiceStationDTO dto, @LoginUser TokenDto tokenDto){ + dto.setCustomerId(tokenDto.getCustomerId()); //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); powerServiceStationService.save(dto); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index 33f6571..d4831d5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -81,7 +81,7 @@ public interface PowerAxisStructDao extends BaseDao { int getKernelHouseHold(@Param("agencyId") String agencyId, @Param("customerId") String customerId); - int getServiceStation(@Param("agencyId") String agencyId,@Param("customerId") String customerId); + int getServiceStation(@Param("agencyId") String agencyId, @Param("customerId") String customerId); List getStructTree(PowerAxisStructStructTreeFormDTO form); @@ -111,4 +111,18 @@ public interface PowerAxisStructDao extends BaseDao { * @date 2022/4/24 19:29 */ String getCateGoryCode(String customerId, int level, String tagCateGory); + + /** + * 查询动力主轴跟节点 + * + * @param customerId 客户 + * @param agencyId 组织 + * @param structLevel 级别 {@link com.epmet.plugin.power.enums.PowerTagLevelEnum#ROOT} + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2022/5/12/0012 9:52 + */ + String getRootAxisStructId(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("structLevel") int structLevel); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java index d77247e..1509ff5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java @@ -54,6 +54,4 @@ public interface PowerKernelHouseholdDao extends BaseDao getPage(Map params); - String queryAxisStructId(@Param("agencyId") String agencyId, - @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java index 29a10ef..557dd09 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java @@ -122,7 +122,6 @@ public interface PowerAxisStructService extends BaseService getIdByAgencyId(String agencyId); /** - * * 关键指标统计 * * @param form @@ -142,7 +141,7 @@ public interface PowerAxisStructService extends BaseService getStructTree(PowerAxisStructStructTreeFormDTO form); - List getListPosition(int structLevel,PowerAxisDataListPositionFormDTO form); + List getListPosition(int structLevel, PowerAxisDataListPositionFormDTO form); /** * 根据节点接报,组装其上级节点树 @@ -154,4 +153,16 @@ public interface PowerAxisStructService extends BaseService listParentTreeByLevel(String structLevel, String customerId); + + /** + * 获取动力主轴根节点ID + * + * @param rootStructId 根节点ID,不为空直接返回该值 + * @param customerId 客户 + * @param agencyId 组织 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2022/5/12/0012 10:26 + */ + String getRootAxisStructId(String rootStructId, String customerId, String agencyId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index df6c554..34bad4f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -10,12 +10,11 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.TreeUtils; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.result.*; @@ -31,7 +30,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import javax.validation.constraints.NotBlank; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -45,9 +43,6 @@ import java.util.Map; @Service public class PowerAxisStructServiceImpl extends BaseServiceImpl implements PowerAxisStructService { - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired private PowerAxisTagService powerAxisTagService; @@ -186,11 +181,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl agencyInfoResult = govOrgOpenFeignClient.getAgencyById(agencyId); - if (!agencyInfoResult.success()) { - throw new EpmetException(agencyInfoResult.getCode(), agencyInfoResult.getMsg()); - } - CustomerAgencyDTO agencyInfo = agencyInfoResult.getData(); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); struct.setAgencyId(agencyInfo.getId()); struct.setAgencyName(agencyInfo.getOrganizationName()); struct.setAgencyType(agencyInfo.getLevel()); @@ -275,4 +266,12 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl result = baseDao.listParentTreeByLevel(Integer.parseInt(structLevel), customerId); return TreeUtils.build(result); } + + @Override + public String getRootAxisStructId(String rootStructId, String customerId, String agencyId) { + if (StringUtils.isNotBlank(rootStructId)) { + return rootStructId; + } + return baseDao.getRootAxisStructId(customerId, agencyId, PowerTagLevelEnum.ROOT.level()); + } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java index 453bd88..579b5b5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.plugin.commons.utils.NumUtils; import com.epmet.plugin.power.dto.axis.PowerKernelHouseholdDTO; import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseFormDTO; import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO; @@ -24,14 +25,15 @@ import com.epmet.plugin.power.dto.axis.result.PowerKernelListPostitionResultDTO; import com.epmet.plugin.power.dto.axis.result.PowerkernelMemberListResultDTO; import com.epmet.plugin.power.modules.axis.dao.PowerKernelHouseholdDao; import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; +import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; import com.google.common.collect.Sets; +import org.apache.commons.compress.utils.Lists; 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 javax.validation.constraints.NotBlank; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -54,6 +56,9 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl page(Map params) { @@ -123,8 +128,12 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getList(PowerKernelHouseHoldViewListFormDTO form) { - form.setPageNo((form.getPageNo() - 1) * form.getPageSize()); - form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), form.getCustomerId(), form.getAgencyId()); + if (StringUtils.isBlank(axisStructId)) { + return Lists.newArrayList(); + } + form.setAxisStructId(axisStructId); + form.setPageNo((form.getPageNo() - NumConstant.ONE) * form.getPageSize()); List list = baseDao.getList(form); for (PowerKernelHouseHoldViewListResultDTO dto : list) { List nameList = dto.getKernelMemberList().stream().map(PowerkernelMemberListResultDTO::getKernelMemberName).distinct().collect(Collectors.toList()); @@ -135,22 +144,17 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getListPosition(PowerKernelListPostitionFormDTO form) { - Integer limit = form.getLimit(); - if (null == limit || NumConstant.ZERO_L == limit) { - limit = 999; - } - String axisStructId = form.getAxisStructId(); + String customerId = form.getCustomerId(); + String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), customerId, form.getAgencyId()); if (StringUtils.isBlank(axisStructId)) { - String agencyId = form.getAgencyId(); - axisStructId = baseDao.queryAxisStructId(agencyId,form.getCustomerId()); + return Lists.newArrayList(); } - return baseDao.queryListPosition(axisStructId, form.getCustomerId(), limit); + return baseDao.queryListPosition(axisStructId, customerId, NumUtils.getNumberInt(form.getLimit(), true, NumUtils.ONE_THOUSAND)); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java index 41268f5..379cf79 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java @@ -6,14 +6,16 @@ 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.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.plugin.commons.utils.NumUtils; import com.epmet.plugin.power.dto.axis.PowerServiceStationDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisServiceStationFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisServiceStationResultDTO; import com.epmet.plugin.power.modules.axis.dao.PowerServiceStationDao; import com.epmet.plugin.power.modules.axis.entity.PowerServiceStationEntity; +import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService; +import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -32,9 +34,8 @@ import java.util.Map; @Service public class PowerServiceStationServiceImpl extends BaseServiceImpl implements PowerServiceStationService { - @Autowired - private LoginUserUtil loginUser; + private PowerAxisStructService powerAxisStructService; @Override public PageData page(Map params) { @@ -74,7 +75,6 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl getListPosition(PowerAxisServiceStationFormDTO form) { - form.setCustomerId(loginUser.getLoginUserCustomerId()); - List list = baseDao.getListPosition(form); - return list; + String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), form.getCustomerId(), form.getAgencyId()); + if (StringUtils.isBlank(axisStructId)) { + return Lists.newArrayList(); + } + form.setAxisStructId(axisStructId); + form.setLimit(NumUtils.getNumberInt(form.getLimit(), true, NumUtils.ONE_THOUSAND)); + return baseDao.getListPosition(form); } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 7dc6687..3db8a0e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -244,6 +244,19 @@ AND s.AGENCY_ID = #{agencyId} AND h.CUSTOMER_ID = #{customerId} + \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml index de66e46..ae3fce4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml @@ -128,7 +128,8 @@ GROUP BY h.HOUSE_ID ORDER BY - s.SORT + s.SORT,h.CREATED_TIME + LIMIT #{limit} @@ -171,17 +172,5 @@ ORDER BY h.CREATED_TIME - - \ No newline at end of file From 1abeadadbba6a3d5d2e0a7ff389883d39df065f1 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 12 May 2022 10:52:46 +0800 Subject: [PATCH 027/108] =?UTF-8?q?=E5=85=88=E5=85=B3=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 10 +++++----- .../rent/service/impl/RentHouseServiceImpl.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 97f41ae..8356c1f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -218,11 +218,11 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); - IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); - formDTO.setRentFlag(NumConstant.ONE); - govOrgOpenFeignClient.houseUpdate(formDTO); +// // 更新房屋的状态为租赁 +// Result houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); +// IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); +// formDTO.setRentFlag(NumConstant.ONE); +// govOrgOpenFeignClient.houseUpdate(formDTO); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index d945038..b6ceaa5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -96,11 +96,11 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Thu, 12 May 2022 10:58:17 +0800 Subject: [PATCH 028/108] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 10 +++++----- .../rent/service/impl/RentHouseServiceImpl.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 8356c1f..97f41ae 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -218,11 +218,11 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); -// IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); -// formDTO.setRentFlag(NumConstant.ONE); -// govOrgOpenFeignClient.houseUpdate(formDTO); + // 更新房屋的状态为租赁 + Result houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); + IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); + formDTO.setRentFlag(NumConstant.ONE); + govOrgOpenFeignClient.houseUpdate(formDTO); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index b6ceaa5..d945038 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -96,11 +96,11 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Fri, 13 May 2022 10:11:30 +0800 Subject: [PATCH 029/108] =?UTF-8?q?=E7=A7=81=E6=9C=89=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentBlacklistServiceImpl.java | 2 +- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 2 +- .../modules/rent/service/impl/RentTenantInfoServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java index 352fd81..a1c4e79 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -43,7 +43,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl page(Map params) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 97f41ae..322eee4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -52,7 +52,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Fri, 13 May 2022 10:19:43 +0800 Subject: [PATCH 030/108] =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/controller/RentBlacklistController.java | 1 + .../rent/controller/RentContractFileController.java | 7 ------- .../rent/controller/RentContractInfoController.java | 1 + .../power/modules/rent/controller/RentHouseController.java | 1 + .../modules/rent/controller/RentTenantInfoController.java | 1 + 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java index a7f68f2..5e71999 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java @@ -70,6 +70,7 @@ public class RentBlacklistController { return new Result(); } + @NoRepeatSubmit @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = rentBlacklistService.list(params); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java index 67f4f08..69de084 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java @@ -71,11 +71,4 @@ public class RentContractFileController { return new Result(); } - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = rentContractFileService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, RentContractFileExcel.class); - } - - } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index fcbfb40..64826f9 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -79,6 +79,7 @@ public class RentContractInfoController { return new Result(); } + @NoRepeatSubmit @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = rentContractInfoService.list(params); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java index bf9481d..eb0dd62 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java @@ -71,6 +71,7 @@ public class RentHouseController { return new Result(); } + @NoRepeatSubmit @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = rentHouseService.list(params); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 2b664f8..e28ac56 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -84,6 +84,7 @@ public class RentTenantInfoController { return new Result(); } + @NoRepeatSubmit @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = rentTenantInfoService.list(params); From 881cd4ccd291038a3c02de545ccce27669f87384 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 13 May 2022 10:54:48 +0800 Subject: [PATCH 031/108] =?UTF-8?q?=20=E6=96=B0=E7=89=88=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.4__pli_rent.sql | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.4__pli_rent.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.4__pli_rent.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.4__pli_rent.sql new file mode 100644 index 0000000..29ae249 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.4__pli_rent.sql @@ -0,0 +1,135 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_test_user + Source Server Type : MySQL + Source Server Version : 50732 + Source Host : 118.190.150.119:13306 + Source Schema : epmet_pli_power + + Target Server Type : MySQL + Target Server Version : 50732 + File Encoding : 65001 + + Date: 13/05/2022 10:53:09 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for pli_rent_tenant_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_rent_tenant_info`; +CREATE TABLE `pli_rent_tenant_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `CONTRACT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合同ID', + `NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名', + `ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证', + `MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', + `YFZGX` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '与房主关系', + `TYPE` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '人员类型 0:房东 1:租客', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `STATE` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用)', + `REASON` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核原因', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `idx_cid`(`CONTRACT_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '租客表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for pli_rent_contract_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_rent_contract_info`; +CREATE TABLE `pli_rent_contract_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `COMMUNITY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '社区ID', + `COMMUNITY_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社区', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格ID', + `GRID_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格', + `VILLAGE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房屋小区ID', + `VILLAGE_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房屋小区', + `BUILD_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '楼号ID', + `BUILD_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '楼号', + `UNIT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单元ID', + `UNIT_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单元', + `HOME_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房屋ID', + `HOME_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房屋', + `OWNER_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房主姓名', + `STATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态:0未审核,1审核通过,2审核不通过', + `LESSOR_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出租人姓名', + `LESSOR_ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出租人身份证', + `LESSOR_MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出租人手机', + `LESSEE_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '承租人姓名', + `LESSEE_ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '承租人身份证', + `LESSEE_MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '承租人手机', + `SIGN_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '签署日期', + `REVIEW_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核日期', + `START_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合同开始日期', + `END_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合同结束日期', + `REASON` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核-原因', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `epdc_master_topic_USER_ID_IDX`(`HOME_NAME`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '合同表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for pli_rent_contract_file +-- ---------------------------- +DROP TABLE IF EXISTS `pli_rent_contract_file`; +CREATE TABLE `pli_rent_contract_file` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', + `REFERENCE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '引用ID', + `FILE_URL` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件地址', + `FILE_TYPE` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件类型 0:图片,1 文件(合同)', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识 0:未删除,1:删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `idx_rid`(`REFERENCE_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '附件表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for pli_rent_blacklist +-- ---------------------------- +DROP TABLE IF EXISTS `pli_rent_blacklist`; +CREATE TABLE `pli_rent_blacklist` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `USER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'epmet用户主键', + `NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名', + `ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '身份证', + `MOBILE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', + `GENDER` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别 0女 1男', + `TYPE` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型 0 租客 1 房东', + `JOIN_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '加入时间', + `JOIN_REASON` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '加入原因', + `REMOVE_DATE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '移除时间', + `REMOVE_REASON` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '移除原因', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'epmet网格ID', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `epdc_master_topic_USER_ID_IDX`(`USER_ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '黑名单表' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; From 0d7e86e15745d5b42c5c8285f9ef8628aa3e79a0 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 13 May 2022 18:41:53 +0800 Subject: [PATCH 032/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentBlacklistServiceImpl.java | 4 ++++ .../rent/service/impl/RentContractInfoServiceImpl.java | 4 ++++ .../modules/rent/service/impl/RentHouseServiceImpl.java | 8 ++++++++ .../rent/service/impl/RentTenantInfoServiceImpl.java | 5 +++++ .../main/resources/mapper/rent/RentContractInfoDao.xml | 3 +++ .../src/main/resources/mapper/rent/RentTenantInfoDao.xml | 3 +++ 6 files changed, 27 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java index a1c4e79..bca0d53 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java @@ -47,6 +47,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) @@ -56,6 +57,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl list(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); List entityList = baseDao.selectList(getWrapper(params)); return ConvertUtils.sourceToTarget(entityList, RentBlacklistDTO.class); @@ -68,6 +70,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -76,6 +79,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); IPage page = getPage(params); List list = baseDao.getContractInfoList(params); return new PageData<>(list, page.getTotal()); @@ -75,6 +76,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl list(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); List entityList = baseDao.selectList(getWrapper(params)); return ConvertUtils.sourceToTarget(entityList, RentContractInfoDTO.class); @@ -98,6 +100,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -115,6 +118,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) @@ -48,6 +53,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl list(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); List entityList = baseDao.selectList(getWrapper(params)); return ConvertUtils.sourceToTarget(entityList, RentHouseDTO.class); @@ -66,6 +72,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -80,6 +87,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) @@ -59,6 +60,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl page4Landlord(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); IPage page = getPage(params); List list = baseDao.getLandlordList(params); return new PageData<>(list, page.getTotal()); @@ -66,6 +68,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl list(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); List entityList = baseDao.selectList(getWrapper(params)); return ConvertUtils.sourceToTarget(entityList, RentTenantInfoDTO.class); @@ -77,6 +80,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -84,6 +88,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl + AND i.CUSTOMER_ID = #{customerId} + AND i.GRID_ID = #{gridId} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index 6c16af5..fdd7959 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -50,6 +50,9 @@ WHERE DEL_FLAG = '0' AND TYPE = '0' + + AND CUSTOMER_ID = #{customerId} + AND STATE = #{state} From 044ce03495e836f1f33cfa2bc420205fdd92f2b2 Mon Sep 17 00:00:00 2001 From: zhangyuan <467571768@qq.com> Date: Fri, 13 May 2022 23:31:39 +0800 Subject: [PATCH 033/108] house --- .../db/migration/V0.0.5__pli_rent_house.sql | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.5__pli_rent_house.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.5__pli_rent_house.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.5__pli_rent_house.sql new file mode 100644 index 0000000..eb90622 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.5__pli_rent_house.sql @@ -0,0 +1,63 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_test_user + Source Server Type : MySQL + Source Server Version : 50732 + Source Host : 118.190.150.119:13306 + Source Schema : epmet_pli_power + + Target Server Type : MySQL + Target Server Version : 50732 + File Encoding : 65001 + + Date: 13/05/2022 10:53:09 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for pli_rent_tenant_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_rent_house`; + +CREATE TABLE `pli_rent_house` ( + `ID` varchar(64) NOT NULL COMMENT '', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT 'ͻid', + `NEIGHBOR_HOOD_ID` varchar(64) DEFAULT NULL COMMENT 'Сid', + `PART_ID` varchar(64) DEFAULT NULL COMMENT 'Ƭidneighbor_hood_part.id,Ϊա', + `BUILDING_ID` varchar(64) DEFAULT NULL COMMENT '¥id', + `BUILDING_UNIT_ID` varchar(64) DEFAULT NULL COMMENT 'Ԫid', + `HOUSE_NAME` varchar(64) DEFAULT NULL COMMENT 'ֺ̨ʱ', + `DOOR_NAME` varchar(64) DEFAULT NULL COMMENT 'ƺ', + `HOUSE_TYPE` varchar(32) DEFAULT NULL COMMENT 'ͣ1¥2ƽ3', + `PURPOSE` varchar(32) DEFAULT NULL COMMENT '洢ֵvalue', + `RENT_FLAG` tinyint(1) DEFAULT NULL COMMENT '1 0ס 2', + `OWNER_NAME` varchar(32) DEFAULT '' COMMENT '', + `OWNER_PHONE` varchar(32) DEFAULT '' COMMENT '绰', + `OWNER_ID_CARD` varchar(32) DEFAULT '' COMMENT '֤', + `SORT` decimal(6,2) DEFAULT '0.00' COMMENT '', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT 'ɾʶ 0δɾ1ɾ', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT 'ֹ', + `CREATED_BY` varchar(32) NOT NULL COMMENT '', + `CREATED_TIME` datetime NOT NULL COMMENT 'ʱ', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '', + `UPDATED_TIME` datetime NOT NULL COMMENT 'ʱ', + `COMMUNITY_ID` varchar(32) NOT NULL COMMENT 'ID', + `COMMUNITY_NAME` varchar(32) DEFAULT NULL COMMENT '', + `GRID_ID` varchar(32) NOT NULL COMMENT 'ID', + `GRID_NAME` varchar(32) DEFAULT NULL COMMENT '', + `VILLAGE_ID` varchar(32) DEFAULT NULL COMMENT 'СID', + `VILLAGE_NAME` varchar(32) DEFAULT NULL COMMENT 'С', + `BUILD_ID` varchar(32) DEFAULT NULL COMMENT '¥ID', + `BUILD_NAME` varchar(32) DEFAULT NULL COMMENT '¥', + `UNIT_ID` varchar(32) DEFAULT NULL COMMENT 'ԪID', + `UNIT_NAME` varchar(32) DEFAULT NULL COMMENT 'Ԫ', + `HOME_ID` varchar(32) DEFAULT NULL COMMENT 'ID', + `HOME_NAME` varchar(32) DEFAULT NULL COMMENT '', + `PURCHASE_DATE` varchar(32) DEFAULT NULL COMMENT '', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_building_id` (`BUILDING_ID`) USING BTREE COMMENT '¥id', + KEY `idx_hood_id` (`NEIGHBOR_HOOD_ID`) USING BTREE COMMENT 'Сid' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Ϣ'; \ No newline at end of file From 0f39e0900ffb2a8dda3202b493325619b881d61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B2=E6=A0=91=E9=80=9A?= <1976590620@qq.com> Date: Fri, 13 May 2022 23:56:33 +0800 Subject: [PATCH 034/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/modules/rent/controller/RentHouseController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java index eb0dd62..b4a4f1d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java @@ -1,5 +1,6 @@ package com.epmet.plugin.power.modules.rent.controller; +import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -75,6 +76,11 @@ public class RentHouseController { @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = rentHouseService.list(params); + if(CollectionUtils.isEmpty(list)){ + RentHouseDTO dto = new RentHouseDTO(); + dto.setId(""); + list.add(dto); + } ExcelUtils.exportExcelToTarget(response, null, list, RentHouseExcel.class); } From ade5ded5d174ffb9b4902d1037544cfc871d1165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B2=E6=A0=91=E9=80=9A?= <1976590620@qq.com> Date: Sat, 14 May 2022 10:42:23 +0800 Subject: [PATCH 035/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.6__pli_rent_house.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house.sql new file mode 100644 index 0000000..3b3798c --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house.sql @@ -0,0 +1,25 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_test_user + Source Server Type : MySQL + Source Server Version : 50732 + Source Host : 118.190.150.119:13306 + Source Schema : epmet_pli_power + + Target Server Type : MySQL + Target Server Version : 50732 + File Encoding : 65001 + + Date: 13/05/2022 10:53:09 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for pli_rent_tenant_info +-- ---------------------------- + + +ALTER TABLE pli_rent_house MODIFY COLUMN COMMUNITY_ID VARCHAR(32) DEFAULT NULL ; \ No newline at end of file From dd752a9694e16fb7da2b629187436d9e47f2ee56 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 16 May 2022 09:19:22 +0800 Subject: [PATCH 036/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A4=BE=E5=8C=BAID?= =?UTF-8?q?=E9=9D=9E=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.6__pli_rent_house_update.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql new file mode 100644 index 0000000..8fbcbd7 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql @@ -0,0 +1 @@ +ALTER TABLE epmet_pli_power.pli_rent_house MODIFY COLUMN COMMUNITY_ID varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '社区ID'; From 7724c425817e14861e792e9cf33bed4580252e65 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 17 May 2022 09:16:00 +0800 Subject: [PATCH 037/108] =?UTF-8?q?=E8=B5=8B=E5=80=BChouseId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 36f0698..684e42f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -226,6 +226,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl houseInfo = govOrgOpenFeignClient.get(dto.getHomeId()); IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class); formDTO.setRentFlag(NumConstant.ONE); + formDTO.setHouseId(dto.getHomeId()); govOrgOpenFeignClient.houseUpdate(formDTO); } } From 3ca0cd705dcf5c955d123512b457e452f84a2e50 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 17 May 2022 09:26:14 +0800 Subject: [PATCH 038/108] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=9A=84=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E4=B9=9F=E9=9C=80=E8=A6=81houseId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/modules/rent/service/impl/RentHouseServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java index 60e3d30..c806972 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentHouseServiceImpl.java @@ -107,6 +107,7 @@ public class RentHouseServiceImpl extends BaseServiceImpl Date: Tue, 17 May 2022 09:39:27 +0800 Subject: [PATCH 039/108] =?UTF-8?q?=E5=88=A0=E6=8E=89flyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.6__pli_rent_house_update.sql | 1 - 1 file changed, 1 deletion(-) delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql deleted file mode 100644 index 8fbcbd7..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.6__pli_rent_house_update.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE epmet_pli_power.pli_rent_house MODIFY COLUMN COMMUNITY_ID varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '社区ID'; From c41dead91b4c581b1c1921897927278aa9ce4e6b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 17 May 2022 19:44:42 +0800 Subject: [PATCH 040/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=87=BA=E7=A7=9F?= =?UTF-8?q?=E4=BA=BA=E4=B8=8E=E6=88=BF=E4=B8=9C=E5=85=B3=E7=B3=BB=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java | 5 +++++ .../power/modules/rent/entity/RentContractInfoEntity.java | 5 +++++ .../db/migration/V0.0.7__pli_rent_contract_update.sql | 2 ++ .../src/main/resources/mapper/rent/RentContractInfoDao.xml | 1 + 4 files changed, 13 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.7__pli_rent_contract_update.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index c540588..e456d66 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -123,6 +123,11 @@ public class RentContractInfoDTO implements Serializable { @NotBlank(message = "出租人手机不能为空") private String lessorMobile; + /** + * 出租人与户主关系 + */ + private String lessorRelation; + /** * 承租人姓名 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java index 11b0433..bb6f79a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java @@ -106,6 +106,11 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String lessorMobile; + /** + * 出租人与户主关系 + */ + private String lessorRelation; + /** * 承租人姓名 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.7__pli_rent_contract_update.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.7__pli_rent_contract_update.sql new file mode 100644 index 0000000..7e439d5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.7__pli_rent_contract_update.sql @@ -0,0 +1,2 @@ +ALTER TABLE epmet_pli_power.pli_rent_contract_info ADD LESSOR_RELATION varchar(32) NULL COMMENT '出租人与户主关系'; +ALTER TABLE epmet_pli_power.pli_rent_contract_info CHANGE LESSOR_RELATION LESSOR_RELATION varchar(32) NULL COMMENT '出租人与户主关系' AFTER LESSOR_MOBILE; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index f7e75d2..1ab3135 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -18,6 +18,7 @@ + From 513d60779595625d5d6c4e38be386a816493f729 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 17 May 2022 20:01:18 +0800 Subject: [PATCH 041/108] =?UTF-8?q?=E6=9C=89dataflag=E6=97=B6=E5=8F=AA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=87=AA=E5=B7=B1=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 684e42f..9f67d66 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -96,12 +96,15 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); @@ -116,10 +119,13 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Tue, 17 May 2022 20:02:00 +0800 Subject: [PATCH 042/108] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 684e42f..9f67d66 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -96,12 +96,15 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); @@ -116,10 +119,13 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Tue, 17 May 2022 20:46:42 +0800 Subject: [PATCH 043/108] =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E7=85=A7=E7=89=87=E5=92=8C=E4=B8=AD=E4=BB=8B=E8=B5=84?= =?UTF-8?q?=E6=96=99=E7=9A=84=E4=BF=9D=E5=AD=98=E5=92=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/rent/RentContractInfoDTO.java | 5 ++ .../power/dto/rent/RentTenantInfoDTO.java | 6 +++ .../rent/entity/RentTenantInfoEntity.java | 6 +++ .../rent/service/RentContractFileService.java | 11 +++++ .../impl/RentContractFileServiceImpl.java | 8 +++ .../impl/RentContractInfoServiceImpl.java | 49 +++++++++++++------ .../impl/RentTenantInfoServiceImpl.java | 25 ++++++++-- 7 files changed, 91 insertions(+), 19 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index e456d66..1a8a3ee 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -186,6 +186,11 @@ public class RentContractInfoDTO implements Serializable { @NotEmpty private List fileList; + /** + * 中介资料 + */ + private List agencyImgList; + /** * 是否黑名单 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 8fb17d8..96df344 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -88,4 +88,10 @@ public class RentTenantInfoDTO implements Serializable { @NotEmpty private List imgList; + /** + * 身份证列表 + */ + @NotEmpty + private List idCardImgList; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 1e9c599..973d9ac 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -75,4 +75,10 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { @TableField(exist = false) private List imgList; + /** + * 身份证照片列表 + */ + @TableField(exist = false) + private List idCardImgList; + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java index bb0b789..612e149 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java @@ -85,4 +85,15 @@ public interface RentContractFileService extends BaseService params); + + /** + * 查出对应资料 + * + * @param referenceId + * @param fileType + * @return java.util.List + * @author zhy + * @date 2022/5/17 20:31 + */ + List listByRefAndType(String referenceId, String fileType); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java index e362927..dffa8a0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -96,4 +97,11 @@ public class RentContractFileServiceImpl extends BaseServiceImpl listByRefAndType(String referenceId, String fileType) { + Map params = new HashMap<>(4); + params.put("referenceId", referenceId); + params.put("fileType", fileType); + return list(params); + } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 9f67d66..1c60953 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -141,21 +141,16 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { // 租客信息补充照片信息 - Map imgParams = new HashMap<>(4); - imgParams.put("referenceId", item.getId()); - imgParams.put("fileType", NumConstant.ZERO_STR); - List imgList = rentContractFileService.list(imgParams); - item.setImgList(imgList); + item.setImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.ZERO_STR)); + // 租客信息补充身份证照片信息 + item.setIdCardImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.TWO_STR)); }); dto.setTenantList(tenantList); dto.setTenantNum(tenantList.size()); // 取出合同文件信息 - Map fileParams = new HashMap<>(4); - fileParams.put("referenceId", dto.getId()); - fileParams.put("fileType", NumConstant.ONE_STR); - List fileList = rentContractFileService.list(fileParams); - dto.setFileList(fileList); + dto.setFileList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.ONE_STR)); + dto.setAgencyImgList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.THREE_STR)); return dto; } @@ -191,10 +186,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl imgParams = new HashMap<>(4); - imgParams.put("referenceId", tenant.getId()); - imgParams.put("fileType", NumConstant.ZERO_STR); - List imgList = rentContractFileService.list(imgParams); + List imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR); imgList.forEach(img -> { // 更新基础库的人员头像 @@ -275,13 +267,17 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { if (null == tenant.getImgList() || tenant.getImgList().isEmpty()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "租客照片不能为空"); @@ -294,9 +290,21 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl idCardImgList = ConvertUtils.sourceToTarget(tenant.getIdCardImgList(), RentContractFileEntity.class); + idCardImgList.forEach(img -> { + img.setReferenceId(tenant.getId()); + img.setFileType(NumConstant.TWO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentContractFileService.insertBatch(idCardImgList); + } }); } + // 附件处理 if (null == dto.getFileList() || dto.getFileList().isEmpty()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "合同附件不能为空"); } else { @@ -308,6 +316,17 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl 0) { + List fileList = ConvertUtils.sourceToTarget(dto.getAgencyImgList(), RentContractFileEntity.class); + fileList.forEach(item -> { + item.setReferenceId(contractId); + item.setFileType(NumConstant.THREE_STR); + item.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentContractFileService.insertBatch(fileList); + } return new Result(); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index d8d4bc4..33ac5ea 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -104,6 +104,13 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl imgList = rentContractFileService.list(params); dto.setImgList(imgList); + // 补充身份证照片信息 + params = new HashMap<>(4); + params.put("referenceId", id); + params.put("fileType", NumConstant.TWO_STR); + List idCardImgList = rentContractFileService.list(params); + dto.setIdCardImgList(idCardImgList); + return dto; } @@ -121,6 +128,8 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl idCardImgList = ConvertUtils.sourceToTarget(dto.getIdCardImgList(), RentContractFileEntity.class); + idCardImgList.forEach(img -> { + img.setReferenceId(entity.getId()); + img.setFileType(NumConstant.TWO_STR); + img.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + }); + rentContractFileService.insertBatch(idCardImgList); + // // 如果是房东信息立马去更新照片 // if (NumConstant.ZERO_STR.equals(dto.getType())) { // RentTenantFormDTO formDTO = new RentTenantFormDTO(); From e2ff7924b35d7866d68482a9e3a7f4dd238ea043 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 18 May 2022 15:53:31 +0800 Subject: [PATCH 044/108] =?UTF-8?q?=E5=8F=AA=E6=9F=A5=E8=AF=A2=E8=87=AA?= =?UTF-8?q?=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 3 +++ .../src/main/resources/mapper/rent/RentContractInfoDao.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 1c60953..9b22c46 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -69,6 +69,9 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) { params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + if (StringUtils.isNotBlank((String) params.get("dataFlag"))) { + params.put("createdBy", loginUserUtil.getLoginUserId()); + } IPage page = getPage(params); List list = baseDao.getContractInfoList(params); return new PageData<>(list, page.getTotal()); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index 1ab3135..3c7f712 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -95,6 +95,9 @@ AND i.SIGN_DATE <= #{endTime} + + AND i.CREATED_BY = #{createdBy} + AND DATE( i.END_DATE ) <= DATE_ADD( curdate(), INTERVAL 1 MONTH ) From 9963cca077affc536fe2fefb2cc5f1f002d86f76 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 19 May 2022 10:24:18 +0800 Subject: [PATCH 045/108] =?UTF-8?q?=E7=A7=9F=E5=AE=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=89=E7=A7=8D=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentTenantInfoDTO.java | 15 +++++++++++++++ .../modules/rent/entity/RentTenantInfoEntity.java | 15 +++++++++++++++ .../V0.0.8__pli_rent_tenant_info_update.sql | 3 +++ .../resources/mapper/rent/RentTenantInfoDao.xml | 5 ++++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.8__pli_rent_tenant_info_update.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 96df344..772ddf2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -82,6 +82,21 @@ public class RentTenantInfoDTO implements Serializable { ) private Date updatedTime; + /** + * 政治面貌 + */ + private String politicalStatus; + + /** + * 是否服兵役【是:1 否:0】 + */ + private String isMilitary; + + /** + * 国籍 + */ + private String nation; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index 973d9ac..e45aefb 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -69,6 +69,21 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { */ private String customerId; + /** + * 政治面貌 + */ + private String politicalStatus; + + /** + * 是否服兵役【是:1 否:0】 + */ + private String isMilitary; + + /** + * 国籍 + */ + private String nation; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.8__pli_rent_tenant_info_update.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.8__pli_rent_tenant_info_update.sql new file mode 100644 index 0000000..541e6d7 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.8__pli_rent_tenant_info_update.sql @@ -0,0 +1,3 @@ +ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD POLITICAL_STATUS varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '政治面貌'; +ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD IS_MILITARY varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '是否服兵役【是:1 否:0】'; +ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD NATION varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '国籍'; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml index fdd7959..b355a83 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentTenantInfoDao.xml @@ -44,7 +44,10 @@ TYPE, STATE, CREATED_TIME, - UPDATED_TIME + UPDATED_TIME, + POLITICAL_STATUS, + IS_MILITARY, + NATION FROM pli_rent_tenant_info WHERE From 6555f5b5bdec376aa93a77ed1a4c18ee58610aa6 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 19 May 2022 10:45:43 +0800 Subject: [PATCH 046/108] =?UTF-8?q?=E5=90=88=E5=90=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF=E5=AE=9E?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/controller/RentContractInfoController.java | 3 ++- .../modules/rent/service/RentContractInfoService.java | 2 +- .../rent/service/impl/RentContractInfoServiceImpl.java | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index 64826f9..3173018 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -50,7 +50,8 @@ public class RentContractInfoController { public Result save(@RequestBody RentContractInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return rentContractInfoService.save(dto); + rentContractInfoService.save(dto); + return new Result(); } @NoRepeatSubmit diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java index 5a552ea..64d9e37 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -55,7 +55,7 @@ public interface RentContractInfoService extends BaseService params = new HashMap<>(8); params.put("contractId", contractId); params.put("referenceId", contractId); @@ -330,7 +331,6 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Mon, 23 May 2022 09:02:57 +0800 Subject: [PATCH 047/108] =?UTF-8?q?=E6=9A=82=E5=AD=98=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=92=8C=E7=A4=BE=E5=8C=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/plugin/power/dto/.gitkeep | 0 .../power/dto/hik/HikCommunityInfoDTO.java | 94 +++++++++++++++++++ .../power/dto/hik/HikDeviceInfoDTO.java | 94 +++++++++++++++++++ .../pli-power-base-server/pom.xml | 27 +++++- .../power/config/HikCloudProperties.java | 54 +++++++++++ .../HikCommunityInfoController.java | 82 ++++++++++++++++ .../controller/HikDeviceInfoController.java | 82 ++++++++++++++++ .../modules/hik/dao/HikCommunityInfoDao.java | 16 ++++ .../modules/hik/dao/HikDeviceInfoDao.java | 16 ++++ .../hik/entity/HikCommunityInfoEntity.java | 64 +++++++++++++ .../hik/entity/HikDeviceInfoEntity.java | 64 +++++++++++++ .../hik/excel/HikCommunityInfoExcel.java | 63 +++++++++++++ .../modules/hik/excel/HikDeviceInfoExcel.java | 63 +++++++++++++ .../hik/redis/HikCommunityInfoRedis.java | 30 ++++++ .../modules/hik/redis/HikDeviceInfoRedis.java | 30 ++++++ .../hik/service/HikCommunityInfoService.java | 78 +++++++++++++++ .../hik/service/HikDeviceInfoService.java | 78 +++++++++++++++ .../impl/HikCommunityInfoServiceImpl.java | 87 +++++++++++++++++ .../impl/HikDeviceInfoServiceImpl.java | 87 +++++++++++++++++ .../controller/RentTenantInfoController.java | 9 ++ .../rent/service/RentTenantInfoService.java | 1 + .../epmet/plugin/power/modules/utils/.gitkeep | 0 .../power/modules/utils/HkDeviceUtil.java | 86 +++++++++++++++++ .../src/main/resources/bootstrap.yml | 6 ++ .../mapper/hik/HikCommunityInfoDao.xml | 25 +++++ .../resources/mapper/hik/HikDeviceInfoDao.xml | 25 +++++ 26 files changed, 1260 insertions(+), 1 deletion(-) delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/.gitkeep create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java delete mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/.gitkeep create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikDeviceInfoDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java new file mode 100644 index 0000000..72e1d58 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java @@ -0,0 +1,94 @@ +package com.epmet.plugin.power.dto.hik; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 海康社区信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class HikCommunityInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区名称 + */ + private String communityName; + + /** + * 省代号 + */ + private String provinceCode; + + /** + * 市代号 + */ + private String cityCode; + + /** + * 区代号 + */ + private String countyCode; + + /** + * 经度坐标值 + */ + private String longitude; + + /** + * 维度坐标值 + */ + private String latitude; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java new file mode 100644 index 0000000..dc9bac4 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java @@ -0,0 +1,94 @@ +package com.epmet.plugin.power.dto.hik; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 海康设备信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class HikDeviceInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区ID + */ + private String communityId; + + /** + * 设备ID + */ + private String deviceId; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 设备型号 + */ + private String deviceModel; + + /** + * 设备序列号 + */ + private String deviceSerial; + + /** + * 设备状态,0:离线,1:在线 + */ + private String deviceStatus; + + /** + * 设备路径 + */ + private String devicePath; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index af1b196..adfd171 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -164,6 +164,11 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + https://api2.hik-cloud.com + 90688b09bb9d40088f7be404ccb347c7 + 7b1940707a4240be9c794c5a967a30c9 @@ -193,7 +198,7 @@ false - 192.168.43.104 + 192.168.43.186 false @@ -214,6 +219,11 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + https://api2.hik-cloud.com + 90688b09bb9d40088f7be404ccb347c7 + 7b1940707a4240be9c794c5a967a30c9 @@ -268,6 +278,11 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + https://api2.hik-cloud.com + 90688b09bb9d40088f7be404ccb347c7 + 7b1940707a4240be9c794c5a967a30c9 @@ -317,6 +332,11 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + https://api2.hik-cloud.com + 90688b09bb9d40088f7be404ccb347c7 + 7b1940707a4240be9c794c5a967a30c9 @@ -369,6 +389,11 @@ 60 epmet-user callerRunsPolicy + + + https://api2.hik-cloud.com + 90688b09bb9d40088f7be404ccb347c7 + 7b1940707a4240be9c794c5a967a30c9 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java new file mode 100644 index 0000000..815d47f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java @@ -0,0 +1,54 @@ +package com.epmet.plugin.power.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * 海康设备参数 + * + * @author zhy + * @date 2022/5/20 14:59 + */ +@Configuration +@ConfigurationProperties(prefix = "hik.cloud") +public class HikCloudProperties { + + /** + * 应用ID + */ + private String url; + + /** + * 应用KEY + */ + private String client; + + /** + * 生成AccessToken密钥 + */ + private String secret; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java new file mode 100644 index 0000000..88c0b5f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.hik.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.plugin.power.dto.hik.HikCommunityInfoDTO; +import com.epmet.plugin.power.modules.hik.excel.HikCommunityInfoExcel; +import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService; +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-20 + */ +@RestController +@RequestMapping("hikCommunityInfo") +public class HikCommunityInfoController { + + @Autowired + private HikCommunityInfoService hikCommunityInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = hikCommunityInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + HikCommunityInfoDTO data = hikCommunityInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody HikCommunityInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + hikCommunityInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody HikCommunityInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + hikCommunityInfoService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + hikCommunityInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = hikCommunityInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HikCommunityInfoExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java new file mode 100644 index 0000000..fa5ef45 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.hik.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.plugin.power.dto.hik.HikDeviceInfoDTO; +import com.epmet.plugin.power.modules.hik.excel.HikDeviceInfoExcel; +import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService; +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-20 + */ +@RestController +@RequestMapping("hikDeviceInfo") +public class HikDeviceInfoController { + + @Autowired + private HikDeviceInfoService hikDeviceInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = hikDeviceInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + HikDeviceInfoDTO data = hikDeviceInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody HikDeviceInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + hikDeviceInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody HikDeviceInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + hikDeviceInfoService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + hikDeviceInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = hikDeviceInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HikDeviceInfoExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java new file mode 100644 index 0000000..356270d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.hik.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 海康社区信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Mapper +public interface HikCommunityInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java new file mode 100644 index 0000000..6b91224 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.hik.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 海康设备信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Mapper +public interface HikDeviceInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java new file mode 100644 index 0000000..3b3e83e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java @@ -0,0 +1,64 @@ +package com.epmet.plugin.power.modules.hik.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 2022-05-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_hik_community_info") +public class HikCommunityInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区ID + */ + private String communityId; + + /** + * 社区名称 + */ + private String communityName; + + /** + * 省代号 + */ + private String provinceCode; + + /** + * 市代号 + */ + private String cityCode; + + /** + * 区代号 + */ + private String countyCode; + + /** + * 经度坐标值 + */ + private String longitude; + + /** + * 维度坐标值 + */ + private String latitude; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java new file mode 100644 index 0000000..4ad17cc --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java @@ -0,0 +1,64 @@ +package com.epmet.plugin.power.modules.hik.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 2022-05-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_hik_device_info") +public class HikDeviceInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 社区ID + */ + private String communityId; + + /** + * 设备ID + */ + private String deviceId; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 设备型号 + */ + private String deviceModel; + + /** + * 设备序列号 + */ + private String deviceSerial; + + /** + * 设备状态,0:离线,1:在线 + */ + private String deviceStatus; + + /** + * 设备路径 + */ + private String devicePath; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java new file mode 100644 index 0000000..c230129 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java @@ -0,0 +1,63 @@ +package com.epmet.plugin.power.modules.hik.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-20 + */ +@Data +public class HikCommunityInfoExcel { + + @Excel(name = "主键") + private String id; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "社区ID") + private String communityId; + + @Excel(name = "社区名称") + private String communityName; + + @Excel(name = "省代号") + private String provinceCode; + + @Excel(name = "市代号") + private String cityCode; + + @Excel(name = "区代号") + private String countyCode; + + @Excel(name = "经度坐标值") + private String longitude; + + @Excel(name = "维度坐标值") + private String latitude; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java new file mode 100644 index 0000000..9cd4f02 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java @@ -0,0 +1,63 @@ +package com.epmet.plugin.power.modules.hik.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-20 + */ +@Data +public class HikDeviceInfoExcel { + + @Excel(name = "主键") + private String id; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "社区ID") + private String communityId; + + @Excel(name = "设备ID") + private String deviceId; + + @Excel(name = "设备名称") + private String deviceName; + + @Excel(name = "设备型号") + private String deviceModel; + + @Excel(name = "设备序列号") + private String deviceSerial; + + @Excel(name = "设备状态,0:离线,1:在线") + private String deviceStatus; + + @Excel(name = "设备路径") + private String devicePath; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java new file mode 100644 index 0000000..24a6b3a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.hik.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-20 + */ +@Component +public class HikCommunityInfoRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java new file mode 100644 index 0000000..045d049 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.hik.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-20 + */ +@Component +public class HikDeviceInfoRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java new file mode 100644 index 0000000..6128386 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.hik.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 海康社区信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +public interface HikCommunityInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HikCommunityInfoDTO + * @author generator + * @date 2022-05-20 + */ + HikCommunityInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-20 + */ + void save(HikCommunityInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-20 + */ + void update(HikCommunityInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java new file mode 100644 index 0000000..c87d107 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.plugin.power.modules.hik.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 海康设备信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +public interface HikDeviceInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HikDeviceInfoDTO + * @author generator + * @date 2022-05-20 + */ + HikDeviceInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-20 + */ + void save(HikDeviceInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-20 + */ + void update(HikDeviceInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java new file mode 100644 index 0000000..7fc5202 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.modules.hik.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao; +import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; +import com.epmet.plugin.power.modules.hik.redis.HikCommunityInfoRedis; +import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService; +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-20 + */ +@Service +public class HikCommunityInfoServiceImpl extends BaseServiceImpl implements HikCommunityInfoService { + + @Autowired + private HikCommunityInfoRedis hikCommunityInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HikCommunityInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HikCommunityInfoDTO.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 HikCommunityInfoDTO get(String id) { + HikCommunityInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HikCommunityInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HikCommunityInfoDTO dto) { + HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HikCommunityInfoDTO dto) { + HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java new file mode 100644 index 0000000..07f8896 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.modules.hik.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.hik.dao.HikDeviceInfoDao; +import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; +import com.epmet.plugin.power.modules.hik.redis.HikDeviceInfoRedis; +import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService; +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-20 + */ +@Service +public class HikDeviceInfoServiceImpl extends BaseServiceImpl implements HikDeviceInfoService { + + @Autowired + private HikDeviceInfoRedis hikDeviceInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HikDeviceInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HikDeviceInfoDTO.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 HikDeviceInfoDTO get(String id) { + HikDeviceInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HikDeviceInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HikDeviceInfoDTO dto) { + HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HikDeviceInfoDTO dto) { + HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.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/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index e28ac56..6a90baa 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel; import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; +import com.epmet.plugin.power.modules.utils.HkDeviceUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -33,6 +34,9 @@ public class RentTenantInfoController { @Autowired private RentTenantInfoService rentTenantInfoService; + @Autowired + private HkDeviceUtil hkDeviceUtil; + @RequestMapping("page") public Result> page(@RequestParam Map params) { PageData page = rentTenantInfoService.page(params); @@ -91,5 +95,10 @@ public class RentTenantInfoController { ExcelUtils.exportExcelToTarget(response, null, list, RentTenantInfoExcel.class); } + @GetMapping("test") + public Result test(@RequestParam Map params, HttpServletResponse response) throws Exception { + return new Result().ok(hkDeviceUtil.getAccessToken()); + } + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java index 8d548d4..1b3fa25 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java @@ -106,4 +106,5 @@ public interface RentTenantInfoService extends BaseService * @date 2022/4/24 14:08 */ void deletePhysical(Map params); + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java new file mode 100644 index 0000000..6e47b45 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java @@ -0,0 +1,86 @@ +package com.epmet.plugin.power.modules.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.plugin.power.config.HikCloudProperties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * 海康设备下放命令 + * + * @author zhy + * @date 2022/5/20 9:36 + */ +@Component +public class HkDeviceUtil { + private static Logger logger = LoggerFactory.getLogger(HkDeviceUtil.class); + + @Autowired + private HikCloudProperties hikCloudProperties; + + private final String GET_ACCESS_TOKEN = "/oauth/token"; + private final String GET_DEVICES = "/api/v1/estate/devices"; + + private final String GRANT_TYPE = "client_credentials"; + + /** + * 获取accessToken + * + * @param + * @return void + * @author zhy + * @date 2022/5/20 16:40 + */ + public String getAccessToken() { + String url = hikCloudProperties.getUrl().concat(GET_ACCESS_TOKEN); + Map paramsMap = new HashMap<>(8); + paramsMap.put("client_id", hikCloudProperties.getClient()); + paramsMap.put("client_secret", hikCloudProperties.getSecret()); + paramsMap.put("grant_type", GRANT_TYPE); +// paramsMap.put("scope", "app"); + + String data = HttpClientManager.getInstance().sendPost(url, paramsMap).getData(); + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + + JSONObject toResult = JSON.parseObject(data); + if (!toResult.containsKey("access_token")) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + return toResult.get("access_token").toString(); + } +// +// public String getDevices() { +// String url = hikCloudProperties.getUrl().concat(GET_DEVICES); +// Map paramsMap = new HashMap<>(8); +// paramsMap.put("deviceId", hikCloudProperties.getClient()); +// +// +// String data = HttpClientManager.getInstance().sendGet(ThirdApiConstant.THIRD_PAUSER_SAVEUSER, JSON.toJSONString(dto)).getData(); +// JSONObject toResult = JSON.parseObject(data); +// Result result = ConvertUtils.mapToEntity(toResult, Result.class); +// if (null != toResult.get("code")) { +// result.setCode(((Integer) toResult.get("code")).intValue()); +// } +// if (!result.success()) { +// throw new RenException(PublicUserLoginConstant.SAVE_USER_EXCEPTION); +// } +// Object RegisterResult = result.getData(); +// JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); +// SaveUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, SaveUserResultDTO.class); +// +// } +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml index 66aedcd..f93c0cf 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml @@ -127,6 +127,12 @@ dingTalk: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ +hik: + cloud: + url: @hik.cloud.url@ + client: @hik.cloud.client@ + secret: @hik.cloud.secret@ + # 停机选项 shutdown: graceful: diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml new file mode 100644 index 0000000..942410e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikDeviceInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikDeviceInfoDao.xml new file mode 100644 index 0000000..ca5b5ee --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikDeviceInfoDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7a4681617ba9af7a0ca70339d5c5a330c8ec4639 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 10:12:12 +0800 Subject: [PATCH 048/108] =?UTF-8?q?=E5=B8=A6header=E7=9A=84=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/hik/form/HikPersonFormDTO.java | 33 ++++++++++ .../controller/RentTenantInfoController.java | 5 +- .../power/modules/utils/HkDeviceUtil.java | 63 ++++++++++++------- 3 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java new file mode 100644 index 0000000..0962390 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.plugin.power.dto.hik.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class HikPersonFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String unionId; + + private String personName; + + private Integer gender; + + private Integer credentialType; + + private String credentialNumber; + + private String mobile; + + private String faceUrl; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 6a90baa..9cdddaf 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -97,7 +97,10 @@ public class RentTenantInfoController { @GetMapping("test") public Result test(@RequestParam Map params, HttpServletResponse response) throws Exception { - return new Result().ok(hkDeviceUtil.getAccessToken()); + String token =hkDeviceUtil.getAccessToken(); +token = "Bearer ".concat(token); + + return new Result().ok(hkDeviceUtil.sendPerson(token)); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java index 6e47b45..b6d8fed 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java @@ -4,11 +4,11 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.config.HikCloudProperties; +import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +32,7 @@ public class HkDeviceUtil { private final String GET_ACCESS_TOKEN = "/oauth/token"; private final String GET_DEVICES = "/api/v1/estate/devices"; + private final String SEND_PERSON = "/api/v1/estate/system/person"; private final String GRANT_TYPE = "client_credentials"; @@ -62,25 +63,43 @@ public class HkDeviceUtil { } return toResult.get("access_token").toString(); } -// -// public String getDevices() { -// String url = hikCloudProperties.getUrl().concat(GET_DEVICES); -// Map paramsMap = new HashMap<>(8); -// paramsMap.put("deviceId", hikCloudProperties.getClient()); -// -// -// String data = HttpClientManager.getInstance().sendGet(ThirdApiConstant.THIRD_PAUSER_SAVEUSER, JSON.toJSONString(dto)).getData(); -// JSONObject toResult = JSON.parseObject(data); -// Result result = ConvertUtils.mapToEntity(toResult, Result.class); -// if (null != toResult.get("code")) { -// result.setCode(((Integer) toResult.get("code")).intValue()); -// } -// if (!result.success()) { -// throw new RenException(PublicUserLoginConstant.SAVE_USER_EXCEPTION); -// } -// Object RegisterResult = result.getData(); -// JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); -// SaveUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, SaveUserResultDTO.class); -// -// } + + /** + * 下发人员 + * + * @param token + * @return java.lang.String 人员ID + * @author zhy + * @date 2022/5/23 10:08 + */ + public String sendPerson(String token) { + String url = hikCloudProperties.getUrl().concat(SEND_PERSON); + Map paramsMap = new HashMap<>(4); + paramsMap.put("Authorization", token); + + HikPersonFormDTO dto = new HikPersonFormDTO(); + dto.setPersonName("张三"); + dto.setGender(1); + dto.setCredentialType(1); + dto.setCredentialNumber("350781196403072329"); + dto.setMobile("17890987654"); + dto.setFaceUrl("https://ai-security-protection.oss-cn-qingdao.aliyuncs.com/test/20220501/b714a5d77e46449980ad7d6dcf3d3aab.jpg"); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + } + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + } + Object RegisterResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); + return "11111111111111111"; + } + } From e586797e441fc86bdde538f9b8f5987da1ead8a5 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 13:36:31 +0800 Subject: [PATCH 049/108] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/hik/HikErrorInfoDTO.java | 74 +++++++++++++++ .../dto/hik/form/HikAuthorityFormDTO.java | 27 ++++++ .../power/dto/hik/form/HikPersonFormDTO.java | 16 ++-- .../controller/HikErrorInfoController.java | 82 ++++++++++++++++ .../modules/hik/dao/HikErrorInfoDao.java | 27 ++++++ .../hik/entity/HikErrorInfoEntity.java | 44 +++++++++ .../modules/hik/excel/HikErrorInfoExcel.java | 51 ++++++++++ .../modules/hik/redis/HikErrorInfoRedis.java | 30 ++++++ .../hik/service/HikErrorInfoService.java | 88 +++++++++++++++++ .../service/impl/HikErrorInfoServiceImpl.java | 95 +++++++++++++++++++ .../controller/RentTenantInfoController.java | 22 ++++- .../power/modules/utils/HkDeviceUtil.java | 58 ++++++++--- .../resources/mapper/hik/HikErrorInfoDao.xml | 30 ++++++ 13 files changed, 618 insertions(+), 26 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikErrorInfoDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java new file mode 100644 index 0000000..958606d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java @@ -0,0 +1,74 @@ +package com.epmet.plugin.power.dto.hik; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 海康设备推送失败信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-23 + */ +@Data +public class HikErrorInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 错误类型 0:token,1:人员,2权限 + */ + private String errorType; + + /** + * 错误详情 + */ + private String errorInfo; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java new file mode 100644 index 0000000..3f436c1 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.dto.hik.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员权限信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class HikAuthorityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String communityId; + + private String personId; + + private Integer personType; + + private String deviceId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java index 0962390..1a7eedc 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; /** - * 海康社区人员信息 + * 海康社区人员信息下放 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-05-20 @@ -16,18 +16,18 @@ public class HikPersonFormDTO implements Serializable { private static final long serialVersionUID = 1L; - private String unionId; + private String unionId; - private String personName; + private String personName; - private Integer gender; + private Integer gender; - private Integer credentialType; + private Integer credentialType; - private String credentialNumber; + private String credentialNumber; - private String mobile; + private String mobile; - private String faceUrl; + private String faceUrl; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java new file mode 100644 index 0000000..abea6e8 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.plugin.power.modules.hik.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.plugin.power.dto.hik.HikErrorInfoDTO; +import com.epmet.plugin.power.modules.hik.excel.HikErrorInfoExcel; +import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService; +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-23 + */ +@RestController +@RequestMapping("hikErrorInfo") +public class HikErrorInfoController { + + @Autowired + private HikErrorInfoService hikErrorInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = hikErrorInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + HikErrorInfoDTO data = hikErrorInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody HikErrorInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + hikErrorInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody HikErrorInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + hikErrorInfoService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + hikErrorInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = hikErrorInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, HikErrorInfoExcel.class); + } + + + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java new file mode 100644 index 0000000..95268f5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.modules.hik.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Map; + +/** + * 海康设备推送失败信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-23 + */ +@Mapper +public interface HikErrorInfoDao extends BaseDao { + + /** + * 物理删除 + * + * @param params + * @return void + * @author zhy + * @date 2022/4/24 14:08 + */ + void deletePhysical(Map params); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java new file mode 100644 index 0000000..d4598a7 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java @@ -0,0 +1,44 @@ +package com.epmet.plugin.power.modules.hik.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 2022-05-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_hik_error_info") +public class HikErrorInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 错误类型 0:token,1:人员,2权限 + */ + private String errorType; + + /** + * 错误详情 + */ + private String errorInfo; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java new file mode 100644 index 0000000..7be08bd --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java @@ -0,0 +1,51 @@ +package com.epmet.plugin.power.modules.hik.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-23 + */ +@Data +public class HikErrorInfoExcel { + + @Excel(name = "主键") + private String id; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "错误类型 0:token,1:人员,2权限") + private String errorType; + + @Excel(name = "错误详情") + private String errorInfo; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java new file mode 100644 index 0000000..970dac0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.hik.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-23 + */ +@Component +public class HikErrorInfoRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java new file mode 100644 index 0000000..bde8c62 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java @@ -0,0 +1,88 @@ +package com.epmet.plugin.power.modules.hik.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 海康设备推送失败信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-23 + */ +public interface HikErrorInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HikErrorInfoDTO + * @author generator + * @date 2022-05-23 + */ + HikErrorInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-23 + */ + void save(HikErrorInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-23 + */ + void update(HikErrorInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-23 + */ + void delete(String[] ids); + + /** + * 物理删除 + * + * @param params + * @return void + * @author zhy + * @date 2022/4/24 14:08 + */ + void deletePhysical(Map params); +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java new file mode 100644 index 0000000..1a6e31a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java @@ -0,0 +1,95 @@ +package com.epmet.plugin.power.modules.hik.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.modules.hik.dao.HikErrorInfoDao; +import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; +import com.epmet.plugin.power.modules.hik.redis.HikErrorInfoRedis; +import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService; +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-23 + */ +@Service +public class HikErrorInfoServiceImpl extends BaseServiceImpl implements HikErrorInfoService { + + @Autowired + private HikErrorInfoRedis hikErrorInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HikErrorInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HikErrorInfoDTO.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 HikErrorInfoDTO get(String id) { + HikErrorInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HikErrorInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HikErrorInfoDTO dto) { + HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HikErrorInfoDTO dto) { + HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class); + 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 deletePhysical(Map params) { + if (!params.isEmpty()) { + baseDao.deletePhysical(params); + } + } + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 9cdddaf..4286065 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -9,6 +9,8 @@ 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.plugin.power.dto.hik.form.HikAuthorityFormDTO; +import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel; import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; @@ -97,10 +99,22 @@ public class RentTenantInfoController { @GetMapping("test") public Result test(@RequestParam Map params, HttpServletResponse response) throws Exception { - String token =hkDeviceUtil.getAccessToken(); -token = "Bearer ".concat(token); - - return new Result().ok(hkDeviceUtil.sendPerson(token)); + HikPersonFormDTO dto = new HikPersonFormDTO(); + dto.setPersonName("张三"); + dto.setGender(1); + dto.setCredentialType(1); + dto.setCredentialNumber("350781196403072329"); + dto.setMobile("17890987654"); + dto.setFaceUrl("https://ai-security-protection.oss-cn-qingdao.aliyuncs.com/test/20220501/b714a5d77e46449980ad7d6dcf3d3aab.jpg"); + + HikAuthorityFormDTO dto1 = new HikAuthorityFormDTO(); +dto1.setPersonType(1); +dto1.setPersonId("91704aafae7849529460809e04102a1e"); +dto1.setCommunityId("98b6060a7b8e408dbc3278a5b4fcfe2b"); +dto1.setDeviceId("edbc991eb97445e698f709f3710a6fd4"); + + + return new Result().ok(hkDeviceUtil.authorityIssued(dto1)); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java index b6d8fed..0c47d6b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java @@ -2,12 +2,14 @@ package com.epmet.plugin.power.modules.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.config.HikCloudProperties; +import com.epmet.plugin.power.dto.hik.form.HikAuthorityFormDTO; import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,6 +35,7 @@ public class HkDeviceUtil { private final String GET_ACCESS_TOKEN = "/oauth/token"; private final String GET_DEVICES = "/api/v1/estate/devices"; private final String SEND_PERSON = "/api/v1/estate/system/person"; + private final String ISSUE_AUTHORITY = "/api/v1/estate/entranceGuard/permissions/actions/authorityIssued"; private final String GRANT_TYPE = "client_credentials"; @@ -61,29 +64,24 @@ public class HkDeviceUtil { if (!toResult.containsKey("access_token")) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); } - return toResult.get("access_token").toString(); + String accessToken = "Bearer ".concat(toResult.get("access_token").toString()); + return accessToken; } /** * 下发人员 * - * @param token + * @param dto * @return java.lang.String 人员ID * @author zhy * @date 2022/5/23 10:08 */ - public String sendPerson(String token) { + public String sendPerson(HikPersonFormDTO dto) { String url = hikCloudProperties.getUrl().concat(SEND_PERSON); + Map paramsMap = new HashMap<>(4); - paramsMap.put("Authorization", token); - - HikPersonFormDTO dto = new HikPersonFormDTO(); - dto.setPersonName("张三"); - dto.setGender(1); - dto.setCredentialType(1); - dto.setCredentialNumber("350781196403072329"); - dto.setMobile("17890987654"); - dto.setFaceUrl("https://ai-security-protection.oss-cn-qingdao.aliyuncs.com/test/20220501/b714a5d77e46449980ad7d6dcf3d3aab.jpg"); + paramsMap.put("Authorization", getAccessToken()); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { @@ -94,12 +92,44 @@ public class HkDeviceUtil { if (null != toResult.get("code")) { result.setCode(((Integer) toResult.get("code")).intValue()); } - if (!result.success()) { + if (NumConstant.TWO_HUNDRED != result.getCode()) { + logger.info(result.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); } Object RegisterResult = result.getData(); JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); - return "11111111111111111"; + return jsonObject.getString("personId"); + } + + /** + * 下发人员权限 + * + * @param dto + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String authorityIssued(HikAuthorityFormDTO dto) { + String url = hikCloudProperties.getUrl().concat(ISSUE_AUTHORITY); + + Map paramsMap = new HashMap<>(4); + paramsMap.put("Authorization", getAccessToken()); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + } + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (NumConstant.TWO_HUNDRED != result.getCode()) { + logger.info(result.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + } + return "success"; } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikErrorInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikErrorInfoDao.xml new file mode 100644 index 0000000..43b53c7 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikErrorInfoDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + pli_hik_error_info + + + AND ID_CARD = #{idCard} + + + + \ No newline at end of file From dd27674522ed17911bb1141bbf39295779764f84 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 14:06:01 +0800 Subject: [PATCH 050/108] =?UTF-8?q?=E5=8F=91=E9=80=81-=E5=82=A8=E5=AD=98?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HikCommunityInfoServiceImpl.java | 2 + .../impl/HikDeviceInfoServiceImpl.java | 2 + .../RentContractInfoController.java | 9 +++ .../rent/service/RentContractInfoService.java | 10 +++ .../impl/RentContractInfoServiceImpl.java | 67 +++++++++++++++++++ 5 files changed, 90 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java index 7fc5202..4212eee 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java @@ -50,9 +50,11 @@ public class HikCommunityInfoServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String communityName = (String)params.get("communityName"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(communityName), "COMMUNITY_NAME", communityName); return wrapper; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java index 07f8896..b51fd24 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java @@ -50,9 +50,11 @@ public class HikDeviceInfoServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String communityId = (String)params.get("communityId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(communityId), "COMMUNITY_ID", communityId); return wrapper; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index 3173018..d0f8f06 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -63,6 +63,15 @@ public class RentContractInfoController { return new Result(); } + @NoRepeatSubmit + @PostMapping("send") + public Result send(@RequestBody RentContractInfoDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + rentContractInfoService.send(dto); + return new Result(); + } + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody RentContractInfoDTO dto) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java index 64d9e37..14068e4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -67,6 +67,16 @@ public interface RentContractInfoService extends BaseService page(Map params) { params.put("customerId", loginUserUtil.getLoginUserCustomerId()); @@ -233,6 +254,52 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { + try { + HikPersonFormDTO person = new HikPersonFormDTO(); + person.setFaceUrl(item.getImgList().get(0).getFileUrl()); + person.setMobile(item.getMobile()); + person.setCredentialType(NumConstant.ONE); + person.setCredentialNumber(item.getIdCard()); + person.setPersonName(item.getName()); + person.setGender(NumConstant.ONE_NEG); + String personId = hkDeviceUtil.sendPerson(person); + + if (StringUtils.isNotBlank(personId)) { + HikAuthorityFormDTO authority = new HikAuthorityFormDTO(); + authority.setPersonType(NumConstant.ONE); + authority.setPersonId(personId); + + Map communityParams = new HashMap<>(4); + communityParams.put("communityName", dto.getVillageName()); + List communityList = hikCommunityInfoService.list(communityParams); + + communityList.forEach(community -> { + authority.setCommunityId(community.getCommunityId()); + + Map deviceParams = new HashMap<>(4); + deviceParams.put("communityName", dto.getVillageName()); + List deviceList = hikDeviceInfoService.list(deviceParams); + + deviceList.forEach(device -> { + authority.setDeviceId(device.getDeviceId()); + + hkDeviceUtil.authorityIssued(authority); + }); + }); + } + } catch (EpmetException e) { + HikErrorInfoDTO error = new HikErrorInfoDTO(); + error.setIdCard(item.getIdCard()); + error.setErrorInfo(e.getMessage()); + hikErrorInfoService.save(error); + } + }); + } + @Override @Transactional(rollbackFor = Exception.class) public void update(RentContractInfoDTO dto) { From e40930bf2b5818d4a84d94e0ee56af1898698679 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Mon, 23 May 2022 14:33:08 +0800 Subject: [PATCH 051/108] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HikCommunityInfoController.java | 12 +++ .../controller/HikDeviceInfoController.java | 12 +++ .../modules/hik/dao/HikCommunityInfoDao.java | 9 +- .../hik/service/HikCommunityInfoService.java | 11 ++- .../hik/service/HikDeviceInfoService.java | 10 ++- .../impl/HikCommunityInfoServiceImpl.java | 86 +++++++++++++++++- .../impl/HikDeviceInfoServiceImpl.java | 89 ++++++++++++++++++- .../mapper/hik/HikCommunityInfoDao.xml | 8 +- 8 files changed, 224 insertions(+), 13 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java index 88c0b5f..1639f11 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java @@ -77,6 +77,18 @@ public class HikCommunityInfoController { ExcelUtils.exportExcelToTarget(response, null, list, HikCommunityInfoExcel.class); } + /** + * @Description: 同步社区列表信息 + * @Param: [formDto] + * @return: com.elink.esua.epdc.commons.tools.utils.Result<> + * @Author: wgf + * @Date: 2022-05-23 + */ + @GetMapping("getCommunityList") + public Result getCommunityList() { + return hikCommunityInfoService.getCommunityList(); + } + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java index fa5ef45..f1bc823 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java @@ -77,6 +77,18 @@ public class HikDeviceInfoController { ExcelUtils.exportExcelToTarget(response, null, list, HikDeviceInfoExcel.class); } + /** + * @Description: 同步设备列表信息 + * @Param: [formDto] + * @return: com.elink.esua.epdc.commons.tools.utils.Result<> + * @Author: wgf + * @Date: 2022-05-23 + */ + @GetMapping("getDeviceList") + public Result getDeviceList() { + return hikDeviceInfoService.getDeviceList(); + } + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java index 356270d..c25e7b3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java @@ -1,9 +1,12 @@ package com.epmet.plugin.power.modules.hik.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 海康社区信息 * @@ -12,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface HikCommunityInfoDao extends BaseDao { - -} \ No newline at end of file + + List getCommunityInfoAll(); + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java index 6128386..9a47eb5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.modules.hik.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; @@ -75,4 +76,12 @@ public interface HikCommunityInfoService extends BaseService { * @date 2022-05-20 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * 同步设备信息 + * @param + * @return + */ + Result getDeviceList(); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java index 7fc5202..2edf97e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java @@ -1,24 +1,32 @@ package com.epmet.plugin.power.modules.hik.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao; import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; import com.epmet.plugin.power.modules.hik.redis.HikCommunityInfoRedis; import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService; +import com.epmet.plugin.power.modules.utils.HkDeviceUtil; +import com.fasterxml.jackson.databind.ObjectMapper; 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; +import java.util.*; /** * 海康社区信息 @@ -32,6 +40,16 @@ public class HikCommunityInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -84,4 +102,64 @@ public class HikCommunityInfoServiceImpl extends BaseServiceImpl headerMap = new HashMap<>(4); + headerMap.put("Authorization",token); + + Map paramsMap = new HashMap<>(4); + paramsMap.put("pageNo", pageNo); + paramsMap.put("pageSize", pageSize); + + JSONArray jsonArray = getJSONArrayListGET(url,false,paramsMap,headerMap,"请求社区列表信息失败"); + + List entityList = new ArrayList(); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObj = jsonArray.getJSONObject(i); + // 转成对象实体 + HikCommunityInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikCommunityInfoEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId()); + entityList.add(entity); + } + insertBatch(entityList); + + if(jsonArray != null && jsonArray.size() == 10){ + pageNo++; + getCommunityList(); + } + + return new Result(); + } + + /** + * sendGet请求 + * @param url + * @param isHttps + * @param paramsMap + * @param headerMap + * @param msg + * @return + */ + public JSONArray getJSONArrayListGET(String url,Boolean isHttps,Map paramsMap,Map headerMap,String msg){ + // 请求接口 + String data = HttpClientManager.getInstance().sendGet(url,false,paramsMap, headerMap).getData(); + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg); + } + JSONObject toResult = JSON.parseObject(data); + + JSONObject dataList = JSON.parseObject(toResult.get("data").toString()); + + JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString()); + + return rows; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java index 07f8896..52b1fad 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java @@ -1,24 +1,34 @@ package com.epmet.plugin.power.modules.hik.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; +import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao; import com.epmet.plugin.power.modules.hik.dao.HikDeviceInfoDao; import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; +import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; import com.epmet.plugin.power.modules.hik.redis.HikDeviceInfoRedis; import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService; +import com.epmet.plugin.power.modules.utils.HkDeviceUtil; 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; +import java.util.*; /** * 海康设备信息 @@ -32,6 +42,15 @@ public class HikDeviceInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -84,4 +103,66 @@ public class HikDeviceInfoServiceImpl extends BaseServiceImpl headerMap = new HashMap<>(4); + headerMap.put("Authorization",token); + + // 获取社区列表 + List communityList = hikCommunityInfoDao.getCommunityInfoAll(); + + for(HikCommunityInfoDTO hikCommunityInfoDTO : communityList){ + // 参数 + Integer pageNo = 1; + Integer pageSize = 1000; + Map paramsMap = new HashMap<>(4); + paramsMap.put("pageNo", pageNo); + paramsMap.put("pageSize", pageSize); + paramsMap.put("communityId",hikCommunityInfoDTO.getCommunityId()); + JSONArray jsonArray = getJSONArrayListPOST(url,JSON.toJSONString(paramsMap),headerMap,"请求设备列表信息失败"); + + List entityList = new ArrayList(); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObj = jsonArray.getJSONObject(i); + // 转成对象实体 + HikDeviceInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikDeviceInfoEntity.class); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId()); + entityList.add(entity); + } + insertBatch(entityList); + } + + return new Result(); + } + + /** + * sendGet请求 + * @param url + * @param jsonStrParam + * @param headerMap + * @param msg + * @return + */ + public JSONArray getJSONArrayListPOST(String url,String jsonStrParam,Map headerMap,String msg){ + // 请求接口 + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url,jsonStrParam, headerMap).getData(); + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg); + } + JSONObject toResult = JSON.parseObject(data); + + JSONObject dataList = JSON.parseObject(toResult.get("data").toString()); + + JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString()); + + return rows; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml index 942410e..978427b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/hik/HikCommunityInfoDao.xml @@ -21,5 +21,11 @@ + - \ No newline at end of file + + From 6bfd93a6c8a312ed7f313d95d999ca8135930a57 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 15:35:34 +0800 Subject: [PATCH 052/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0redis=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/commons/redis/RedisKeys.java | 29 +++++++++++++++++++ .../plugin/power/dto/hik/HikErrorInfoDTO.java | 5 ++++ .../hik/entity/HikErrorInfoEntity.java | 4 +++ .../impl/HikCommunityInfoServiceImpl.java | 2 +- .../RentContractInfoController.java | 8 +++++ .../rent/service/RentContractInfoService.java | 10 +++++++ .../impl/RentContractInfoServiceImpl.java | 14 +++++++++ .../power/modules/utils/HkDeviceUtil.java | 13 +++++++++ 8 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java new file mode 100644 index 0000000..b5f3a6e --- /dev/null +++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.plugin.commons.redis; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class RedisKeys { + + /** + * redis前缀 + */ + private static String rootPrefix = "epmet:"; + + /** + * 海康accessToken + */ + public static String getHikTokenKey() { + return "hik:token"; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java index 958606d..a06778c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java @@ -71,4 +71,9 @@ public class HikErrorInfoDTO implements Serializable { */ private String errorInfo; + /** + * 引用ID + */ + private String referenceId; + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java index d4598a7..134ea93 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java @@ -41,4 +41,8 @@ public class HikErrorInfoEntity extends BaseEpmetEntity { */ private String errorInfo; + /** + * 引用ID + */ + private String referenceId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java index d10718e..56e441d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java @@ -72,7 +72,7 @@ public class HikCommunityInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - wrapper.eq(StringUtils.isNotBlank(communityName), "COMMUNITY_NAME", communityName); + wrapper.like(StringUtils.isNotBlank(communityName), "COMMUNITY_NAME", communityName); return wrapper; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java index d0f8f06..5516860 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java @@ -72,6 +72,14 @@ public class RentContractInfoController { return new Result(); } + @NoRepeatSubmit + @PostMapping("resend/{id}") + public Result resend(@PathVariable("id") String id) { + //效验数据 + rentContractInfoService.resend(id); + return new Result(); + } + @NoRepeatSubmit @PostMapping("update") public Result update(@RequestBody RentContractInfoDTO dto) { diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java index 14068e4..742834f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java @@ -77,6 +77,16 @@ public interface RentContractInfoService extends BaseService { try { + Map delParams = new HashMap<>(); + delParams.put("idCard", item.getIdCard()); + hikErrorInfoService.deletePhysical(delParams); + HikPersonFormDTO person = new HikPersonFormDTO(); person.setFaceUrl(item.getImgList().get(0).getFileUrl()); person.setMobile(item.getMobile()); @@ -295,11 +299,21 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl paramsMap = new HashMap<>(8); paramsMap.put("client_id", hikCloudProperties.getClient()); @@ -65,6 +76,8 @@ public class HkDeviceUtil { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); } String accessToken = "Bearer ".concat(toResult.get("access_token").toString()); + + redisUtils.set(key, accessToken, RedisUtils.HOUR_ONE_EXPIRE); return accessToken; } From 1d598f7542beb8530237e5d25b1c7a07fa1cbb42 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 15:52:10 +0800 Subject: [PATCH 053/108] =?UTF-8?q?=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RentTenantInfoController.java | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java index 4286065..4601409 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java @@ -7,14 +7,11 @@ 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.plugin.power.dto.hik.form.HikAuthorityFormDTO; -import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel; import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; -import com.epmet.plugin.power.modules.utils.HkDeviceUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -36,9 +33,6 @@ public class RentTenantInfoController { @Autowired private RentTenantInfoService rentTenantInfoService; - @Autowired - private HkDeviceUtil hkDeviceUtil; - @RequestMapping("page") public Result> page(@RequestParam Map params) { PageData page = rentTenantInfoService.page(params); @@ -97,25 +91,4 @@ public class RentTenantInfoController { ExcelUtils.exportExcelToTarget(response, null, list, RentTenantInfoExcel.class); } - @GetMapping("test") - public Result test(@RequestParam Map params, HttpServletResponse response) throws Exception { - HikPersonFormDTO dto = new HikPersonFormDTO(); - dto.setPersonName("张三"); - dto.setGender(1); - dto.setCredentialType(1); - dto.setCredentialNumber("350781196403072329"); - dto.setMobile("17890987654"); - dto.setFaceUrl("https://ai-security-protection.oss-cn-qingdao.aliyuncs.com/test/20220501/b714a5d77e46449980ad7d6dcf3d3aab.jpg"); - - HikAuthorityFormDTO dto1 = new HikAuthorityFormDTO(); -dto1.setPersonType(1); -dto1.setPersonId("91704aafae7849529460809e04102a1e"); -dto1.setCommunityId("98b6060a7b8e408dbc3278a5b4fcfe2b"); -dto1.setDeviceId("edbc991eb97445e698f709f3710a6fd4"); - - - return new Result().ok(hkDeviceUtil.authorityIssued(dto1)); - } - - } From 7eefe89854fb50f8c2aa4e3ee3a409a85be7d556 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 17:44:56 +0800 Subject: [PATCH 054/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index c3634d2..04c7366 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -256,7 +256,8 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl { try { Map delParams = new HashMap<>(); From 9f7a6237d17c050d9c476dc02111f8cebaa383d9 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Mon, 23 May 2022 18:00:02 +0800 Subject: [PATCH 055/108] =?UTF-8?q?=E5=8E=BB=E6=8E=89token=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/hik/service/impl/HikCommunityInfoServiceImpl.java | 2 +- .../modules/hik/service/impl/HikDeviceInfoServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java index d10718e..2055525 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java @@ -111,7 +111,7 @@ public class HikCommunityInfoServiceImpl extends BaseServiceImpl headerMap = new HashMap<>(4); headerMap.put("Authorization",token); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java index fb05681..5933489 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java @@ -112,7 +112,7 @@ public class HikDeviceInfoServiceImpl extends BaseServiceImpl headerMap = new HashMap<>(4); headerMap.put("Authorization",token); From 760a00af69796796e6c65660a586afb49a7de646 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 23 May 2022 18:04:30 +0800 Subject: [PATCH 056/108] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=97=B6=E4=BD=BF=E7=94=A8=E7=A4=BE=E5=8C=BAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 04c7366..9551e26 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -286,7 +286,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl deviceParams = new HashMap<>(4); - deviceParams.put("communityName", dto.getVillageName()); + deviceParams.put("communityId", community.getCommunityId()); List deviceList = hikDeviceInfoService.list(deviceParams); deviceList.forEach(device -> { From 0b10d9aa3e540062ecde0bc5f01812a0a355849f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 26 May 2022 11:01:15 +0800 Subject: [PATCH 057/108] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java | 5 +++++ .../com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java | 5 +++++ .../pli-power-base/pli-power-base-server/pom.xml | 5 +++++ .../power/modules/rent/entity/RentContractInfoEntity.java | 5 +++++ .../power/modules/rent/entity/RentTenantInfoEntity.java | 5 +++++ .../rent/service/impl/RentContractInfoServiceImpl.java | 2 +- .../src/main/resources/mapper/rent/RentTenantInfoDao.xml | 3 ++- 7 files changed, 28 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index 1a8a3ee..c9a3198 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -146,6 +146,11 @@ public class RentContractInfoDTO implements Serializable { @NotBlank(message = "承租人手机不能为空") private String lesseeMobile; + /** + * 承租人单位 + */ + private String lesseeUnit; + /** * 签署日期 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java index 772ddf2..700b825 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java @@ -97,6 +97,11 @@ public class RentTenantInfoDTO implements Serializable { */ private String nation; + /** + * 工作单位 + */ + private String unit; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index adfd171..4a2aa92 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -83,6 +83,11 @@ RELEASE compile + + net.coobird + thumbnailator + 0.4.8 + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java index bb6f79a..5acefe5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java @@ -126,6 +126,11 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String lesseeMobile; + /** + * 承租人单位 + */ + private String lesseeUnit; + /** * 签署日期 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java index e45aefb..f235ed5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java @@ -84,6 +84,11 @@ public class RentTenantInfoEntity extends BaseEpmetEntity { */ private String nation; + /** + * 工作单位 + */ + private String unit; + /** * 头像列表 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 9551e26..5b18087 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -320,7 +320,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Thu, 26 May 2022 11:04:34 +0800 Subject: [PATCH 058/108] =?UTF-8?q?=E5=86=97=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pli-power-base/pli-power-base-server/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 4a2aa92..adfd171 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -83,11 +83,6 @@ RELEASE compile - - net.coobird - thumbnailator - 0.4.8 - From 64736a1bc006a9f8ffbb961311fdcb39d897ffae Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 26 May 2022 11:07:42 +0800 Subject: [PATCH 059/108] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=B7=E5=BA=B7?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.9__pli_hik.sql | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.9__pli_hik.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.9__pli_hik.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.9__pli_hik.sql new file mode 100644 index 0000000..7f35f7e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.9__pli_hik.sql @@ -0,0 +1,207 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_test + Source Server Type : MySQL + Source Server Version : 50732 + Source Host : rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306 + Source Schema : epmet_pli_power + + Target Server Type : MySQL + Target Server Version : 50732 + File Encoding : 65001 + + Date: 26/05/2022 11:06:34 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for pli_hik_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_hik_user_info`; +CREATE TABLE `pli_hik_user_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `COMMUNITY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社区ID', + `DEVICE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备ID', + `DEVICE_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `DEVICE_MODEL` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备型号', + `DEVICE_SERIAL` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备序列号', + `DEVICE_STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备状态,0:离线,1:在线', + `DEVICE_PATH` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备路径', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '海康设备信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of pli_hik_user_info +-- ---------------------------- +INSERT INTO `pli_hik_user_info` VALUES ('1', '0', 0, '1', '2022-04-24 16:37:02', '1518475117776248834', '2022-05-05 16:05:40', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519130902068830209', '0', 0, '1519129607526060033', '2022-04-27 09:46:46', '1519129607526060033', '2022-04-27 09:46:46', '775bf1a4331d2451eb0faf44294914a9', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519137954380570626', '0', 0, '1519129607526060033', '2022-04-27 10:14:47', '1519129607526060033', '2022-04-27 10:14:47', '775bf1a4331d2451eb0faf44294914a9', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519255397025304578', '0', 0, 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:01:28', 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:01:28', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519255921506242562', '0', 0, 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:03:33', 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:03:33', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519259445602406401', '0', 0, 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:17:33', 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-05-05 15:55:51', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519261145046306818', '0', 0, 'bd5797b6ccc67d0da5c7afc81683a88b', '2022-04-27 18:24:18', '1518475117776248834', '2022-05-05 15:55:46', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870856960946177', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870856969334786', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870856973529090', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:05', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870892964851714', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870892973240321', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519870892977434626', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 10:47:13', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519952110813069313', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519952110825652225', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1519952110829846529', '0', 0, '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '31d97bba11edd092731c4bcdd0cfd885', '2022-04-29 16:09:57', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522818520787673089', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522818520787673090', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522818520854781954', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:00:03', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522831908135481346', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522831908135481347', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522831908135481348', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:53:14', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522833276204199937', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522833276204199938', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522833276204199939', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 14:58:41', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522839236871004162', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522839236871004163', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1522839236871004164', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-07 15:22:22', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1523941125874941954', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1523941125891719170', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1523941125900107777', '0', 0, '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '5c257e9ed03c48fa0add951d482d35fe', '2022-05-10 16:20:53', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1526858235601604610', '0', 0, '1519589686647726082', '2022-05-18 17:32:26', '1519589686647726082', '2022-05-18 17:32:26', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1526861851389448194', '0', 0, '1519589686647726082', '2022-05-18 17:46:48', '1519589686647726082', '2022-05-18 17:46:48', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1526861851397836802', '0', 0, '1519589686647726082', '2022-05-18 17:46:48', '1519589686647726082', '2022-05-18 17:46:48', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527098588476854273', '0', 0, '1519589686647726082', '2022-05-19 09:27:30', '1519589686647726082', '2022-05-19 09:27:30', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527098588535574529', '0', 0, '1519589686647726082', '2022-05-19 09:27:30', '1519589686647726082', '2022-05-19 09:27:30', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527098588543963137', '0', 0, '1519589686647726082', '2022-05-19 09:27:30', '1519589686647726082', '2022-05-19 09:27:30', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527103454301507586', '0', 0, '1519589686647726082', '2022-05-19 09:46:50', '1519589686647726082', '2022-05-19 09:46:50', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527103454309896193', '0', 0, '1519589686647726082', '2022-05-19 09:46:50', '1519589686647726082', '2022-05-19 09:46:50', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527103454309896194', '0', 0, '1519589686647726082', '2022-05-19 09:46:50', '1519589686647726082', '2022-05-19 09:46:50', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527107590946410497', '0', 0, '1519589686647726082', '2022-05-19 10:03:17', '1519589686647726082', '2022-05-19 10:03:17', '45687aa479955f9d06204d415238f7cc', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527172217686175746', '0', 0, '1519589686647726082', '2022-05-19 14:20:05', '1519589686647726082', '2022-05-19 14:20:05', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527172217744896002', '0', 0, '1519589686647726082', '2022-05-19 14:20:05', '1519589686647726082', '2022-05-19 14:20:05', '45687aa479955f9d06204d415238f7cc', '群众', '否', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527173017498005505', '0', 0, '1519589686647726082', '2022-05-19 14:23:16', '1519589686647726082', '2022-05-19 14:23:16', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527175894891212802', '0', 0, '1519589686647726082', '2022-05-19 14:34:42', '1519589686647726082', '2022-05-19 14:34:42', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527177360733351938', '0', 0, '1519589686647726082', '2022-05-19 14:40:31', '1519589686647726082', '2022-05-19 14:40:31', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527483669210968066', '0', 0, '1519589686647726082', '2022-05-20 10:57:41', '1519589686647726082', '2022-05-20 10:57:41', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527485515858161666', '0', 0, '1519589686647726082', '2022-05-20 11:05:01', '1519589686647726082', '2022-05-20 11:05:01', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('1527485965554659330', '0', 0, '1519589686647726082', '2022-05-20 11:06:48', '1519589686647726082', '2022-05-20 11:06:48', '45687aa479955f9d06204d415238f7cc', '党员', '是', '中国', NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('2', '0', 0, '1', '2022-04-24 16:37:02', '1', '2022-04-24 16:37:06', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `pli_hik_user_info` VALUES ('3', '0', 0, '1', '2022-04-24 16:37:02', '1', '2022-04-24 16:37:06', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +-- ---------------------------- +-- Table structure for pli_hik_error_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_hik_error_info`; +CREATE TABLE `pli_hik_error_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `ID_CARD` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号', + `ERROR_TYPE` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '错误类型 0:token,1:人员,2权限', + `ERROR_INFO` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '错误详情', + `REFERENCE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '引用ID', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '海康设备推送失败信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of pli_hik_error_info +-- ---------------------------- + +-- ---------------------------- +-- Table structure for pli_hik_device_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_hik_device_info`; +CREATE TABLE `pli_hik_device_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `COMMUNITY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社区ID', + `DEVICE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备ID', + `DEVICE_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `DEVICE_MODEL` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备型号', + `DEVICE_SERIAL` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备序列号', + `DEVICE_STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备状态,0:离线,1:在线', + `DEVICE_PATH` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备路径', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '海康设备信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of pli_hik_device_info +-- ---------------------------- +INSERT INTO `pli_hik_device_info` VALUES ('1528615649503821826', '0', 0, 'APP_USER', '2022-05-23 13:55:46', 'APP_USER', '2022-05-23 13:55:46', '0001', '98b6060a7b8e408dbc3278a5b4fcfe2b', 'edbc991eb97445e698f709f3710a6fd4', '华二小区南门入口', 'DS-K1T671TM', 'F30961045', '1', '98b6060a7b8e408dbc3278a5b4fcfe2b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615649503821827', '0', 0, 'APP_USER', '2022-05-23 13:55:46', 'APP_USER', '2022-05-23 13:55:46', '0001', '98b6060a7b8e408dbc3278a5b4fcfe2b', '7a6f9f4b80184661a979534fc09ed6c7', '华二小区南门出口', 'DS-K1T671TM', 'F30961014', '1', '98b6060a7b8e408dbc3278a5b4fcfe2b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368898', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', '6ede5b5c18614274a778b789751e9600', '华三西区西门出口', 'DS-K1T671TM', 'F30961113', '1', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368899', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', '52d8049b99054beb82034836c0438a65', '华三西区西门入口', 'DS-K1T671TM', 'F30961001', '1', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368900', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', '352f21733f8442bcb5129ad924374df5', '华三西区东门出口', 'DS-K1T671TM', 'F30961136', '1', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368901', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', 'af7277c249bf488295a281ffd032f821', '华三西区东门入口', 'DS-K1T671TM', 'F30960996', '1', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368902', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', '99d463a32a3c47168e1ae9e607f9a431', '华三东区西门出口', 'DS-K1T671TM', 'F30961071', '0', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693724368903', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', 'fe025123bd6040fa972b94300936563d', '华三东区西门入口', 'DS-K1T671TM', 'F30960993', '0', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693787283458', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', 'c1656946183247e297988bc42c9f048c', '华三东区东门出口', 'DS-K1T671TM', 'F30961059', '0', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615693787283459', '0', 0, 'APP_USER', '2022-05-23 13:55:56', 'APP_USER', '2022-05-23 13:55:56', '0001', 'eff54b400c814a64906159f961aa9146', '2221e0f2737d4dcf9622c6277e2cf59a', '华三东区东门入口', 'DS-K1T671TM', 'F30961092', '0', 'eff54b400c814a64906159f961aa9146'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615695485976577', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', '9da3bab48a9d4b919172f91f73bed754', '924311c1327b4a24b242a2130de6bbbe', '青福楼入口', 'DS-K1T671TM', 'F30969104', '1', '9da3bab48a9d4b919172f91f73bed754'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615696467443713', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', 'b6a3f4d2012441b1ac419b6afafbf913', '285f5fba0a3940b2bddcb09fdffd2292', 'F区入口', 'DS-K1T671TM', 'F30969051', '1', 'b6a3f4d2012441b1ac419b6afafbf913'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615697377607682', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', '9f80094d599145868e3e61dbea5b4412', '8df91ee9cd3c483bb26e5bb4f5141d59', 'E区入口', 'DS-K1T671TM', 'F30969049', '1', '9f80094d599145868e3e61dbea5b4412'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615698346491905', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', 'ad0e2e103e1e4093a56f2707a681aa8b', '3178efe3ded2413d95fe002a3cf718be', '翠竹苑北门出口', 'DS-K1T671TM', 'F30961037', '1', 'ad0e2e103e1e4093a56f2707a681aa8b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615698409406466', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', 'ad0e2e103e1e4093a56f2707a681aa8b', 'a30b62d9e1614905a280f3e1e86ddddf', '翠竹苑北门入口', 'DS-K1T671TM', 'F30960956', '1', 'ad0e2e103e1e4093a56f2707a681aa8b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615698409406467', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', 'ad0e2e103e1e4093a56f2707a681aa8b', '22abf36c38894b6c9ba59787e1301c2a', '翠竹苑入口', 'DS-K1T671TM', 'F18089303', '1', 'ad0e2e103e1e4093a56f2707a681aa8b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615698409406468', '0', 0, 'APP_USER', '2022-05-23 13:55:57', 'APP_USER', '2022-05-23 13:55:57', '0001', 'ad0e2e103e1e4093a56f2707a681aa8b', 'eb4b2976e3cb48aaa8aa55d784baa77e', '翠竹苑出口', 'DS-K1T671TM', 'F18089140', '1', 'ad0e2e103e1e4093a56f2707a681aa8b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615699642531842', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '94c3557623ae49708237224f7fb2238b', 'b2a7437e6cf14e0e91c21e4e3169b8cc', '玫瑰苑出口', 'DS-K1T671TM', 'F18089306', '1', '94c3557623ae49708237224f7fb2238b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615699642531843', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '94c3557623ae49708237224f7fb2238b', 'ab04e9526f9d42adbc6cfaa31e42e634', '玫瑰苑入口', 'DS-K1T671TM', 'F18089215', '1', '94c3557623ae49708237224f7fb2238b'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615700695302146', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '6c4109be29d34c0ebf4203459ba36e11', '299b26bbc81347bb84d85d92f9a0493f', '芙蓉苑南门入口', 'DS-K1T671TM', 'F30969058', '0', '6c4109be29d34c0ebf4203459ba36e11'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615700695302147', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '6c4109be29d34c0ebf4203459ba36e11', 'd7a1cef53bd94fb2824540dac3b87276', '芙蓉苑南门出口', 'DS-K1T671TM', 'F18089300', '0', '6c4109be29d34c0ebf4203459ba36e11'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615700695302148', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '6c4109be29d34c0ebf4203459ba36e11', '84c86dba7f2649a3be40d91d62fd9432', '芙蓉苑北门出口', 'DS-K1T671TM', 'F18089307', '1', '6c4109be29d34c0ebf4203459ba36e11'); +INSERT INTO `pli_hik_device_info` VALUES ('1528615700695302149', '0', 0, 'APP_USER', '2022-05-23 13:55:58', 'APP_USER', '2022-05-23 13:55:58', '0001', '6c4109be29d34c0ebf4203459ba36e11', 'a038ea3b85774e0bb8c5a472a330e296', '芙蓉苑北门入口', 'DS-K1T671TM', 'F18089312', '1', '6c4109be29d34c0ebf4203459ba36e11'); + +-- ---------------------------- +-- Table structure for pli_hik_community_info +-- ---------------------------- +DROP TABLE IF EXISTS `pli_hik_community_info`; +CREATE TABLE `pli_hik_community_info` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID', + `COMMUNITY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社区ID', + `COMMUNITY_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '社区名称', + `PROVINCE_CODE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省代号', + `CITY_CODE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市代号', + `COUNTY_CODE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区代号', + `LONGITUDE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度坐标值', + `LATITUDE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '维度坐标值', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '海康社区信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of pli_hik_community_info +-- ---------------------------- +INSERT INTO `pli_hik_community_info` VALUES ('1528611740751986689', '0', 0, 'APP_USER', '2022-05-23 13:40:14', 'APP_USER', '2022-05-23 13:40:14', '0001', '98b6060a7b8e408dbc3278a5b4fcfe2b', '华城路二小区', '370000', '370200', '370214', '120.396', '36.307'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611740856844290', '0', 0, 'APP_USER', '2022-05-23 13:40:14', 'APP_USER', '2022-05-23 13:40:14', '0001', 'eff54b400c814a64906159f961aa9146', '华城路三小区', '370000', '370200', '370214', '120.388905', '36.304356'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611740856844291', '0', 0, 'APP_USER', '2022-05-23 13:40:14', 'APP_USER', '2022-05-23 13:40:14', '0001', '9da3bab48a9d4b919172f91f73bed754', '小寨子社区青福楼小区', '370000', '370200', '370214', '120.38749', '36.300049'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611740856844292', '0', 0, 'APP_USER', '2022-05-23 13:40:14', 'APP_USER', '2022-05-23 13:40:14', '0001', 'b6a3f4d2012441b1ac419b6afafbf913', '小寨子社区华城路1小区F区', '370000', '370200', '370214', '120.388541', '36.296505'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611740856844293', '0', 0, 'APP_USER', '2022-05-23 13:40:14', 'APP_USER', '2022-05-23 13:40:14', '0001', '9f80094d599145868e3e61dbea5b4412', '小寨子社区中城路120号E区', '370000', '370200', '370214', '120.389277', '36.292424'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611784972533762', '0', 0, 'APP_USER', '2022-05-23 13:40:24', 'APP_USER', '2022-05-23 13:40:24', '0001', 'ad0e2e103e1e4093a56f2707a681aa8b', '小寨子社区A区翠竹苑', '370000', '370200', '370214', '120.391351', '36.293698'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611784972533763', '0', 0, 'APP_USER', '2022-05-23 13:40:24', 'APP_USER', '2022-05-23 13:40:24', '0001', '94c3557623ae49708237224f7fb2238b', '小寨子社区D区玫瑰苑', '370000', '370200', '370214', '120.392055', '36.300876'); +INSERT INTO `pli_hik_community_info` VALUES ('1528611784972533764', '0', 0, 'APP_USER', '2022-05-23 13:40:24', 'APP_USER', '2022-05-23 13:40:24', '0001', '6c4109be29d34c0ebf4203459ba36e11', '小寨子社区C区芙蓉苑', '370000', '370200', '370214', '120.392576', '36.29958'); + +SET FOREIGN_KEY_CHECKS = 1; From 832c9dc83e8b0a2c29ff2cd0a3b3fc97b4fa5ad7 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 26 May 2022 13:18:59 +0800 Subject: [PATCH 060/108] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.10__pli_rent_update.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.10__pli_rent_update.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.10__pli_rent_update.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.10__pli_rent_update.sql new file mode 100644 index 0000000..68c19fe --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.10__pli_rent_update.sql @@ -0,0 +1,3 @@ +ALTER TABLE epmet_pli_power.pli_rent_tenant_info ADD UNIT varchar(255) NULL; +ALTER TABLE epmet_pli_power.pli_rent_contract_info ADD LESSEE_UNIT varchar(255) NULL COMMENT '承租人工作单位'; +ALTER TABLE epmet_pli_power.pli_rent_contract_info CHANGE LESSEE_UNIT LESSEE_UNIT varchar(255) NULL COMMENT '承租人工作单位' AFTER LESSEE_MOBILE; From 5e963bfcbac9d9678d9a75da2758858e67d217fe Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 26 May 2022 13:19:28 +0800 Subject: [PATCH 061/108] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E9=9D=9E=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E4=BB=A5=E5=A4=96=E4=B8=8B=E5=8F=91=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pli-power-base/pli-power-base-server/pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index adfd171..2e43ec1 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -167,8 +167,8 @@ https://api2.hik-cloud.com - 90688b09bb9d40088f7be404ccb347c7 - 7b1940707a4240be9c794c5a967a30c9 + 111 + 222 @@ -222,8 +222,8 @@ https://api2.hik-cloud.com - 90688b09bb9d40088f7be404ccb347c7 - 7b1940707a4240be9c794c5a967a30c9 + 111 + 222 @@ -281,8 +281,8 @@ https://api2.hik-cloud.com - 90688b09bb9d40088f7be404ccb347c7 - 7b1940707a4240be9c794c5a967a30c9 + 111 + 222 From fc9d39ae4e7b06de546a771d0a907ecb9ebe160c Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 9 Jun 2022 14:24:11 +0800 Subject: [PATCH 062/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=91=E7=8A=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/controller/PowerAxisStructController.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index 250a4f8..c65f523 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -1,9 +1,12 @@ package com.epmet.plugin.power.modules.axis.controller; +import com.alibaba.excel.util.StringUtils; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -97,7 +100,14 @@ public class PowerAxisStructController { * @date 2022/4/19/0019 14:17 */ @PostMapping("list4Tree") - public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { + public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto,@LoginUser TokenDto tokenDto) { + String agencyId = formDto.getAgencyId(); + if (StringUtils.isBlank(agencyId)) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null != staffInfo && StringUtils.isNotBlank(staffInfo.getAgencyId())) { + formDto.setAgencyId(staffInfo.getAgencyId()); + } + } return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); } From 7bdd209f2f91cad0d5a951997d2bf8142dceacf0 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Tue, 5 Jul 2022 09:25:42 +0800 Subject: [PATCH 063/108] =?UTF-8?q?=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 5b18087..9551e26 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -320,7 +320,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl Date: Wed, 6 Jul 2022 09:17:55 +0800 Subject: [PATCH 064/108] =?UTF-8?q?=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/power/dto/rent/RentContractFileDTO.java | 4 ++-- .../power/modules/rent/entity/RentContractFileEntity.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java index 51f4ab8..34faf2b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java @@ -32,7 +32,7 @@ public class RentContractFileDTO implements Serializable { private String fileUrl; /** - * 文件类型 0:图片,1 文件(合同) + * 文件类型 0:图片(人脸/头像),1 文件(合同),2 身份证照片,3 中介资料 */ private String fileType; @@ -66,4 +66,4 @@ public class RentContractFileDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java index d423815..1315055 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java @@ -31,9 +31,9 @@ public class RentContractFileEntity extends BaseEpmetEntity { */ private String fileUrl; - /** - * 文件类型 0:图片,1 文件(合同) - */ + /** + * 文件类型 0:图片(人脸/头像),1 文件(合同),2 身份证照片,3 中介资料 + */ private String fileType; /** From da7ff7e9199963f8675ce536a77d7472aee9b396 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Wed, 6 Jul 2022 14:13:49 +0800 Subject: [PATCH 065/108] =?UTF-8?q?=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/dto/rent/RentContractInfoDTO.java | 12 +++++++++++- .../modules/rent/entity/RentContractInfoEntity.java | 10 ++++++++++ .../V0.0.11__pli_rent_contract_info_add_address.sql | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.11__pli_rent_contract_info_add_address.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index c9a3198..7f47610 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -128,6 +128,11 @@ public class RentContractInfoDTO implements Serializable { */ private String lessorRelation; + /** + * 出租人现居住地址 + */ + private String lessorLiveAddress; + /** * 承租人姓名 */ @@ -151,6 +156,11 @@ public class RentContractInfoDTO implements Serializable { */ private String lesseeUnit; + /** + * 承租人户籍地地址 + */ + private String lesseeHouseAddress; + /** * 签署日期 */ @@ -200,4 +210,4 @@ public class RentContractInfoDTO implements Serializable { * 是否黑名单 */ private String isBlack; -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java index 5acefe5..22091f2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java @@ -111,6 +111,11 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String lessorRelation; + /** + * 出租人现居住地址 + */ + private String lessorLiveAddress; + /** * 承租人姓名 */ @@ -131,6 +136,11 @@ public class RentContractInfoEntity extends BaseEpmetEntity { */ private String lesseeUnit; + /** + * 承租人户籍地地址 + */ + private String lesseeHouseAddress; + /** * 签署日期 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.11__pli_rent_contract_info_add_address.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.11__pli_rent_contract_info_add_address.sql new file mode 100644 index 0000000..8c52b47 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.11__pli_rent_contract_info_add_address.sql @@ -0,0 +1,2 @@ +ALTER TABLE pli_rent_contract_info ADD COLUMN LESSOR_LIVE_ADDRESS varchar(255) COMMENT '出租人现居住地'; +ALTER TABLE pli_rent_contract_info ADD COLUMN LESSEE_HOUSE_ADDRESS varchar(255) COMMENT '承租人户籍地地址'; From 0c43ca9dda625426ae6785c58c98d6fc1113b7f6 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Wed, 6 Jul 2022 14:31:00 +0800 Subject: [PATCH 066/108] =?UTF-8?q?=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java index 7f47610..e0351b5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java @@ -131,6 +131,7 @@ public class RentContractInfoDTO implements Serializable { /** * 出租人现居住地址 */ + @NotBlank(message = "出租人现居住地址不能为空") private String lessorLiveAddress; /** @@ -159,6 +160,7 @@ public class RentContractInfoDTO implements Serializable { /** * 承租人户籍地地址 */ + @NotBlank(message = "承租人户籍地地址不能为空") private String lesseeHouseAddress; /** From 1120e668d50f644149340ad05d90476fd9ca6a68 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 11 Jul 2022 14:16:36 +0800 Subject: [PATCH 067/108] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentTenantInfoServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 33ac5ea..56b6d79 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -120,6 +120,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); params.put("state", NumConstant.ONE_STR); + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); if (!list(params).isEmpty()) { return new Result().error("用户已通过审核"); } From c2a97c29fbf199940d0e162549c944ef7766bed9 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 11 Jul 2022 17:08:49 +0800 Subject: [PATCH 068/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentTenantInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java index 56b6d79..1dfbd9e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentTenantInfoServiceImpl.java @@ -122,7 +122,7 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl images = new ArrayList<>(); From 12f564f8cdddf9e9568322ee0029827637f25d8a Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 26 Jul 2022 13:58:55 +0800 Subject: [PATCH 069/108] =?UTF-8?q?=E6=96=B9=E5=8F=AF=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/visit/VisitVisitorDTO.java | 129 ++++++++++++++++++ .../dto/visit/form/VisitVisitorFormDTO.java | 87 ++++++++++++ .../controller/VisitVisitorController.java | 90 ++++++++++++ .../modules/visit/dao/VisitVisitorDao.java | 16 +++ .../visit/entity/VisitVisitorEntity.java | 99 ++++++++++++++ .../visit/excel/VisitVisitorExcel.java | 81 +++++++++++ .../visit/redis/VisitVisitorRedis.java | 30 ++++ .../visit/service/VisitVisitorService.java | 90 ++++++++++++ .../service/impl/VisitVisitorServiceImpl.java | 96 +++++++++++++ .../mapper/visit/VisitVisitorDao.xml | 31 +++++ 10 files changed, 749 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/excel/VisitVisitorExcel.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/redis/VisitVisitorRedis.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java new file mode 100644 index 0000000..7ef81cf --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java @@ -0,0 +1,129 @@ +package com.epmet.plugin.power.dto.visit; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +@Data +public class VisitVisitorDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 性别 + */ + private String gender; + + /** + * 手机号 + */ + private String mobile; + + /** + * 人员类型 0:访客 1:租客 + */ + private String type; + + /** + * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用) + */ + private String state; + + /** + * 审核原因 + */ + private String reason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户ID + */ + private String customerId; + + /** + * 来访事由 + */ + private String visitReason; + + /** + * 头像 + */ + private String faceImg; + + /** + * 小区 + */ + private String residential; + + /** + * 楼栋 + */ + private String building; + + /** + * 单元 + */ + private String unit; + + /** + * 房屋 + */ + private String room; + + /** + * 二维码地区code + */ + private String areaCode; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java new file mode 100644 index 0000000..5ea58ed --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java @@ -0,0 +1,87 @@ +package com.epmet.plugin.power.dto.visit.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +@Data +public class VisitVisitorFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String name; + + /** + * 身份证 + */ + @NotBlank(message = "身份证号不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String idCard; + + /** + * 性别 + */ + @NotBlank(message = "性别不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String gender; + + /** + * 手机号 + */ + @NotBlank(message = "联系方式不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String mobile; + + /** + * 人员类型 0:访客 1:租客 + */ + private String type; + + /** + * 来访事由 + */ + private String visitReason; + + /** + * 头像 + */ + private String faceImg; + + /** + * 小区 + */ + private String residential; + + /** + * 楼栋 + */ + private String building; + + /** + * 单元 + */ + private String unit; + + /** + * 房屋 + */ + private String room; + + /** + * 二维码地区code + */ + private String areaCode; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java new file mode 100644 index 0000000..c360674 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java @@ -0,0 +1,90 @@ +package com.epmet.plugin.power.modules.visit.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.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.modules.visit.excel.VisitVisitorExcel; +import com.epmet.plugin.power.modules.visit.service.VisitVisitorService; +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-07-26 + */ +@RestController +@RequestMapping("visitVisitor") +public class VisitVisitorController { + + @Autowired + private VisitVisitorService visitVisitorService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = visitVisitorService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + VisitVisitorDTO data = visitVisitorService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody VisitVisitorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + visitVisitorService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody VisitVisitorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + visitVisitorService.update(dto); + return new Result(); + } + + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + visitVisitorService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = visitVisitorService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VisitVisitorExcel.class); + } + + @NoRepeatSubmit + @PostMapping("visit") + public Result visit(@RequestBody VisitVisitorFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + visitVisitorService.visit(dto); + return new Result(); + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java new file mode 100644 index 0000000..ca69c64 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java @@ -0,0 +1,16 @@ +package com.epmet.plugin.power.modules.visit.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +@Mapper +public interface VisitVisitorDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java new file mode 100644 index 0000000..d7a9f70 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java @@ -0,0 +1,99 @@ +package com.epmet.plugin.power.modules.visit.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 2022-07-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pli_visit_visitor") +public class VisitVisitorEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 性别 + */ + private String gender; + + /** + * 手机号 + */ + private String mobile; + + /** + * 人员类型 0:访客 1:租客 + */ + private String type; + + /** + * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用) + */ + private String state; + + /** + * 审核原因 + */ + private String reason; + + /** + * 客户ID + */ + private String customerId; + + /** + * 来访事由 + */ + private String visitReason; + + /** + * 头像 + */ + private String faceImg; + + /** + * 小区 + */ + private String residential; + + /** + * 楼栋 + */ + private String building; + + /** + * 单元 + */ + private String unit; + + /** + * 房屋 + */ + private String room; + + /** + * 二维码地区code + */ + private String areaCode; + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/excel/VisitVisitorExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/excel/VisitVisitorExcel.java new file mode 100644 index 0000000..5812052 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/excel/VisitVisitorExcel.java @@ -0,0 +1,81 @@ +package com.epmet.plugin.power.modules.visit.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-07-26 + */ +@Data +public class VisitVisitorExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "人员类型 0:访客 1:租客") + private String type; + + @Excel(name = "审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用)") + private String state; + + @Excel(name = "审核原因") + private String reason; + + @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; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "来访事由") + private String visitReason; + + @Excel(name = "头像") + private String faceImg; + + @Excel(name = "小区") + private String residential; + + @Excel(name = "楼栋") + private String building; + + @Excel(name = "单元") + private String unit; + + @Excel(name = "房屋") + private String room; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/redis/VisitVisitorRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/redis/VisitVisitorRedis.java new file mode 100644 index 0000000..0472c16 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/redis/VisitVisitorRedis.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.modules.visit.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-07-26 + */ +@Component +public class VisitVisitorRedis { + @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-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java new file mode 100644 index 0000000..120c580 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java @@ -0,0 +1,90 @@ +package com.epmet.plugin.power.modules.visit.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; + +import java.util.List; +import java.util.Map; + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +public interface VisitVisitorService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-07-26 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-07-26 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VisitVisitorDTO + * @author generator + * @date 2022-07-26 + */ + VisitVisitorDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-26 + */ + void save(VisitVisitorDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-26 + */ + void update(VisitVisitorDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-07-26 + */ + void delete(String[] ids); + + /** + * 访客来访 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-26 + */ + void visit(VisitVisitorFormDTO dto); + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java new file mode 100644 index 0000000..f25308a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -0,0 +1,96 @@ +package com.epmet.plugin.power.modules.visit.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.modules.visit.dao.VisitVisitorDao; +import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; +import com.epmet.plugin.power.modules.visit.redis.VisitVisitorRedis; +import com.epmet.plugin.power.modules.visit.service.VisitVisitorService; +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-07-26 + */ +@Service +public class VisitVisitorServiceImpl extends BaseServiceImpl implements VisitVisitorService { + + @Autowired + private VisitVisitorRedis visitVisitorRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VisitVisitorDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VisitVisitorDTO.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 VisitVisitorDTO get(String id) { + VisitVisitorEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VisitVisitorDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VisitVisitorDTO dto) { + VisitVisitorEntity entity = ConvertUtils.sourceToTarget(dto, VisitVisitorEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VisitVisitorDTO dto) { + VisitVisitorEntity entity = ConvertUtils.sourceToTarget(dto, VisitVisitorEntity.class); + 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 visit(VisitVisitorFormDTO dto) { + VisitVisitorEntity entity = ConvertUtils.sourceToTarget(dto, VisitVisitorEntity.class); + insert(entity); + } + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml new file mode 100644 index 0000000..20b3238 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4856b7544d9f809e7b97115de64f20a4f830647f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 26 Jul 2022 14:16:30 +0800 Subject: [PATCH 070/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/visit/form/VisitVisitorFormDTO.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java index 5ea58ed..427ecfd 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java @@ -1,6 +1,7 @@ package com.epmet.plugin.power.dto.visit.form; 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 lombok.Data; @@ -23,25 +24,25 @@ public class VisitVisitorFormDTO implements Serializable { /** * 姓名 */ - @NotBlank(message = "姓名不能为空",groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "姓名不能为空",groups = {AddGroup.class, DefaultGroup.class}) private String name; /** * 身份证 */ - @NotBlank(message = "身份证号不能为空",groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "身份证号不能为空",groups = {AddGroup.class, DefaultGroup.class}) private String idCard; /** * 性别 */ - @NotBlank(message = "性别不能为空",groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "性别不能为空",groups = {AddGroup.class, DefaultGroup.class}) private String gender; /** * 手机号 */ - @NotBlank(message = "联系方式不能为空",groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "联系方式不能为空",groups = {AddGroup.class, DefaultGroup.class}) private String mobile; /** @@ -84,4 +85,10 @@ public class VisitVisitorFormDTO implements Serializable { */ private String areaCode; + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = {AddGroup.class, DefaultGroup.class}) + private String customerId; + } \ No newline at end of file From e5e96cce421e46db970666602e2cf6cd0983ba13 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 26 Jul 2022 17:04:07 +0800 Subject: [PATCH 071/108] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/visit/VisitVisitorDTO.java | 18 ++++++++++++++++-- .../dto/visit/form/VisitVisitorFormDTO.java | 10 +++++----- .../visit/entity/VisitVisitorEntity.java | 19 +++++++++++++++++-- .../service/impl/VisitVisitorServiceImpl.java | 14 ++++++++++++++ 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java index 7ef81cf..2d038af 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java @@ -122,8 +122,22 @@ public class VisitVisitorDTO implements Serializable { private String room; /** - * 二维码地区code + * 组织id */ - private String areaCode; + private String agencyId; + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 网格id + */ + private String gridId; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java index 427ecfd..0bf90f8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java @@ -60,6 +60,11 @@ public class VisitVisitorFormDTO implements Serializable { */ private String faceImg; + /** + * 小区ID + */ + private String neighborhoodId; + /** * 小区 */ @@ -80,11 +85,6 @@ public class VisitVisitorFormDTO implements Serializable { */ private String room; - /** - * 二维码地区code - */ - private String areaCode; - /** * 客户ID */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java index d7a9f70..ccf906d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java @@ -92,8 +92,23 @@ public class VisitVisitorEntity extends BaseEpmetEntity { private String room; /** - * 二维码地区code + * 组织id */ - private String areaCode; + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 组织的所有上级组织id + */ + private String agencyPids; + + /** + * 网格id + */ + private String gridId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index f25308a..16b5619 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -3,9 +3,13 @@ package com.epmet.plugin.power.modules.visit.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.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; import com.epmet.plugin.power.modules.visit.dao.VisitVisitorDao; @@ -33,6 +37,9 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -89,6 +96,13 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getIcNeighbordhoodById(dto.getNeighborhoodId()); + if (result.success()) { + entity.setGridId(result.getData().getGridId()); + entity.setAgencyId(result.getData().getAgencyId()); + entity.setParentAgencyId(result.getData().getParentAgencyId()); + entity.setAgencyPids(result.getData().getAgencyPids()); + } insert(entity); } From b906d6a1d17020e542e8181ecb2241027c1a5d64 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 26 Jul 2022 17:45:08 +0800 Subject: [PATCH 072/108] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visit/service/impl/VisitVisitorServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 16b5619..70ff380 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -58,9 +58,13 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String idCard = (String)params.get("idCard"); + String mobile = (String)params.get("mobile"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); return wrapper; } From e645d2989308e7ed7a4c86e147269174005061bf Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 27 Jul 2022 15:13:49 +0800 Subject: [PATCH 073/108] =?UTF-8?q?=E4=B8=80=E5=A4=A7=E5=A0=86=E5=87=86?= =?UTF-8?q?=E5=A4=87=E4=B8=8B=E5=8F=91=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/commons/redis/RedisKeys.java | 14 + .../power/dto/visit/VisitVisitorDTO.java | 20 + .../dto/visit/form/VisitVisitorFormDTO.java | 15 + .../pli-power-base-server/pom.xml | 12 + .../power/config/DhCloudProperties.java | 43 + .../visit/entity/VisitVisitorEntity.java | 20 + .../service/impl/VisitVisitorServiceImpl.java | 27 +- .../power/modules/visit/utils/Base64Util.java | 768 ++++++++++++++++++ .../power/modules/visit/utils/BaseNCodec.java | 521 ++++++++++++ .../modules/visit/utils/DhDeviceUtil.java | 184 +++++ .../power/modules/visit/utils/DhToken.java | 40 + .../power/modules/visit/utils/RSAUtils.java | 309 +++++++ .../src/main/resources/bootstrap.yml | 4 + 13 files changed, 1973 insertions(+), 4 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/Base64Util.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/BaseNCodec.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java index b5f3a6e..c38a55c 100644 --- a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java +++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java @@ -26,4 +26,18 @@ public class RedisKeys { return "hik:token"; } + /** + * 大华publicKey + */ + public static String getDhPublicKey() { + return "dh:public"; + } + + /** + * 大华token + */ + public static String getDhToken() { + return "dh:token"; + } + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java index 2d038af..dec7fd5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java @@ -140,4 +140,24 @@ public class VisitVisitorDTO implements Serializable { * 网格id */ private String gridId; + + /** + * 小区ID + */ + private String neighborhoodId; + + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 单元ID + */ + private String unitId; + + /** + * 房屋ID + */ + private String houseId; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java index 0bf90f8..37233a8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java @@ -65,6 +65,21 @@ public class VisitVisitorFormDTO implements Serializable { */ private String neighborhoodId; + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 单元ID + */ + private String unitId; + + /** + * 房屋ID + */ + private String houseId; + /** * 小区 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 2e43ec1..d674639 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -169,6 +169,9 @@ https://api2.hik-cloud.com 111 222 + + https://api2.hik-cloud.com + 111 @@ -224,6 +227,9 @@ https://api2.hik-cloud.com 111 222 + + https://api2.hik-cloud.com + 111 @@ -283,6 +289,9 @@ https://api2.hik-cloud.com 111 222 + + https://api2.hik-cloud.com + 111 @@ -394,6 +403,9 @@ https://api2.hik-cloud.com 90688b09bb9d40088f7be404ccb347c7 7b1940707a4240be9c794c5a967a30c9 + + https://api2.hik-cloud.com + 111 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java new file mode 100644 index 0000000..260d863 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java @@ -0,0 +1,43 @@ +package com.epmet.plugin.power.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * 海康设备参数 + * + * @author zhy + * @date 2022/5/20 14:59 + */ +@Configuration +@ConfigurationProperties(prefix = "dh.cloud") +public class DhCloudProperties { + + /** + * 应用ID + */ + private String url; + + /** + * 应用KEY + */ + private String loginName; + + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java index ccf906d..0c31c8d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/entity/VisitVisitorEntity.java @@ -111,4 +111,24 @@ public class VisitVisitorEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 小区ID + */ + private String neighborhoodId; + + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 单元ID + */ + private String unitId; + + /** + * 房屋ID + */ + private String houseId; + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 70ff380..5f9efc4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.plugin.power.modules.visit.dao.VisitVisitorDao; import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; import com.epmet.plugin.power.modules.visit.redis.VisitVisitorRedis; import com.epmet.plugin.power.modules.visit.service.VisitVisitorService; +import com.epmet.plugin.power.modules.visit.utils.DhDeviceUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -40,6 +41,9 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -56,15 +60,27 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - String idCard = (String)params.get("idCard"); - String mobile = (String)params.get("mobile"); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String idCard = (String) params.get("idCard"); + String mobile = (String) params.get("mobile"); + String neighborhoodId = (String) params.get("neighborhoodId"); + String buildingId = (String) params.get("buildingId"); + String unitId = (String) params.get("unitId"); + String houseId = (String) params.get("houseId"); + String startTime = (String) params.get("startTime"); + String endTime = (String) params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.eq(StringUtils.isNotBlank(neighborhoodId), "NEIGHBORHOOD_ID", neighborhoodId); + wrapper.eq(StringUtils.isNotBlank(buildingId), "BUILDING_ID", buildingId); + wrapper.eq(StringUtils.isNotBlank(unitId), "UNIT_ID", unitId); + wrapper.eq(StringUtils.isNotBlank(houseId), "HOUSE_ID", houseId); + wrapper.gt(StringUtils.isNotBlank(startTime), "CREATED_TIME", startTime); + wrapper.lt(StringUtils.isNotBlank(endTime), "CREATED_TIME", endTime); return wrapper; } @@ -110,5 +126,8 @@ public class VisitVisitorServiceImpl extends BaseServiceImplRFC 2045. + * + *

+ * This class implements section 6.8. Base64 Content-Transfer-Encoding from RFC 2045 Multipurpose + * Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies by Freed and Borenstein. + *

+ *

+ * The class can be parameterized in the following manner with various constructors: + *

+ *
    + *
  • URL-safe mode: Default off.
  • + *
  • Line length: Default 76. Line length that aren't multiples of 4 will still essentially end up being multiples of + * 4 in the encoded data. + *
  • Line separator: Default is CRLF ("\r\n")
  • + *
+ *

+ * The URL-safe parameter is only applied to encode operations. Decoding seamlessly handles both modes. + *

+ *

+ * Since this class operates directly on byte streams, and not character streams, it is hard-coded to only + * encode/decode character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252, + * UTF-8, etc). + *

+ *

+ * This class is thread-safe. + *

+ * + * @see RFC 2045 + * @since 1.0 + * @version $Id: Base64.java 1635986 2014-11-01 16:27:52Z tn $ + */ +public class Base64Util extends BaseNCodec { + + /** + * BASE32 characters are 6 bits in length. + * They are formed by taking a block of 3 octets to form a 24-bit string, + * which is converted into 4 BASE64 characters. + */ + private static final int BITS_PER_ENCODED_BYTE = 6; + private static final int BYTES_PER_UNENCODED_BLOCK = 3; + private static final int BYTES_PER_ENCODED_BLOCK = 4; + + /** + * Chunk separator per RFC 2045 section 2.1. + * + *

+ * N.B. The next major release may break compatibility and make this field private. + *

+ * + * @see RFC 2045 section 2.1 + */ + static final byte[] CHUNK_SEPARATOR = {'\r', '\n'}; + + /** + * This array is a lookup table that translates 6-bit positive integer index values into their "Base64 Alphabet" + * equivalents as specified in Table 1 of RFC 2045. + * + * Thanks to "commons" project in ws.apache.org for this code. + * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/ + */ + private static final byte[] STANDARD_ENCODE_TABLE = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' + }; + + /** + * This is a copy of the STANDARD_ENCODE_TABLE above, but with + and / + * changed to - and _ to make the encoded Base64 results more URL-SAFE. + * This table is only used when the Base64's mode is set to URL-SAFE. + */ + private static final byte[] URL_SAFE_ENCODE_TABLE = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_' + }; + + /** + * This array is a lookup table that translates Unicode characters drawn from the "Base64 Alphabet" (as specified + * in Table 1 of RFC 2045) into their 6-bit positive integer equivalents. Characters that are not in the Base64 + * alphabet but fall within the bounds of the array are translated to -1. + * + * Note: '+' and '-' both decode to 62. '/' and '_' both decode to 63. This means decoder seamlessly handles both + * URL_SAFE and STANDARD base64. (The encoder, on the other hand, needs to know ahead of time what to emit). + * + * Thanks to "commons" project in ws.apache.org for this code. + * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/ + */ + private static final byte[] DECODE_TABLE = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 + }; + + /** + * Base64 uses 6-bit fields. + */ + /** Mask used to extract 6 bits, used when encoding */ + private static final int MASK_6BITS = 0x3f; + + // The static final fields above are used for the original static byte[] methods on Base64. + // The private member fields below are used with the new streaming approach, which requires + // some state be preserved between calls of encode() and decode(). + + /** + * Encode table to use: either STANDARD or URL_SAFE. Note: the DECODE_TABLE above remains static because it is able + * to decode both STANDARD and URL_SAFE streams, but the encodeTable must be a member variable so we can switch + * between the two modes. + */ + private final byte[] encodeTable; + + // Only one decode table currently; keep for consistency with Base32 code + private final byte[] decodeTable = DECODE_TABLE; + + /** + * Line separator for encoding. Not used when decoding. Only used if lineLength > 0. + */ + private final byte[] lineSeparator; + + /** + * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing. + * decodeSize = 3 + lineSeparator.length; + */ + private final int decodeSize; + + /** + * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing. + * encodeSize = 4 + lineSeparator.length; + */ + private final int encodeSize; + + /** + * Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode. + *

+ * When encoding the line length is 0 (no chunking), and the encoding table is STANDARD_ENCODE_TABLE. + *

+ * + *

+ * When decoding all variants are supported. + *

+ */ + public Base64Util() { + this(0); + } + + /** + * Creates a Base64 codec used for decoding (all modes) and encoding in the given URL-safe mode. + *

+ * When encoding the line length is 76, the line separator is CRLF, and the encoding table is STANDARD_ENCODE_TABLE. + *

+ * + *

+ * When decoding all variants are supported. + *

+ * + * @param urlSafe + * if true, URL-safe encoding is used. In most cases this should be set to + * false. + * @since 1.4 + */ + public Base64Util(final boolean urlSafe) { + this(MIME_CHUNK_SIZE, CHUNK_SEPARATOR, urlSafe); + } + + /** + * Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode. + *

+ * When encoding the line length is given in the constructor, the line separator is CRLF, and the encoding table is + * STANDARD_ENCODE_TABLE. + *

+ *

+ * Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data. + *

+ *

+ * When decoding all variants are supported. + *

+ * + * @param lineLength + * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of + * 4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when + * decoding. + * @since 1.4 + */ + public Base64Util(final int lineLength) { + this(lineLength, CHUNK_SEPARATOR); + } + + /** + * Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode. + *

+ * When encoding the line length and line separator are given in the constructor, and the encoding table is + * STANDARD_ENCODE_TABLE. + *

+ *

+ * Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data. + *

+ *

+ * When decoding all variants are supported. + *

+ * + * @param lineLength + * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of + * 4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when + * decoding. + * @param lineSeparator + * Each line of encoded data will end with this sequence of bytes. + * @throws IllegalArgumentException + * Thrown when the provided lineSeparator included some base64 characters. + * @since 1.4 + */ + public Base64Util(final int lineLength, final byte[] lineSeparator) { + this(lineLength, lineSeparator, false); + } + + /** + * Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode. + *

+ * When encoding the line length and line separator are given in the constructor, and the encoding table is + * STANDARD_ENCODE_TABLE. + *

+ *

+ * Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data. + *

+ *

+ * When decoding all variants are supported. + *

+ * + * @param lineLength + * Each line of encoded data will be at most of the given length (rounded down to nearest multiple of + * 4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when + * decoding. + * @param lineSeparator + * Each line of encoded data will end with this sequence of bytes. + * @param urlSafe + * Instead of emitting '+' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode + * operations. Decoding seamlessly handles both modes. + * Note: no padding is added when using the URL-safe alphabet. + * @throws IllegalArgumentException + * The provided lineSeparator included some base64 characters. That's not going to work! + * @since 1.4 + */ + public Base64Util(final int lineLength, final byte[] lineSeparator, final boolean urlSafe) { + super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK, + lineLength, + lineSeparator == null ? 0 : lineSeparator.length); + // TODO could be simplified if there is no requirement to reject invalid line sep when length <=0 + // @see test case Base64Test.testConstructors() + if (lineSeparator != null) { + if (containsAlphabetOrPad(lineSeparator)) { + final String sep = newStringUtf8(lineSeparator); + throw new IllegalArgumentException("lineSeparator must not contain base64 characters: [" + sep + "]"); + } + if (lineLength > 0){ // null line-sep forces no chunking rather than throwing IAE + this.encodeSize = BYTES_PER_ENCODED_BLOCK + lineSeparator.length; + this.lineSeparator = new byte[lineSeparator.length]; + System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length); + } else { + this.encodeSize = BYTES_PER_ENCODED_BLOCK; + this.lineSeparator = null; + } + } else { + this.encodeSize = BYTES_PER_ENCODED_BLOCK; + this.lineSeparator = null; + } + this.decodeSize = this.encodeSize - 1; + this.encodeTable = urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE; + } + + /** + * Returns our current encode mode. True if we're URL-SAFE, false otherwise. + * + * @return true if we're in URL-SAFE mode, false otherwise. + * @since 1.4 + */ + public boolean isUrlSafe() { + return this.encodeTable == URL_SAFE_ENCODE_TABLE; + } + + /** + *

+ * Encodes all of the provided data, starting at inPos, for inAvail bytes. Must be called at least twice: once with + * the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has been reached, to flush last + * remaining bytes (if not multiple of 3). + *

+ *

Note: no padding is added when encoding using the URL-safe alphabet.

+ *

+ * Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach. + * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/ + *

+ * + * @param in + * byte[] array of binary data to base64 encode. + * @param inPos + * Position to start reading data from. + * @param inAvail + * Amount of bytes available from input for encoding. + * @param context + * the context to be used + */ + @Override + void encode(final byte[] in, int inPos, final int inAvail, final Context context) { + if (context.eof) { + return; + } + // inAvail < 0 is how we're informed of EOF in the underlying data we're + // encoding. + if (inAvail < 0) { + context.eof = true; + if (0 == context.modulus && lineLength == 0) { + return; // no leftovers to process and not using chunking + } + final byte[] buffer = ensureBufferSize(encodeSize, context); + final int savedPos = context.pos; + switch (context.modulus) { // 0-2 + case 0 : // nothing to do here + break; + case 1 : // 8 bits = 6 + 2 + // top 6 bits: + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 2) & MASK_6BITS]; + // remaining 2: + buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 4) & MASK_6BITS]; + // URL-SAFE skips the padding to further reduce size. + if (encodeTable == STANDARD_ENCODE_TABLE) { + buffer[context.pos++] = pad; + buffer[context.pos++] = pad; + } + break; + + case 2 : // 16 bits = 6 + 6 + 4 + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 10) & MASK_6BITS]; + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 4) & MASK_6BITS]; + buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 2) & MASK_6BITS]; + // URL-SAFE skips the padding to further reduce size. + if (encodeTable == STANDARD_ENCODE_TABLE) { + buffer[context.pos++] = pad; + } + break; + default: + throw new IllegalStateException("Impossible modulus "+context.modulus); + } + context.currentLinePos += context.pos - savedPos; // keep track of current line position + // if currentPos == 0 we are at the start of a line, so don't add CRLF + if (lineLength > 0 && context.currentLinePos > 0) { + System.arraycopy(lineSeparator, 0, buffer, context.pos, lineSeparator.length); + context.pos += lineSeparator.length; + } + } else { + for (int i = 0; i < inAvail; i++) { + final byte[] buffer = ensureBufferSize(encodeSize, context); + context.modulus = (context.modulus+1) % BYTES_PER_UNENCODED_BLOCK; + int b = in[inPos++]; + if (b < 0) { + b += 256; + } + context.ibitWorkArea = (context.ibitWorkArea << 8) + b; // BITS_PER_BYTE + if (0 == context.modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 18) & MASK_6BITS]; + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 12) & MASK_6BITS]; + buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 6) & MASK_6BITS]; + buffer[context.pos++] = encodeTable[context.ibitWorkArea & MASK_6BITS]; + context.currentLinePos += BYTES_PER_ENCODED_BLOCK; + if (lineLength > 0 && lineLength <= context.currentLinePos) { + System.arraycopy(lineSeparator, 0, buffer, context.pos, lineSeparator.length); + context.pos += lineSeparator.length; + context.currentLinePos = 0; + } + } + } + } + } + + /** + *

+ * Decodes all of the provided data, starting at inPos, for inAvail bytes. Should be called at least twice: once + * with the data to decode, and once with inAvail set to "-1" to alert decoder that EOF has been reached. The "-1" + * call is not necessary when decoding, but it doesn't hurt, either. + *

+ *

+ * Ignores all non-base64 characters. This is how chunked (e.g. 76 character) data is handled, since CR and LF are + * silently ignored, but has implications for other bytes, too. This method subscribes to the garbage-in, + * garbage-out philosophy: it will not check the provided data for validity. + *

+ *

+ * Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach. + * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/ + *

+ * + * @param in + * byte[] array of ascii data to base64 decode. + * @param inPos + * Position to start reading data from. + * @param inAvail + * Amount of bytes available from input for encoding. + * @param context + * the context to be used + */ + @Override + void decode(final byte[] in, int inPos, final int inAvail, final Context context) { + if (context.eof) { + return; + } + if (inAvail < 0) { + context.eof = true; + } + for (int i = 0; i < inAvail; i++) { + final byte[] buffer = ensureBufferSize(decodeSize, context); + final byte b = in[inPos++]; + if (b == pad) { + // We're done. + context.eof = true; + break; + } else { + if (b >= 0 && b < DECODE_TABLE.length) { + final int result = DECODE_TABLE[b]; + if (result >= 0) { + context.modulus = (context.modulus+1) % BYTES_PER_ENCODED_BLOCK; + context.ibitWorkArea = (context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result; + if (context.modulus == 0) { + buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 16) & MASK_8BITS); + buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS); + buffer[context.pos++] = (byte) (context.ibitWorkArea & MASK_8BITS); + } + } + } + } + } + + // Two forms of EOF as far as base64 decoder is concerned: actual + // EOF (-1) and first time '=' character is encountered in stream. + // This approach makes the '=' padding characters completely optional. + if (context.eof && context.modulus != 0) { + final byte[] buffer = ensureBufferSize(decodeSize, context); + + // We have some spare bits remaining + // Output all whole multiples of 8 bits and ignore the rest + switch (context.modulus) { +// case 0 : // impossible, as excluded above + case 1 : // 6 bits - ignore entirely + // TODO not currently tested; perhaps it is impossible? + break; + case 2 : // 12 bits = 8 + 4 + context.ibitWorkArea = context.ibitWorkArea >> 4; // dump the extra 4 bits + buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS); + break; + case 3 : // 18 bits = 8 + 8 + 2 + context.ibitWorkArea = context.ibitWorkArea >> 2; // dump 2 bits + buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS); + buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS); + break; + default: + throw new IllegalStateException("Impossible modulus "+context.modulus); + } + } + } + + /** + * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the + * method treats whitespace as valid. + * + * @param arrayOctet + * byte array to test + * @return true if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; + * false, otherwise + * @deprecated 1.5 Use {@link #isBase64(byte[])}, will be removed in 2.0. + */ + @Deprecated + public static boolean isArrayByteBase64(final byte[] arrayOctet) { + return isBase64(arrayOctet); + } + + /** + * Returns whether or not the octet is in the base 64 alphabet. + * + * @param octet + * The value to test + * @return true if the value is defined in the the base 64 alphabet, false otherwise. + * @since 1.4 + */ + public static boolean isBase64(final byte octet) { + return octet == PAD_DEFAULT || (octet >= 0 && octet < DECODE_TABLE.length && DECODE_TABLE[octet] != -1); + } + + /** + * Tests a given String to see if it contains only valid characters within the Base64 alphabet. Currently the + * method treats whitespace as valid. + * + * @param base64 + * String to test + * @return true if all characters in the String are valid characters in the Base64 alphabet or if + * the String is empty; false, otherwise + * @since 1.5 + */ + public static boolean isBase64(final String base64) { + return isBase64(getBytesUtf8(base64)); + } + + /** + * Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the + * method treats whitespace as valid. + * + * @param arrayOctet + * byte array to test + * @return true if all bytes are valid characters in the Base64 alphabet or if the byte array is empty; + * false, otherwise + * @since 1.5 + */ + public static boolean isBase64(final byte[] arrayOctet) { + for (int i = 0; i < arrayOctet.length; i++) { + if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) { + return false; + } + } + return true; + } + + /** + * Encodes binary data using the base64 algorithm but does not chunk the output. + * + * @param binaryData + * binary data to encode + * @return byte[] containing Base64 characters in their UTF-8 representation. + */ + public static byte[] encodeBase64(final byte[] binaryData) { + return encodeBase64(binaryData, false); + } + + /** + * Encodes binary data using the base64 algorithm but does not chunk the output. + * + * NOTE: We changed the behaviour of this method from multi-line chunking (commons-codec-1.4) to + * single-line non-chunking (commons-codec-1.5). + * + * @param binaryData + * binary data to encode + * @return String containing Base64 characters. + * @since 1.4 (NOTE: 1.4 chunked the output, whereas 1.5 does not). + */ + public static String encodeBase64String(final byte[] binaryData) { + return newStringUtf8(encodeBase64(binaryData, false)); + } + + /** + * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The + * url-safe variation emits - and _ instead of + and / characters. + * Note: no padding is added. + * @param binaryData + * binary data to encode + * @return byte[] containing Base64 characters in their UTF-8 representation. + * @since 1.4 + */ + public static byte[] encodeBase64URLSafe(final byte[] binaryData) { + return encodeBase64(binaryData, false, true); + } + + /** + * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The + * url-safe variation emits - and _ instead of + and / characters. + * Note: no padding is added. + * @param binaryData + * binary data to encode + * @return String containing Base64 characters + * @since 1.4 + */ + public static String encodeBase64URLSafeString(final byte[] binaryData) { + return newStringUtf8(encodeBase64(binaryData, false, true)); + } + + /** + * Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks + * + * @param binaryData + * binary data to encode + * @return Base64 characters chunked in 76 character blocks + */ + public static byte[] encodeBase64Chunked(final byte[] binaryData) { + return encodeBase64(binaryData, true); + } + + /** + * Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks. + * + * @param binaryData + * Array containing binary data to encode. + * @param isChunked + * if true this encoder will chunk the base64 output into 76 character blocks + * @return Base64-encoded data. + * @throws IllegalArgumentException + * Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE} + */ + public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked) { + return encodeBase64(binaryData, isChunked, false); + } + + /** + * Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks. + * + * @param binaryData + * Array containing binary data to encode. + * @param isChunked + * if true this encoder will chunk the base64 output into 76 character blocks + * @param urlSafe + * if true this encoder will emit - and _ instead of the usual + and / characters. + * Note: no padding is added when encoding using the URL-safe alphabet. + * @return Base64-encoded data. + * @throws IllegalArgumentException + * Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE} + * @since 1.4 + */ + public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked, final boolean urlSafe) { + return encodeBase64(binaryData, isChunked, urlSafe, Integer.MAX_VALUE); + } + + /** + * Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks. + * + * @param binaryData + * Array containing binary data to encode. + * @param isChunked + * if true this encoder will chunk the base64 output into 76 character blocks + * @param urlSafe + * if true this encoder will emit - and _ instead of the usual + and / characters. + * Note: no padding is added when encoding using the URL-safe alphabet. + * @param maxResultSize + * The maximum result size to accept. + * @return Base64-encoded data. + * @throws IllegalArgumentException + * Thrown when the input array needs an output array bigger than maxResultSize + * @since 1.4 + */ + public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked, + final boolean urlSafe, final int maxResultSize) { + if (binaryData == null || binaryData.length == 0) { + return binaryData; + } + + // Create this so can use the super-class method + // Also ensures that the same roundings are performed by the ctor and the code + final Base64Util b64 = isChunked ? new Base64Util(urlSafe) : new Base64Util(0, CHUNK_SEPARATOR, urlSafe); + final long len = b64.getEncodedLength(binaryData); + if (len > maxResultSize) { + throw new IllegalArgumentException("Input array too big, the output array would be bigger (" + + len + + ") than the specified maximum size of " + + maxResultSize); + } + + return b64.encode(binaryData); + } + + /** + * Decodes a Base64 String into octets. + *

+ * Note: this method seamlessly handles data encoded in URL-safe or normal mode. + *

+ * + * @param base64String + * String containing Base64 data + * @return Array containing decoded data. + * @since 1.4 + */ + public static byte[] decodeBase64(final String base64String) { + return new Base64Util().decode(base64String); + } + + /** + * Decodes Base64 data into octets. + *

+ * Note: this method seamlessly handles data encoded in URL-safe or normal mode. + *

+ * + * @param base64Data + * Byte array containing Base64 data + * @return Array containing decoded data. + */ + public static byte[] decodeBase64(final byte[] base64Data) { + return new Base64Util().decode(base64Data); + } + + // Implementation of the Encoder Interface + + // Implementation of integer encoding used for crypto + /** + * Decodes a byte64-encoded integer according to crypto standards such as W3C's XML-Signature. + * + * @param pArray + * a byte array containing base64 character data + * @return A BigInteger + * @since 1.4 + */ + public static BigInteger decodeInteger(final byte[] pArray) { + return new BigInteger(1, decodeBase64(pArray)); + } + + /** + * Encodes to a byte64-encoded integer according to crypto standards such as W3C's XML-Signature. + * + * @param bigInt + * a BigInteger + * @return A byte array containing base64 character data + * @throws NullPointerException + * if null is passed in + * @since 1.4 + */ + public static byte[] encodeInteger(final BigInteger bigInt) { + if (bigInt == null) { + throw new NullPointerException("encodeInteger called with null parameter"); + } + return encodeBase64(toIntegerBytes(bigInt), false); + } + + /** + * Returns a byte-array representation of a BigInteger without sign bit. + * + * @param bigInt + * BigInteger to be converted + * @return a byte array representation of the BigInteger parameter + */ + static byte[] toIntegerBytes(final BigInteger bigInt) { + int bitlen = bigInt.bitLength(); + // round bitlen + bitlen = ((bitlen + 7) >> 3) << 3; + final byte[] bigBytes = bigInt.toByteArray(); + + if (((bigInt.bitLength() % 8) != 0) && (((bigInt.bitLength() / 8) + 1) == (bitlen / 8))) { + return bigBytes; + } + // set up params for copying everything but sign bit + int startSrc = 0; + int len = bigBytes.length; + + // if bigInt is exactly byte-aligned, just skip signbit in copy + if ((bigInt.bitLength() % 8) == 0) { + startSrc = 1; + len--; + } + final int startDst = bitlen / 8 - len; // to pad w/ nulls as per spec + final byte[] resizedBytes = new byte[bitlen / 8]; + System.arraycopy(bigBytes, startSrc, resizedBytes, startDst, len); + return resizedBytes; + } + + /** + * Returns whether or not the octet is in the Base64 alphabet. + * + * @param octet + * The value to test + * @return true if the value is defined in the the Base64 alphabet false otherwise. + */ + @Override + protected boolean isInAlphabet(final byte octet) { + return octet >= 0 && octet < decodeTable.length && decodeTable[octet] != -1; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/BaseNCodec.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/BaseNCodec.java new file mode 100644 index 0000000..2ab2ea6 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/BaseNCodec.java @@ -0,0 +1,521 @@ +package com.epmet.plugin.power.modules.visit.utils; + + +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * Abstract superclass for Base-N encoders and decoders. + * + *

+ * This class is thread-safe. + *

+ * + * @version $Id: BaseNCodec.java 1634404 2014-10-26 23:06:10Z ggregory $ + */ +public abstract class BaseNCodec { + + /** + * Holds thread context so classes can be thread-safe. + * + * This class is not itself thread-safe; each thread must allocate its own copy. + * + * @since 1.7 + */ + static class Context { + + /** + * Place holder for the bytes we're dealing with for our based logic. + * Bitwise operations store and extract the encoding or decoding from this variable. + */ + int ibitWorkArea; + + /** + * Place holder for the bytes we're dealing with for our based logic. + * Bitwise operations store and extract the encoding or decoding from this variable. + */ + long lbitWorkArea; + + /** + * Buffer for streaming. + */ + byte[] buffer; + + /** + * Position where next character should be written in the buffer. + */ + int pos; + + /** + * Position where next character should be read from the buffer. + */ + int readPos; + + /** + * Boolean flag to indicate the EOF has been reached. Once EOF has been reached, this object becomes useless, + * and must be thrown away. + */ + boolean eof; + + /** + * Variable tracks how many characters have been written to the current line. Only used when encoding. We use + * it to make sure each encoded line never goes beyond lineLength (if lineLength > 0). + */ + int currentLinePos; + + /** + * Writes to the buffer only occur after every 3/5 reads when encoding, and every 4/8 reads when decoding. This + * variable helps track that. + */ + int modulus; + + Context() { + } + + /** + * Returns a String useful for debugging (especially within a debugger.) + * + * @return a String useful for debugging. + */ + @SuppressWarnings("boxing") // OK to ignore boxing here + public String toString() { + return String.format("%s[buffer=%s, currentLinePos=%s, eof=%s, ibitWorkArea=%s, lbitWorkArea=%s, " + + "modulus=%s, pos=%s, readPos=%s]", this.getClass().getSimpleName(), Arrays.toString(buffer), + currentLinePos, eof, ibitWorkArea, lbitWorkArea, modulus, pos, readPos); + } + } + + /** + * EOF + * + * @since 1.7 + */ + static final int EOF = -1; + + /** + * MIME chunk size per RFC 2045 section 6.8. + * + *

+ * The {@value} character limit does not count the trailing CRLF, but counts all other characters, including any + * equal signs. + *

+ * + * @see RFC 2045 section 6.8 + */ + public static final int MIME_CHUNK_SIZE = 76; + + /** + * PEM chunk size per RFC 1421 section 4.3.2.4. + * + *

+ * The {@value} character limit does not count the trailing CRLF, but counts all other characters, including any + * equal signs. + *

+ * + * @see RFC 1421 section 4.3.2.4 + */ + public static final int PEM_CHUNK_SIZE = 64; + + private static final int DEFAULT_BUFFER_RESIZE_FACTOR = 2; + + /** + * Defines the default buffer size - currently {@value} + * - must be large enough for at least one encoded block+separator + */ + private static final int DEFAULT_BUFFER_SIZE = 8192; + + /** Mask used to extract 8 bits, used in decoding bytes */ + protected static final int MASK_8BITS = 0xff; + + /** + * Byte used to pad output. + */ + protected static final byte PAD_DEFAULT = '='; // Allow static access to default + + /** + * @deprecated Use {@link #pad}. Will be removed in 2.0. + */ + @Deprecated + protected final byte PAD = PAD_DEFAULT; // instance variable just in case it needs to vary later + + protected final byte pad; // instance variable just in case it needs to vary later + + /** Number of bytes in each full block of unencoded data, e.g. 4 for Base64 and 5 for Base32 */ + private final int unencodedBlockSize; + + /** Number of bytes in each full block of encoded data, e.g. 3 for Base64 and 8 for Base32 */ + private final int encodedBlockSize; + + /** + * Chunksize for encoding. Not used when decoding. + * A value of zero or less implies no chunking of the encoded data. + * Rounded down to nearest multiple of encodedBlockSize. + */ + protected final int lineLength; + + /** + * Size of chunk separator. Not used unless {@link #lineLength} > 0. + */ + private final int chunkSeparatorLength; + + /** + * Note lineLength is rounded down to the nearest multiple of {@link #encodedBlockSize} + * If chunkSeparatorLength is zero, then chunking is disabled. + * @param unencodedBlockSize the size of an unencoded block (e.g. Base64 = 3) + * @param encodedBlockSize the size of an encoded block (e.g. Base64 = 4) + * @param lineLength if > 0, use chunking with a length lineLength + * @param chunkSeparatorLength the chunk separator length, if relevant + */ + protected BaseNCodec(final int unencodedBlockSize, final int encodedBlockSize, + final int lineLength, final int chunkSeparatorLength) { + this(unencodedBlockSize, encodedBlockSize, lineLength, chunkSeparatorLength, PAD_DEFAULT); + } + + /** + * Note lineLength is rounded down to the nearest multiple of {@link #encodedBlockSize} + * If chunkSeparatorLength is zero, then chunking is disabled. + * @param unencodedBlockSize the size of an unencoded block (e.g. Base64 = 3) + * @param encodedBlockSize the size of an encoded block (e.g. Base64 = 4) + * @param lineLength if > 0, use chunking with a length lineLength + * @param chunkSeparatorLength the chunk separator length, if relevant + * @param pad byte used as padding byte. + */ + protected BaseNCodec(final int unencodedBlockSize, final int encodedBlockSize, + final int lineLength, final int chunkSeparatorLength, final byte pad) { + this.unencodedBlockSize = unencodedBlockSize; + this.encodedBlockSize = encodedBlockSize; + final boolean useChunking = lineLength > 0 && chunkSeparatorLength > 0; + this.lineLength = useChunking ? (lineLength / encodedBlockSize) * encodedBlockSize : 0; + this.chunkSeparatorLength = chunkSeparatorLength; + + this.pad = pad; + } + + /** + * Returns true if this object has buffered data for reading. + * + * @param context the context to be used + * @return true if there is data still available for reading. + */ + boolean hasData(final Context context) { // package protected for access from I/O streams + return context.buffer != null; + } + + /** + * Returns the amount of buffered data available for reading. + * + * @param context the context to be used + * @return The amount of buffered data available for reading. + */ + int available(final Context context) { // package protected for access from I/O streams + return context.buffer != null ? context.pos - context.readPos : 0; + } + + /** + * Get the default buffer size. Can be overridden. + * + * @return {@link #DEFAULT_BUFFER_SIZE} + */ + protected int getDefaultBufferSize() { + return DEFAULT_BUFFER_SIZE; + } + + /** + * Increases our buffer by the {@link #DEFAULT_BUFFER_RESIZE_FACTOR}. + * @param context the context to be used + */ + private byte[] resizeBuffer(final Context context) { + if (context.buffer == null) { + context.buffer = new byte[getDefaultBufferSize()]; + context.pos = 0; + context.readPos = 0; + } else { + final byte[] b = new byte[context.buffer.length * DEFAULT_BUFFER_RESIZE_FACTOR]; + System.arraycopy(context.buffer, 0, b, 0, context.buffer.length); + context.buffer = b; + } + return context.buffer; + } + + /** + * Ensure that the buffer has room for size bytes + * + * @param size minimum spare space required + * @param context the context to be used + * @return the buffer + */ + protected byte[] ensureBufferSize(final int size, final Context context){ + if ((context.buffer == null) || (context.buffer.length < context.pos + size)){ + return resizeBuffer(context); + } + return context.buffer; + } + + /** + * Extracts buffered data into the provided byte[] array, starting at position bPos, up to a maximum of bAvail + * bytes. Returns how many bytes were actually extracted. + *

+ * Package protected for access from I/O streams. + * + * @param b + * byte[] array to extract the buffered data into. + * @param bPos + * position in byte[] array to start extraction at. + * @param bAvail + * amount of bytes we're allowed to extract. We may extract fewer (if fewer are available). + * @param context + * the context to be used + * @return The number of bytes successfully extracted into the provided byte[] array. + */ + int readResults(final byte[] b, final int bPos, final int bAvail, final Context context) { + if (context.buffer != null) { + final int len = Math.min(available(context), bAvail); + System.arraycopy(context.buffer, context.readPos, b, bPos, len); + context.readPos += len; + if (context.readPos >= context.pos) { + context.buffer = null; // so hasData() will return false, and this method can return -1 + } + return len; + } + return context.eof ? EOF : 0; + } + + /** + * Checks if a byte value is whitespace or not. + * Whitespace is taken to mean: space, tab, CR, LF + * @param byteToCheck + * the byte to check + * @return true if byte is whitespace, false otherwise + */ + protected static boolean isWhiteSpace(final byte byteToCheck) { + switch (byteToCheck) { + case ' ' : + case '\n' : + case '\r' : + case '\t' : + return true; + default : + return false; + } + } + + /** + * Encodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of + * the Encoder interface, and will throw an EncoderException if the supplied object is not of type byte[]. + * + * @param obj + * Object to encode + * @return An object (of type byte[]) containing the Base-N encoded data which corresponds to the byte[] supplied. + * @throws Exception + * if the parameter supplied is not of type byte[] + */ + public Object encode(final Object obj) throws Exception { + if (!(obj instanceof byte[])) { + throw new Exception("Parameter supplied to Base-N encode is not a byte[]"); + } + return encode((byte[]) obj); + } + + /** + * Encodes a byte[] containing binary data, into a String containing characters in the Base-N alphabet. + * Uses UTF8 encoding. + * + * @param pArray + * a byte array containing binary data + * @return A String containing only Base-N character data + */ + public String encodeToString(final byte[] pArray) { + return newStringUtf8(encode(pArray)); + } + + /** + * Encodes a byte[] containing binary data, into a String containing characters in the appropriate alphabet. + * Uses UTF8 encoding. + * + * @param pArray a byte array containing binary data + * @return String containing only character data in the appropriate alphabet. + */ + public String encodeAsString(final byte[] pArray){ + return newStringUtf8(encode(pArray)); + } + + /** + * Decodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of + * the Decoder interface, and will throw a DecoderException if the supplied object is not of type byte[] or String. + * + * @param obj + * Object to decode + * @return An object (of type byte[]) containing the binary data which corresponds to the byte[] or String + * supplied. + * @throws Exception + * if the parameter supplied is not of type byte[] + */ + public Object decode(final Object obj) throws Exception { + if (obj instanceof byte[]) { + return decode((byte[]) obj); + } else if (obj instanceof String) { + return decode((String) obj); + } else { + throw new Exception("Parameter supplied to Base-N decode is not a byte[] or a String"); + } + } + + /** + * Decodes a String containing characters in the Base-N alphabet. + * + * @param pArray + * A String containing Base-N character data + * @return a byte array containing binary data + */ + public byte[] decode(final String pArray) { + return decode(getBytesUtf8(pArray)); + } + + /** + * Decodes a byte[] containing characters in the Base-N alphabet. + * + * @param pArray + * A byte array containing Base-N character data + * @return a byte array containing binary data + */ + public byte[] decode(final byte[] pArray) { + if (pArray == null || pArray.length == 0) { + return pArray; + } + final Context context = new Context(); + decode(pArray, 0, pArray.length, context); + decode(pArray, 0, EOF, context); // Notify decoder of EOF. + final byte[] result = new byte[context.pos]; + readResults(result, 0, result.length, context); + return result; + } + + /** + * Encodes a byte[] containing binary data, into a byte[] containing characters in the alphabet. + * + * @param pArray + * a byte array containing binary data + * @return A byte array containing only the basen alphabetic character data + */ + public byte[] encode(final byte[] pArray) { + if (pArray == null || pArray.length == 0) { + return pArray; + } + final Context context = new Context(); + encode(pArray, 0, pArray.length, context); + encode(pArray, 0, EOF, context); // Notify encoder of EOF. + final byte[] buf = new byte[context.pos - context.readPos]; + readResults(buf, 0, buf.length, context); + return buf; + } + + // package protected for access from I/O streams + abstract void encode(byte[] pArray, int i, int length, Context context); + + // package protected for access from I/O streams + abstract void decode(byte[] pArray, int i, int length, Context context); + + /** + * Returns whether or not the octet is in the current alphabet. + * Does not allow whitespace or pad. + * + * @param value The value to test + * + * @return true if the value is defined in the current alphabet, false otherwise. + */ + protected abstract boolean isInAlphabet(byte value); + + /** + * Tests a given byte array to see if it contains only valid characters within the alphabet. + * The method optionally treats whitespace and pad as valid. + * + * @param arrayOctet byte array to test + * @param allowWSPad if true, then whitespace and PAD are also allowed + * + * @return true if all bytes are valid characters in the alphabet or if the byte array is empty; + * false, otherwise + */ + public boolean isInAlphabet(final byte[] arrayOctet, final boolean allowWSPad) { + for (int i = 0; i < arrayOctet.length; i++) { + if (!isInAlphabet(arrayOctet[i]) && + (!allowWSPad || (arrayOctet[i] != pad) && !isWhiteSpace(arrayOctet[i]))) { + return false; + } + } + return true; + } + + /** + * Tests a given String to see if it contains only valid characters within the alphabet. + * The method treats whitespace and PAD as valid. + * + * @param basen String to test + * @return true if all characters in the String are valid characters in the alphabet or if + * the String is empty; false, otherwise + * @see #isInAlphabet(byte[], boolean) + */ + public boolean isInAlphabet(final String basen) { + return isInAlphabet(getBytesUtf8(basen), true); + } + + /** + * Tests a given byte array to see if it contains any characters within the alphabet or PAD. + * + * Intended for use in checking line-ending arrays + * + * @param arrayOctet + * byte array to test + * @return true if any byte is a valid character in the alphabet or PAD; false otherwise + */ + protected boolean containsAlphabetOrPad(final byte[] arrayOctet) { + if (arrayOctet == null) { + return false; + } + for (final byte element : arrayOctet) { + if (pad == element || isInAlphabet(element)) { + return true; + } + } + return false; + } + + /** + * Calculates the amount of space needed to encode the supplied array. + * + * @param pArray byte[] array which will later be encoded + * + * @return amount of space needed to encoded the supplied array. + * Returns a long since a max-len array will require > Integer.MAX_VALUE + */ + public long getEncodedLength(final byte[] pArray) { + // Calculate non-chunked size - rounded up to allow for padding + // cast to long is needed to avoid possibility of overflow + long len = ((pArray.length + unencodedBlockSize-1) / unencodedBlockSize) * (long) encodedBlockSize; + if (lineLength > 0) { // We're using chunking + // Round up to nearest multiple + len += ((len + lineLength-1) / lineLength) * chunkSeparatorLength; + } + return len; + } + + public static Charset UTF8 = Charset.forName("UTF-8"); + + public static String newStringUtf8(byte[] bytes) { + return newString(bytes, UTF8); + } + + private static String newString(final byte[] bytes, final Charset charset) { + return bytes == null ? null : new String(bytes, charset); + } + + public static byte[] getBytesUtf8(final String string) { + return getBytes(string, UTF8); + } + + private static byte[] getBytes(final String string, final Charset charset) { + if (string == null) { + return null; + } + return string.getBytes(charset); + } +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java new file mode 100644 index 0000000..86381b0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java @@ -0,0 +1,184 @@ +package com.epmet.plugin.power.modules.visit.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.plugin.commons.redis.RedisKeys; +import com.epmet.plugin.power.config.DhCloudProperties; +import com.epmet.plugin.power.dto.hik.form.HikAuthorityFormDTO; +import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * 海康设备下放命令 + * + * @author zhy + * @date 2022/5/20 9:36 + */ +@Component +public class DhDeviceUtil { + private static Logger logger = LoggerFactory.getLogger(DhDeviceUtil.class); + + @Autowired + private DhCloudProperties dhCloudProperties; + + @Autowired + private RedisUtils redisUtils; + + private final String GET_PUBLIC_KEY = "/WPMS/getPublicKey"; + private final String GET_LOGIN_PASS = "/WPMS/login"; + private final String SEND_PERSON = "/api/v1/estate/system/person"; + private final String ISSUE_AUTHORITY = "/api/v1/estate/entranceGuard/permissions/actions/authorityIssued"; + + /** + * 获取publicKey + * + * @param + * @return void + * @author zhy + * @date 2022/5/20 16:40 + */ + public String getAccessToken() { + String key = RedisKeys.getDhPublicKey(); + Object obj = redisUtils.get(key); + if (null != obj) { + return (String) obj; + } + + String url = dhCloudProperties.getUrl().concat(GET_PUBLIC_KEY); + Map paramsMap = new HashMap<>(4); + paramsMap.put("loginName", dhCloudProperties.getLoginName()); + + String data = HttpClientManager.getInstance().sendPost(url, paramsMap).getData(); + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + + JSONObject toResult = JSON.parseObject(data); + if (!toResult.containsKey("publicKey")) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + String accessToken = toResult.get("publicKey").toString(); + + redisUtils.set(key, accessToken, RedisUtils.MINUTE_THIRTY_EXPIRE); + return accessToken; + } + + /** + * 获取loginPass + * + * @param + * @return void + * @author zhy + * @date 2022/5/20 16:40 + */ + public DhToken getLoginPass(String publicKey) { + String key = RedisKeys.getDhToken(); + Object obj = redisUtils.get(key); + if (null != obj) { + return (DhToken) obj; + } + + String url = dhCloudProperties.getUrl().concat(GET_LOGIN_PASS); + Map paramsMap = new HashMap<>(8); + paramsMap.put("loginName", dhCloudProperties.getLoginName()); + paramsMap.put("loginPass", publicKey); + + String data = HttpClientManager.getInstance().sendPost(url, paramsMap).getData(); + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + + JSONObject toResult = JSON.parseObject(data); + if (!toResult.containsKey("token")) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); + } + DhToken token = new DhToken(); + token.setId(toResult.get("id").toString()); + token.setLoginName(toResult.get("loginName").toString()); + token.setPublicKey(toResult.get("publicKey").toString()); + token.setToken(toResult.get("token").toString()); + redisUtils.set(key, token, RedisUtils.MINUTE_THIRTY_EXPIRE); + return token; + } + + /** + * 下发人员 + * + * @param dto + * @return java.lang.String 人员ID + * @author zhy + * @date 2022/5/23 10:08 + */ + public String sendPerson(VisitVisitorFormDTO dto) { + String url = dhCloudProperties.getUrl().concat(SEND_PERSON); + + Map paramsMap = new HashMap<>(4); + DhToken token = getLoginPass(getAccessToken()); + String urlParam = "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); + url = url + urlParam; + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + } + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (NumConstant.TWO_HUNDRED != result.getCode()) { + logger.info(result.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + } + Object RegisterResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); + return jsonObject.getString("personId"); + } + + /** + * 下发人员权限 + * + * @param dto + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String authorityIssued(HikAuthorityFormDTO dto) { + String url = dhCloudProperties.getUrl().concat(ISSUE_AUTHORITY); + + Map paramsMap = new HashMap<>(4); + paramsMap.put("Authorization", getAccessToken()); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + } + JSONObject toResult = JSON.parseObject(data); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (NumConstant.TWO_HUNDRED != result.getCode()) { + logger.info(result.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + } + return "success"; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java new file mode 100644 index 0000000..8878bb4 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java @@ -0,0 +1,40 @@ +package com.epmet.plugin.power.modules.visit.utils; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 大华设备鉴权信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-22 + */ +@Data +public class DhToken implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * loginName + */ + private String loginName; + + /** + * token + */ + private String token; + + /** + * publicKey + */ + private String publicKey; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java new file mode 100644 index 0000000..9d33dfa --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java @@ -0,0 +1,309 @@ +package com.epmet.plugin.power.modules.visit.utils; + +import java.security.Key; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Security; +import java.security.Signature; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.HashMap; +import java.util.Map; + +import javax.crypto.Cipher; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +/** + * + *

Title:RSAUtils

+ *

Description:RSA工具类

+ *

Company:浙江大华技术股份有限公司

+ * @author 32174 + * @date 2018年12月18日 + */ +public class RSAUtils{ + public static final String KEY_ALGORITHM = "RSA"; + public static final String SIGNATURE_ALGORITHM = "MD5withRSA"; + public static final String PADDING="RSA/None/PKCS1Padding"; + + private static final String PUBLIC_KEY = "RSAPublicKey"; + private static final String PRIVATE_KEY = "RSAPrivateKey"; + + private static final int KEY_SIZE = 1024; // 秘钥长度1024,最长加密117字节明文 + + static{ + Security.addProvider(new BouncyCastleProvider()); + } + /** + * 用私钥对信息生成数字签名 + * + * @param data + * 加密数据 + * @param privateKey + * 私钥 + * + * @return + * @throws Exception + */ + public static String sign(byte[] data, String privateKey) throws Exception { + // 解密由base64编码的私钥 + byte[] keyBytes = decryptBASE64(privateKey); + + // 构造PKCS8EncodedKeySpec对象 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); + + // KEY_ALGORITHM 指定的加密算法 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + + // 取私钥匙对象 + PrivateKey priKey = keyFactory.generatePrivate(pkcs8KeySpec); + + // 用私钥对信息生成数字签名 + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + signature.initSign(priKey); + signature.update(data); + + return encryptBASE64(signature.sign()); + } + + /** + * BASE64加密 + * + * @param key + * @return + * @throws Exception + */ + public static String encryptBASE64(byte[] key) throws Exception { + return Base64Util.encodeBase64String(key); + } + + /** + * BASE64解密 + * + * @param key + * @return + * @throws Exception + */ + public static byte[] decryptBASE64(String key) throws Exception { + return Base64Util.decodeBase64(key.getBytes()); + } + + /** + * 校验数字签名 + * + * @param data + * 加密数据 + * @param publicKey + * 公钥 + * @param sign + * 数字签名 + * + * @return 校验成功返回true 失败返回false + * @throws Exception + * + */ + public static boolean verify(byte[] data, String publicKey, String sign) + throws Exception { + + // 解密由base64编码的公钥 + byte[] keyBytes = decryptBASE64(publicKey); + + // 构造X509EncodedKeySpec对象 + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); + + // KEY_ALGORITHM 指定的加密算法 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + + // 取公钥匙对象 + PublicKey pubKey = keyFactory.generatePublic(keySpec); + + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + signature.initVerify(pubKey); + signature.update(data); + + // 验证签名是否正常 + return signature.verify(decryptBASE64(sign)); + } + + /** + * 解密
+ * 用私钥解密 + * + * @param data + * @param key + * @return + * @throws Exception + */ + public static byte[] decryptByPrivateKey(byte[] data, String key) + throws Exception { + // 对密钥解密 + byte[] keyBytes = decryptBASE64(key); + + // 取得私钥 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + + // 对数据解密 + Cipher cipher = Cipher.getInstance(PADDING , BouncyCastleProvider.PROVIDER_NAME); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + + return cipher.doFinal(data); + } + + /** + * 解密
+ * 用公钥解密 + * + * @param data + * @param key + * @return + * @throws Exception + */ + public static byte[] decryptByPublicKey(byte[] data, String key) + throws Exception { + // 对密钥解密 + byte[] keyBytes = decryptBASE64(key); + + // 取得公钥 + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + Key publicKey = keyFactory.generatePublic(x509KeySpec); + + // 对数据解密 + Cipher cipher = Cipher.getInstance(PADDING , BouncyCastleProvider.PROVIDER_NAME); + cipher.init(Cipher.DECRYPT_MODE, publicKey); + + return cipher.doFinal(data); + } + + /** + * 加密
+ * 用公钥加密 + * + * @param data + * @param key + * @return + * @throws Exception + */ + public static byte[] encryptByPublicKey(byte[] data, String key) + throws Exception { + // 对公钥解密 + byte[] keyBytes = decryptBASE64(key); + + // 取得公钥 + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + Key publicKey = keyFactory.generatePublic(x509KeySpec); + + // 对数据加密 + Cipher cipher = Cipher.getInstance(PADDING , BouncyCastleProvider.PROVIDER_NAME); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + + return cipher.doFinal(data); + } + + /** + * 加密
+ * 用私钥加密 + * + * @param data + * @param key + * @return + * @throws Exception + */ + public static byte[] encryptByPrivateKey(byte[] data, String key) + throws Exception { + // 对密钥解密 + byte[] keyBytes = decryptBASE64(key); + + // 取得私钥 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + + // 对数据加密 + Cipher cipher = Cipher.getInstance(PADDING , BouncyCastleProvider.PROVIDER_NAME); + cipher.init(Cipher.ENCRYPT_MODE, privateKey); + + return cipher.doFinal(data); + } + + /** + * 取得私钥(BASE64编码) + * + * @param keyMap + * @return + * @throws Exception + */ + public static String getPrivateKey(Map keyMap) + throws Exception { + Key key = (Key) keyMap.get(PRIVATE_KEY); + + return encryptBASE64(key.getEncoded()); + } + + /** + * 取得公钥(BASE64编码) + * + * @param keyMap + * @return + * @throws Exception + */ + public static String getPublicKey(Map keyMap) + throws Exception { + Key key = (Key) keyMap.get(PUBLIC_KEY); + + return encryptBASE64(key.getEncoded()); + } + + /** + * 判断字符串是否被公钥加密 + * @param text + * @param privateKey + * @return + */ + public static boolean isTextEncryptByPublicKey(String text , String privateKey){ + boolean bol = true; + try{ + byte[] encryBytes = RSAUtils.decryptBASE64(text); + RSAUtils.decryptByPrivateKey(encryBytes, privateKey); + }catch(Exception e){ + bol = false; + } + return bol; + } + + /** + * 初始化密钥 + * + * @return + * @throws Exception + */ + public static Map initKey() throws Exception { + KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM , BouncyCastleProvider.PROVIDER_NAME); + keyPairGen.initialize(KEY_SIZE , new SecureRandom()); + + KeyPair keyPair = keyPairGen.generateKeyPair(); + + // 公钥 + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + + // 私钥 + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + + Map keyMap = new HashMap(2); + + keyMap.put(PUBLIC_KEY, publicKey); + keyMap.put(PRIVATE_KEY, privateKey); + return keyMap; + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml index f93c0cf..8114045 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml @@ -132,6 +132,10 @@ hik: url: @hik.cloud.url@ client: @hik.cloud.client@ secret: @hik.cloud.secret@ +dh: + cloud: + url: @dh.cloud.url@ + loginName: @dh.cloud.loginName@ # 停机选项 shutdown: From 27d58da2c13fff7a2314972d265b8df78b11c3ff Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 27 Jul 2022 15:28:30 +0800 Subject: [PATCH 074/108] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visit/service/impl/VisitVisitorServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 5f9efc4..0026a77 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -63,6 +63,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); String idCard = (String) params.get("idCard"); + String name = (String) params.get("name"); String mobile = (String) params.get("mobile"); String neighborhoodId = (String) params.get("neighborhoodId"); String buildingId = (String) params.get("buildingId"); @@ -74,6 +75,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); + wrapper.eq(StringUtils.isNotBlank(name), "NAME", name); wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); wrapper.eq(StringUtils.isNotBlank(neighborhoodId), "NEIGHBORHOOD_ID", neighborhoodId); wrapper.eq(StringUtils.isNotBlank(buildingId), "BUILDING_ID", buildingId); From 7419d8b34f02b20c8a7d761c23a8463ff01fc50e Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Jul 2022 10:40:14 +0800 Subject: [PATCH 075/108] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visit/form/VisitVisitorChartFormDTO.java | 27 +++++++++++++++++ .../result/VisitVisitorChartResultDTO.java | 30 +++++++++++++++++++ .../controller/VisitVisitorController.java | 22 ++++++++++---- .../modules/visit/dao/VisitVisitorDao.java | 13 +++++++- .../visit/service/VisitVisitorService.java | 13 ++++++++ .../service/impl/VisitVisitorServiceImpl.java | 24 +++++++++++++-- .../mapper/visit/VisitVisitorDao.xml | 11 +++++++ 7 files changed, 131 insertions(+), 9 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java new file mode 100644 index 0000000..e15769d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.dto.visit.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +@Data +public class VisitVisitorChartFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 时间 + */ + private String date; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java new file mode 100644 index 0000000..a5dcd69 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.plugin.power.dto.visit.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 租客表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-26 + */ +@Data +public class VisitVisitorChartResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 时间 + */ + private String hour; + + /** + * 数量 + */ + private String num; + + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java index c360674..9495fa3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java @@ -10,7 +10,9 @@ 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.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorChartFormDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; import com.epmet.plugin.power.modules.visit.excel.VisitVisitorExcel; import com.epmet.plugin.power.modules.visit.service.VisitVisitorService; import org.springframework.beans.factory.annotation.Autowired; @@ -35,20 +37,20 @@ public class VisitVisitorController { private VisitVisitorService visitVisitorService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = visitVisitorService.page(params); return new Result>().ok(page); } @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { VisitVisitorDTO data = visitVisitorService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody VisitVisitorDTO dto){ + public Result save(@RequestBody VisitVisitorDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); visitVisitorService.save(dto); @@ -57,7 +59,7 @@ public class VisitVisitorController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody VisitVisitorDTO dto){ + public Result update(@RequestBody VisitVisitorDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); visitVisitorService.update(dto); @@ -65,7 +67,7 @@ public class VisitVisitorController { } @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); visitVisitorService.delete(ids); @@ -80,11 +82,19 @@ public class VisitVisitorController { @NoRepeatSubmit @PostMapping("visit") - public Result visit(@RequestBody VisitVisitorFormDTO dto){ + public Result visit(@RequestBody VisitVisitorFormDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); visitVisitorService.visit(dto); return new Result(); } + @NoRepeatSubmit + @PostMapping("chart/traffic") + public Result getTraffic(@RequestBody VisitVisitorChartFormDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return new Result().ok(visitVisitorService.getTraffic(dto);); + } + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java index ca69c64..1f07b9b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java @@ -1,6 +1,8 @@ package com.epmet.plugin.power.modules.visit.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorChartFormDTO; +import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; import org.apache.ibatis.annotations.Mapper; @@ -12,5 +14,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface VisitVisitorDao extends BaseDao { - + + /** + * 人流量 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-26 + */ + VisitVisitorChartResultDTO getTraffic(VisitVisitorChartFormDTO dto); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java index 120c580..8264fc8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java @@ -3,7 +3,9 @@ package com.epmet.plugin.power.modules.visit.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorChartFormDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; import java.util.List; @@ -87,4 +89,15 @@ public interface VisitVisitorService extends BaseService { */ void visit(VisitVisitorFormDTO dto); + /** + * 人流量 + * + * @param dto + * @return void + * @author generator + * @date 2022-07-26 + */ + VisitVisitorChartResultDTO getTraffic(VisitVisitorChartFormDTO dto); + + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 0026a77..4623b03 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -3,15 +3,16 @@ package com.epmet.plugin.power.modules.visit.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.exception.EpmetErrorCode; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.VisitVisitorChartFormDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; +import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; import com.epmet.plugin.power.modules.visit.dao.VisitVisitorDao; import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; import com.epmet.plugin.power.modules.visit.redis.VisitVisitorRedis; @@ -22,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -120,6 +122,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getIcNeighbordhoodById(dto.getNeighborhoodId()); if (result.success()) { + entity.setResidential(result.getData().getNeighborHoodName()); entity.setGridId(result.getData().getGridId()); entity.setAgencyId(result.getData().getAgencyId()); entity.setParentAgencyId(result.getData().getParentAgencyId()); @@ -128,6 +131,23 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl + \ No newline at end of file From db317e82d3d31fb608436b08fd4c43875abb496f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Jul 2022 10:43:02 +0800 Subject: [PATCH 076/108] bug --- .../power/modules/visit/controller/VisitVisitorController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java index 9495fa3..22f42fb 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java @@ -94,7 +94,7 @@ public class VisitVisitorController { public Result getTraffic(@RequestBody VisitVisitorChartFormDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return new Result().ok(visitVisitorService.getTraffic(dto);); + return new Result().ok(visitVisitorService.getTraffic(dto)); } } From ffa25d2aa13b431de00a5852e26cd75f578e07b5 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Jul 2022 10:45:59 +0800 Subject: [PATCH 077/108] asd --- .../modules/visit/controller/VisitVisitorController.java | 4 ++-- .../epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java | 4 +++- .../power/modules/visit/service/VisitVisitorService.java | 2 +- .../modules/visit/service/impl/VisitVisitorServiceImpl.java | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java index 22f42fb..843ca47 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/controller/VisitVisitorController.java @@ -91,10 +91,10 @@ public class VisitVisitorController { @NoRepeatSubmit @PostMapping("chart/traffic") - public Result getTraffic(@RequestBody VisitVisitorChartFormDTO dto) { + public Result> getTraffic(@RequestBody VisitVisitorChartFormDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - return new Result().ok(visitVisitorService.getTraffic(dto)); + return new Result>().ok(visitVisitorService.getTraffic(dto)); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java index 1f07b9b..11c10b9 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/dao/VisitVisitorDao.java @@ -6,6 +6,8 @@ import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; import com.epmet.plugin.power.modules.visit.entity.VisitVisitorEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 租客表 * @@ -23,5 +25,5 @@ public interface VisitVisitorDao extends BaseDao { * @author generator * @date 2022-07-26 */ - VisitVisitorChartResultDTO getTraffic(VisitVisitorChartFormDTO dto); + List getTraffic(VisitVisitorChartFormDTO dto); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java index 8264fc8..46efafa 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/VisitVisitorService.java @@ -97,7 +97,7 @@ public interface VisitVisitorService extends BaseService { * @author generator * @date 2022-07-26 */ - VisitVisitorChartResultDTO getTraffic(VisitVisitorChartFormDTO dto); + List getTraffic(VisitVisitorChartFormDTO dto); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 4623b03..b4b1a57 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -133,7 +133,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl getTraffic(VisitVisitorChartFormDTO dto) { if (StringUtils.isBlank(dto.getDate())) { dto.setDate(LocalDate.now().toString()); } From 1791aa0eb98dd4d0f88ea7368bbf833730a4add8 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Jul 2022 10:49:41 +0800 Subject: [PATCH 078/108] bug --- .../src/main/resources/mapper/visit/VisitVisitorDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml index af96c52..5ac136d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/visit/VisitVisitorDao.xml @@ -29,7 +29,7 @@ - \ No newline at end of file + From f31c1d3d45a61e7e8b3abab8fffe093a35526c2f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 Jul 2022 16:21:53 +0800 Subject: [PATCH 082/108] =?UTF-8?q?=E5=87=86=E5=A4=87=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/visit/form/DhPersonFormDTO.java | 39 +++++ .../power/modules/utils/HkDeviceUtil.java | 4 +- .../service/impl/VisitVisitorServiceImpl.java | 13 +- .../modules/visit/utils/DhDeviceUtil.java | 138 +++++++++++++---- .../power/modules/visit/utils/DhResult.java | 142 ++++++++++++++++++ 5 files changed, 301 insertions(+), 35 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhResult.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java new file mode 100644 index 0000000..3cfcc53 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhPersonFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String paperType; + + private String paperNumber; + + private String name; + + private String code; + + private Long deptId; + + private String sex; + + private String birthday; + + private String phone; + + private String status; + + private String personIdentityId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java index f52f535..fd9689b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/utils/HkDeviceUtil.java @@ -109,8 +109,8 @@ public class HkDeviceUtil { logger.info(result.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); } - Object RegisterResult = result.getData(); - JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); + Object registerResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); return jsonObject.getString("personId"); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index b4b1a57..61e7787 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -4,12 +4,14 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.plugin.power.dto.visit.VisitVisitorDTO; +import com.epmet.plugin.power.dto.visit.form.DhPersonFormDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorChartFormDTO; import com.epmet.plugin.power.dto.visit.form.VisitVisitorFormDTO; import com.epmet.plugin.power.dto.visit.result.VisitVisitorChartResultDTO; @@ -149,7 +151,16 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl paramsMap = new HashMap<>(4); - DhToken token = getLoginPass(getAccessToken()); - String urlParam = "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); + } + Object registerResult = result.getData(); + JSONArray jsonArray = JSON.parseArray(registerResult.toString()); + JSONObject jsonObject = jsonArray.getJSONObject(0); + if (null != jsonObject) { + return Long.parseLong(jsonObject.get("deptId").toString()); + } + return 0L; + } + + /** + * 下发人员权限 + * + * @param + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String getIdentity() { + String url = dhCloudProperties.getUrl().concat(GET_PERSON_IDENTITY); + String urlParam = getDhUrlParams(); url = url + urlParam; - String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); + Map paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); if (null == data) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); } JSONObject toResult = JSON.parseObject(data); - Result result = ConvertUtils.mapToEntity(toResult, Result.class); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); if (null != toResult.get("code")) { result.setCode(((Integer) toResult.get("code")).intValue()); } - if (NumConstant.TWO_HUNDRED != result.getCode()) { - logger.info(result.getMsg()); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); } - Object RegisterResult = result.getData(); - JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); - return jsonObject.getString("personId"); + Object registerResult = result.getData(); + JSONArray jsonArray = JSON.parseArray(registerResult.toString()); + JSONObject jsonObject = jsonArray.getJSONObject(0); + if (null != jsonObject) { + return jsonObject.get("id").toString(); + } + return ""; } /** @@ -158,27 +202,57 @@ public class DhDeviceUtil { * @author zhy * @date 2022/5/23 11:04 */ - public String authorityIssued(HikAuthorityFormDTO dto) { - String url = dhCloudProperties.getUrl().concat(ISSUE_AUTHORITY); + public String addPerson(DhPersonFormDTO dto) { + String url = dhCloudProperties.getUrl().concat(ADD_PERSON); + String urlParam = getDhUrlParams(); + url = url + urlParam; + + Long deptId = getDept(); + if (0L == deptId) { + return ""; + } + String identity = getIdentity(); + if (StringUtils.isBlank(identity)) { + return ""; + } + dto.setDeptId(deptId); + dto.setPersonIdentityId(identity); Map paramsMap = new HashMap<>(4); - paramsMap.put("Authorization", getAccessToken()); String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); } JSONObject toResult = JSON.parseObject(data); - Result result = ConvertUtils.mapToEntity(toResult, Result.class); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); if (null != toResult.get("code")) { result.setCode(((Integer) toResult.get("code")).intValue()); } - if (NumConstant.TWO_HUNDRED != result.getCode()) { - logger.info(result.getMsg()); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); } - return "success"; + Object registerResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); + if (null != jsonObject) { + return jsonObject.toString(); + } + return ""; + } + + /** + * 拼接url固定参数 + * + * @param + * @return java.lang.String + * @author zhy + * @date 2022/7/28 16:09 + */ + private String getDhUrlParams() { + DhToken token = getLoginPass(getAccessToken()); + return "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhResult.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhResult.java new file mode 100644 index 0000000..86a8748 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhResult.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.plugin.power.modules.visit.utils; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ErrorCode; +import com.epmet.commons.tools.utils.MessageUtils; +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; + +/** + * 响应数据 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DhResult implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 编码:0表示成功,其他值表示失败 + */ + private Integer code = 0; + /** + * 消息内容 + */ + private String errMsg = "success"; + + /** + * 内部信息 + */ + private Boolean success = true; + + /** + * 响应数据 + */ + private T data; + + public DhResult ok(T data) { + this.setData(data); + return this; + } + + public boolean success(){ + return code == 0; + } + + /** + * 返回 + * "code": 8000, + * "msg": "服务器开小差了...", + */ + public DhResult error() { + this.code = EpmetErrorCode.SERVER_ERROR.getCode(); + this.errMsg = EpmetErrorCode.getMsg(code); + if (StringUtils.isBlank(this.errMsg)) { + this.errMsg = MessageUtils.getMessage(this.code); + } + return this; + } + + /** + * 根据错误编码查询msg返回 + */ + public DhResult error(int code) { + this.code = code; + this.errMsg = EpmetErrorCode.getMsg(code); + if (StringUtils.isBlank(this.errMsg)) { + this.errMsg = MessageUtils.getMessage(this.code); + } + return this; + } + + /** + * 传入错误编码+msg返回 + */ + public DhResult error(int code, String msg) { + this.code = code; + this.errMsg = msg; + return this; + } + + /** + * + * @param msg + * @return 此方法废弃,统一使用 + * logger.error(XXXX); + * throw new RenException(XXXX); + * XXXX定义常量里 + */ + @Deprecated + public DhResult error(String msg) { + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.errMsg = msg; + return this; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getErrMsg() { + return errMsg; + } + + public void setErrMsg(String errMsg) { + this.errMsg = errMsg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public Boolean getSuccess() { + return success; + } + + public void setSuccess(Boolean success) { + this.success = success; + } + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} From 5952eaa97d54a6b4d3d674dad294f4a1a5a95eeb Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 28 Jul 2022 17:34:25 +0800 Subject: [PATCH 083/108] =?UTF-8?q?=E6=94=B9=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/axis/service/impl/PowerAxisStructServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 34bad4f..1351b4c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -144,7 +144,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ONE) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点"); } @@ -274,4 +274,4 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl Date: Thu, 28 Jul 2022 17:37:35 +0800 Subject: [PATCH 084/108] =?UTF-8?q?=E6=94=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/service/impl/PowerAxisStructServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 34bad4f..531b61b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -144,8 +144,8 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ONE) { + Integer parentStructLevel = powerAxisTagService.selectStructLevelById(customerId, PowerTagCategoryEnum.STRUCT.category(), structDto.getPid()); + if (structLevel - parentStructLevel.intValue() > NumConstant.ONE) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点"); } } @@ -274,4 +274,4 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl Date: Thu, 28 Jul 2022 17:51:44 +0800 Subject: [PATCH 085/108] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/service/impl/PowerAxisStructServiceImpl.java | 1 + .../main/resources/mapper/poweraxis/PowerAxisStructDao.xml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 531b61b..fe1f100 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -145,6 +145,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ONE) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点"); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 3db8a0e..8be24a9 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -89,7 +89,7 @@ - SELECT count(*) FROM @@ -108,7 +108,7 @@ AND s.ID != #{id} AND s.pid = #{pid} - SELECT count(*) FROM @@ -259,4 +259,4 @@ - \ No newline at end of file + From 234d675a5368c2356f69a889e6177efed19ca043 Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 28 Jul 2022 17:57:56 +0800 Subject: [PATCH 086/108] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/axis/service/impl/PowerAxisStructServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index fe1f100..124529c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -146,7 +146,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ONE) { + if (structLevel.intValue() - parentStructLevel.intValue() > NumConstant.ONE) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点"); } } From f66f803682b7e55e49372a9c1560880a1fda26f5 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 29 Jul 2022 10:21:03 +0800 Subject: [PATCH 087/108] =?UTF-8?q?=E4=B8=8B=E5=8F=91=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/visit/form/DhAuthFormDTO.java | 27 ++ .../dto/visit/form/DhPersonCardFormDTO.java | 39 ++ .../dto/visit/form/DhPersonImgFormDTO.java | 23 ++ .../dto/visit/result/DhChannelResultDTO.java | 23 ++ .../pli-power-base-server/pom.xml | 5 + .../service/impl/VisitVisitorServiceImpl.java | 2 +- .../modules/visit/utils/DhDeviceUtil.java | 373 ++++++++++++++++-- 7 files changed, 467 insertions(+), 25 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java new file mode 100644 index 0000000..0f5062e --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.dto.visit.form; + +import com.epmet.plugin.power.dto.visit.result.DhChannelResultDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhAuthFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String cardNumber; + + private String timeQuantumId; + + private List cardPrivilegeDetails; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java new file mode 100644 index 0000000..0c53aa0 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhPersonCardFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long personId; + + private String personName; + + private String cardNumber; + + private String cardType; + + private String category; + + private String cardStatus; + + private String startDate; + + private String endDate; + + private String cardPassword; + + private String subSystems; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java new file mode 100644 index 0000000..62c0e89 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhPersonImgFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String personCode; + + private String base64file; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java new file mode 100644 index 0000000..737b3e8 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.plugin.power.dto.visit.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhChannelResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String privilegeType; + + private String resouceCode; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 22f5974..0b22591 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -83,6 +83,11 @@ RELEASE compile + + net.coobird + thumbnailator + 0.4.8 + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index 61e7787..a923a45 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -160,7 +160,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询开门计划失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("success")) { + result.setCode(200); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询开门计划失败"); + } + Object registerResult = result.getData(); + JSONArray jsonArray = JSON.parseArray(registerResult.toString()); + JSONObject jsonObject = jsonArray.getJSONObject(0); + if (null != jsonObject) { + return jsonObject.get("id").toString(); + } + return ""; + } + + /** + * 查询通道 + * + * @param + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public List getChannel() { + String url = dhCloudProperties.getUrl().concat(GET_DOOR_CHANNEL); + String urlParam = getDhUrlParams(); + url = url + urlParam; + + Map paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询通道列表失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("success")) { + result.setCode(200); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询通道列表失败"); + } + Object registerResult = result.getData(); + JSONArray jsonArray = JSON.parseArray(registerResult.toString()); + List list = new ArrayList<>(); + + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(0); + DhChannelResultDTO channel = new DhChannelResultDTO(); + channel.setPrivilegeType("1"); + channel.setResouceCode(jsonObject.get("channelCode").toString()); + list.add(channel); + } + + return list; + } + + /** + * 新增人员 * * @param dto * @return java.lang.String * @author zhy * @date 2022/5/23 11:04 */ - public String addPerson(DhPersonFormDTO dto) { + public Long addPerson(DhPersonFormDTO dto) { String url = dhCloudProperties.getUrl().concat(ADD_PERSON); String urlParam = getDhUrlParams(); url = url + urlParam; Long deptId = getDept(); if (0L == deptId) { - return ""; + return null; } String identity = getIdentity(); if (StringUtils.isBlank(identity)) { - return ""; + return null; } dto.setDeptId(deptId); dto.setPersonIdentityId(identity); @@ -223,21 +318,172 @@ public class DhDeviceUtil { String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增人员失败"); } JSONObject toResult = JSON.parseObject(data); DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); - if (null != toResult.get("code")) { - result.setCode(((Integer) toResult.get("code")).intValue()); + if (null != toResult.get("success")) { + result.setCode(200); } if (!result.getSuccess()) { logger.info(result.getErrMsg()); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "新增人员失败"); + } + Object registerResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); + if (null != jsonObject) { + return Long.parseLong(jsonObject.toString()); + } + return null; + } + + /** + * 下发人员头像 + * + * @param dto + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String addPersonImg(DhPersonFormDTO dto, String imgUrl) { + DhPersonImgFormDTO imgFormDTO = new DhPersonImgFormDTO(); + String url = dhCloudProperties.getUrl().concat(ADD_PERSON_IMG); + String urlParam = getDhUrlParams(); + url = url + urlParam; + + imgFormDTO.setPersonCode(dto.getCode()); + imgFormDTO.setBase64file(getBase64ByUrl(imgUrl)); + + Map paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(imgFormDTO), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下发人员头像失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("success")) { + result.setCode(200); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下发人员头像失败"); + } + Object registerResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); + if (null != jsonObject) { + return "success"; + } + return ""; + } + + /** + * 人员开卡 + * + * @param dto + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String addPersonCard(DhPersonFormDTO dto) { + Long personId = addPerson(dto); + if (personId == null) { + return "添加人员信息失败"; + } + DhPersonCardFormDTO cardFormDTO = new DhPersonCardFormDTO(); + String url = dhCloudProperties.getUrl().concat(OPEN_CARD); + String urlParam = getDhUrlParams(); + url = url + urlParam; + + cardFormDTO.setPersonId(personId); + cardFormDTO.setPersonName(dto.getName()); + cardFormDTO.setCardNumber(generateNiceString(8)); + cardFormDTO.setCardType("0"); + cardFormDTO.setCategory("0"); + cardFormDTO.setCardStatus("ACTIVE"); + cardFormDTO.setStartDate(LocalDate.now().toString()); + cardFormDTO.setEndDate(LocalDate.now().plusDays(1L).toString()); + cardFormDTO.setCardPassword("0"); + cardFormDTO.setSubSystems("1"); + + Map paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(cardFormDTO), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员开卡失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("success")) { + result.setCode(200); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员开卡失败"); } Object registerResult = result.getData(); JSONObject jsonObject = JSON.parseObject(registerResult.toString()); if (null != jsonObject) { - return jsonObject.toString(); + return cardFormDTO.getCardNumber(); + } + return ""; + } + + /** + * 下发人员权限 + * + * @param dto + * @return java.lang.String + * @author zhy + * @date 2022/5/23 11:04 + */ + public String addPersonAuth(DhPersonFormDTO dto, String imgUrl) { + String personCard = addPersonCard(dto); + List channel = getChannel(); + String plan = getPlan(); + + if (StringUtils.isBlank(personCard)) { + return "开卡失败"; + } else if (StringUtils.isNotBlank(imgUrl)) { + addPersonImg(dto, imgUrl); + } + if (channel.isEmpty()) { + return "获取通道失败"; + } + if (StringUtils.isBlank(plan)) { + return "获取开门计划失败"; + } + DhAuthFormDTO authFormDTO = new DhAuthFormDTO(); + String url = dhCloudProperties.getUrl().concat(ADD_AUTH); + String urlParam = getDhUrlParams(); + url = url + urlParam; + + authFormDTO.setCardNumber(personCard); + authFormDTO.setTimeQuantumId(plan); + authFormDTO.setCardPrivilegeDetails(channel); + + Map paramsMap = new HashMap<>(4); + + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(authFormDTO), paramsMap).getData(); + + if (null == data) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下发人员权限失败"); + } + JSONObject toResult = JSON.parseObject(data); + DhResult result = ConvertUtils.mapToEntity(toResult, DhResult.class); + if (null != toResult.get("success")) { + result.setCode(200); + } + if (!result.getSuccess()) { + logger.info(result.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "下发人员权限失败"); + } + Object registerResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); + if (null != jsonObject) { + return "success"; } return ""; } @@ -255,4 +501,83 @@ public class DhDeviceUtil { return "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); } + private String getBase64ByUrl(String imgUrl) { + String ossDomain; + byte[] fileBytes; + try { + URL url = new URL(imgUrl); + DataInputStream dataInputStream = new DataInputStream(url.openStream()); + byte[] originBytes = toByteArray(dataInputStream); + + fileBytes = compressPicCycle(originBytes, 100L, 0.3); + } catch (IOException e) { + logger.error("图片上传异常", e); + throw new RenException("图片上传异常"); + } + return DatatypeConverter.printBase64Binary(fileBytes); + } + + /** + * @param bytes 原图片字节数组 + * @param desFileSize 指定图片大小,单位 kb + * @param accuracy 精度,递归压缩的比率,建议小于0.9 + * @return + */ + private byte[] compressPicCycle(byte[] bytes, long desFileSize, double accuracy) throws IOException { + // 获取目标图片 + long fileSize = bytes.length; + System.out.println("=====fileSize======== " + fileSize); + // 判断图片大小是否小于指定图片大小 + if (fileSize <= desFileSize * 1024) { + return bytes; + } + //计算宽高 + BufferedImage bim = ImageIO.read(new ByteArrayInputStream(bytes)); + int imgWidth = bim.getWidth(); + System.out.println(imgWidth + "====imgWidth====="); + int imgHeight = bim.getHeight(); + int desWidth = new BigDecimal(imgWidth).multiply(new BigDecimal(accuracy)).intValue(); + System.out.println(desWidth + "====desWidth====="); + int desHeight = new BigDecimal(imgHeight).multiply(new BigDecimal(accuracy)).intValue(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); //字节输出流(写入到内存) + Thumbnails.of(new ByteArrayInputStream(bytes)).size(desWidth, desHeight).outputQuality(accuracy).toOutputStream(baos); + //如果不满足要求,递归直至满足要求 + return compressPicCycle(baos.toByteArray(), desFileSize, accuracy); + } + + /** + * inputstream输入流转换成byte[]字节数组 + * + * @param input + * @return byte[] + * @author yinzuomei + * @date 2020/2/27 16:09 + */ + public static byte[] toByteArray(InputStream input) throws IOException { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024 * 4]; + int n = 0; + while (-1 != (n = input.read(buffer))) { + output.write(buffer, 0, n); + } + return output.toByteArray(); + } + + /** + * 随机生成16进制字符串 + * + * @param len + * @return java.lang.String + * @author zhy + * @date 2022/7/29 9:47 + */ + public static String generateNiceString(int len) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < len; i++) { + sb.append(Integer.toHexString(new Random().nextInt(16))); + } + return sb.toString().toUpperCase(); + } + + } From 9c88819121838f98a8a2c0c8b6f3ac574cf63855 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Fri, 29 Jul 2022 10:23:19 +0800 Subject: [PATCH 088/108] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E5=AE=A1=E6=A0=B8PC?= =?UTF-8?q?=E7=AB=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rent/service/impl/RentContractInfoServiceImpl.java | 7 ++++++- .../src/main/resources/mapper/rent/RentContractInfoDao.xml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index d7ad636..47f3588 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -192,9 +192,14 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl + order by i.CREATED_TIME desc From 82f84a4ff549bc915ca118bb9a0921e8cff85d36 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Fri, 29 Jul 2022 10:29:05 +0800 Subject: [PATCH 089/108] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E5=AE=A1=E6=A0=B8PC?= =?UTF-8?q?=E7=AB=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rent/service/impl/RentContractInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java index 47f3588..b8f74a7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java @@ -207,7 +207,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl tenantParams = new HashMap<>(4); From 8a282df6c09ac7bd7d7f3a7fc00dcf6100e4ea1a Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 29 Jul 2022 10:55:55 +0800 Subject: [PATCH 090/108] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visit/utils/DhDeviceUtil.java | 16 +++++++++++----- .../power/modules/visit/utils/RSAUtils.java | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java index 06c265f..d12936f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java @@ -67,7 +67,7 @@ public class DhDeviceUtil { * @author zhy * @date 2022/5/20 16:40 */ - public String getAccessToken() { + public String getPublicKey() { String key = RedisKeys.getDhPublicKey(); Object obj = redisUtils.get(key); if (null != obj) { @@ -404,7 +404,13 @@ public class DhDeviceUtil { cardFormDTO.setCardStatus("ACTIVE"); cardFormDTO.setStartDate(LocalDate.now().toString()); cardFormDTO.setEndDate(LocalDate.now().plusDays(1L).toString()); - cardFormDTO.setCardPassword("0"); + String pwd; + try { + pwd = RSAUtils.getPwdByRsa(getPublicKey(), "123456"); + } catch (Exception e) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "密码加密失败"); + } + cardFormDTO.setCardPassword(pwd); cardFormDTO.setSubSystems("1"); Map paramsMap = new HashMap<>(4); @@ -497,7 +503,7 @@ public class DhDeviceUtil { * @date 2022/7/28 16:09 */ private String getDhUrlParams() { - DhToken token = getLoginPass(getAccessToken()); + DhToken token = getLoginPass(getPublicKey()); return "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); } @@ -553,7 +559,7 @@ public class DhDeviceUtil { * @author yinzuomei * @date 2020/2/27 16:09 */ - public static byte[] toByteArray(InputStream input) throws IOException { + private byte[] toByteArray(InputStream input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); byte[] buffer = new byte[1024 * 4]; int n = 0; @@ -571,7 +577,7 @@ public class DhDeviceUtil { * @author zhy * @date 2022/7/29 9:47 */ - public static String generateNiceString(int len) { + private String generateNiceString(int len) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { sb.append(Integer.toHexString(new Random().nextInt(16))); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java index 9d33dfa..866b401 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/RSAUtils.java @@ -18,6 +18,7 @@ import java.util.Map; import javax.crypto.Cipher; +import cn.hutool.core.codec.Base64; import org.bouncycastle.jce.provider.BouncyCastleProvider; /** @@ -305,5 +306,20 @@ public class RSAUtils{ keyMap.put(PRIVATE_KEY, privateKey); return keyMap; } - + + /** + * 密码加密 + * + * @param + * @return java.lang.String + * @author zhy + * @date 2022/7/29 10:46 + */ + public static String getPwdByRsa(String publicKey, String str) throws Exception { + byte[] decoded = Base64.decode(publicKey); + RSAPublicKey pubKey =(RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(decoded));// RSA加密 + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + return Base64.encode(cipher.doFinal(str.getBytes("UTF-8"))); + } } From 0dadf5d3b4f2ffa90a08dee06810ccb680e68545 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Fri, 29 Jul 2022 11:04:39 +0800 Subject: [PATCH 091/108] weizhitiaozheng --- .../com/epmet/plugin/power/dto/visit/DhTokenDTO.java} | 5 ++--- .../plugin/power/modules/visit/utils/DhDeviceUtil.java | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename epmet-plugins-module/pli-power-base/{pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java => pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java} (75%) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java similarity index 75% rename from epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java rename to epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java index 8878bb4..bd9732d 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhToken.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java @@ -1,8 +1,7 @@ -package com.epmet.plugin.power.modules.visit.utils; +package com.epmet.plugin.power.dto.visit; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -13,7 +12,7 @@ import java.io.Serializable; * @since v1.0.0 2022-04-22 */ @Data -public class DhToken implements Serializable { +public class DhTokenDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java index d12936f..ba5dbdd 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/utils/DhDeviceUtil.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.plugin.commons.redis.RedisKeys; import com.epmet.plugin.power.config.DhCloudProperties; +import com.epmet.plugin.power.dto.visit.DhTokenDTO; import com.epmet.plugin.power.dto.visit.form.DhAuthFormDTO; import com.epmet.plugin.power.dto.visit.form.DhPersonCardFormDTO; import com.epmet.plugin.power.dto.visit.form.DhPersonFormDTO; @@ -101,11 +102,11 @@ public class DhDeviceUtil { * @author zhy * @date 2022/5/20 16:40 */ - public DhToken getLoginPass(String publicKey) { + public DhTokenDTO getLoginPass(String publicKey) { String key = RedisKeys.getDhToken(); Object obj = redisUtils.get(key); if (null != obj) { - return (DhToken) obj; + return (DhTokenDTO) obj; } String url = dhCloudProperties.getUrl().concat(GET_LOGIN_PASS); @@ -122,7 +123,7 @@ public class DhDeviceUtil { if (!toResult.containsKey("token")) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "loginPass获取失败"); } - DhToken token = new DhToken(); + DhTokenDTO token = new DhTokenDTO(); token.setId(toResult.get("id").toString()); token.setLoginName(toResult.get("loginName").toString()); token.setPublicKey(toResult.get("publicKey").toString()); @@ -503,7 +504,7 @@ public class DhDeviceUtil { * @date 2022/7/28 16:09 */ private String getDhUrlParams() { - DhToken token = getLoginPass(getPublicKey()); + DhTokenDTO token = getLoginPass(getPublicKey()); return "?userId=" + token.getId() + "&username=" + token.getLoginName() + "&token=" + token.getToken(); } From be89c299eaa556c4006c887f4e9bf1e184204c6f Mon Sep 17 00:00:00 2001 From: HAHA Date: Fri, 29 Jul 2022 13:31:16 +0800 Subject: [PATCH 092/108] =?UTF-8?q?message:=E4=BF=AE=E6=94=B9=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=B1=BB=E5=9E=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/axis/dao/PowerAxisTagDao.java | 6 +++++- .../service/impl/PowerAxisTagServiceImpl.java | 18 +++++++++++------- .../mapper/poweraxis/PowerAxisTagDao.xml | 10 +++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java index ef10c7e..babc8bd 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,4 +40,7 @@ public interface PowerAxisTagDao extends BaseDao { Integer selectStructLevelById(@Param("customerId") String customerId, @Param("tagCategory") String tagCategory, @Param("axisStructId") String axisStructId); -} \ No newline at end of file + + List selectByTagCategory(@Param("tagCategory") String tagCategory, + @Param("customerId") String customerId); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java index 36ef95e..a7d0b14 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java @@ -102,13 +102,17 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq("TAG_CATEGORY", tagCategory) - .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value()) - .eq(FieldConstant.CUSTOMER_ID, customerId) - .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME); + List res = baseDao.selectByTagCategory(tagCategory,customerId); + return res; + - return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class); +// QueryWrapper wrapper = new QueryWrapper<>(); +// wrapper.eq("TAG_CATEGORY", tagCategory) +// .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value()) +// .eq(FieldConstant.CUSTOMER_ID, customerId) +// .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME); +// +// return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class); } @Override @@ -135,4 +139,4 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl + - \ No newline at end of file + From 121ea59bd03f7dfc049bf10ac616313930a22ec0 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 29 Jul 2022 14:10:18 +0800 Subject: [PATCH 093/108] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PowerAxisStructController.java | 4 ++-- .../controller/PowerAxisTagController.java | 4 ++-- .../modules/axis/dao/PowerAxisStructDao.java | 16 +++++++++++----- .../modules/axis/dao/PowerAxisTagDao.java | 2 +- .../axis/service/PowerAxisStructService.java | 5 +++-- .../axis/service/PowerAxisTagService.java | 5 +++-- .../impl/PowerAxisStructServiceImpl.java | 18 +++++++++++------- .../service/impl/PowerAxisTagServiceImpl.java | 5 +++-- .../mapper/poweraxis/PowerAxisStructDao.xml | 7 +++++++ .../mapper/poweraxis/PowerAxisTagDao.xml | 7 ++++++- 10 files changed, 49 insertions(+), 24 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index c65f523..4750289 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -46,8 +46,8 @@ public class PowerAxisStructController { private PowerAxisStructService powerAxisStructService; @RequestMapping("page") - public Result> page(@RequestParam Map params) { - PageData page = powerAxisStructService.page(params); + public Result> page(@LoginUser TokenDto tokenDto,@RequestParam Map params) { + PageData page = powerAxisStructService.page(tokenDto,params); return new Result>().ok(page); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java index 38379a3..998bdac 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java @@ -102,8 +102,8 @@ public class PowerAxisTagController { * @date 2022/4/19/0019 9:24 */ @PostMapping("listSimpleAll") - public Result> listSimpleAll() { - return new Result().ok(powerAxisTagService.listSimpleAll()); + public Result> listSimpleAll(@LoginUser TokenDto tokenDto) { + return new Result().ok(powerAxisTagService.listSimpleAll(tokenDto)); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index d4831d5..ebb2b86 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -3,8 +3,14 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; -import com.epmet.plugin.power.dto.axis.form.*; -import com.epmet.plugin.power.dto.axis.result.*; +import com.epmet.plugin.power.dto.axis.form.PowerAxisListPositionFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisListPositionResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -12,8 +18,6 @@ import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; -import java.util.List; - /** * 动力主轴结构 * @@ -125,4 +129,6 @@ public interface PowerAxisStructDao extends BaseDao { String getRootAxisStructId(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("structLevel") int structLevel); -} \ No newline at end of file + + List getPageList(Map params); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java index babc8bd..b4116c7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java @@ -25,7 +25,7 @@ public interface PowerAxisTagDao extends BaseDao { * @author work@yujt.net.cn * @date 2022/4/19/0019 9:14 */ - List listSimpleAll(); + List listSimpleAll(@Param("customerId") String customerId); /** * 根据ID查询节点等级 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java index 557dd09..d2c71f0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java @@ -3,6 +3,7 @@ package com.epmet.plugin.power.modules.axis.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.result.*; @@ -27,7 +28,7 @@ public interface PowerAxisStructService extends BaseService page(Map params); + PageData page(TokenDto tokenDto,Map params); /** * 默认查询 @@ -165,4 +166,4 @@ public interface PowerAxisStructService extends BaseService { * @author work@yujt.net.cn * @date 2022/4/19/0019 9:23 */ - List listSimpleAll(); + List listSimpleAll(TokenDto tokenDto); /** * 根据标签编码,查询节点级别 @@ -121,4 +122,4 @@ public interface PowerAxisTagService extends BaseService { * @date 2022/4/23/0023 15:51 */ Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId); -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 124529c..6ceb724 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -2,7 +2,6 @@ package com.epmet.plugin.power.modules.axis.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.constant.NumConstant; @@ -12,6 +11,7 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.TreeUtils; @@ -53,12 +53,16 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PowerAxisStructDTO.class); + public PageData page(TokenDto tokenDto,Map params) { +// IPage page = baseDao.selectPage( +// getPage(params, FieldConstant.CREATED_TIME, false), +// getWrapper(params) +// ); +// return getPageData(page, PowerAxisStructDTO.class); + params.put("customerId", tokenDto.getCustomerId()); + IPage page = getPage(params); + List list = baseDao.getPageList(params); + return new PageData<>(list, page.getTotal()); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java index a7d0b14..d659a2c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; @@ -116,8 +117,8 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl listSimpleAll() { - return baseDao.listSimpleAll(); + public List listSimpleAll(TokenDto tokenDto) { + return baseDao.listSimpleAll(tokenDto.getCustomerId()); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 8be24a9..689ec0f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -257,6 +257,13 @@ AND s.DEL_FLAG = '0' AND t.STRUCT_LEVEL = #{structLevel} + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml index 27034ee..721ab2b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml @@ -29,7 +29,12 @@ - - - diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml index 721ab2b..fa32864 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml @@ -58,6 +58,13 @@ AND CUSTOMER_ID = #{customerId} order by STRUCT_LEVEL,CREATED_TIME DESC + From 3dccab567f8b7a1245cde69cc8237fbbd6502a17 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 29 Jul 2022 14:38:10 +0800 Subject: [PATCH 095/108] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7id=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/PowerAxisStructLeaderFormDTO.java | 8 ++++++-- .../controller/PowerAxisStructController.java | 1 + .../mapper/poweraxis/PowerAxisStructDao.xml | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java index b71d1db..64a51cf 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; import java.io.Serializable; -import java.util.Date; /** @@ -32,5 +31,10 @@ public class PowerAxisStructLeaderFormDTO implements Serializable { */ private String leaderName; + /** + * 客户id + */ + private String customerId; + -} \ No newline at end of file +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index c65f523..83cef7c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -108,6 +108,7 @@ public class PowerAxisStructController { formDto.setAgencyId(staffInfo.getAgencyId()); } } + formDto.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index df22c24..2948e57 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -51,15 +51,16 @@ left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE and t.DEL_FLAG = '0' where s.DEL_FLAG = '0' - - and s.AGENCY_ID = #{agencyId} - - - and s.NAME like '%${axisName}%' - - - and l.NAME like '%${leaderName}%' - + and s.CUSTOMER_ID = #{customerId} + + and s.AGENCY_ID = #{agencyId} + + + and s.NAME like '%${axisName}%' + + + and l.NAME like '%${leaderName}%' + order by s.sort,s.CREATED_TIME,l.CREATED_TIME From 4859ea4de00c238f90be6cb9dfd2baa3dc7502b5 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 29 Jul 2022 14:43:16 +0800 Subject: [PATCH 096/108] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AE=A2=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/poweraxis/PowerAxisStructDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 2948e57..9094c59 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -47,9 +47,9 @@ l.MOBILE as LEADER_MOBILE, t.STRUCT_LEVEL from pli_power_axis_struct s - left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0' - left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' - left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE and t.DEL_FLAG = '0' + left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0' and sl.CUSTOMER_ID = #{customerId} + left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' and l.CUSTOMER_ID = #{customerId} + left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE and t.DEL_FLAG = '0' and t.CUSTOMER_ID = #{customerId} where s.DEL_FLAG = '0' and s.CUSTOMER_ID = #{customerId} From be3f659f517765d5af49da6fbf42bfab0213f18f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 1 Aug 2022 15:19:22 +0800 Subject: [PATCH 097/108] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/commons/redis/RedisKeys.java | 6 +- .../dto/visit/form/DhChannelFormDTO.java | 23 +++++++ .../power/dto/visit/form/DhDeptFormDTO.java | 27 ++++++++ .../dto/visit/form/DhIdentityFormDTO.java | 29 +++++++++ .../power/dto/visit/form/DhPlanFormDTO.java | 27 ++++++++ .../pli-power-base-server/pom.xml | 28 ++++----- .../service/impl/VisitVisitorServiceImpl.java | 1 + .../modules/visit/utils/DhDeviceUtil.java | 62 ++++++++++++------- 8 files changed, 165 insertions(+), 38 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java index c38a55c..10ead82 100644 --- a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java +++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java @@ -23,21 +23,21 @@ public class RedisKeys { * 海康accessToken */ public static String getHikTokenKey() { - return "hik:token"; + return rootPrefix.concat("hik:token"); } /** * 大华publicKey */ public static String getDhPublicKey() { - return "dh:public"; + return rootPrefix.concat("dh:public"); } /** * 大华token */ public static String getDhToken() { - return "dh:token"; + return rootPrefix.concat("dh:token"); } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelFormDTO.java new file mode 100644 index 0000000..7ab1b72 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhChannelFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer pageNum; + + private Integer pageSize; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java new file mode 100644 index 0000000..456179d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.dto.visit.form; + +import com.epmet.plugin.power.dto.visit.result.DhChannelResultDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhDeptFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String name; + + private String description; + + private Long parentId; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java new file mode 100644 index 0000000..c30adda --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhIdentityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String name; + + private Double subsidyAmount; + + private Integer isCashRecharge; + + private Integer isMachineRecharge; + + private String description; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java new file mode 100644 index 0000000..7719a5a --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.plugin.power.dto.visit.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 海康社区人员信息下放 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-20 + */ +@Data +public class DhPlanFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String detail; + + private String memo; + + private String name; + + private Integer type; + +} \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 0b22591..0c50438 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -175,8 +175,8 @@ 111 222 - https://api2.hik-cloud.com - 111 + http://112.6.213.175:8314 + shundeju @@ -190,10 +190,10 @@ - + - root - Abc@123456 + epmet_pli_power_user + EpmEt-db-UsEr 0 192.168.1.140 @@ -206,7 +206,7 @@ false - 192.168.43.186 + 192.168.43.84 false @@ -233,8 +233,8 @@ 111 222 - https://api2.hik-cloud.com - 111 + http://112.6.213.175:8314 + shundeju @@ -295,8 +295,8 @@ 111 222 - https://api2.hik-cloud.com - 111 + http://112.6.213.175:8314 + shundeju @@ -352,8 +352,8 @@ 90688b09bb9d40088f7be404ccb347c7 7b1940707a4240be9c794c5a967a30c9 - https://api2.hik-cloud.com - 111 + http://112.6.213.175:8314 + shundeju @@ -412,8 +412,8 @@ 90688b09bb9d40088f7be404ccb347c7 7b1940707a4240be9c794c5a967a30c9 - https://api2.hik-cloud.com - 111 + http://112.6.213.175:8314 + shundeju diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java index a923a45..286461b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/visit/service/impl/VisitVisitorServiceImpl.java @@ -131,6 +131,7 @@ public class VisitVisitorServiceImpl extends BaseServiceImpl paramsMap = new HashMap<>(4); + DhDeptFormDTO dto = new DhDeptFormDTO(); + dto.setName("访客部门"); + dto.setParentId(1L); - String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); @@ -162,11 +162,15 @@ public class DhDeviceUtil { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询部门列表失败"); } Object registerResult = result.getData(); - JSONArray jsonArray = JSON.parseArray(registerResult.toString()); - JSONObject jsonObject = jsonArray.getJSONObject(0); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); if (null != jsonObject) { - return Long.parseLong(jsonObject.get("deptId").toString()); + return Long.parseLong(jsonObject.toString()); } +// JSONArray jsonArray = JSON.parseArray(registerResult.toString()); +// JSONObject jsonObject = jsonArray.getJSONObject(0); +// if (null != jsonObject) { +// return Long.parseLong(jsonObject.get("deptId").toString()); +// } return 0L; } @@ -184,8 +188,13 @@ public class DhDeviceUtil { url = url + urlParam; Map paramsMap = new HashMap<>(4); + DhIdentityFormDTO dto = new DhIdentityFormDTO(); + dto.setName("访客"); + dto.setSubsidyAmount(0D); + dto.setIsCashRecharge(1); + dto.setIsMachineRecharge(1); - String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取身份列表失败"); @@ -209,21 +218,25 @@ public class DhDeviceUtil { } /** - * 查询开门计划 + * 新增开门计划 * * @param * @return java.lang.String * @author zhy * @date 2022/5/23 11:04 */ - public String getPlan() { + public Long getPlan() { String url = dhCloudProperties.getUrl().concat(GET_DOOR_PLAN); String urlParam = getDhUrlParams(); url = url + urlParam; Map paramsMap = new HashMap<>(4); + DhPlanFormDTO dto = new DhPlanFormDTO(); + dto.setDetail("{\\\"monday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"tuesday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"wednesday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"thursday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"friday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"saturday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"],\\\"sunday\\\":[\\\"00:00-23:59\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\",\\\"00:00-00:00\\\"]}"); + dto.setName("访客计划"); + dto.setType(1); - String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询开门计划失败"); @@ -238,12 +251,16 @@ public class DhDeviceUtil { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询开门计划失败"); } Object registerResult = result.getData(); - JSONArray jsonArray = JSON.parseArray(registerResult.toString()); - JSONObject jsonObject = jsonArray.getJSONObject(0); + JSONObject jsonObject = JSON.parseObject(registerResult.toString()); if (null != jsonObject) { - return jsonObject.get("id").toString(); + return Long.parseLong(jsonObject.toString()); } - return ""; +// JSONArray jsonArray = JSON.parseArray(registerResult.toString()); +// JSONObject jsonObject = jsonArray.getJSONObject(0); +// if (null != jsonObject) { +// return jsonObject.get("id").toString(); +// } + return null; } /** @@ -260,8 +277,11 @@ public class DhDeviceUtil { url = url + urlParam; Map paramsMap = new HashMap<>(4); + DhChannelFormDTO dto = new DhChannelFormDTO(); + dto.setPageSize(1000); + dto.setPageSize(1); - String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getData(); + String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); if (null == data) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询通道列表失败"); @@ -449,7 +469,7 @@ public class DhDeviceUtil { public String addPersonAuth(DhPersonFormDTO dto, String imgUrl) { String personCard = addPersonCard(dto); List channel = getChannel(); - String plan = getPlan(); + Long plan = getPlan(); if (StringUtils.isBlank(personCard)) { return "开卡失败"; @@ -459,7 +479,7 @@ public class DhDeviceUtil { if (channel.isEmpty()) { return "获取通道失败"; } - if (StringUtils.isBlank(plan)) { + if (plan == null) { return "获取开门计划失败"; } DhAuthFormDTO authFormDTO = new DhAuthFormDTO(); @@ -468,7 +488,7 @@ public class DhDeviceUtil { url = url + urlParam; authFormDTO.setCardNumber(personCard); - authFormDTO.setTimeQuantumId(plan); + authFormDTO.setTimeQuantumId(plan.toString()); authFormDTO.setCardPrivilegeDetails(channel); Map paramsMap = new HashMap<>(4); From 0559aecf0911cd98d375ed5f8893c53a25b0924b Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Mon, 1 Aug 2022 15:54:37 +0800 Subject: [PATCH 098/108] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E5=AE=A1=E6=A0=B8PC?= =?UTF-8?q?=E7=AB=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/rent/RentContractInfoDao.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index 37eca07..61949a3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -43,8 +43,11 @@ LEFT JOIN pli_rent_blacklist b ON i.LESSEE_ID_CARD = b.ID_CARD AND b.DEL_FLAG = '0' WHERE i.DEL_FLAG = '0' - - AND i.IS_PC_INPUT = #{isPcInput} + + AND i.IS_PC_INPUT = '1' + + + AND i.IS_PC_INPUT != '1' AND i.CUSTOMER_ID = #{customerId} From 2825bedf12ae0757780bfc13951922058c6e8cf0 Mon Sep 17 00:00:00 2001 From: wanggongfeng <1305282856@qq.com> Date: Mon, 1 Aug 2022 16:10:26 +0800 Subject: [PATCH 099/108] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E5=AE=A1=E6=A0=B8PC?= =?UTF-8?q?=E7=AB=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/rent/RentContractInfoDao.xml | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml index 61949a3..88f3c96 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/rent/RentContractInfoDao.xml @@ -36,7 +36,44 @@