Browse Source
# Conflicts: # epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ZhzlResiCategoryEnum.javamaster
124 changed files with 6322 additions and 345 deletions
@ -0,0 +1,2 @@ |
|||
alter table import_task add column SUCCESS_ITEMS_QTY int comment '成功条数' after RESULT_DESC; |
|||
alter table import_task add column FAIL_ITEMS_QTY int comment '失败条数' after SUCCESS_ITEMS_QTY; |
|||
Binary file not shown.
@ -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; |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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<PageData<EventResultDTO>> getList(@LoginUser TokenDto tokenDto, @RequestBody EventFormsDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setStaffId(tokenDto.getUserId()); |
|||
return new Result<PageData<EventResultDTO>>().ok(eventService.getList(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @deprecated 根据ID获取事件 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<EventResultDTO> get(@PathVariable("id") String id){ |
|||
EventResultDTO data = eventService.getById(id); |
|||
return new Result<EventResultDTO>().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(); |
|||
} |
|||
|
|||
} |
|||
@ -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<EventEntity> { |
|||
|
|||
List<EventResultDTO> getList(EventFormsDTO formDTO); |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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<EventResultDTO> getList(EventFormsDTO formDTO); |
|||
|
|||
EventResultDTO getById(String id); |
|||
|
|||
void update(EventResultDTO dto); |
|||
|
|||
void delete(String[] ids); |
|||
|
|||
void save(EventAddEditFormDTO dto); |
|||
} |
|||
@ -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<EventEntityDao, EventEntity> implements EventService { |
|||
|
|||
@Autowired |
|||
private LoginUserUtil loginUserUtil; |
|||
|
|||
@Autowired |
|||
private IcEventOperationLogService icEventOperationLogService; |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @deprecated 查询事件列表 |
|||
*/ |
|||
@Override |
|||
public PageData<EventResultDTO> 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<EventResultDTO> list = baseDao.getList(formDTO); |
|||
PageInfo<EventResultDTO> 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<EventEntity> 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<IcEventOperationLogEntity> 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; |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.EventEntityDao"> |
|||
|
|||
<select id="getList" resultType="com.epmet.dto.result.EventResultDTO"> |
|||
select * from event_entity |
|||
<where> |
|||
DEL_FLAG = '0' |
|||
</where> |
|||
order by REPORT_DATE DESC, CREATED_TIME DESC |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,294 @@ |
|||
package com.epmet.dto.form.lingshan; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class LingShanSpecialTypeSaveFormDTO { |
|||
|
|||
private String name; |
|||
private String idCard; |
|||
private String headPhoto; |
|||
private SpecialCrowdDetails specialCrowdDetails; |
|||
|
|||
@Data |
|||
public static class SpecialCrowdDetails { |
|||
private SpecialCrowdAzbj anzhibangjiao ; |
|||
private SpecialCrowdJdry jiedurenyuan ; |
|||
private SpecialCrowdJzhz jingzhanghuanzhe ; |
|||
private SpecialCrowdSqjz shequjiaozheng ; |
|||
private SpecialCrowdXfry xinfangrenyuan ; |
|||
} |
|||
|
|||
/** |
|||
* 安置帮教 |
|||
*/ |
|||
@Data |
|||
public static class SpecialCrowdAzbj { |
|||
@NotBlank(message = "原罪名不能为空") |
|||
private String originalCharge; |
|||
|
|||
/** |
|||
* 释放日期 |
|||
*/ |
|||
@NotNull(message = "释放日期不能为空") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date releaseDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date originPrisonTerm; |
|||
|
|||
/** |
|||
* 是否累犯。0否,1是 |
|||
*/ |
|||
private Integer recidivismFlag; |
|||
|
|||
/** |
|||
* 是否安置。0否,1是 |
|||
*/ |
|||
private Integer emplacementFlag; |
|||
|
|||
/** |
|||
* 安置日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date emplacementDate; |
|||
|
|||
/** |
|||
* 安置帮教情况 |
|||
*/ |
|||
private String emplacementInfo; |
|||
|
|||
/** |
|||
* 是否注销 |
|||
*/ |
|||
private Integer canceledFlag; |
|||
|
|||
/** |
|||
* 注销原因 |
|||
*/ |
|||
private String canceledReason; |
|||
} |
|||
|
|||
/** |
|||
* 戒毒人员 |
|||
*/ |
|||
@Data |
|||
public static class SpecialCrowdJdry { |
|||
/** |
|||
* 有无犯罪史 |
|||
*/ |
|||
@NotNull(message = "有无犯罪史不能为空") |
|||
private Integer criminalHistoryFlag; |
|||
|
|||
/** |
|||
* 有无复吸史 |
|||
*/ |
|||
@NotNull(message = "有无复吸史不能为空") |
|||
private Integer drugRepetitionFlag; |
|||
|
|||
/** |
|||
* 初次发现日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date firstDiscoveryDate; |
|||
|
|||
/** |
|||
* 管控人姓名 |
|||
*/ |
|||
private String controllerName; |
|||
|
|||
/** |
|||
* 管控人联系方式 |
|||
*/ |
|||
private String controllerContact; |
|||
|
|||
/** |
|||
* 帮扶人姓名 |
|||
*/ |
|||
private String helperName; |
|||
|
|||
/** |
|||
* 帮扶人联系方式 |
|||
*/ |
|||
private String helperContact; |
|||
|
|||
/** |
|||
* 是否脱管 |
|||
*/ |
|||
private Integer detachedFlag; |
|||
|
|||
/** |
|||
* 脱管原因 |
|||
*/ |
|||
private String detachedReason; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdJzhz { |
|||
@NotNull(message = "有无肇事肇祸史不能为空") |
|||
private Integer causeTroubleHistoryFlag; |
|||
|
|||
/** |
|||
* 肇事肇祸次数 |
|||
*/ |
|||
@NotNull(message = "肇事肇祸次数不能为空") |
|||
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; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdSqjz { |
|||
@NotNull(message = "矫正类型不能为空") |
|||
private Integer rectificateType; |
|||
|
|||
/** |
|||
* 矫正开始日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date rectificateStartDate; |
|||
|
|||
/** |
|||
* 矫正结束日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
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; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdXfry { |
|||
@NotBlank(message = "反映问题不能为空") |
|||
private String problem; |
|||
|
|||
/** |
|||
* 稳控措施 |
|||
*/ |
|||
@NotBlank(message = "稳控措施不能为空") |
|||
private String stableControlMeasurement; |
|||
|
|||
/** |
|||
* 是否多次上访 |
|||
*/ |
|||
private Integer multipleFlag; |
|||
|
|||
/** |
|||
* 是否在当地 |
|||
*/ |
|||
private Integer localFlag; |
|||
|
|||
/** |
|||
* 分管领导 |
|||
*/ |
|||
private String branchLeader; |
|||
|
|||
/** |
|||
* 分管领导联系方式 |
|||
*/ |
|||
private String branchLeaderContact; |
|||
|
|||
/** |
|||
* 负责人 |
|||
*/ |
|||
private String principal; |
|||
|
|||
/** |
|||
* 负责人联系方式 |
|||
*/ |
|||
private String principalContact; |
|||
|
|||
/** |
|||
* 稳控人员名单 |
|||
*/ |
|||
private String stableControlerList; |
|||
} |
|||
} |
|||
@ -0,0 +1,295 @@ |
|||
package com.epmet.dto.form.lingshan; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class LingShanSpecialTypeSaveResultDTO { |
|||
|
|||
private String gender; |
|||
private String genderZh; |
|||
private String nation; |
|||
private String birthday; |
|||
private String domicilePlace; |
|||
private String name; |
|||
private String mobile; |
|||
private String headPhoto; |
|||
private String address; |
|||
private String idCard; |
|||
private SpecialCrowdDetails specialCrowdDetails = new SpecialCrowdDetails(); |
|||
|
|||
@Data |
|||
public static class SpecialCrowdDetails { |
|||
private SpecialCrowdAzbj anzhibangjiao ; |
|||
private SpecialCrowdJdry jiedurenyuan ; |
|||
private SpecialCrowdJzhz jingzhanghuanzhe ; |
|||
private SpecialCrowdSqjz shequjiaozheng ; |
|||
private SpecialCrowdXfry xinfangrenyuan ; |
|||
} |
|||
|
|||
/** |
|||
* 安置帮教 |
|||
*/ |
|||
@Data |
|||
public static class SpecialCrowdAzbj { |
|||
@NotBlank(message = "原罪名不能为空") |
|||
private String originalCharge; |
|||
|
|||
/** |
|||
* 释放日期 |
|||
*/ |
|||
@NotNull(message = "释放日期不能为空") |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date releaseDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date originPrisonTerm; |
|||
|
|||
/** |
|||
* 是否累犯。0否,1是 |
|||
*/ |
|||
private Integer recidivismFlag; |
|||
|
|||
/** |
|||
* 是否安置。0否,1是 |
|||
*/ |
|||
private Integer emplacementFlag; |
|||
|
|||
/** |
|||
* 安置日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date emplacementDate; |
|||
|
|||
/** |
|||
* 安置帮教情况 |
|||
*/ |
|||
private String emplacementInfo; |
|||
|
|||
/** |
|||
* 是否注销 |
|||
*/ |
|||
private Integer canceledFlag; |
|||
|
|||
/** |
|||
* 注销原因 |
|||
*/ |
|||
private String canceledReason; |
|||
} |
|||
|
|||
/** |
|||
* 戒毒人员 |
|||
*/ |
|||
@Data |
|||
public static class SpecialCrowdJdry { |
|||
/** |
|||
* 有无犯罪史 |
|||
*/ |
|||
@NotNull(message = "有无犯罪史不能为空") |
|||
private Integer criminalHistoryFlag; |
|||
|
|||
/** |
|||
* 有无复吸史 |
|||
*/ |
|||
@NotNull(message = "有无复吸史不能为空") |
|||
private Integer drugRepetitionFlag; |
|||
|
|||
/** |
|||
* 初次发现日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date firstDiscoveryDate; |
|||
|
|||
/** |
|||
* 管控人姓名 |
|||
*/ |
|||
private String controllerName; |
|||
|
|||
/** |
|||
* 管控人联系方式 |
|||
*/ |
|||
private String controllerContact; |
|||
|
|||
/** |
|||
* 帮扶人姓名 |
|||
*/ |
|||
private String helperName; |
|||
|
|||
/** |
|||
* 帮扶人联系方式 |
|||
*/ |
|||
private String helperContact; |
|||
|
|||
/** |
|||
* 是否脱管 |
|||
*/ |
|||
private Integer detachedFlag; |
|||
|
|||
/** |
|||
* 脱管原因 |
|||
*/ |
|||
private String detachedReason; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdJzhz { |
|||
@NotNull(message = "有无肇事肇祸史不能为空") |
|||
private Integer causeTroubleHistoryFlag; |
|||
|
|||
/** |
|||
* 肇事肇祸次数 |
|||
*/ |
|||
@NotNull(message = "肇事肇祸次数不能为空") |
|||
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; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdSqjz { |
|||
@NotNull(message = "矫正类型不能为空") |
|||
private Integer rectificateType; |
|||
|
|||
/** |
|||
* 矫正开始日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date rectificateStartDate; |
|||
|
|||
/** |
|||
* 矫正结束日期 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
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; |
|||
} |
|||
|
|||
@Data |
|||
public static class SpecialCrowdXfry { |
|||
@NotBlank(message = "反映问题不能为空") |
|||
private String problem; |
|||
|
|||
/** |
|||
* 稳控措施 |
|||
*/ |
|||
@NotBlank(message = "稳控措施不能为空") |
|||
private String stableControlMeasurement; |
|||
|
|||
/** |
|||
* 是否多次上访 |
|||
*/ |
|||
private Integer multipleFlag; |
|||
|
|||
/** |
|||
* 是否在当地 |
|||
*/ |
|||
private Integer localFlag; |
|||
|
|||
/** |
|||
* 分管领导 |
|||
*/ |
|||
private String branchLeader; |
|||
|
|||
/** |
|||
* 分管领导联系方式 |
|||
*/ |
|||
private String branchLeaderContact; |
|||
|
|||
/** |
|||
* 负责人 |
|||
*/ |
|||
private String principal; |
|||
|
|||
/** |
|||
* 负责人联系方式 |
|||
*/ |
|||
private String principalContact; |
|||
|
|||
/** |
|||
* 稳控人员名单 |
|||
*/ |
|||
private String stableControlerList; |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class LingShanSpecialCrowdListResultDTO { |
|||
|
|||
private String resiId; |
|||
private String orgNamePath; |
|||
private String specialTypesStr; |
|||
private String specialTypeDisplay; |
|||
private String name; |
|||
private String mobile; |
|||
private String idCard; |
|||
private String address; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date createdTime; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.result.lingshan; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class LingShanSpecialCrowdStatsByOrgResultDTO { |
|||
|
|||
private String orgId; |
|||
|
|||
private String orgIdPath; |
|||
/** |
|||
* 组织层级。agency:行政组织。grid:网格 |
|||
*/ |
|||
private String orgType; |
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String orgName; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer quantity = 0; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dto.result.lingshan; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class LingShanSpecialCrowdStatsBySpecialTypeResultDTO { |
|||
|
|||
private String specialType; |
|||
private String specialTypeName; |
|||
private Integer quantity; |
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
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("jiedurenyuan", "戒毒人员", 1), |
|||
JZHZ("jingzhanghuanzhe", "精障患者", 1), |
|||
XFRY("xinfangrenyuan", "信访人员", 1); |
|||
|
|||
/** |
|||
* 类型。anzhibangjiao, |
|||
*/ |
|||
public final String type; |
|||
public final 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; |
|||
} |
|||
|
|||
public static LingShanSpecialCrowdTypeEnums getByType(String type) { |
|||
for (LingShanSpecialCrowdTypeEnums e : LingShanSpecialCrowdTypeEnums.values()) { |
|||
if (e.getType().equals(type)) { |
|||
return e; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package com.epmet.bean; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class PersonSpecialTypeBean { |
|||
private String resiId; |
|||
private String idCard; |
|||
|
|||
private String specialType; |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsBySpecialTypeResultDTO; |
|||
import com.epmet.service.LingShanScreenService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 灵山大屏 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("lingshanScreen") |
|||
public class LingShanScreenController { |
|||
|
|||
@Autowired |
|||
private LingShanScreenService lingShanScreenService; |
|||
|
|||
/** |
|||
* @description: 特殊人群-按组织分组统计数量 |
|||
* @param parentAgencyId: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/27 10:20 AM |
|||
*/ |
|||
@GetMapping("specialCrowdStats/qtyOfSubOrg") |
|||
public Result specialCrowdStatsCountBySubOrg(@RequestParam("parentAgencyId") String parentAgencyId, |
|||
@RequestParam(value = "specialType", required = false) String specialType) { |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> l = lingShanScreenService.specialCrowdStatsCountBySubOrg(parentAgencyId, specialType); |
|||
return new Result().ok(l); |
|||
} |
|||
|
|||
/** |
|||
* @description: 组织下每一类人群数量 |
|||
* @param parentAgencyId: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/27 12:16 PM |
|||
*/ |
|||
@GetMapping("specialCrowdStats/qtyOfSpecialType") |
|||
public Result specialCrowdStatsCountBySpecialType(@RequestParam("parentAgencyId") String parentAgencyId) { |
|||
List<LingShanSpecialCrowdStatsBySpecialTypeResultDTO> l = lingShanScreenService.specialCrowdStatsCountBySpecialType(parentAgencyId); |
|||
return new Result().ok(l); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,218 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.MaskResponse; |
|||
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.page.PageData; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.FileUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveFormDTO; |
|||
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveResultDTO; |
|||
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; |
|||
import com.epmet.enums.LingShanSpecialCrowdTypeEnums; |
|||
import com.epmet.excel.data.*; |
|||
import com.epmet.service.LingShanSpecialCrowdService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.io.IOUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.ServletOutputStream; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.FileOutputStream; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.net.URLEncoder; |
|||
import java.nio.file.Files; |
|||
import java.nio.file.Path; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @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 specialType: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/21 10:16 AM |
|||
*/ |
|||
@GetMapping("downloadTemplate") |
|||
public void downloadTemplate(@RequestParam("specialType") String specialType, HttpServletResponse response) { |
|||
InputStream is = null; |
|||
|
|||
LingShanSpecialCrowdTypeEnums st = LingShanSpecialCrowdTypeEnums.getByType(specialType); |
|||
if (st == null) { |
|||
log.error("【灵山街道-下载特殊人群导入模板】传入的特殊人群类型错误:{}", specialType); |
|||
return; |
|||
} |
|||
|
|||
try (ServletOutputStream os = response.getOutputStream()) { |
|||
is = this.getClass().getClassLoader().getResourceAsStream("excel/lingshan/special_crowd_" + specialType + "_import.xlsx"); |
|||
|
|||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
|||
response.setHeader("content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|||
// response.setHeader("content-Type", "application/vnd.ms-excel");
|
|||
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(st.getName(), "UTF-8")); |
|||
|
|||
IOUtils.copy(is, os); |
|||
} catch (IOException e) { |
|||
throw new RuntimeException(e); |
|||
} finally { |
|||
org.apache.poi.util.IOUtils.closeQuietly(is); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @description: 特殊人群导入 |
|||
* @param file: |
|||
* @param crowdCategory: 人群类别 |
|||
* anzhibangjiao |
|||
* buliangqingshaonian |
|||
* shequjiaozheng |
|||
* jiedurenyuan |
|||
* 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 { |
|||
String taskId = lingShanSpecialCrowdService.importSpecialCrowd(crowdCategory, fileSavePath.toString(), originalFilename); |
|||
return new Result().ok(taskId); |
|||
} catch (Exception e) { |
|||
// 3.出错的话,删除文件。不能在finally中删除,因为正常执行的话,是在异步线程中执行导入,这里删除了,那子线程就获取不到文件了,所以子线程中有单独的删除逻辑
|
|||
FileUtils.deleteFileIfExists(fileSavePath); |
|||
throw e; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @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 input: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/23 10:58 AM |
|||
*/ |
|||
@PostMapping("save") |
|||
public Result saveSpecialCrowd(@RequestBody LingShanSpecialTypeSaveFormDTO input) { |
|||
ValidatorUtils.validateEntity(input); |
|||
lingShanSpecialCrowdService.saveSpecialCrowd(input); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 特殊人群详情 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/20 3:44 PM |
|||
*/ |
|||
@GetMapping("getPersonSpecialTypeDetail") |
|||
public Result<LingShanSpecialTypeSaveResultDTO> getPersonSpecialTypeDetail(@RequestParam("resiId") String resiId) { |
|||
|
|||
LingShanSpecialTypeSaveResultDTO r = lingShanSpecialCrowdService.getPersonSpecialTypeDetail(resiId); |
|||
return new Result<LingShanSpecialTypeSaveResultDTO>().ok(r); |
|||
} |
|||
|
|||
/** |
|||
* @description: 列表查询 |
|||
* @param orgId: |
|||
* @param orgType: |
|||
* @param specialType: |
|||
* @param name: |
|||
* @param mobile: |
|||
* @param idCard: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/20 5:42 PM |
|||
*/ |
|||
@GetMapping("listSpecialCrowd") |
|||
@MaskResponse(fieldNames = {"name", "mobile", "idCard"}, |
|||
fieldsMaskType = { MaskResponse.MASK_TYPE_CHINESE_NAME, MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) |
|||
public Result<PageData<LingShanSpecialCrowdListResultDTO>> listSpecialCrowds(@RequestParam(value = "orgId", required = false) String orgId, |
|||
@RequestParam(value = "orgType", required = false) String orgType, |
|||
@RequestParam(value = "specialType", required = false) String specialType, |
|||
@RequestParam(value = "name", required = false) String name, |
|||
@RequestParam(value = "mobile", required = false) String mobile, |
|||
@RequestParam(value = "idCard", required = false) String idCard, |
|||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, |
|||
@RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize) { |
|||
|
|||
PageData<LingShanSpecialCrowdListResultDTO> pd = lingShanSpecialCrowdService.listSpecialCrowds(orgId, orgType, specialType, name, mobile, |
|||
idCard, pageNo, pageSize); |
|||
return new Result<PageData<LingShanSpecialCrowdListResultDTO>>().ok(pd); |
|||
} |
|||
|
|||
/** |
|||
* @description: 删除 |
|||
* @param params: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/21 9:40 AM |
|||
*/ |
|||
@PostMapping("deleteByResi") |
|||
public Result deleteByType(@RequestBody Map<String, String> params) { |
|||
String resiId = params.get("resiId"); |
|||
|
|||
if (StringUtils.isAnyBlank(resiId, resiId)) { |
|||
throw new ValidateException("特殊人群类型或身份证不能为空"); |
|||
} |
|||
|
|||
lingShanSpecialCrowdService.deleteByResi(resiId); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; |
|||
import com.epmet.entity.IcSpecialEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface IcSpecialDao extends BaseDao<IcSpecialEntity> { |
|||
|
|||
public IcSpecialEntity selectByResiId(@Param("resiId") String resiId); |
|||
|
|||
List<LingShanSpecialCrowdListResultDTO> listSpecialCrowd(@Param("orgIdPath") String orgIdPath, |
|||
@Param("orgId") String orgId, |
|||
@Param("orgType") String orgType, |
|||
@Param("specialType") String specialType, |
|||
@Param("name") String name, |
|||
@Param("mobile") String mobile, |
|||
@Param("idCard") String idCard); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
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<LingshanSpecialCrowdDetailAzbjEntity> { |
|||
|
|||
void saveBatchManually(@Param("asbjList") List<LingshanSpecialCrowdDetailAzbjEntity> l); |
|||
|
|||
void deletePhysical(@Param("idCard") String idCard); |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
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<LingshanSpecialCrowdDetailJdryEntity> { |
|||
|
|||
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailJdryEntity> l); |
|||
void deletePhysical(@Param("idCard") String idCard); |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
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<LingshanSpecialCrowdDetailJzhzEntity> { |
|||
|
|||
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailJzhzEntity> l); |
|||
void deletePhysical(@Param("idCard") String idCard); |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
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<LingshanSpecialCrowdDetailSqjzEntity> { |
|||
|
|||
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailSqjzEntity> l); |
|||
void deletePhysical(@Param("idCard") String idCard); |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; |
|||
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<LingshanSpecialCrowdDetailXfryEntity> { |
|||
|
|||
void saveBatchManually(@Param("list") List<LingshanSpecialCrowdDetailXfryEntity> l); |
|||
void deletePhysical(@Param("idCard") String idCard); |
|||
|
|||
List<LingShanSpecialCrowdStatsByOrgResultDTO> statsCountsByOrgIds(@Param("orgIdPaths") List<String> orgIdPaths); |
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -0,0 +1,129 @@ |
|||
package com.epmet.excel.converter; |
|||
|
|||
import com.alibaba.excel.converters.Converter; |
|||
import com.alibaba.excel.converters.ReadConverterContext; |
|||
import com.alibaba.excel.converters.WriteConverterContext; |
|||
import com.alibaba.excel.enums.CellDataTypeEnum; |
|||
import com.alibaba.excel.metadata.GlobalConfiguration; |
|||
import com.alibaba.excel.metadata.data.ReadCellData; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.metadata.property.ExcelContentProperty; |
|||
import com.epmet.excel.data.LingshanSpecialCrowdDetailJzhzExcelData; |
|||
|
|||
/** |
|||
* 灵山-诊断类型转换器 |
|||
*/ |
|||
public class LingShanSpecialCrowdJzhzConverter implements Converter<Integer> { |
|||
|
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return CellDataTypeEnum.STRING; |
|||
} |
|||
|
|||
@Override |
|||
public Class<?> supportJavaTypeKey() { |
|||
return Integer.class; |
|||
} |
|||
|
|||
@Override |
|||
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String fieldName = contentProperty.getField().getName(); |
|||
String value = cellData.getStringValue(); |
|||
if (fieldName.equals("currentDiagnosis")) { |
|||
return Diagnosis.getByName(value).code; |
|||
} else if (fieldName.equals("dangerousClass")) { |
|||
return DangerousClass.getByName(value).code; |
|||
} |
|||
|
|||
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String fieldName = contentProperty.getField().getName(); |
|||
if (fieldName.equals("currentDiagnosis")) { |
|||
return new WriteCellData<>(Diagnosis.getByCode(value).name); |
|||
} else if (fieldName.equals("dangerousClass")) { |
|||
return new WriteCellData<>(DangerousClass.getByCode(value).name); |
|||
} |
|||
|
|||
return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 诊断 |
|||
*/ |
|||
public enum Diagnosis { |
|||
JSFLZ(1, "精神分裂症"), |
|||
FLQGXZA(2, "分裂情感性障碍"), |
|||
CJDWXXZA(3, "持久的妄想性障碍(偏执性精神病)"), |
|||
SXZA(4, "双相(情感)障碍"), |
|||
DXSZJSZA(5, "癫痫所致精神障碍"), |
|||
JSFYCZBFJSZA(6, "精神发育迟滞伴发精神障碍"), |
|||
ZDYYFZ(7, "重度抑郁发作"), |
|||
JSHXWZ(8, "精神活性物质所致精神障碍"), |
|||
OTHERS(9, "其他"); |
|||
|
|||
private Integer code; |
|||
private String name; |
|||
|
|||
Diagnosis(Integer code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
static Diagnosis getByCode(Integer code) { |
|||
for (Diagnosis d : Diagnosis.values()) { |
|||
if (d.code.equals(code)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
static Diagnosis getByName(String name) { |
|||
for (Diagnosis d : Diagnosis.values()) { |
|||
if (d.name.equals(name)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
public enum DangerousClass { |
|||
ZERO(0, "0级"), |
|||
ONE(1, "1级"), |
|||
TOW(2, "2级(偏执性精神病)"), |
|||
THREE(3, "3级(情感)障碍"), |
|||
FOUR(4, "4级"), |
|||
FIVE(5, "5级"); |
|||
|
|||
private Integer code; |
|||
private String name; |
|||
|
|||
DangerousClass(Integer code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
static DangerousClass getByCode(Integer code) { |
|||
for (DangerousClass d : DangerousClass.values()) { |
|||
if (d.code.equals(code)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
static DangerousClass getByName(String name) { |
|||
for (DangerousClass d : DangerousClass.values()) { |
|||
if (d.name.equals(name)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,126 @@ |
|||
package com.epmet.excel.converter; |
|||
|
|||
import com.alibaba.excel.converters.Converter; |
|||
import com.alibaba.excel.converters.ReadConverterContext; |
|||
import com.alibaba.excel.enums.CellDataTypeEnum; |
|||
import com.alibaba.excel.metadata.GlobalConfiguration; |
|||
import com.alibaba.excel.metadata.data.ReadCellData; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.metadata.property.ExcelContentProperty; |
|||
import org.omg.CORBA.PRIVATE_MEMBER; |
|||
|
|||
/** |
|||
* 灵山-社区矫正转换器 |
|||
*/ |
|||
public class LingShanSpecialCrowdSqjzConverter implements Converter<Integer> { |
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return CellDataTypeEnum.STRING; |
|||
} |
|||
|
|||
@Override |
|||
public Class<?> supportJavaTypeKey() { |
|||
return Integer.class; |
|||
} |
|||
|
|||
@Override |
|||
public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String fieldName = contentProperty.getField().getName(); |
|||
String value = cellData.getStringValue(); |
|||
|
|||
if (fieldName.equals("rectificateType")) { |
|||
return RectificateType.getByName(value).code; |
|||
} else if (fieldName.equals("receiveWay")) { |
|||
return ReceiveWay.getByName(value).code; |
|||
} |
|||
|
|||
return Converter.super.convertToJavaData(cellData, contentProperty, globalConfiguration); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String fieldName = contentProperty.getField().getName(); |
|||
if (fieldName.equals("rectificateType")) { |
|||
return new WriteCellData(RectificateType.getByCode(value).name); |
|||
} else if (fieldName.equals("receiveWay")) { |
|||
return new WriteCellData(ReceiveWay.getByCode(value).name); |
|||
} |
|||
|
|||
return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration); |
|||
} |
|||
|
|||
/** |
|||
* 矫正类型 |
|||
*/ |
|||
public enum RectificateType { |
|||
GUANZHI(1,"管制"), |
|||
HUANXING(2,"缓刑"), |
|||
JIASHI(3,"假释"), |
|||
ZYJWZX(4,"暂予监外执行"), |
|||
BDZZQL(5,"剥夺政治权利"); |
|||
|
|||
private Integer code; |
|||
private String name; |
|||
|
|||
RectificateType(Integer code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
static RectificateType getByCode(Integer code) { |
|||
for (RectificateType d : RectificateType.values()) { |
|||
if (d.code.equals(code)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
static RectificateType getByName(String name) { |
|||
for (RectificateType d : RectificateType.values()) { |
|||
if (d.name.equals(name)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 接受方式。1.自行报到,2狱所押送,3当庭交接,4其他 |
|||
*/ |
|||
public enum ReceiveWay { |
|||
ZXBD(1,"自行报到"), |
|||
YSYS(2,"狱所押送"), |
|||
DTJJ(3,"当庭交接"), |
|||
OTHERS(4,"其他"); |
|||
|
|||
private Integer code; |
|||
private String name; |
|||
|
|||
ReceiveWay(Integer code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
static ReceiveWay getByCode(Integer code) { |
|||
for (ReceiveWay d : ReceiveWay.values()) { |
|||
if (d.code.equals(code)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
static ReceiveWay getByName(String name) { |
|||
for (ReceiveWay d : ReceiveWay.values()) { |
|||
if (d.name.equals(name)) { |
|||
return d; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
package com.epmet.excel.converter; |
|||
|
|||
import com.alibaba.excel.converters.Converter; |
|||
import com.alibaba.excel.converters.ReadConverterContext; |
|||
import com.alibaba.excel.converters.WriteConverterContext; |
|||
import com.alibaba.excel.enums.CellDataTypeEnum; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 灵山-是否转换器 |
|||
*/ |
|||
public class LingShanSpecialCrowdYesOrNoConverter implements Converter<Integer> { |
|||
List<String> group1 = Arrays.asList("localFlag", "multipleFlag", "recidivismFlag", "emplacementFlag", "canceledFlag", |
|||
"detachedFlag", "canGoOutFlag", "violenceFlag", "allowanceFlag", "subsistenceFlag"); |
|||
|
|||
List<String> group2 = Arrays.asList("criminalHistoryFlag", "drugRepetitionFlag", "causeTroubleHistoryFlag"); |
|||
|
|||
|
|||
@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); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception { |
|||
String fieldName = context.getContentProperty().getField().getName(); |
|||
Integer value = context.getValue(); |
|||
if (group1.contains(fieldName)) { |
|||
return convertYesOrNoFlag(value); |
|||
} else if (group2.contains(fieldName)) { |
|||
return convertHaveOrNotFlag(value); |
|||
} |
|||
|
|||
return Converter.super.convertToExcelData(context); |
|||
} |
|||
|
|||
WriteCellData<?> convertHaveOrNotFlag(Integer value) { |
|||
if (value.equals(1)) { |
|||
return new WriteCellData("有"); |
|||
} else if (value.equals(0)) { |
|||
return new WriteCellData("无"); |
|||
} else { |
|||
return new WriteCellData("未知"); |
|||
} |
|||
} |
|||
|
|||
WriteCellData<?> convertYesOrNoFlag(Integer value) { |
|||
if (value.equals(1)) { |
|||
return new WriteCellData("是"); |
|||
} else if (value.equals(0)) { |
|||
return new WriteCellData("否"); |
|||
} else { |
|||
return new WriteCellData("未知"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
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 = "释放日期不能为空") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date releaseDate; |
|||
|
|||
/** |
|||
* 原判刑期(单位:月) |
|||
*/ |
|||
@ExcelProperty(value = "原判刑期(单位:月)") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date originPrisonTerm; |
|||
|
|||
/** |
|||
* 是否累犯。0否,1是 |
|||
*/ |
|||
@ExcelProperty(value = "是否累犯", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer recidivismFlag; |
|||
|
|||
/** |
|||
* 是否安置。0否,1是 |
|||
*/ |
|||
@ExcelProperty(value = "是否安置", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer emplacementFlag; |
|||
|
|||
/** |
|||
* 安置日期 |
|||
*/ |
|||
@ExcelProperty(value = "安置日期") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date emplacementDate; |
|||
|
|||
/** |
|||
* 安置帮教情况 |
|||
*/ |
|||
@ExcelProperty(value = "安置帮教情况") |
|||
private String emplacementInfo; |
|||
|
|||
/** |
|||
* 是否注销 |
|||
*/ |
|||
@ExcelProperty(value = "是否注销", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer canceledFlag; |
|||
|
|||
/** |
|||
* 注销原因 |
|||
*/ |
|||
@ExcelProperty(value = "注销原因") |
|||
private String canceledReason; |
|||
|
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnore; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Data |
|||
public class LingShanSpecialCrowdDetailBaseExcelData extends LingShanSpecialCrowdDetailResultExtraInfo { |
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
@ExcelProperty(value = "*姓名") |
|||
@NotBlank(message = "姓名不能为空") |
|||
private String name; |
|||
/** |
|||
* 证件号 |
|||
*/ |
|||
@ExcelProperty(value = "*身份证号") |
|||
@NotBlank(message = "身份证号不能为空") |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 错误信息 |
|||
*/ |
|||
@ExcelProperty(value = "错误信息") |
|||
private String errorInfo; |
|||
|
|||
/** |
|||
* 居民id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String resiId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String resiGridId; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @description: 灵山特殊人群扩展字段 |
|||
* @param null: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/20 4:21 PM |
|||
*/ |
|||
@Data |
|||
public class LingShanSpecialCrowdDetailResultExtraInfo { |
|||
|
|||
private String gender; |
|||
private String genderZh; |
|||
private String nation; |
|||
private String birthday; |
|||
/** |
|||
* 户籍地 |
|||
*/ |
|||
private String domicilePlace; |
|||
private String mobile; |
|||
/** |
|||
* 住址 |
|||
*/ |
|||
private String address; |
|||
|
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import lombok.Data; |
|||
|
|||
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 = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
@NotNull(message = "有无犯罪史不能为空") |
|||
private Integer criminalHistoryFlag; |
|||
|
|||
/** |
|||
* 有无复吸史 |
|||
*/ |
|||
@ExcelProperty(value = "*有无复吸史", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
@NotNull(message = "有无复吸史不能为空") |
|||
private Integer drugRepetitionFlag; |
|||
|
|||
/** |
|||
* 初次发现日期 |
|||
*/ |
|||
@ExcelProperty(value = "初次发现日期") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
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 = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer detachedFlag; |
|||
|
|||
/** |
|||
* 脱管原因 |
|||
*/ |
|||
@ExcelProperty(value = "脱管原因") |
|||
private String detachedReason; |
|||
|
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdJzhzConverter; |
|||
import lombok.Data; |
|||
|
|||
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 = LingShanSpecialCrowdYesOrNoConverter.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 = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer canGoOutFlag; |
|||
|
|||
/** |
|||
* 是否有暴力倾向 |
|||
*/ |
|||
@ExcelProperty(value = "是否有暴力倾向", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer violenceFlag; |
|||
|
|||
/** |
|||
* 是否落实监管补助 |
|||
*/ |
|||
@ExcelProperty(value = "是否落实监管补助", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer allowanceFlag; |
|||
|
|||
/** |
|||
* 是否纳入低保 |
|||
*/ |
|||
@ExcelProperty(value = "是否纳入低保", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer subsistenceFlag; |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
@ExcelProperty(value = "监护人姓名") |
|||
private String guardianName; |
|||
|
|||
/** |
|||
* 监护人联系方式 |
|||
*/ |
|||
@ExcelProperty(value = "监护人联系方式") |
|||
private String guardianContact; |
|||
|
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdSqjzConverter; |
|||
import lombok.Data; |
|||
|
|||
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 = "矫正开始日期") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date rectificateStartDate; |
|||
|
|||
/** |
|||
* 矫正结束日期 |
|||
*/ |
|||
@ExcelProperty(value = "矫正结束日期") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
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 = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer detachedFlag; |
|||
|
|||
/** |
|||
* 脱管原因 |
|||
*/ |
|||
@ExcelProperty(value = "脱管原因") |
|||
private String detachedReason; |
|||
|
|||
/** |
|||
* 是否注销 |
|||
*/ |
|||
@ExcelProperty(value = "是否注销" , converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer canceledFlag; |
|||
|
|||
/** |
|||
* 注销原因 |
|||
*/ |
|||
@ExcelProperty(value = "注销原因") |
|||
private String canceledReason; |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import lombok.Data; |
|||
|
|||
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 = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer multipleFlag; |
|||
|
|||
/** |
|||
* 是否在当地 |
|||
*/ |
|||
@ExcelProperty(value = "是否在当地", converter = LingShanSpecialCrowdYesOrNoConverter.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; |
|||
|
|||
} |
|||
@ -0,0 +1,409 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.alibaba.excel.context.AnalysisContext; |
|||
import com.alibaba.excel.event.AnalysisEventListener; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import com.epmet.bean.PersonSpecialTypeBean; |
|||
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.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.lang3.StringUtils; |
|||
import org.redisson.api.RLock; |
|||
|
|||
import java.util.*; |
|||
import java.util.concurrent.atomic.AtomicInteger; |
|||
|
|||
/** |
|||
* 灵山大屏-抽象的导入excel监听器 |
|||
*/ |
|||
@Data |
|||
@Slf4j |
|||
public abstract class AbstractLingShanSpecialCrowdExcelImportListener<T extends LingShanSpecialCrowdDetailBaseExcelData, E extends LingshanSpecialCrowdDetailBaseEntity> |
|||
extends AnalysisEventListener<T> { |
|||
|
|||
/** |
|||
* @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<String> headerZhList; |
|||
|
|||
/** |
|||
* @description: 是否只校验表头 |
|||
* @param null: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 5:16 PM |
|||
*/ |
|||
private Boolean validateHeaderOnly = false; |
|||
|
|||
/** |
|||
* 当前表头读到了第几行 |
|||
*/ |
|||
private Integer currentHeadRowNum = 0; |
|||
|
|||
/** |
|||
* 原始数据列表 |
|||
*/ |
|||
private List<T> originDatas = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 错误数据列表 |
|||
*/ |
|||
private List<T> errorDatas = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 正确数据 |
|||
*/ |
|||
private List<E> correctDatas = new ArrayList<>(); |
|||
|
|||
private AtomicInteger correctDatasQty = new AtomicInteger(); |
|||
|
|||
// 为什么去掉了?因为需求改成了:直接用type根居民基础信息关联
|
|||
// private List<LingshanSpecialCrowdPersonEntity> persons = new ArrayList<>();
|
|||
// private List<LingshanSpecialCrowdPersonTypeEntity> personTypes = new ArrayList<>();
|
|||
private List<PersonSpecialTypeBean> specialTypes = new ArrayList<>(); |
|||
|
|||
protected LingShanSpecialCrowdService lingShanSpecialCrowdService; |
|||
|
|||
private Class<E> 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(); |
|||
templateFileName = setTemplateFileName(); |
|||
} |
|||
|
|||
/** |
|||
* @param headMap: |
|||
* @param context: |
|||
* @return |
|||
* @description: 表头回调函数,此处做统一表头校验,确认文件内容与当前要导入的数据的字段一致,防止导错类型. |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 10:42 AM |
|||
*/ |
|||
@Override |
|||
public void invokeHeadMap(Map<Integer, String> 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<String> redundentHeaders = new ArrayList<>(); |
|||
List<String> lackHeaders = new ArrayList<>(); |
|||
|
|||
Collection<String> 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.getAgencyId(), currentStaffInfo.getAgencyPIds()); |
|||
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); |
|||
Date now = new Date(); |
|||
Iterator<T> 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 { |
|||
specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType())); |
|||
|
|||
orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), orgIdPath); |
|||
|
|||
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); |
|||
correctDatasQty.incrementAndGet(); |
|||
} |
|||
} |
|||
|
|||
// 执行保存
|
|||
if(!CollectionUtils.isEmpty(specialTypes)) { |
|||
savePersonAndTypes(specialTypes); |
|||
} |
|||
|
|||
// 将错误的数据处理 todo
|
|||
|
|||
// 保存人群详情数据
|
|||
saveBatchCallback(correctDatas); |
|||
} |
|||
|
|||
/** |
|||
* @description: 保存人员信息,人员类型 |
|||
* @param personTypes: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 11:06 AM |
|||
*/ |
|||
private void savePersonAndTypes(List<PersonSpecialTypeBean> personTypes) { |
|||
lingShanSpecialCrowdService.savePersonAndTypes(personTypes, false); |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 清理数据 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:41 PM |
|||
*/ |
|||
protected void clear() { |
|||
originDatas.clear(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取读取到的原始数据 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:21 PM |
|||
*/ |
|||
protected List<T> getOriginDatas() { |
|||
return originDatas; |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取错误数据行 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:22 PM |
|||
*/ |
|||
public List<T> getErrorDatas() { |
|||
return errorDatas; |
|||
} |
|||
|
|||
public Integer getFailedItemsQty() { |
|||
return errorDatas.size(); |
|||
} |
|||
|
|||
public Integer getSuccessedItemsQty() { |
|||
return correctDatasQty.get(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取正确数据行 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:22 PM |
|||
*/ |
|||
protected List<E> getCorrectDatas() { |
|||
return correctDatas; |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 批量保存,子类实现 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:32 PM |
|||
*/ |
|||
abstract void saveBatchCallback(List<E> 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<String> 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<E> getEntityClass(); |
|||
|
|||
/** |
|||
* @description: 指定特殊人群类型 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 11:00 AM |
|||
*/ |
|||
abstract LingShanSpecialCrowdTypeEnums getSpecialCrowdType(); |
|||
|
|||
/** |
|||
* 人员类别信息bean,用于导入临时存储数据 |
|||
*/ |
|||
|
|||
} |
|||
@ -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<LingShanSpecialCrowdDetailAzbjExcelData, LingshanSpecialCrowdDetailAzbjEntity> { |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*原罪名", "*释放日期", "原判刑期(单位:月)", "是否累犯", "是否安置", "安置日期", "安置帮教情况", "是否注销", "注销原因"); |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanSpecialCrowdDetailAzbjEntity> getEntityClass() { |
|||
return LingshanSpecialCrowdDetailAzbjEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanSpecialCrowdDetailAzbjEntity> entities) { |
|||
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailAzbjEntity()); |
|||
} |
|||
|
|||
@Override |
|||
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { |
|||
return LingShanSpecialCrowdTypeEnums.AZBJ; |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_special_crowd_azbj_export.xlsx"; |
|||
} |
|||
} |
|||
@ -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<LingshanSpecialCrowdDetailJdryExcelData, LingshanSpecialCrowdDetailJdryEntity> { |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*有无犯罪史", "*有无复吸史", "初次发现日期", "管控人姓名", "管控人联系方式", "帮扶人姓名", "帮扶人联系方式", "是否脱管", "脱管原因"); |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanSpecialCrowdDetailJdryEntity> getEntityClass() { |
|||
return LingshanSpecialCrowdDetailJdryEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanSpecialCrowdDetailJdryEntity> entities) { |
|||
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJdryEntity()); |
|||
} |
|||
|
|||
@Override |
|||
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { |
|||
return LingShanSpecialCrowdTypeEnums.JDRY; |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_special_crowd_jdry_export.xlsx"; |
|||
} |
|||
} |
|||
@ -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<LingshanSpecialCrowdDetailJzhzExcelData, LingshanSpecialCrowdDetailJzhzEntity> { |
|||
|
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanSpecialCrowdDetailJzhzEntity> entities) { |
|||
lingShanSpecialCrowdService.saveBatch(entities, new LingshanSpecialCrowdDetailJzhzEntity()); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*有无肇事肇祸史", "*肇事肇祸次数", "目前诊断类型", "危险性评估等级", "是否具备外出能力", "是否有暴力倾向", "是否落实监管补助", "是否纳入低保", "监护人姓名", "监护人联系方式"); |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanSpecialCrowdDetailJzhzEntity> getEntityClass() { |
|||
return LingshanSpecialCrowdDetailJzhzEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanSpecialCrowdTypeEnums getSpecialCrowdType() { |
|||
return LingShanSpecialCrowdTypeEnums.JZHZ; |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_special_crowd_jzhz_export.xlsx"; |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue