|
|
@ -28,6 +28,7 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.dto.result.OptionDataResultDTO; |
|
|
|
import com.epmet.commons.tools.enums.IcFormCodeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
@ -91,9 +92,6 @@ import java.util.stream.Collectors; |
|
|
|
@RequestMapping("icresiuser") |
|
|
|
public class IcResiUserController { |
|
|
|
|
|
|
|
//todo 枚举吧
|
|
|
|
private static final String IC_RESI_FORM_CODE = "resi_base_info"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 居民上传临时目录 |
|
|
|
*/ |
|
|
@ -312,7 +310,7 @@ public class IcResiUserController { |
|
|
|
Set<String> stopSearchSet = new HashSet<>(); |
|
|
|
|
|
|
|
//获取表单项
|
|
|
|
List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IC_RESI_FORM_CODE); |
|
|
|
List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode()); |
|
|
|
Map<String, FormItemResult> allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); |
|
|
|
Map<String, ExportResiUserItemDTO> map = new HashMap<>(); |
|
|
|
allItemMap.values().forEach(item->{ |
|
|
@ -436,7 +434,7 @@ public class IcResiUserController { |
|
|
|
savePath = IC_RESI_UPLOAD_DIR.resolve(fileName); |
|
|
|
|
|
|
|
IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString())); |
|
|
|
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IC_RESI_FORM_CODE); |
|
|
|
List<FormItemResult> formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode()); |
|
|
|
icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response); |
|
|
|
} catch (IOException e) { |
|
|
|
String errorMsg = ExceptionUtils.getErrorStackTrace(e); |
|
|
@ -444,7 +442,9 @@ public class IcResiUserController { |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} finally { |
|
|
|
try { |
|
|
|
Files.delete(savePath); |
|
|
|
if (savePath != null){ |
|
|
|
Files.delete(savePath); |
|
|
|
} |
|
|
|
} catch (IOException e) { |
|
|
|
log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
|
|
|
} |
|
|
@ -491,7 +491,7 @@ public class IcResiUserController { |
|
|
|
@NotNull |
|
|
|
private CustomerFormResultDTO getResiFormAddItems(String customerId) { |
|
|
|
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); |
|
|
|
queryDTO.setFormCode("resi_base_info"); |
|
|
|
queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); |
|
|
|
queryDTO.setCustomerId(customerId); |
|
|
|
Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); |
|
|
|
if (resultForm == null || !resultForm.success() || resultForm.getData() == null) { |
|
|
@ -656,7 +656,7 @@ public class IcResiUserController { |
|
|
|
input.setKeyword(input.getKeyword().trim()); |
|
|
|
input.setCustomerId(loginUser.getCustomerId()); |
|
|
|
input.setStaffId(loginUser.getUserId()); |
|
|
|
input.setFormCode("resi_base_info"); |
|
|
|
input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); |
|
|
|
if (input.getPageNo() == null) { |
|
|
|
input.setPageNo(1); |
|
|
|
} |
|
|
|