Browse Source

Merge remote-tracking branch 'origin/develop' into release_temp

master
yinzuomei 4 years ago
parent
commit
9fd3224792
  1. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java
  2. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  3. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  4. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  5. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java
  7. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java
  8. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  9. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java
  10. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx
  11. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx
  12. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  13. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml
  14. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  15. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  16. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xlsx
  17. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx

18
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

@ -17,9 +17,7 @@
package com.epmet.dto.form; package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
@ -35,17 +33,21 @@ public class IcPropertyManagementFormDTO implements Serializable {
public interface DeleteGroup extends CustomerClientShowGroup { public interface DeleteGroup extends CustomerClientShowGroup {
} }
@NotBlank(message = "物业id不能为空", groups = { UpdateGroup.class,DeleteGroup.class}) public interface AddShowGroup extends CustomerClientShowGroup {
private String id; }
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class})
private String id;
/** /**
* 物业名称 * 物业名称
*/ */
@NotBlank(message = "物业名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) @NotBlank(message = "物业名称不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@Length(max=50,message = "物业名称不能超过50个字", groups = {AddGroup.class, UpdateGroup.class}) @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name; private String name;
} }

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -22,10 +22,10 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.BuildingTreeLevelDTO;
import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.IcBulidingFormDTO;
@ -63,7 +63,7 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("building") @RequestMapping("building")
public class BuildingController { public class BuildingController {
@Autowired @Autowired
private NeighborHoodService neighborHoodService; private NeighborHoodService neighborHoodService;
@ -86,6 +86,7 @@ public class BuildingController {
} }
@NoRepeatSubmit
@PostMapping("buildingadd") @PostMapping("buildingadd")
public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ public Result buildingAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){
//效验数据 //效验数据
@ -97,6 +98,7 @@ public class BuildingController {
return new Result().ok("保存成功"); return new Result().ok("保存成功");
} }
@NoRepeatSubmit
@PostMapping("buildingupdate") @PostMapping("buildingupdate")
public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){ public Result buildingUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcBulidingFormDTO formDTO){
//效验数据 //效验数据
@ -222,4 +224,4 @@ public class BuildingController {
} }
} }

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -20,6 +20,7 @@ package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -71,6 +72,7 @@ public class HouseController {
} }
@NoRepeatSubmit
@PostMapping("houseadd") @PostMapping("houseadd")
public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){
//效验数据 //效验数据
@ -82,6 +84,7 @@ public class HouseController {
return new Result(); return new Result();
} }
@NoRepeatSubmit
@PostMapping("houseupdate") @PostMapping("houseupdate")
public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ public Result houseUpdate(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){
//效验数据 //效验数据

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -21,6 +21,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -84,6 +85,7 @@ public class NeighborHoodController {
} }
@NoRepeatSubmit
@PostMapping("neighborhoodadd") @PostMapping("neighborhoodadd")
public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){
//效验数据 //效验数据
@ -95,6 +97,7 @@ public class NeighborHoodController {
return new Result(); return new Result();
} }
@NoRepeatSubmit
@PostMapping("neighborhoodupdate") @PostMapping("neighborhoodupdate")
public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){ public Result neighborhoodupdate(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodFormDTO formDTO){
//效验数据 //效验数据

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java

@ -21,8 +21,6 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.service.IcPropertyManagementService; import com.epmet.service.IcPropertyManagementService;
@ -64,7 +62,7 @@ public class PropertyManagementController {
@PostMapping("add") @PostMapping("add")
public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, AddGroup.class); ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class);
Map map=new HashMap<>(); Map map=new HashMap<>();
map.put("propertyId",propertyManagementService.add(formDTO)); map.put("propertyId",propertyManagementService.add(formDTO));
return new Result().ok(map); return new Result().ok(map);
@ -75,7 +73,7 @@ public class PropertyManagementController {
@PostMapping("update") @PostMapping("update")
public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据 //效验数据
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class);
propertyManagementService.update(formDTO); propertyManagementService.update(formDTO);
return new Result(); return new Result();
} }

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java

@ -29,5 +29,6 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEntity> { public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEntity> {
IcPropertyManagementEntity selectByName(String name);
} }

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcHouseExcel.java

@ -95,7 +95,13 @@ public class IcHouseExcel extends ExcelVerifyInfo implements Serializable {
@Excel(name = "更新时间") @Excel(name = "更新时间")
private Date updatedTime;*/ private Date updatedTime;*/
@Excel(name = "所属组织")
@NotBlank(message = "所属组织不能位空")
private String agencyName;
@Excel(name = "所属网格")
@NotBlank(message = "所属网格不能位空")
private String gridName;
@Excel(name = "所属小区") @Excel(name = "所属小区")
@NotBlank(message = "小区名称不能位空") @NotBlank(message = "小区名称不能位空")

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -17,9 +17,7 @@ import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums; import com.epmet.enums.HouseTypeEnums;
@ -202,9 +200,9 @@ public class HouseServiceImpl implements HouseService {
} }
private List<IcHouseExcel> searchAllHouse(ListIcNeighborHoodFormDTO formDTO) { private List<IcHouseExcel> searchAllHouse(ListIcNeighborHoodFormDTO formDTO) {
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class); //IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
//
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class); //IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

@ -44,6 +44,13 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String add(IcPropertyManagementFormDTO formDTO) { public String add(IcPropertyManagementFormDTO formDTO) {
//物业名字平台内唯一
//如果输入的物业名字已经存在,直接返回物业id
formDTO.setName(formDTO.getName().trim());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName());
if (null != entity) {
return entity.getId();
}
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class);
icPropertyManagementDao.insert(icPropertyManagementEntity); icPropertyManagementDao.insert(icPropertyManagementEntity);
return icPropertyManagementEntity.getId(); return icPropertyManagementEntity.getId();

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -157,7 +157,7 @@
a.OWNER_ID_CARD as ownerIdCard, a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName, b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName, c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName d.UNIT_NUM as buildingUnit
from ic_house a from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' INNER JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -14,5 +14,13 @@
<result property="updatedTime" column="UPDATED_TIME"/> <result property="updatedTime" column="UPDATED_TIME"/>
</resultMap> </resultMap>
<select id="selectByName" parameterType="java.lang.String" resultType="com.epmet.entity.IcPropertyManagementEntity">
SELECT
m.id
FROM
ic_property_management m
WHERE
m.DEL_FLAG = '0'
AND m.`NAME` = #{name}
</select>
</mapper> </mapper>

5
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -223,7 +223,7 @@ public class IcResiUserController {
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
//resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]"); //resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
log.info("resiMainList:{}", JSON.toJSONString(resiMainList)); log.info("resiMainList:{}", JSON.toJSONString(resiMainList));
String templatePath = "excel/ic_resi_info_cid.xls"; String templatePath = "excel/ic_resi_info_cid.xlsx";
TemplateExportParams params = new TemplateExportParams(templatePath, true); TemplateExportParams params = new TemplateExportParams(templatePath, true);
Map<Integer, Map<String, Object>> sheetMap = new HashMap<>(); Map<Integer, Map<String, Object>> sheetMap = new HashMap<>();
@ -251,8 +251,9 @@ public class IcResiUserController {
Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params);
workbook.setActiveSheet(0); workbook.setActiveSheet(0);
String fileName = "居民基本信息.xls"; String fileName = "居民基本信息.xlsx";
response.setHeader("content-Type", "application/vnd.ms-excel"); response.setHeader("content-Type", "application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
workbook.write(response.getOutputStream()); workbook.write(response.getOutputStream());
} }

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -206,10 +207,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
} }
} }
String errors = JSON.toJSONString(errorRows.get()); //String errors = JSON.toJSONString(errorRows.get());
//String skipeds = JSON.toJSONString(skipedRows.get()); //String skipeds = JSON.toJSONString(skipedRows.get());
log.error(errors); //log.error(errors);
//log.error(skipeds); //log.error(skipeds);
try { try {
@ -252,7 +253,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
private Object importIcResiBaseInfoFromExcel(String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId, private Object importIcResiBaseInfoFromExcel(String excelPathName, int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId,
String tableName) { String tableName) {
DynamicEasyExcelListener readListener = new DynamicEasyExcelListener(); DynamicEasyExcelListener readListener = new DynamicEasyExcelListener();
EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead(); //EasyExcelFactory.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead();
EasyExcel.read(new File(excelPathName)).registerReadListener(readListener).headRowNumber(headRowNumber).sheet(sheetNo).doRead();
List<Map<Integer, String>> headList = readListener.getHeadList(); List<Map<Integer, String>> headList = readListener.getHeadList();
List<Map<Integer, String>> dataList = readListener.getDataList(); List<Map<Integer, String>> dataList = readListener.getDataList();
@ -592,7 +594,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
} }
if (interupt) { if (interupt) {
throw new RenException(String.join(",", errorColumnNames) + "的值未填写"); throw new RenException(String.join(",", errorColumnNames) + "的值未填写,或者所填写信息在系统中未找到");
} }
} }
@ -918,15 +920,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
//public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>(); //public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>();
String fileName = "导入失败条目清单.xls"; String fileName = "导入失败条目清单.xls";
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.ms-excel"); response.setHeader("content-Type", "application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
LinkedList<ErrorRow> list = new LinkedList<>(); LinkedList<ErrorRow> list = new LinkedList<>();
for (Map.Entry<String, List<ErrorRow>> entry : errorRows.get().entrySet()) { for (Map.Entry<String, List<ErrorRow>> entry : errorRows.get().entrySet()) {
list.addAll(entry.getValue()); list.addAll(entry.getValue());
} }
list.forEach(row -> {System.out.println(row.getTableName());row.setSheetName(IcResiUserTableEnums.getObjectByTableName(row.tableName).getTableComment());}); //list.forEach(row -> {System.out.println(row.getTableName());row.setSheetName(IcResiUserTableEnums.getObjectByTableName(row.tableName).getTableComment());});
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的条目列表","导入失败"), Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的条目列表","导入失败"),
ErrorRow.class, list); ErrorRow.class, list);

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xlsx

Binary file not shown.
Loading…
Cancel
Save