|
@ -50,22 +50,22 @@ public class IcMoveInRecordController { |
|
|
private IcMoveInRecordService icMoveInRecordService; |
|
|
private IcMoveInRecordService icMoveInRecordService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|
|
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|
|
public Result<IcMoveInRecordDTO> get(@PathVariable("id") String id){ |
|
|
public Result<IcMoveInRecordDTO> get(@PathVariable("id") String id) { |
|
|
IcMoveInRecordDTO data = icMoveInRecordService.get(id); |
|
|
IcMoveInRecordDTO data = icMoveInRecordService.get(id); |
|
|
return new Result<IcMoveInRecordDTO>().ok(data); |
|
|
return new Result<IcMoveInRecordDTO>().ok(data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@RequestMapping("list") |
|
|
@RequestMapping("list") |
|
|
@MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) |
|
|
@MaskResponse(fieldNames = {"mobile", "idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) |
|
|
public Result<PageData<IcMoveInListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ |
|
|
public Result<PageData<IcMoveInListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO) { |
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
return new Result<PageData<IcMoveInListResultDTO>>().ok(icMoveInRecordService.list(formDTO)); |
|
|
return new Result<PageData<IcMoveInListResultDTO>>().ok(icMoveInRecordService.list(formDTO)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
@NoRepeatSubmit |
|
|
@PostMapping("add") |
|
|
@PostMapping("add") |
|
|
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInAddEditFormDTO dto){ |
|
|
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInAddEditFormDTO dto) { |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
dto.setUserId(tokenDto.getUserId()); |
|
|
dto.setUserId(tokenDto.getUserId()); |
|
@ -74,7 +74,7 @@ public class IcMoveInRecordController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("edit") |
|
|
@PostMapping("edit") |
|
|
public Result update(@RequestBody IcMoveInAddEditFormDTO dto){ |
|
|
public Result update(@RequestBody IcMoveInAddEditFormDTO dto) { |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
icMoveInRecordService.update(dto); |
|
|
icMoveInRecordService.update(dto); |
|
@ -82,7 +82,7 @@ public class IcMoveInRecordController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("delete") |
|
|
@PostMapping("delete") |
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
//效验数据
|
|
|
//效验数据
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
icMoveInRecordService.delete(ids); |
|
|
icMoveInRecordService.delete(ids); |
|
@ -95,9 +95,8 @@ public class IcMoveInRecordController { |
|
|
formDTO.setIsPage(false); |
|
|
formDTO.setIsPage(false); |
|
|
ExcelWriter excelWriter = null; |
|
|
ExcelWriter excelWriter = null; |
|
|
formDTO.setPageSize(NumConstant.TEN_THOUSAND); |
|
|
formDTO.setPageSize(NumConstant.TEN_THOUSAND); |
|
|
int pageNo = NumConstant.ONE; |
|
|
|
|
|
try { |
|
|
try { |
|
|
String fileName = "迁入管理"+DateUtils.format(new Date())+".xlsx"; |
|
|
String fileName = "迁入管理" + DateUtils.format(new Date()) + ".xlsx"; |
|
|
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcMoveInRecordExcel.class).build(); |
|
|
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcMoveInRecordExcel.class).build(); |
|
|
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); |
|
|
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); |
|
|
PageData<IcMoveInListResultDTO> data = null; |
|
|
PageData<IcMoveInListResultDTO> data = null; |
|
@ -105,12 +104,12 @@ public class IcMoveInRecordController { |
|
|
do { |
|
|
do { |
|
|
data = icMoveInRecordService.list(formDTO); |
|
|
data = icMoveInRecordService.list(formDTO); |
|
|
list = ConvertUtils.sourceToTarget(data.getList(), IcMoveInRecordExcel.class); |
|
|
list = ConvertUtils.sourceToTarget(data.getList(), IcMoveInRecordExcel.class); |
|
|
formDTO.setPageNo(++pageNo); |
|
|
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); |
|
|
excelWriter.write(list, writeSheet); |
|
|
excelWriter.write(list, writeSheet); |
|
|
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); |
|
|
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); |
|
|
}catch (Exception e){ |
|
|
} catch (Exception e) { |
|
|
log.error("export exception", e); |
|
|
log.error("export exception", e); |
|
|
}finally { |
|
|
} finally { |
|
|
if (excelWriter != null) { |
|
|
if (excelWriter != null) { |
|
|
excelWriter.finish(); |
|
|
excelWriter.finish(); |
|
|
} |
|
|
} |
|
@ -118,12 +117,11 @@ public class IcMoveInRecordController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@RequestMapping("detail") |
|
|
@RequestMapping("detail") |
|
|
public Result<IcMoveInListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ |
|
|
public Result<IcMoveInListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO) { |
|
|
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); |
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
return new Result<IcMoveInListResultDTO>().ok(icMoveInRecordService.detail(formDTO)); |
|
|
return new Result<IcMoveInListResultDTO>().ok(icMoveInRecordService.detail(formDTO)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|