Commit 5bfe2bfc authored by fangxinjiang's avatar fangxinjiang

公積金批量导入办理

parent 3691d45c
......@@ -153,5 +153,6 @@ public class ExcelAttributeConstants {
public static final String CUSTOMER = "customer";
public static final String HOUSEHOLD = "household";
// 派单办理失败类型
public static final String DISPATCH_HANDLE_REASON = "dispatch-audit-add-reason";
}
......@@ -65,14 +65,14 @@ public class FundImportHandleVo extends RowIndex implements Serializable {
/**
* 办理意见
*/
@ExcelAttribute(name = "办理意见")
@ExcelAttribute(name = "办理意见",maxLength = 150,errorInfo = "办理意见长度不可超过150!")
@Schema(description = "办理意见" )
@ExcelProperty("办理意见" )
@ExcelProperty("办理意见")
private String remark;
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型")
@ExcelAttribute(name = "失败类型",isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.DISPATCH_HANDLE_REASON)
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
......
......@@ -643,7 +643,7 @@ public class TDispatchInfoController {
@Operation(summary = "单个派增 权限:social_dispatchinfo_add", description = "单个派增")
@PostMapping("/fundImportHandle")
//@PreAuthorize("@pms.hasPermission('fund_import_handle')")
public R<List<ErrorMessage>> fundImportHandle(@RequestBody MultipartFile file) {
public R<List<ErrorMessage>> fundImportHandle(@RequestBody MultipartFile file, @RequestParam(required = true)String mId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)) {
return R.failed(CommonConstants.USER_FAIL);
......@@ -659,7 +659,16 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.fundImportHandle(file.getInputStream());
TDispatchInfo tDispatchInfo = new TDispatchInfo();
tDispatchInfo.setMId(mId);
tDispatchInfo.setMenuInfo(mId);
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
tDispatchInfo.setCreateBy(user.getId());
return tDispatchInfoService.fundImportHandle(file.getInputStream(),tDispatchInfo);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......
......@@ -111,7 +111,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
**/
R<List<ErrorMessage>> dispatchAdd(TDispatchImportVo importVo);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo);
R<Boolean> updateExportSocialFlagById(String id,String status);
......
......@@ -5024,7 +5024,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream) {
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -5075,7 +5075,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
fundImportHandle(cachedDataList, errorMessageList,user);
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5093,7 +5093,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,TDispatchInfo dispatchInfo) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5103,6 +5103,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
String handleStatus = "2";
SocialHandleSearchVo tDispatchInfo = new SocialHandleSearchVo();
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
tDispatchInfo.setAuthSql(dispatchInfo.getAuthSql());
tDispatchInfo.setCreateBy(dispatchInfo.getCreateBy());
tDispatchInfo.setMId(dispatchInfo.getMId());
tDispatchInfo.setMenuInfo(dispatchInfo.getMenuInfo());
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
......@@ -5133,6 +5137,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.ZERO_STRING.equals(excel.getHandleStatus())) {
flag = CommonConstants.ZERO_INT;
handleStatus = CommonConstants.ONE_STRING;
excel.setReasonType(CommonConstants.EMPTY_STRING);
}
if (CommonConstants.ONE_STRING.equals(excel.getHandleStatus())) {
flag = CommonConstants.ONE_INT;
......@@ -5143,10 +5148,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.FUND_IMPORT_HANDLE_NOT_EXITS),excel));
continue;
}
if (Common.isEmpty(excel.getRemark())){
excel.setRemark(CommonConstants.EMPTY_STRING);
}
try {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ONE_STRING, user
, flag, handleStatus, excel.getReasonType(), null, excel.getReasonType()+CommonConstants.COLON_STRING+excel.getRemark());
, flag, handleStatus, (Common.isEmpty(excel.getReasonType())?"":excel.getReasonType()+CommonConstants.COLON_STRING)
+excel.getRemark(), null, excel.getReasonType());
if (Common.isNotNull(messageList)){
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment