diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java index e6318f61b6..517330e427 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/BizTypeEnum.java @@ -19,6 +19,7 @@ public enum BizTypeEnum { GRID_PROJECT("grid_project", "网格项目"), PROJECT("project", "项目"), ARTICLE("article", "文章(党建声音)"), + SPECIAL_CROWD("special_crowd", "社会维稳(特殊人群)"), ; public static BizTypeEnum getEnum(String code) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java index 34647de7ec..822d6cfe22 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java @@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j public class TCCCClientUtils { - private static String SDKAPPID = "1400801042"; + private static Long SDKAPPID = 1400801042L; private static String USERID = "286388969@qq.com"; @@ -34,12 +34,12 @@ public class TCCCClientUtils { CccClient client = new CccClient(cred, "", clientProfile); // 实例化一个请求对象,每个接口都会对应一个request对象 CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest(); - req.setSdkAppId(1400801042L); - req.setSeatUserId("286388969@qq.com"); + req.setSdkAppId(SDKAPPID); + req.setSeatUserId(USERID); // 返回的resp是一个CreateSDKLoginTokenResponse的实例,与请求对象对应 CreateSDKLoginTokenResponse resp = client.CreateSDKLoginToken(req); // 输出json格式的字符串回包 - System.out.println(CreateSDKLoginTokenResponse.toJsonString(resp)); + log.info(CreateSDKLoginTokenResponse.toJsonString(resp)); return CreateSDKLoginTokenResponse.toJsonString(resp); } catch (TencentCloudSDKException e) { log.error(e.toString()); diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c723860629..0aa5931823 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -528,6 +528,8 @@ epmet: # 员工登记、受众群体登记 - /gov/org/icEmployeeRegister/add - /gov/org/icGroupPeopleRegister/add + # 组织树,灵山大屏需要无登录调用,放开 + - /gov/org/agency/maporg # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: - /data/report/** diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java index 18c2baba6e..dd852c7eca 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/tccc/TCCCAuthController.java @@ -14,7 +14,7 @@ public class TCCCAuthController { public String getTcccAuth() { try { String tcccAuth = TCCCClientUtils.getToken(); - System.out.println(tcccAuth); + log.info(tcccAuth); return tcccAuth; } catch (Exception e) { log.error(e.toString()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 5624c39127..09007cde56 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -362,14 +362,13 @@ public class AgencyController { /** * @param formDTO - * @param tokenDto * @Description 【地图配置】组织查询 * @author zxc * @date 2021/10/25 10:50 上午 */ @PostMapping("maporg") - public Result mapOrg(@RequestBody MapOrgFormDTO formDTO, @LoginUser TokenDto tokenDto) { - return new Result().ok(agencyService.mapOrg(formDTO, tokenDto)); + public Result mapOrg(@RequestBody MapOrgFormDTO formDTO) { + return new Result().ok(agencyService.mapOrg(formDTO)); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index 5d2a97ba5c..9237f186c8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -118,12 +118,11 @@ public interface AgencyService { /** * @param formDTO - * @param tokenDto * @Description 【地图配置】组织查询 * @author zxc * @date 2021/10/25 10:50 上午 */ - MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto); + MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO); /** * @param formDTO diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index a972cd9797..c7444f047b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; @@ -733,7 +734,6 @@ public class AgencyServiceImpl implements AgencyService { /** * @param formDTO - * @param tokenDto * @Description 【地图配置】组织查询 * 根据level查询去查询不同的表,类型,组织:agency,网格:grid,小区:neighborHood * 组织类型去查 customer_agency,看本级是不是 community,是,下级组织就是网格,查询customer_grid,不是,继续查customer_agency @@ -744,19 +744,35 @@ public class AgencyServiceImpl implements AgencyService { * @date 2021/10/25 10:50 上午 */ @Override - public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto) { + public MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO) { MapOrgResultDTO result = new MapOrgResultDTO(); - LambdaQueryWrapper qw = new LambdaQueryWrapper(); - qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, tokenDto.getCustomerId()); - CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); + + String customerId = null; + if (StringUtils.isBlank(formDTO.getOrgId())) { - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + // 没有传参,则使用当前用户所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo((customerId = EpmetRequestHolder.getLoginUserCustomerId()), EpmetRequestHolder.getLoginUserId()); if (null == staffInfo) { return result; } formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setLevel(OrgInfoConstant.AGENCY); + } else { + // 前段传递了,那就用前端传递的level和orgId,并且查出来这个组织的客户id,用于后面查询跟组织中心点 + if (OrgInfoConstant.AGENCY.equals(formDTO.getLevel())) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId()); + customerId = agencyInfo.getCustomerId(); + } else if (OrgInfoConstant.GRID.equals(formDTO.getLevel())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId()); + customerId = gridInfo.getCustomerId(); + } } + + // 查询客户跟组织中心点 + LambdaQueryWrapper qw = new LambdaQueryWrapper(); + qw.eq(CustomerAgencyEntity::getPid, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getDelFlag, NumConstant.ZERO_STR).eq(CustomerAgencyEntity::getCustomerId, customerId); + CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectOne(qw); + if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())) { result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java new file mode 100644 index 0000000000..d31d57b3d1 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventAddEditFormDTO.java @@ -0,0 +1,83 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +@Data +public class EventAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 事件编号 + */ + private String code; + /** + * 事件状态 + */ + private String status; + /** + * 上报人员 + */ + private String reporter; + /** + * 联系电话 + */ + private String phone; + /** + * 上报事件 + */ + private Date reportDate; + /** + * 紧急程度 + */ + private String urgency; + /** + * 所属网格 + */ + private String grid; + /** + * 事件类型 + */ + private String eventType; + /** + * 即办类型 + */ + private String type; + /** + * 办理期限 + */ + private Date lastDate; + + /** + * 满意度 + */ + private String satisficing; + + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + + + private String customerId; + + private String agencyId; + + private String staffId; + + private String userId; + + private String app; + + private String client; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java new file mode 100644 index 0000000000..a9c4c2baa5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventFormsDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 灵山项目事件 formDTO + */ + +@Data +public class EventFormsDTO implements Serializable { + private static final long serialVersionUID = 1; + + public interface Detail extends CustomerClientShowGroup { + } + + public interface GovRedDot extends CustomerClientShowGroup { + } + + /** + * 事件编号 + */ + private String code; + /** + * 事件状态 + */ + private String status; + /** + * 上报人员 + */ + private String reporter; + /** + * 联系电话 + */ + private String phone; + /** + * 上报事件 + */ + private Date reportDate; + /** + * 紧急程度 + */ + private String urgency; + /** + * 所属网格 + */ + private String grid; + /** + * 事件类型 + */ + private String eventType; + /** + * 即办类型 + */ + private String type; + /** + * 办理期限 + */ + private Date lastDate; + + /** + * 满意度 + */ + private String satisficing; + + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + + + private String customerId; + + private String agencyId; + + private String staffId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java new file mode 100644 index 0000000000..059905086a --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventResultDTO.java @@ -0,0 +1,102 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 即墨灵山项目 + */ + +@Data +public class EventResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 事件编号 + */ + private String code; + + /** + * 事件状态 + */ + private String status; + + /** + * 事件明细ID + */ + private String detailId; + /** + * 上报人员 + */ + private String reporter; + /** + * 联系电话 + */ + private String phone; + /** + * 上报事件事件 + */ + private Date reportDate; + /** + * 紧急程度 + */ + private String urgency; + /** + * 所属网格 + */ + private String grid; + /** + * 事件类型 + */ + private String eventType; + /** + * 即办类型 + */ + private String type; + /** + * 办理期限 + */ + private Date lastDate; + /** + * 事件地址 + */ + private String eventAddr; + + /** + * 坐标经度 + */ + private String longitude; + /** + * 坐标纬度 + */ + private String latitude; + /** + * 音频 + */ + private String voice; + /** + * 视频 + */ + private String video; + /** + * 满意度 + */ + private String satisficing; + /** + * 解决情况 + */ + private String remark; + /** + * 事件描述 + */ + private String conetnt; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java new file mode 100644 index 0000000000..2a85af367f --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java @@ -0,0 +1,88 @@ +package com.epmet.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.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.dto.form.EventAddEditFormDTO; +import com.epmet.dto.form.EventFormsDTO; +import com.epmet.dto.result.EventResultDTO; +import com.epmet.service.EventService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author yan Lu + * @date 2023-04-14 19:07 + * @deprecated 社会治理--事件处理 + */ +@Slf4j +@RestController +@RequestMapping("event") +public class EventController { + + @Autowired + private EventService eventService; + + /** + * 社会治理 事件列表 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("list") + public Result> getList(@LoginUser TokenDto tokenDto, @RequestBody EventFormsDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(eventService.getList(formDTO)); + } + + /** + * @deprecated 根据ID获取事件 + * @param id + * @return + */ + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + EventResultDTO data = eventService.getById(id); + return new Result().ok(data); + } + + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody EventAddEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); + formDTO.setClient(tokenDto.getClient()); + eventService.save(formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody EventResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + eventService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + eventService.delete(ids); + return new Result(); + } + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java new file mode 100644 index 0000000000..fe05484677 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/EventEntityDao.java @@ -0,0 +1,19 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.EventFormsDTO; +import com.epmet.dto.result.EventResultDTO; +import com.epmet.entity.EventEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 灵山项目 + */ + +@Mapper +public interface EventEntityDao extends BaseDao { + + List getList(EventFormsDTO formDTO); +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java new file mode 100644 index 0000000000..84d4c2e0c8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventDetailEntity.java @@ -0,0 +1,43 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("event_detail") +public class EventDetailEntity extends BaseEpmetEntity { + + /** + * 事件ID + */ + private String eventId; + /** + * 上报人 + */ + private String reporter; + /** + * 接收人 + */ + private String recipient; + /** + * 上报事件 + */ + private Date reportDate; + /** + * 事件附件地址 + */ + private String atts; + /** + * 事件处理耗时 + */ + private String timeSpent; + /** + * 反馈内容 + */ + private String content; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java new file mode 100644 index 0000000000..1d6212adcf --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/EventEntity.java @@ -0,0 +1,97 @@ +package com.epmet.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山项目事件 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("event_entity") +public class EventEntity extends BaseEpmetEntity { + + /** + * 事件编号 + */ + private String code; + /** + * 事件状态 + */ + private String status; + /** + * 事件明细ID + */ + private String detailId; + /** + * 上报人员 + */ + private String reporter; + /** + * 联系电话 + */ + private String phone; + /** + * 上报事件事件 + */ + private Date reportDate; + /** + * 紧急程度 + */ + private String urgency; + /** + * 所属网格 + */ + private String grid; + /** + * 事件类型 + */ + private String eventType; + /** + * 即办类型 + */ + private String type; + /** + * 办理期限 + */ + private Date lastDate; + /** + * 事件地址 + */ + private String eventAddr; + + /** + * 坐标经度 + */ + private String longitude; + /** + * 坐标纬度 + */ + private String latitude; + /** + * 音频 + */ + private String voice; + /** + * 视频 + */ + private String video; + /** + * 满意度 + */ + private String satisficing; + /** + * 解决情况 + */ + private String remark; + /** + * 事件描述 + */ + private String conetnt; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java new file mode 100644 index 0000000000..07371f7f4f --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/EventService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.EventAddEditFormDTO; +import com.epmet.dto.form.EventFormsDTO; +import com.epmet.dto.result.EventResultDTO; + +public interface EventService { + PageData getList(EventFormsDTO formDTO); + + EventResultDTO getById(String id); + + void update(EventResultDTO dto); + + void delete(String[] ids); + + void save(EventAddEditFormDTO dto); +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java new file mode 100644 index 0000000000..7567d05e6d --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java @@ -0,0 +1,136 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.EventEntityDao; +import com.epmet.dto.form.EventAddEditFormDTO; +import com.epmet.dto.form.EventFormsDTO; +import com.epmet.dto.result.EventResultDTO; +import com.epmet.entity.EventEntity; +import com.epmet.entity.IcEventOperationLogEntity; +import com.epmet.service.EventService; +import com.epmet.service.IcEventOperationLogService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.Date; +import java.util.List; + +@Service +public class EventServiceImpl extends BaseServiceImpl implements EventService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Autowired + private IcEventOperationLogService icEventOperationLogService; + + /** + * @param formDTO + * @return + * @deprecated 查询事件列表 + */ + @Override + public PageData getList(EventFormsDTO formDTO) { + if (StringUtils.isBlank(formDTO.getAgencyId())) { + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + //分页查询当前组织下网格内事件数据 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.getList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * @param id + * @return + * @deprecated 获取事件详情 + */ + @Override + public EventResultDTO getById(String id) { + EventEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EventResultDTO.class); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EventResultDTO dto) { + EventEntity entity = ConvertUtils.sourceToTarget(dto, EventEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + for (String id : ids) { + EventEntity entity = baseDao.selectById(id); + if (null == entity) { + continue; + } + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(EventEntity::getId, id).set(EventEntity::getUpdatedTime, new Date()) + .set(EventEntity::getUpdatedBy, loginUserUtil.getLoginUserId()) + .set(EventEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); +// icEventCategoryService.delInsert(id,null); + } + } + + @Override + public void save(EventAddEditFormDTO formDTO) { + EventEntity entity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class); + entity.setId(IdWorker.getIdStr()); +// List logList = new ArrayList<>(); +// logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), new Date(), "add", "publish")); +// icEventOperationLogService.insertBatch(logList); + insert(entity); + } + + /** + * @param customerId + * @param staffId + * @return + * @deprecated 获取当前登陆人员信息 + */ + + public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId)); + } + return staffInfo; + } + + /** + * 事件管理操作日志记录 + * + * @return + */ + private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date operateTime, String actionCode, String actionDesc) { + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setCustomerId(customerId); + logEntity.setIcEventId(icEventId); + logEntity.setUserId(userId); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode(actionCode); + logEntity.setActionDesc(actionDesc); + logEntity.setOperateTime(operateTime); + return logEntity; + } +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml new file mode 100644 index 0000000000..722e76a38f --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/EventEntityDao.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java new file mode 100644 index 0000000000..28e0c19e7c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/LingShanSpecialCrowdTypeEnums.java @@ -0,0 +1,42 @@ +package com.epmet.enums; + +/** + * @description: 灵山街道-特殊人群 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 10:55 AM + */ +public enum LingShanSpecialCrowdTypeEnums { + AZBJ("anzhibangjiao", "安置帮教", 1), + SQJZ("shequjiaozheng", "社区矫正", 1), + JDRY("xidurenyuan", "戒毒人员", 1), + JZHZ("jingzhanghuanzhe", "精障患者", 1), + XFRY("xinfangrenyuan", "信访人员", 1); + + /** + * 类型。anzhibangjiao, + */ + private String type; + private String name; + + private Integer headerRowNumber; + + LingShanSpecialCrowdTypeEnums(String type, String name, Integer headerRowNumber) { + this.type = type; + this.name = name; + this.headerRowNumber = headerRowNumber; + } + + public String getType() { + return type; + } + + public String getName() { + return name; + } + + public Integer getHeaderRowNumber() { + return headerRowNumber; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java new file mode 100644 index 0000000000..1d99dbce93 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/LingShanSpecialCrowdController.java @@ -0,0 +1,117 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.LingShanSpecialCrowdService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Date; + +/** + * @description: 灵山社会维稳(特殊人群) + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:08 AM + */ +@Slf4j +@RestController +@RequestMapping("lingShan/specialCrowd") +public class LingShanSpecialCrowdController { + + @Autowired + private LingShanSpecialCrowdService lingShanSpecialCrowdService; + + /** + * @description: 特殊人群导入 + * @param file: + * @param crowdCategory: 人群类别 + * anzhibangjiao + * buliangqingshaonian + * shequjiaozheng + * xidurenyuan + * xiejiaorenyuan + * zhaoshizhaohuojingshenbing + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:12 AM + */ + @PostMapping("import") + public Result importSpecialCowd(MultipartFile file, @RequestParam("crowdCategory") String crowdCategory) { + + String originalFilename = file.getOriginalFilename(); + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); + + // 1.存文件 + Path fileSavePath = saveSpecialCrowdTempFile(file, suffix); + + // 2.执行业务导入 + try { + lingShanSpecialCrowdService.importSpecialCrowd(crowdCategory, fileSavePath.toString(), originalFilename); + } catch (Exception e) { + throw e; + // ... + } finally { + // 3.删除文件 + deleteSpecialCrowdTempFile(fileSavePath); + } + + return new Result(); + } + + /** + * @description: 保存特殊人群临时文件 + * @param file: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:46 AM + */ + public Path saveSpecialCrowdTempFile(@RequestParam("file") MultipartFile file, String suffix) { + Path fileSavePath; + FileOutputStream os = null; + try { + Path fileSaveDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("special_crowd_import"); + String fileName = DateUtils.format(new Date(), "yyyyMMdd_HHmmss_" + System.nanoTime()) + suffix; + fileSavePath = fileSaveDir.resolve(fileName); + IOUtils.copy(file.getInputStream(), (os = new FileOutputStream(fileSavePath.toString()))); + return fileSavePath; + } catch (IOException e) { + log.error("【灵山街道】导入社会维稳数据,缓存文件失败。"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(os); + } + } + + /** + * @description: 删除特殊人群临时文件 + * @param fileSavePath: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 9:47 AM + */ + public void deleteSpecialCrowdTempFile(Path fileSavePath) { + if (fileSavePath != null) { + try { + Files.deleteIfExists(fileSavePath); + } catch ( + IOException e) { + log.error("【灵山街道】导入社会维稳数据,删除临时文件失败"); + } + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java new file mode 100644 index 0000000000..867b812be2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailAzbjDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-安置帮教 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailAzbjDao extends BaseDao { + + void saveBatchManually(@Param("asbjList") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java new file mode 100644 index 0000000000..46419693c3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJdryDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-戒毒人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailJdryDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java new file mode 100644 index 0000000000..727b1f3e07 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailJzhzDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-精障患者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailJzhzDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java new file mode 100644 index 0000000000..331aa3a227 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailSqjzDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailSqjzEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-社区矫正 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailSqjzDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java new file mode 100644 index 0000000000..e3e3ef3527 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdDetailXfryDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailXfryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-信访人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdDetailXfryDao extends BaseDao { + + void saveBatchManually(@Param("list") List l); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java new file mode 100644 index 0000000000..5c048ed7fb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonDao.java @@ -0,0 +1,21 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-人员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdPersonDao extends BaseDao { + + void saveOrUpdateManually(@Param("list") List list); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java new file mode 100644 index 0000000000..5dbb31709b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/LingshanSpecialCrowdPersonTypeDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanSpecialCrowdPersonTypeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山-特殊人群-人员具有的特殊人群类型信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Mapper +public interface LingshanSpecialCrowdPersonTypeDao extends BaseDao { + + void saveOrUpdateManually(@Param("types") List types); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java new file mode 100644 index 0000000000..e8905d6624 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailAzbjEntity.java @@ -0,0 +1,69 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-安置帮教 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_azbj") +public class LingshanSpecialCrowdDetailAzbjEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 原罪名 + */ + private String originalCharge; + + /** + * 释放日期 + */ + private Date releaseDate; + + /** + * 原判刑期(单位:月) + */ + private Date originPrisonTerm; + + /** + * 是否累犯。0否,1是 + */ + private Integer recidivismFlag; + + /** + * 是否安置。0否,1是 + */ + private Integer emplacementFlag; + + /** + * 安置日期 + */ + private Date emplacementDate; + + /** + * 安置帮教情况 + */ + private String emplacementInfo; + + /** + * 是否注销 + */ + private Integer canceledFlag; + + /** + * 注销原因 + */ + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java new file mode 100644 index 0000000000..ae663fc8c1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailBaseEntity.java @@ -0,0 +1,22 @@ +package com.epmet.entity; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; + +@Data +public class LingshanSpecialCrowdDetailBaseEntity extends BaseEpmetEntity { + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 证件号 + */ + private String idCard; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java new file mode 100644 index 0000000000..279af30d10 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJdryEntity.java @@ -0,0 +1,69 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-戒毒人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_jdry") +public class LingshanSpecialCrowdDetailJdryEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 有无犯罪史 + */ + private Integer criminalHistoryFlag; + + /** + * 有无复吸史 + */ + private Integer drugRepetitionFlag; + + /** + * 初次发现日期 + */ + private Date firstDiscoveryDate; + + /** + * 管控人姓名 + */ + private String controllerName; + + /** + * 管控人联系方式 + */ + private String controllerContact; + + /** + * 帮扶人姓名 + */ + private String helperName; + + /** + * 帮扶人联系方式 + */ + private String helperContact; + + /** + * 是否脱管 + */ + private Integer detachedFlag; + + /** + * 脱管原因 + */ + private String detachedReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java new file mode 100644 index 0000000000..4bdef1f2b0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailJzhzEntity.java @@ -0,0 +1,74 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-精障患者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_jzhz") +public class LingshanSpecialCrowdDetailJzhzEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 有无肇事肇祸史 + */ + private Integer causeTroubleHistoryFlag; + + /** + * 肇事肇祸次数 + */ + private Integer causeTroubleTimes; + + /** + * 目前诊断类型。1精神分裂症,2分裂情感性障碍,3持久的妄想性障碍(偏执性精神病),4双相(情感)障碍,5癫痫所致精神障碍,6精神发育迟滞伴发精神障碍,7重度抑郁发作,8精神活性物质所致精神障碍,9其他 + */ + private Integer currentDiagnosis; + + /** + * 危险性评估等级。0,1,2,3,4,5 + */ + private Integer dangerousClass; + + /** + * 是否具备外出能力 + */ + private Integer canGoOutFlag; + + /** + * 是否有暴力倾向 + */ + private Integer violenceFlag; + + /** + * 是否落实监管补助 + */ + private Integer allowanceFlag; + + /** + * 是否纳入低保 + */ + private Integer subsistenceFlag; + + /** + * 监护人姓名 + */ + private String guardianName; + + /** + * 监护人联系方式 + */ + private String guardianContact; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java new file mode 100644 index 0000000000..66f1b8767a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailSqjzEntity.java @@ -0,0 +1,79 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-社区矫正 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_sqjz") +public class LingshanSpecialCrowdDetailSqjzEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 矫正类型。1.管制,2缓刑,3假释,4暂予监外执行,5剥夺政治权利 + */ + private Integer rectificateType; + + /** + * 矫正开始日期 + */ + private Date rectificateStartDate; + + /** + * 矫正结束日期 + */ + private Date rectificateEndDate; + + /** + * 原羁押场所 + */ + private String originDetainAddress; + + /** + * 原罪名 + */ + private String originalCharge; + + /** + * 接受方式。1.自行报到,2狱所押送,3当庭交接,4其他 + */ + private Integer receiveWay; + + /** + * 矫正情况说明 + */ + private String rectificateInfo; + + /** + * 是否脱管 + */ + private Integer detachedFlag; + + /** + * 脱管原因 + */ + private String detachedReason; + + /** + * 是否注销 + */ + private Integer canceledFlag; + + /** + * 注销原因 + */ + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java new file mode 100644 index 0000000000..34605bd8cc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdDetailXfryEntity.java @@ -0,0 +1,70 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-信访人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_detail_xfry") +public class LingshanSpecialCrowdDetailXfryEntity extends LingshanSpecialCrowdDetailBaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 反映问题 + */ + private String problem; + + /** + * 稳控措施 + */ + private String stableControlMeasurement; + + /** + * 是否多次上访 + */ + private Integer multipleFlag; + + /** + * 是否在当地 + */ + private Integer localFlag; + + /** + * 分管领导 + */ + private String branchLeader; + + /** + * 分管领导联系方式 + */ + private String branchLeaderContact; + + /** + * 负责人 + */ + private String principal; + + /** + * 负责人联系方式 + */ + private String principalContact; + + /** + * 稳控人员名单 + */ + private String stableControlerList; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java new file mode 100644 index 0000000000..8291a3fe24 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonEntity.java @@ -0,0 +1,64 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 灵山-特殊人群-人员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_person") +public class LingshanSpecialCrowdPersonEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 姓名 + */ + private String name; + + /** + * 证件号 + */ + private String idCard; + + public LingshanSpecialCrowdPersonEntity() { + } + + public LingshanSpecialCrowdPersonEntity(String id, String customerId, String orgIdPath, String name, String idCard, + String delFlag, Integer revision, Date createdTime, String createdBy, Date updatedTime, + String updatedBy) { + this.customerId = customerId; + this.orgIdPath = orgIdPath; + this.name = name; + this.idCard = idCard; + this.setDelFlag(delFlag); + this.setCreatedBy(createdBy); + this.setCreatedTime(createdTime); + this.setUpdatedBy(updatedBy); + this.setUpdatedTime(updatedTime); + this.setRevision(revision); + this.setId(id); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java new file mode 100644 index 0000000000..35276f46ef --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/LingshanSpecialCrowdPersonTypeEntity.java @@ -0,0 +1,59 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 灵山-特殊人群-人员具有的特殊人群类型信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_special_crowd_person_type") +public class LingshanSpecialCrowdPersonTypeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * org id路径,:分割 + */ + private String orgIdPath; + + /** + * 证件号 + */ + private String idCard; + + /** + * 特殊人群类别 + */ + private String specialType; + + public LingshanSpecialCrowdPersonTypeEntity(String id, String customerId, String orgIdPath, String idCard, String specialType, String delFlag, + Integer revision, Date createdTime, String createdBy, Date updatedTime, String updatedBy) { + this.customerId = customerId; + this.orgIdPath = orgIdPath; + this.idCard = idCard; + this.specialType = specialType; + this.setDelFlag(delFlag); + this.setCreatedBy(createdBy); + this.setCreatedTime(createdTime); + this.setUpdatedBy(updatedBy); + this.setUpdatedTime(updatedTime); + this.setRevision(revision); + this.setId(id); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java new file mode 100644 index 0000000000..e146615243 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdIsOrNotConverter.java @@ -0,0 +1,34 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; +import org.apache.commons.lang3.StringUtils; + +/** + * 灵山-是否转换器 + */ +public class LingShanSpecialCrowdIsOrNotConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + String content = context.getReadCellData().getStringValue(); + if (StringUtils.isNotBlank(content)) { + if (content.equals("是") || content.equals("有")) { + return 1; + } else if (content.equals("无") || content.equals("否")) { + return 0; + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java new file mode 100644 index 0000000000..fbefaf92fd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java @@ -0,0 +1,57 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; + +/** + * 灵山-诊断类型转换器 + */ +public class LingShanSpecialCrowdJzhzConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + String content = context.getReadCellData().getStringValue(); + if (content instanceof String) { + switch (content) { + // 诊断类型 + case "精神分裂症": + return 1; + case "分裂情感性障碍": + return 2; + case "持久的妄想性障碍(偏执性精神病)": + return 3; + case "双相(情感)障碍": + return 4; + case "癫痫所致精神障碍": + return 5; + case "精神发育迟滞伴发精神障碍": + return 6; + case "重度抑郁发作": + return 7; + case "精神活性物质所致精神障碍": + return 8; + case "其他": + return 9; + // 危险性评估等级 + case "0级": + return 0; + case "1级": + return 1; + case "2级": + return 2; + case "3级": + return 3; + case "4级": + return 4; + case "5级": + return 5; + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java new file mode 100644 index 0000000000..8de25b0e9a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdSqjzConverter.java @@ -0,0 +1,51 @@ +package com.epmet.excel.converter; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; + +/** + * 灵山-社区矫正转换器 + */ +public class LingShanSpecialCrowdSqjzConverter implements Converter { + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public Integer convertToJavaData(ReadConverterContext context) throws Exception { + Object content = context.getReadCellData().getStringValue(); + if (content instanceof String) { + switch ((String) content) { + // 矫正类型 + case "管制": + return 1; + case "缓刑": + return 2; + case "假释": + return 3; + case "暂予监外执行": + return 4; + case "剥夺政治权利": + return 5; + // 接受方式 + case "自行报到": + return 1; + case "狱所押送": + return 2; + case "当庭交接": + return 3; + case "其他": + return 4; + + } + } + return Converter.super.convertToJavaData(context); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java new file mode 100644 index 0000000000..49bacc91d7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailAzbjExcelData.java @@ -0,0 +1,73 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 安置帮教 + */ +@Data +public class LingShanSpecialCrowdDetailAzbjExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 原罪名 + */ + @ExcelProperty(value = "*原罪名") + @NotBlank(message = "原罪名不能为空") + private String originalCharge; + + /** + * 释放日期 + */ + @ExcelProperty(value = "*释放日期") + @NotNull(message = "释放日期不能为空") + private Date releaseDate; + + /** + * 原判刑期(单位:月) + */ + @ExcelProperty(value = "原判刑期(单位:月)") + private Date originPrisonTerm; + + /** + * 是否累犯。0否,1是 + */ + @ExcelProperty(value = "是否累犯", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer recidivismFlag; + + /** + * 是否安置。0否,1是 + */ + @ExcelProperty(value = "是否安置", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer emplacementFlag; + + /** + * 安置日期 + */ + @ExcelProperty(value = "安置日期") + private Date emplacementDate; + + /** + * 安置帮教情况 + */ + @ExcelProperty(value = "安置帮教情况") + private String emplacementInfo; + + /** + * 是否注销 + */ + @ExcelProperty(value = "是否注销", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canceledFlag; + + /** + * 注销原因 + */ + @ExcelProperty(value = "注销原因") + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java new file mode 100644 index 0000000000..1d43fb5790 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingShanSpecialCrowdDetailBaseExcelData.java @@ -0,0 +1,30 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * + */ +@Data +public class LingShanSpecialCrowdDetailBaseExcelData { + /** + * 姓名 + */ + @ExcelProperty(value = "*姓名") + @NotBlank(message = "姓名不能为空") + private String name; + /** + * 证件号 + */ + @ExcelProperty(value = "*身份证号") + @NotBlank(message = "身份证号不能为空") + private String idCard; + + /** + * 错误信息 + */ + private String errorInfo; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java new file mode 100644 index 0000000000..8ca975af70 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJdryExcelData.java @@ -0,0 +1,79 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 灵山-特殊人群-戒毒人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailJdryExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 有无犯罪史 + */ + @ExcelProperty(value = "*有无犯罪史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无犯罪史不能为空") + private Integer criminalHistoryFlag; + + /** + * 有无复吸史 + */ + @ExcelProperty(value = "*有无复吸史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无复吸史不能为空") + private Integer drugRepetitionFlag; + + /** + * 初次发现日期 + */ + @ExcelProperty(value = "初次发现日期") + private Date firstDiscoveryDate; + + /** + * 管控人姓名 + */ + @ExcelProperty(value = "管控人姓名") + private String controllerName; + + /** + * 管控人联系方式 + */ + @ExcelProperty(value = "管控人联系方式") + private String controllerContact; + + /** + * 帮扶人姓名 + */ + @ExcelProperty(value = "帮扶人姓名") + private String helperName; + + /** + * 帮扶人联系方式 + */ + @ExcelProperty(value = "帮扶人联系方式") + private String helperContact; + + /** + * 是否脱管 + */ + @ExcelProperty(value = "是否脱管", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer detachedFlag; + + /** + * 脱管原因 + */ + @ExcelProperty(value = "脱管原因") + private String detachedReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java new file mode 100644 index 0000000000..067cd35987 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailJzhzExcelData.java @@ -0,0 +1,84 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdJzhzConverter; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 灵山-特殊人群-精障患者 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailJzhzExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + private static final long serialVersionUID = 1L; + + /** + * 有无肇事肇祸史 + */ + @ExcelProperty(value = "*有无肇事肇祸史", converter = LingShanSpecialCrowdIsOrNotConverter.class) + @NotNull(message = "有无肇事肇祸史不能为空") + private Integer causeTroubleHistoryFlag; + + /** + * 肇事肇祸次数 + */ + @ExcelProperty(value = "*肇事肇祸次数") + @NotNull(message = "肇事肇祸次数不能为空") + private Integer causeTroubleTimes; + + /** + * 目前诊断类型。1精神分裂症,2分裂情感性障碍,3持久的妄想性障碍(偏执性精神病),4双相(情感)障碍,5癫痫所致精神障碍,6精神发育迟滞伴发精神障碍,7重度抑郁发作,8精神活性物质所致精神障碍,9其他 + */ + @ExcelProperty(value = "目前诊断类型", converter = LingShanSpecialCrowdJzhzConverter.class) + private Integer currentDiagnosis; + + /** + * 危险性评估等级。0,1,2,3,4,5 + */ + @ExcelProperty(value = "危险性评估等级", converter = LingShanSpecialCrowdJzhzConverter.class) + private Integer dangerousClass; + + /** + * 是否具备外出能力 + */ + @ExcelProperty(value = "是否具备外出能力", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canGoOutFlag; + + /** + * 是否有暴力倾向 + */ + @ExcelProperty(value = "是否有暴力倾向", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer violenceFlag; + + /** + * 是否落实监管补助 + */ + @ExcelProperty(value = "是否落实监管补助", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer allowanceFlag; + + /** + * 是否纳入低保 + */ + @ExcelProperty(value = "是否纳入低保", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer subsistenceFlag; + + /** + * 监护人姓名 + */ + @ExcelProperty(value = "监护人姓名") + private String guardianName; + + /** + * 监护人联系方式 + */ + @ExcelProperty(value = "监护人联系方式") + private String guardianContact; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java new file mode 100644 index 0000000000..950ce47381 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailSqjzExcelData.java @@ -0,0 +1,92 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import com.epmet.excel.converter.LingShanSpecialCrowdSqjzConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 灵山-特殊人群-社区矫正 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailSqjzExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + + /** + * 矫正类型。1.管制,2缓刑,3假释,4暂予监外执行,5剥夺政治权利 + */ + @ExcelProperty(value = "*矫正类型", converter = LingShanSpecialCrowdSqjzConverter.class) + @NotNull(message = "矫正类型不能为空") + private Integer rectificateType; + + /** + * 矫正开始日期 + */ + @ExcelProperty(value = "矫正开始日期") + private Date rectificateStartDate; + + /** + * 矫正结束日期 + */ + @ExcelProperty(value = "矫正结束日期") + private Date rectificateEndDate; + + /** + * 原羁押场所 + */ + @ExcelProperty(value = "原羁押场所") + private String originDetainAddress; + + /** + * 原罪名 + */ + @ExcelProperty(value = "原罪名") + private String originalCharge; + + /** + * 接受方式。1.自行报到,2狱所押送,3当庭交接,4其他 + */ + @ExcelProperty(value = "接受方式", converter = LingShanSpecialCrowdSqjzConverter.class) + private Integer receiveWay; + + /** + * 矫正情况说明 + */ + @ExcelProperty(value = "矫正情况说明") + private String rectificateInfo; + + /** + * 是否脱管 + */ + @ExcelProperty(value = "是否脱管", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer detachedFlag; + + /** + * 脱管原因 + */ + @ExcelProperty(value = "脱管原因") + private String detachedReason; + + /** + * 是否注销 + */ + @ExcelProperty(value = "是否注销" , converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer canceledFlag; + + /** + * 注销原因 + */ + @ExcelProperty(value = "注销原因") + private String canceledReason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java new file mode 100644 index 0000000000..f7a865a3ba --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/LingshanSpecialCrowdDetailXfryExcelData.java @@ -0,0 +1,77 @@ +package com.epmet.excel.data; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.excel.converter.LingShanSpecialCrowdIsOrNotConverter; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotBlank; + +/** + * 灵山-特殊人群-信访人员 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-04-18 + */ +@Data +public class LingshanSpecialCrowdDetailXfryExcelData extends LingShanSpecialCrowdDetailBaseExcelData { + + /** + * 反映问题 + */ + @ExcelProperty(value = "*反映问题") + @NotBlank(message = "反映问题不能为空") + private String problem; + + /** + * 稳控措施 + */ + @ExcelProperty(value = "*稳控措施") + @NotBlank(message = "稳控措施不能为空") + private String stableControlMeasurement; + + /** + * 是否多次上访 + */ + @ExcelProperty(value = "是否多次上访", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer multipleFlag; + + /** + * 是否在当地 + */ + @ExcelProperty(value = "是否在当地", converter = LingShanSpecialCrowdIsOrNotConverter.class) + private Integer localFlag; + + /** + * 分管领导 + */ + @ExcelProperty(value = "分管领导") + private String branchLeader; + + /** + * 分管领导联系方式 + */ + @ExcelProperty(value = "分管领导联系方式") + private String branchLeaderContact; + + /** + * 负责人 + */ + @ExcelProperty(value = "负责人") + private String principal; + + /** + * 负责人联系方式 + */ + @ExcelProperty(value = "负责人联系方式") + private String principalContact; + + /** + * 稳控人员名单 + */ + @ExcelProperty(value = "稳控人员名单") + private String stableControlerList; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java new file mode 100644 index 0000000000..72bea84f54 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java @@ -0,0 +1,401 @@ +package com.epmet.excel.handler; + +import cn.hutool.log.Log; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.read.listener.ReadListener; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.common.token.util.TokenUtil; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.LingshanSpecialCrowdDetailBaseEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonEntity; +import com.epmet.entity.LingshanSpecialCrowdPersonTypeEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; +import com.epmet.exceptions.ReadExcelHeaderOnlyException; +import com.epmet.service.LingShanSpecialCrowdService; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 灵山大屏-抽象的导入excel监听器 + */ +@Data +@Slf4j +public abstract class AbstractLingShanSpecialCrowdExcelImportListener + extends AnalysisEventListener { + + /** + * @description: 分布式锁 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:43 PM + */ + private DistributedLock distributedLock; + + /** + * 按批次保存,单次最大数据量 + */ + private static final Integer MAX_BATCH_SIZE = 500; + + private String templateFileName; + + /** + * 表头应有行数 + */ + private Integer maxHeadRowNum; + + /** + * 文件的表头中应当有哪些列 + */ + private List headerZhList; + + /** + * @description: 是否只校验表头 + * @param null: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 5:16 PM + */ + private Boolean validateHeaderOnly = false; + + /** + * 当前表头读到了第几行 + */ + private Integer currentHeadRowNum = 0; + + /** + * 原始数据列表 + */ + private List originDatas = new ArrayList<>(); + + /** + * 错误数据列表 + */ + private List errorDatas = new ArrayList<>(); + + /** + * 正确数据 + */ + private List correctDatas = new ArrayList<>(); + + private List persons = new ArrayList<>(); + private List personTypes = new ArrayList<>(); + + protected LingShanSpecialCrowdService lingShanSpecialCrowdService; + + private Class entityClass; + + private CustomerStaffInfoCacheResult currentStaffInfo; + + private LingShanSpecialCrowdTypeEnums specialCrowdType; + + public AbstractLingShanSpecialCrowdExcelImportListener() { + lingShanSpecialCrowdService = SpringContextUtils.getBean(LingShanSpecialCrowdService.class); + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + currentStaffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + maxHeadRowNum = setMaxHeadRowNum(); + headerZhList = setHeaderZhList(); + specialCrowdType = getSpecialCrowdType(); + entityClass = getEntityClass(); + } + + /** + * @param headMap: + * @param context: + * @return + * @description: 表头回调函数,此处做统一表头校验,确认文件内容与当前要导入的数据的字段一致,防止导错类型. + * @author: WangXianZhang + * @date: 2023/4/18 10:42 AM + */ + @Override + public void invokeHeadMap(Map headMap, AnalysisContext context) { + // super.invokeHeadMap(headMap, context); + + if (maxHeadRowNum == null || CollectionUtils.isEmpty(headerZhList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道】社会维稳数据导入-子类未设置header行数以及header字段列表。"); + } + + if ((++currentHeadRowNum).equals(maxHeadRowNum)) { + // 如果是表头最后一行,则校验表头 + List redundentHeaders = new ArrayList<>(); + List lackHeaders = new ArrayList<>(); + + Collection headersFromFile = headMap.values(); + // 2次循环,双向校验 + for (String headerZh : headersFromFile) { + if (StringUtils.isNotBlank(headerZh) && !headerZhList.contains(headerZh)) { + redundentHeaders.add(headerZh); + } + } + + for (String headerZh : headerZhList) { + if (StringUtils.isNotBlank(headerZh) && !headersFromFile.contains(headerZh)) { + lackHeaders.add(headerZh); + } + } + + // 汇总错误字段,成一句话 + String preValidTipStr = ""; + if (CollectionUtils.isNotEmpty(redundentHeaders)) { + preValidTipStr += "多余【" + String.join(",", redundentHeaders) + "】字段。"; + } + + if (CollectionUtils.isNotEmpty(lackHeaders)) { + preValidTipStr += "缺少【" + String.join(",", lackHeaders) + "】必填字段。"; + } + + if (StringUtils.isNotBlank(preValidTipStr)) { + log.error("【灵山街道-社会维稳导入】表格表头不对应," + preValidTipStr); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "上传文件有误!" + preValidTipStr + "请确认表格格式正确"); + } + } + } + + /** + * @description: 行读取回调函数 + * @param row: + * @param context: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:44 PM + */ + @Override + public void invoke(T row, AnalysisContext context) { + if (validateHeaderOnly) { + // 如果仅解析表头,那么抛出异常,外层接住 + throw new ReadExcelHeaderOnlyException(); + } + try { + ValidatorUtils.validateEntity(row); + } catch (ValidateException e) { + // 加入到错误记录中去 + errorDatas.add(row); + return; + } + + originDatas.add(row); + + if (originDatas.size() >= MAX_BATCH_SIZE) { + // 满足了一批次的数量,执行保存 + saveBatchWithLock(); + clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + if (validateHeaderOnly) { + throw new ReadExcelHeaderOnlyException(); + } + + if (originDatas.size() > 0) { + saveBatchWithLock(); + clear(); + } + } + + /** + * @param : + * @return + * @description: 批量保存,带锁的。因为要在Listener中过滤出哪些数据不能导入,返回给前端。 + * 所以需要再lisener中做批量检查,然后批量保存。过程需要一点时间,为了防止并发问题,加分布式锁。以agencyId为粒度。 + * @author: WangXianZhang + * @date: 2023/4/18 4:33 PM + */ + private void saveBatchWithLock() { + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, EpmetRequestHolder.getLoginUserId()); + RLock lock = distributedLock.getLock(String.format("{}:{}:{}", "lock:specialcrowd", customerId, staffInfo.getAgencyId())); + try { + this.saveBatch(); + } catch (Exception e) { + throw e; + } finally { + if (lock != null && lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } + } + + /** + * @param : + * @return + * @description: 批量保存 + * @author: WangXianZhang + * @date: 2023/4/18 3:42 PM + */ + protected void saveBatch() { + String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getFromOrgId(), currentStaffInfo.getAgencyPIds()); + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + Date now = new Date(); + Iterator it = getOriginDatas().iterator(); + for (; it.hasNext(); ) { + T row = it.next(); + String errorInfo = lingShanSpecialCrowdService.validate(row); + if (StringUtils.isNotBlank(errorInfo)) { + row.setErrorInfo(errorInfo); + errorDatas.add(row); + it.remove(); + } else { + persons.add(new LingshanSpecialCrowdPersonEntity(IdWorker.getIdStr(), customerId, orgIdPath, row.getName(), row.getIdCard(), + "0", 0, now, currentStaffInfo.getStaffId(), now, currentStaffInfo.getStaffId())); + personTypes.add(new LingshanSpecialCrowdPersonTypeEntity(IdWorker.getIdStr(), customerId, orgIdPath, row.getIdCard(), specialCrowdType.getType(), + "0", 0, now, currentStaffInfo.getStaffId(), now, currentStaffInfo.getStaffId())); + + E e = ConvertUtils.sourceToTarget(row, entityClass); + e.setCustomerId(customerId); + e.setOrgIdPath(orgIdPath); + e.setId(IdWorker.getIdStr()); + e.setRevision(0); + e.setCreatedTime(now); + e.setUpdatedTime(now); + e.setCreatedBy(currentStaffInfo.getStaffId()); + e.setUpdatedBy(currentStaffInfo.getStaffId()); + e.setDelFlag("0"); + correctDatas.add(e); + } + } + + // 执行保存 + if(!CollectionUtils.isEmpty(persons) && !CollectionUtils.isEmpty(personTypes)) { + savePersonAndTypes(persons, personTypes); + } + + // 将错误的数据处理 todo + + // 保存人群详情数据 + saveBatchCallback(correctDatas); + } + + /** + * @description: 保存人员信息,人员类型 + * @param persons: + * @param personTypes: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 11:06 AM + */ + private void savePersonAndTypes(List persons, List personTypes) { + lingShanSpecialCrowdService.savePersonAndTypes(persons, personTypes); + } + + /** + * @param : + * @return + * @description: 清理数据 + * @author: WangXianZhang + * @date: 2023/4/18 4:41 PM + */ + protected void clear() { + originDatas.clear(); + errorDatas.clear(); + } + + /** + * @description: 获取读取到的原始数据 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:21 PM + */ + protected List getOriginDatas() { + return originDatas; + } + + /** + * @description: 获取错误数据行 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + public List getErrorDatas() { + return errorDatas; + } + + /** + * @description: 获取正确数据行 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + protected List getCorrectDatas() { + return correctDatas; + } + + /** + * @param : + * @return + * @description: 批量保存,子类实现 + * @author: WangXianZhang + * @date: 2023/4/18 4:32 PM + */ + abstract void saveBatchCallback(List entities); + + /** + * @description: 设置表头行数 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:22 PM + */ + abstract Integer setMaxHeadRowNum(); + + /** + * @description: 设置header字段列表。子类应当调用该方法设置该值 + * @return + * @author: WangXianZhang + * @date: 2023/4/18 11:21 PM + */ + abstract List setHeaderZhList(); + + /** + * @description: 设置模板名称 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/20 9:07 AM + */ + abstract String setTemplateFileName(); + + /** + * @description: 获取entity的class,用于数据拷贝 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/19 9:47 AM + */ + abstract Class getEntityClass(); + + /** + * @description: 指定特殊人群类型 + * @param : + * @return + * @author: WangXianZhang + * @date: 2023/4/19 11:00 AM + */ + abstract LingShanSpecialCrowdTypeEnums getSpecialCrowdType(); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java new file mode 100644 index 0000000000..117d5c833b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdAzbjExcelImportListener.java @@ -0,0 +1,54 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingShanSpecialCrowdDetailAzbjExcelData; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; + +import java.io.File; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +/** + * 灵山-安置帮教导入 + */ +public class LingShanSpecialCrowdAzbjExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*原罪名", "*释放日期", "原判刑期(单位:月)", "是否累犯", "是否安置", "安置日期", "安置帮教情况", "是否注销", "注销原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailAzbjEntity.class; + } + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailAzbjEntity()); + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.AZBJ; + } + + @Override + String setTemplateFileName() { + return "lingshan/lingshan_special_crowd_azbj_export.xlsx"; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java new file mode 100644 index 0000000000..6ab49e11a7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJieduExcelImportListener.java @@ -0,0 +1,50 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailAzbjEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailJdryExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-戒毒导入 + */ +public class LingShanSpecialCrowdJieduExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*有无犯罪史", "*有无复吸史", "初次发现日期", "管控人姓名", "管控人联系方式", "帮扶人姓名", "帮扶人联系方式", "是否脱管", "脱管原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailJdryEntity.class; + } + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJdryEntity()); + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.JDRY; + } + + @Override + String setTemplateFileName() { + return "lingshan/lingshan_special_crowd_jdry_export.xlsx"; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java new file mode 100644 index 0000000000..236811340a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdJingZhangExcelImportListener.java @@ -0,0 +1,51 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailJdryEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailJzhzExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-精神障碍患者导入 + */ +public class LingShanSpecialCrowdJingZhangExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJzhzEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*有无肇事肇祸史", "*肇事肇祸次数", "目前诊断类型", "危险性评估等级", "是否具备外出能力", "是否有暴力倾向", "是否落实监管补助", "是否纳入低保", "监护人姓名", "监护人联系方式"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailJzhzEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.JZHZ; + } + + @Override + String setTemplateFileName() { + return "lingshan/lingshan_special_crowd_jzhz_export.xlsx"; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java new file mode 100644 index 0000000000..2d25a7652b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdSqjzExcelImportListener.java @@ -0,0 +1,50 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.dao.LingshanSpecialCrowdDetailSqjzDao; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailSqjzEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailSqjzExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; + +/** + * 灵山-矫正人员导入 + */ +public class LingShanSpecialCrowdSqjzExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailSqjzEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*矫正类型", "矫正开始日期", "矫正结束日期", "原羁押场所", "原罪名", "接受方式", "矫正情况说明", "是否脱管", "脱管原因", "是否注销", "注销原因"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailSqjzEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.SQJZ; + } + + @Override + String setTemplateFileName() { + return "lingshan/lingshan_special_crowd_sqjz_export.xlsx"; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java new file mode 100644 index 0000000000..ac1557245e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanSpecialCrowdXinFangExcelImportListener.java @@ -0,0 +1,51 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.context.AnalysisContext; +import com.epmet.entity.LingshanSpecialCrowdDetailJzhzEntity; +import com.epmet.entity.LingshanSpecialCrowdDetailXfryEntity; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.LingshanSpecialCrowdDetailXfryExcelData; + +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 灵山-信访人员导入 + */ +public class LingShanSpecialCrowdXinFangExcelImportListener + extends AbstractLingShanSpecialCrowdExcelImportListener { + + + @Override + void saveBatchCallback(List entities) { + lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailXfryEntity()); + } + + @Override + Integer setMaxHeadRowNum() { + return 1; + } + + @Override + List setHeaderZhList() { + return Arrays.asList("*姓名", "*身份证号", "*反映问题", "*稳控措施", "是否多次上访", "是否在当地", "分管领导", "分管领导联系方式", "负责人", "负责人联系方式", "稳控人员名单"); + } + + @Override + Class getEntityClass() { + return LingshanSpecialCrowdDetailXfryEntity.class; + } + + @Override + LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { + return LingShanSpecialCrowdTypeEnums.XFRY; + } + + @Override + String setTemplateFileName() { + return "lingshan/lingshan_special_crowd_xfry_export.xlsx"; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/exceptions/ReadExcelHeaderOnlyException.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/exceptions/ReadExcelHeaderOnlyException.java new file mode 100644 index 0000000000..4efda39455 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/exceptions/ReadExcelHeaderOnlyException.java @@ -0,0 +1,7 @@ +package com.epmet.exceptions; + +/** + * 只解析表头的异常(用于停止excel导入) + */ +public class ReadExcelHeaderOnlyException extends RuntimeException { +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java new file mode 100644 index 0000000000..5ad0abd666 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanSpecialCrowdService.java @@ -0,0 +1,47 @@ +package com.epmet.service; + +import com.epmet.entity.*; +import com.epmet.excel.data.LingShanSpecialCrowdDetailAzbjExcelData; +import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; + +/** + * 灵山特殊人群service + */ +public interface LingShanSpecialCrowdService { + + /** + * @description: 导入特殊人群 + * @param crowdCategory: + * @param fileSavePath: + * @return + * @author: WangXianZhang + * @date: 2023/4/18 5:42 PM + */ + void importSpecialCrowd(String crowdCategory, String fileSavePath, String originFilename); + + /** + * @description: 数据校验 + * @param row: + * @returns + * @author: WangXianZhang + * @date: 2023/4/18 4:49 PM + */ + String validate(LingShanSpecialCrowdDetailBaseExcelData row); + + void savePersonAndTypes(List persons, List personTypes); + + /** + * @description: 安置帮教-导入 + * @return + * @author: WangXianZhang + * @date: 2023/4/18 4:11 PM + */ + void saveBatch(List entities, LingshanSpecialCrowdDetailAzbjEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailJdryEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailJzhzEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailSqjzEntity e); + void saveBatch(List entities, LingshanSpecialCrowdDetailXfryEntity e); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java new file mode 100644 index 0000000000..d9ba64e551 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java @@ -0,0 +1,281 @@ +package com.epmet.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.converters.ReadConverterContext; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.alibaba.excel.write.builder.ExcelWriterBuilder; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.BizTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.FileUtils; +import com.epmet.constants.ImportTaskConstants; +import com.epmet.dao.*; +import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.entity.*; +import com.epmet.enums.LingShanSpecialCrowdTypeEnums; +import com.epmet.excel.data.*; +import com.epmet.excel.handler.*; +import com.epmet.exceptions.ReadExcelHeaderOnlyException; +import com.epmet.feign.OssFeignClient; +import com.epmet.service.LingShanSpecialCrowdService; +import com.epmet.utils.ImportTaskUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.http.entity.ContentType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Date; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; + +/** + * 灵山特殊人群service + */ +@Slf4j +@Service +public class LingShanSpecialCrowdServiceImpl implements LingShanSpecialCrowdService, ResultDataResolver { + + @Autowired + private LingshanSpecialCrowdPersonDao specialCrowdPersonDao; + + @Autowired + private LingshanSpecialCrowdPersonTypeDao specialCrowdPersonTypeDao; + + @Autowired + private LingshanSpecialCrowdDetailAzbjDao specialCrowdDetailAzbjDao; + + @Autowired + private LingshanSpecialCrowdDetailSqjzDao specialCrowdDetailSqjzDao; + + @Autowired + private LingshanSpecialCrowdDetailJdryDao specialCrowdDetailJdryDao; + + @Autowired + private LingshanSpecialCrowdDetailJzhzDao specialCrowdDetailJzhzDao; + + @Autowired + private LingshanSpecialCrowdDetailXfryDao specialCrowdDetailXfryDao; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Autowired + private ExecutorService executorService; + + @Autowired + private OssFeignClient ossFeignClient; + + @Override + public void importSpecialCrowd(String crowdCategory, String fileSavePath, String originFilename) { + Class excelDataClass; + AbstractLingShanSpecialCrowdExcelImportListener listener; + LingShanSpecialCrowdTypeEnums specialCrowdTypeEnum; + + if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdAzbjExcelImportListener(); + excelDataClass = LingShanSpecialCrowdDetailAzbjExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.AZBJ; + } else if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdSqjzExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailSqjzExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.SQJZ; + } else if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdJieduExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailJdryExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.JDRY; + } else if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdJingZhangExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailJzhzExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.JZHZ; + } else if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(crowdCategory)) { + listener = new LingShanSpecialCrowdXinFangExcelImportListener(); + excelDataClass = LingshanSpecialCrowdDetailXfryExcelData.class; + specialCrowdTypeEnum = LingShanSpecialCrowdTypeEnums.XFRY; + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-维稳】导入。不支持的人群类别:" + crowdCategory); + } + + // Execute reading + // ReadSheet sheet = EasyExcel.readSheet(0).registerReadListener(listener).build(); + // EasyExcel.read(fileSavePath).build().read(sheet); + + // 解析表头,判断表头是否合格 + try { + listener.setValidateHeaderOnly(true); + EasyExcel.read(fileSavePath, excelDataClass, listener) + .headRowNumber(specialCrowdTypeEnum.getHeaderRowNumber()) + .sheet(0) + .doRead(); + } catch (ReadExcelHeaderOnlyException e) { + log.info("【灵山街道-导入社会维稳】验证通过,可以继续导入"); + } + + // 正式开始导入。异步导入 + listener.setValidateHeaderOnly(false); + + CompletableFuture.runAsync(() -> { + // 创建导入任务 + ImportTaskCommonResultDTO importTaskRst = getResultDataOrThrowsException(ImportTaskUtils.createImportTask(originFilename, + BizTypeEnum.SPECIAL_CROWD.getType()), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + null, "【灵山街道-导入特殊人群】创建导入任务失败"); + + try { + EasyExcel.read(fileSavePath, excelDataClass, listener) + .headRowNumber(specialCrowdTypeEnum.getHeaderRowNumber()) + .sheet(0) + .doRead(); + + List errorDatas = listener.getErrorDatas(); + if (CollectionUtils.isNotEmpty(errorDatas)) { + // 有错误数据需要提示 + String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName()); + ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(), + ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDescFilePath, "失败,请导出文件查看详细信息"); + } else { + // 全部成功 + ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(), + ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功"); + } + } catch (Exception e) { + log.error("【灵山街道-导入特殊人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); + ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(), + ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误"); + } + }, executorService); + } + + /** + * @description: 上传错误描述文件 + * @param errorDatas: + * @return + * @author: WangXianZhang + * @date: 2023/4/19 10:19 PM + */ + private String uploadResultDescFilePath(List errorDatas, String templateFileName) { + FileItem fileItem = null; + try { + String fileName = + DateUtils.format(new Date(), "yyyyMMdd_HHmmss_") + System.nanoTime() + "社会维稳导入失败数据.xlsx"; + + // 创建临时文件 + fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, FileUtils.getAndCreateDirUnderEpmetFilesDir("temp").toFile()) + .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); + + // 写入临时文件 + try (OutputStream os = fileItem.getOutputStream()) { + ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateFileName).build(); + excelWriter.finish(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + // 上传文件 + UploadImgResultDTO uploadRst = getResultDataOrThrowsException(ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)), ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + null, "【灵山街道-导入特殊人群】上传错误描述文件失败。"); + + return uploadRst.getUrl(); + + } catch (IOException e) { + throw new RuntimeException("【灵山街道-导入特殊人群】生成错误描述文件-创建临时目录失败"); + } finally { + try { + fileItem.delete(); + } catch (Exception e) { + log.error("【灵山街道-导入特殊人群】删除fileItem临时文件失败"); + } + } + } + + @Override + public String validate(LingShanSpecialCrowdDetailBaseExcelData row) { + String idCard = row.getIdCard(); + String name = row.getName(); + + IcResiUserEntity resiEntity = icResiUserDao.selectResiUserEntityByIdCard(idCard, EpmetRequestHolder.getLoginUserCustomerId()); + if (resiEntity == null) { + // 居民不存在,报错 + return "居民信息不存在,请先维护居民基础信息。"; + } + if (!resiEntity.getName().equals(name)) { + return String.format("姓名信息与居民基础信息不一致。(在居民哭华总根据身份证号找到的居民姓名为:{})", name); + } + + return null; + } + + @Override + public void savePersonAndTypes(List persons, List personTypes) { + List> personParts = ListUtils.partition(persons, 50); + List> personTypeParts = ListUtils.partition(personTypes, 50); + + for (List p : personParts) { + specialCrowdPersonDao.saveOrUpdateManually(p); + } + for (List p : personTypeParts) { + specialCrowdPersonTypeDao.saveOrUpdateManually(p); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailAzbjEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailAzbjDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailJdryEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailJdryDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailJzhzEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailJzhzDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailSqjzEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailSqjzDao.saveBatchManually(l); + } + } + + @Override + public void saveBatch(List entities, LingshanSpecialCrowdDetailXfryEntity e) { + List> partition = ListUtils.partition(entities, 50); + for (List l : partition) { + specialCrowdDetailXfryDao.saveBatchManually(l); + } + } +} diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_azbj_export.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_azbj_export.xlsx new file mode 100644 index 0000000000..5fc410a64e Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_azbj_export.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jdry_export.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jdry_export.xlsx new file mode 100644 index 0000000000..2ab2738250 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jdry_export.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jzhz_export.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jzhz_export.xlsx new file mode 100644 index 0000000000..d055b68eb1 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_jzhz_export.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_sqjz_export.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_sqjz_export.xlsx new file mode 100644 index 0000000000..47927aa2a0 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_sqjz_export.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_xfry_export.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_xfry_export.xlsx new file mode 100644 index 0000000000..9eb90e825b Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/lingshan_special_crowd_xfry_export.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml new file mode 100644 index 0000000000..60a3bb3c17 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailAzbjDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_azbj ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, ORIGINAL_CHARGE, RELEASE_DATE + , ORIGIN_PRISON_TERM, RECIDIVISM_FLAG, EMPLACEMENT_FLAG, EMPLACEMENT_DATE + , EMPLACEMENT_INFO, CANCELED_FLAG, CANCELED_REASON, DEL_FLAG, REVISION + , CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( #{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.originalCharge}, + #{item.releaseDate},#{item.originPrisonTerm},#{item.recidivismFlag},#{item.emplacementFlag}, + #{item.emplacementDate}, #{item.emplacementInfo}, #{item.canceledFlag}, #{item.canceledReason}, #{item.delFlag}, + #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime} + ) + + on duplicate key update ORG_ID_PATH = values(ORG_ID_PATH) + , ID_CARD = values(ID_CARD) + , ORIGINAL_CHARGE = values(ORIGINAL_CHARGE) + , RELEASE_DATE = values(RELEASE_DATE) + , ORIGIN_PRISON_TERM = values(ORIGIN_PRISON_TERM) + , RECIDIVISM_FLAG = values(RECIDIVISM_FLAG) + , EMPLACEMENT_FLAG = values(EMPLACEMENT_FLAG) + , EMPLACEMENT_DATE = values(EMPLACEMENT_DATE) + , EMPLACEMENT_INFO = values(EMPLACEMENT_INFO) + , CANCELED_FLAG = values(CANCELED_FLAG) + , CANCELED_REASON = values(CANCELED_REASON) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml new file mode 100644 index 0000000000..efdc2079e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJdryDao.xml @@ -0,0 +1,36 @@ + + + + + + insert into lingshan_special_crowd_detail_jdry ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, CRIMINAL_HISTORY_FLAG + , DRUG_REPETITION_FLAG, FIRST_DISCOVERY_DATE, CONTROLLER_NAME + , CONTROLLER_CONTACT, HELPER_NAME, HELPER_CONTACT, DETACHED_FLAG + , DETACHED_REASON, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME + , UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.criminalHistoryFlag}, + #{item.drugRepetitionFlag}, #{item.firstDiscoveryDate}, #{item.controllerName}, #{item.controllerContact}, #{item.helperName}, + #{item.helperContact}, #{item.detachedFlag}, #{item.detachedReason}, #{item.delFlag}, #{item.revision}, + #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values(ORG_ID_PATH), + CRIMINAL_HISTORY_FLAG = values(CRIMINAL_HISTORY_FLAG), + DRUG_REPETITION_FLAG = values(DRUG_REPETITION_FLAG), + FIRST_DISCOVERY_DATE = values(FIRST_DISCOVERY_DATE), + CONTROLLER_NAME = values(CONTROLLER_NAME), + CONTROLLER_CONTACT = values(CONTROLLER_CONTACT), + HELPER_NAME = values(HELPER_NAME), + HELPER_CONTACT = values(HELPER_CONTACT), + DETACHED_FLAG = values(DETACHED_FLAG), + DETACHED_REASON = values(DETACHED_REASON), + DEL_FLAG = values(DEL_FLAG), + REVISION = values(REVISION), + UPDATED_BY = values(UPDATED_BY), + UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml new file mode 100644 index 0000000000..e750b74a6c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailJzhzDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_jzhz ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, CAUSE_TROUBLE_HISTORY_FLAG + , CAUSE_TROUBLE_TIMES, CURRENT_DIAGNOSIS, DANGEROUS_CLASS + , CAN_GO_OUT_FLAG, VIOLENCE_FLAG, ALLOWANCE_FLAG, SUBSISTENCE_FLAG + , GUARDIAN_NAME, GUARDIAN_CONTACT, DEL_FLAG, REVISION, CREATED_BY + , CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.causeTroubleHistoryFlag}, + #{item.causeTroubleTimes}, #{item.currentDiagnosis}, #{item.dangerousClass}, #{item.canGoOutFlag}, #{item.violenceFlag}, + #{item.allowanceFlag}, #{item.subsistenceFlag}, #{item.guardianName}, #{item.guardianContact}, #{item.delFlag}, + #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime} + ) + + on duplicate key update ORG_ID_PATH = values(ORG_ID_PATH) + , ID_CARD = values(ID_CARD) + , CAUSE_TROUBLE_HISTORY_FLAG = values(CAUSE_TROUBLE_HISTORY_FLAG) + , CAUSE_TROUBLE_TIMES = values(CAUSE_TROUBLE_TIMES) + , CURRENT_DIAGNOSIS = values(CURRENT_DIAGNOSIS) + , DANGEROUS_CLASS = values(DANGEROUS_CLASS) + , CAN_GO_OUT_FLAG = values(CAN_GO_OUT_FLAG) + , VIOLENCE_FLAG = values(VIOLENCE_FLAG) + , ALLOWANCE_FLAG = values(ALLOWANCE_FLAG) + , SUBSISTENCE_FLAG = values(SUBSISTENCE_FLAG) + , GUARDIAN_NAME = values(GUARDIAN_NAME) + , GUARDIAN_CONTACT = values(GUARDIAN_CONTACT) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml new file mode 100644 index 0000000000..fd26ee7938 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailSqjzDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_sqjz ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, RECTIFICATE_TYPE + , RECTIFICATE_START_DATE, RECTIFICATE_END_DATE, ORIGIN_DETAIN_ADDRESS + , ORIGINAL_CHARGE, RECEIVE_WAY, RECTIFICATE_INFO, DETACHED_FLAG + , DETACHED_REASON, CANCELED_FLAG, CANCELED_REASON, DEL_FLAG, REVISION + , CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.rectificateType}, + #{item.rectificateStartDate}, #{item.rectificateEndDate}, #{item.originDetainAddress}, #{item.originalCharge}, #{item.receiveWay}, + #{item.rectificateInfo}, #{item.detachedFlag}, #{item.detachedReason}, #{item.canceledFlag}, #{item.canceledReason}, + #{item.delFlag}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, + #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values(ORG_ID_PATH) + , RECTIFICATE_TYPE = values(RECTIFICATE_TYPE) + , RECTIFICATE_START_DATE = values(RECTIFICATE_START_DATE) + , RECTIFICATE_END_DATE = values(RECTIFICATE_END_DATE) + , ORIGIN_DETAIN_ADDRESS = values(ORIGIN_DETAIN_ADDRESS) + , ORIGINAL_CHARGE = values(ORIGINAL_CHARGE), RECEIVE_WAY = values(RECEIVE_WAY) + , RECTIFICATE_INFO = values(RECTIFICATE_INFO), DETACHED_FLAG = values(DETACHED_FLAG) + , DETACHED_REASON = values(DETACHED_REASON), CANCELED_FLAG = values(CANCELED_FLAG) + , CANCELED_REASON = values(CANCELED_REASON) + , UPDATED_BY = values(UPDATED_BY), + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml new file mode 100644 index 0000000000..8258af9767 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdDetailXfryDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_detail_xfry ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, PROBLEM + , STABLE_CONTROL_MEASUREMENT, MULTIPLE_FLAG, LOCAL_FLAG, BRANCH_LEADER + , BRANCH_LEADER_CONTACT, PRINCIPAL, PRINCIPAL_CONTACT + , STABLE_CONTROLER_LIST, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME + , UPDATED_BY, UPDATED_TIME) + values + + (#{item.id}, #{item.customerId}, #{item.orgIdPath}, #{item.idCard}, #{item.problem}, + #{item.stableControlMeasurement}, #{item.multipleFlag}, #{item.localFlag}, #{item.branchLeader}, #{item.branchLeaderContact}, + #{item.principal}, #{item.principalContact}, #{item.stableControlerList}, #{item.delFlag}, #{item.revision}, + #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}) + + on duplicate key update + ORG_ID_PATH = values (ORG_ID_PATH) + , PROBLEM = values(PROBLEM) + , STABLE_CONTROL_MEASUREMENT = values(STABLE_CONTROL_MEASUREMENT) + , MULTIPLE_FLAG = values(MULTIPLE_FLAG) + , LOCAL_FLAG = values(LOCAL_FLAG) + , BRANCH_LEADER = values(BRANCH_LEADER) + , BRANCH_LEADER_CONTACT = values(BRANCH_LEADER_CONTACT) + , PRINCIPAL = values(PRINCIPAL) + , PRINCIPAL_CONTACT = values(PRINCIPAL_CONTACT) + , STABLE_CONTROLER_LIST = values(STABLE_CONTROLER_LIST) + , DEL_FLAG = values(DEL_FLAG) + , REVISION = values(REVISION) + , UPDATED_BY = values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml new file mode 100644 index 0000000000..bdf6bfb32b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + insert into lingshan_special_crowd_person ( ID, CUSTOMER_ID, ORG_ID_PATH, `NAME`, ID_CARD, + DEL_FLAG, REVISION, CREATED_BY , CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( #{item.id}, + #{item.customerId}, + #{item.orgIdPath}, + #{item.name}, + #{item.idCard}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + #{item.createdTime}, + #{item.updatedBy}, + #{item.updatedTime} + ) + + on duplicate key update NAME=values(name) + , UPDATED_BY=values(UPDATED_BY) + , UPDATED_TIME=values(UPDATED_TIME) + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml new file mode 100644 index 0000000000..1fc8a8b92b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/LingshanSpecialCrowdPersonTypeDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + insert into lingshan_special_crowd_person_type ( ID, CUSTOMER_ID, ORG_ID_PATH, ID_CARD, SPECIAL_TYPE, + DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + (#{type.id}, #{type.customerId}, #{type.orgIdPath}, #{type.idCard}, #{type.specialType}, + #{type.delFlag}, #{type.revision}, #{type.createdBy}, #{type.createdTime}, #{type.updatedBy}, #{type.updatedTime}) + + on duplicate key update + ORG_ID_PATH=values(ORG_ID_PATH) + , SPECIAL_TYPE =values(SPECIAL_TYPE) + , UPDATED_BY =values(UPDATED_BY) + , UPDATED_TIME = values(UPDATED_TIME) + + + + \ No newline at end of file