Browse Source

暂提一波

master
zxc 3 years ago
parent
commit
cb315f9d28
  1. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java
  2. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java
  3. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java
  4. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java
  5. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java
  6. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java
  7. 58
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java
  8. 55
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java

@ -107,6 +107,7 @@ public class DataSyncRecordDisabilityDTO implements Serializable {
* 现居住地址
*/
private String nowAdd;
private String address;
/**
* 监护人

18
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java

@ -74,6 +74,14 @@ public class DataSyncRecordDisabilityController {
return new Result();
}
/**
* Desc: 导出
* @param tokenDto
* @param formDTO
* @param response
* @author zxc
* @date 2022/10/13 16:17
*/
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -81,9 +89,15 @@ public class DataSyncRecordDisabilityController {
dataSyncRecordDisabilityService.export(formDTO,response);
}
/**
* Desc: 批量更新
* @param ids
* @author zxc
* @date 2022/10/13 16:18
*/
@PostMapping("batchUpdate")
public Result batchUpdate(){
public Result batchUpdate(@RequestBody String[] ids,@LoginUser TokenDto tokenDto){
dataSyncRecordDisabilityService.batchUpdate(ids,tokenDto.getCustomerId());
return new Result();
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java

@ -20,4 +20,6 @@ public interface DataSyncRecordDisabilityDao extends BaseDao<DataSyncRecordDisab
//int upsertBatch(List<DataSyncRecordDisabilityEntity> list);
List<DataSyncRecordDisabilityDTO> list(DataSyncRecordDisabilityFormDTO formDTO);
void batchUpdateResiDisability(List<DataSyncRecordDisabilityEntity> entities);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java

@ -1,5 +1,6 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
@ -68,11 +69,17 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity {
*/
private String cjzkCn;
@TableField(exist = false)
private String cjzk;
/**
* 残疾类别
*/
private String cjlbCn;
@TableField(exist = false)
private String cjlb;
/**
* 文化程度
*/

8
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java

@ -26,11 +26,11 @@ public class DataSyncRecordDisabilityExcel {
@ExcelProperty(value = "性别")
@ColumnWidth(20)
private String gender;
private Integer gender;
@ExcelProperty(value = "民族")
@ColumnWidth(20)
private String mz;
private String mzCn;
@ExcelProperty(value = "家庭住址")
@ColumnWidth(20)
@ -38,11 +38,11 @@ public class DataSyncRecordDisabilityExcel {
@ExcelProperty(value = "残疾类别")
@ColumnWidth(20)
private String cjlb;
private String cjlbCn;
@ExcelProperty(value = "残疾等级")
@ColumnWidth(20)
private String cjzk;
private String cjzkCn;
@ExcelProperty(value = "监护人")
@ColumnWidth(20)

21
epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java

@ -82,7 +82,28 @@ public interface DataSyncRecordDisabilityService extends BaseService<DataSyncRec
DataSyncRecordDisabilityDTO selectOne(LambdaQueryWrapper<DataSyncRecordDisabilityEntity> queryWrapper);
/**
* Desc: 列表
* @param formDTO
* @author zxc
* @date 2022/10/13 16:17
*/
PageData<DataSyncRecordDisabilityDTO> list(DataSyncRecordDisabilityFormDTO formDTO);
/**
* Desc: 导出
* @param formDTO
* @param response
* @author zxc
* @date 2022/10/13 16:17
*/
void export(DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException;
/**
* Desc: 批量更新
* @param ids
* @author zxc
* @date 2022/10/13 16:18
*/
void batchUpdate(String[] ids,String customerId);
}

58
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java

@ -23,10 +23,14 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.dao.DataSyncRecordDisabilityDao;
import com.epmet.dto.DataSyncRecordDisabilityDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.form.IcFormOptionsQueryFormDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO;
import com.epmet.dto.form.dataSync.ResiInfoDTO;
import com.epmet.dto.result.FormItemResult;
import com.epmet.entity.DataSyncRecordDisabilityEntity;
import com.epmet.excel.DataSyncRecordDisabilityExcel;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.DataSyncRecordDisabilityService;
import com.epmet.service.IcResiUserService;
import com.github.pagehelper.PageHelper;
@ -55,6 +59,8 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn
@Autowired
private IcResiUserService icResiUserService;
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@Override
public PageData<DataSyncRecordDisabilityDTO> page(Map<String, Object> params) {
@ -171,4 +177,56 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl<DataSyn
}
}
/**
* Desc: 批量更新
* 更新 ic_resi_user的是否残疾cjlb,cjzk,cjzh
* 添加 变更记录
* 回填残疾表状态
* @param ids
* @author zxc
* @date 2022/10/13 16:18
*/
@Override
public void batchUpdate(String[] ids, String customerId) {
if (null == ids || ids.length == NumConstant.ZERO){
return;
}
List<String> all = Arrays.asList(ids);
List<DataSyncRecordDisabilityEntity> entities = baseDao.selectBatchIds(all);
IcFormOptionsQueryFormDTO formDTO = new IcFormOptionsQueryFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setFormCode("resi_base_info");
formDTO.setColumnName("CJZK");
Result<Map<String, String>> cjzkOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO);
if (!cjzkOptionsMap.success()){
throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败");
}
formDTO.setColumnName("CJLB");
Result<Map<String, String>> cjlbOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO);
if (!cjlbOptionsMap.success()){
throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败");
}
Map<String, String> cjlbMap = cjlbOptionsMap.getData();
Map<String, String> cjzkMap = cjzkOptionsMap.getData();
entities.forEach(e -> {
cjlbMap.forEach((k,v) ->{
if (e.getCjlbCn().equals(v)){
e.setCjlb(k);
}
});
cjzkMap.forEach((k,v) -> {
if (e.getCjzkCn().equals(v)){
e.setCjzk(k);
}
});
});
// 变更记录
}
@Transactional(rollbackFor = Exception.class)
public void disposeDisabilitybatchUpdate(List<DataSyncRecordDisabilityEntity> entities){
baseDao.batchUpdateResiDisability(entities);
}
}

55
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml

@ -36,12 +36,67 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="batchUpdateResiDisability">
UPDATE ic_resi_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="IS_CJ =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.disabilityStatus'>
when id = #{item.icResiUserId} then #{item.disabilityStatus}
</if>
</foreach>
</trim>
<trim prefix="CJZH =(case" suffix="end),">
<foreach collection="list" item="item">
<choose>
<when test='item.disabilityStatus == 1'>
when id = #{item.icResiUserId} then #{item.cjzh}
</when>
<otherwise>
when id = #{item.icResiUserId} then ''
</otherwise>
</choose>
</foreach>
</trim>
<trim prefix="CJZK =(case" suffix="end),">
<foreach collection="list" item="item">
<choose>
<when test='item.disabilityStatus == 1'>
when id = #{item.icResiUserId} then #{item.cjzk}
</when>
<otherwise>
when id = #{item.icResiUserId} then ''
</otherwise>
</choose>
</foreach>
</trim>
<trim prefix="CJLB =(case" suffix="end),">
<foreach collection="list" item="item">
<choose>
<when test='item.disabilityStatus == 1'>
when id = #{item.icResiUserId} then #{item.cjlb}
</when>
<otherwise>
when id = #{item.icResiUserId} then ''
</otherwise>
</choose>
</foreach>
</trim>
UPDATED_TIME = NOW()
WHERE
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
id = #{item.icResiUserId}
</foreach>
</trim>
</update>
<select id="list" resultType="com.epmet.dto.DataSyncRecordDisabilityDTO">
SELECT
(case when d.deal_status = 0 then '未处理'
when d.deal_status = 1 then '处理成功'
when d.deal_status = 2 then '处理失败'
else '处理失败' end) as dealStatusName,
d.now_add as address,
d.*
FROM data_sync_record_disability d
WHERE DEL_FLAG = 0

Loading…
Cancel
Save