Commit 2a002ab4 authored by hongguangwu's avatar hongguangwu

MVP1.5.2-派单相关

parent 9991dbb0
......@@ -112,11 +112,11 @@ public class TDispatchInfo extends BaseEntity {
/**
* 员工电话 (手机号码)
*/
@Length(max = 32, message = "员工电话 不能超过32个字符" )
@ExcelAttribute(name = "员工电话", maxLength = 32)
@Schema(description = "员工电话" )
@Length(max = 32, message = "手机号码 不能超过32个字符" )
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工电话" )
@ExcelProperty("手机号码" )
private String empMobile;
/**
* 民族
......
......@@ -69,6 +69,13 @@ public class FundHandleExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码" )
private String empMobile;
@ExcelAttribute(name = "身份证所在地")
@Schema(description = "身份证所在地" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证所在地" )
private String idCardAddress;
/**
* 创建人姓名
*/
......
......@@ -153,6 +153,13 @@ public class SocialHandleExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码" )
private String empMobile;
@ExcelAttribute(name = "身份证所在地")
@Schema(description = "身份证所在地" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证所在地" )
private String idCardAddress;
/**
* 户口性质
*/
......
......@@ -76,6 +76,18 @@ public class TDispatchAuditExportVo {
@ExcelProperty("项目名称")
private String settleDomainName;
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码" )
private String empMobile;
@ExcelAttribute(name = "身份证所在地")
@Schema(description = "身份证所在地" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证所在地" )
private String idCardAddress;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Schema(description = "社保户")
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -33,6 +33,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* 派单信息记录表
*
......@@ -61,7 +63,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
@ShardingTransactionType(TransactionType.BASE)
void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user, String orderId);
YifuUser user, String orderId, Map<String, String> idCardMap);
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream, String orderId);
......
......@@ -344,6 +344,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TDispatchImportVo> util1 = new ExcelUtil<>(TDispatchImportVo.class);
Map<String, String> idCardMap = new HashMap<>();
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
......@@ -385,20 +386,23 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTDispatchInfo(cachedDataList, errorMessageList,user,orderId);
importTDispatchInfo(cachedDataList, errorMessageList,user,orderId, idCardMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
} finally {
Common.clear(idCardMap);
}
return this.judgeAllMessage(errorMessageList);
}
@Override
public void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user, String orderId) {
YifuUser user, String orderId,
Map<String, String> idCardMap) {
if (!Common.isNotNull(excelVOList)){
return;
}
......@@ -452,6 +456,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
injury =false;
empVo = null;
excel = excelVOList.get(i);
if (idCardMap.get(excel.getEmpIdcard()) != null) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "身份证【"+ excel.getEmpIdcard() +"】与第"+ idCardMap.get(excel.getEmpIdcard()) +"行重复,未导入"));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
idCardMap.put(excel.getEmpIdcard(), idCardMap.get(excel.getEmpIdcard()) + "、" + excel.getRowIndex());
continue;
} else {
idCardMap.put(excel.getEmpIdcard(), String.valueOf(excel.getRowIndex()));
}
fundSet = fundHoldMap.get(excel.getProvidentHousehold());
socialSet = socialHoldMap.get(excel.getSocialHousehold());
socialFund = getSocialFund(socialFundMap,excel);
......
......@@ -382,7 +382,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
// 档案地市没问题 开始派单处理
if (errorMessageList.size() == CommonConstants.ZERO_INT) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null);
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>());
}
// 处理派增结果
errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
......@@ -2544,7 +2544,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
// 档案地市没问题 开始派单处理
if (!Common.isNotNull(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null);
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>());
}
// 处理派增结果
handleDispatchAddRes(pre, errorMessageList);
......
......@@ -178,6 +178,9 @@
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="belongUnitName" column="BELONG_UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="type" column="TYPE"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
......@@ -815,6 +818,8 @@
select
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_MOBILE,
a.ID_CARD_ADDRESS,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.TYPE,
......@@ -877,6 +882,7 @@
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="empNational" column="EMP_NATIONAL"/>
<result property="type" column="TYPE"/>
<result property="settleDomain" column="SETTLE_DOMAIN_NAME"/>
......@@ -924,6 +930,7 @@
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
<result property="settleDomain" column="SETTLE_DOMAIN_NAME"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="createUserName" column="CREATE_NAME"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
......@@ -966,6 +973,7 @@
a.EMP_TYPE,
a.POST,
a.EMP_MOBILE,
a.ID_CARD_ADDRESS,
a.EMP_REGIS_TYPE,
a.EMP_NATIONAL,
a.WORKING_HOURS,
......@@ -1040,6 +1048,7 @@
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.EMP_MOBILE,
a.ID_CARD_ADDRESS,
a.CREATE_NAME,
a.PROVIDENT_HOUSEHOLD_NAME,
......
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