|
@@ -921,6 +921,8 @@ public class AsyncTaskImportService {
|
|
|
StringBuffer messageContent = new StringBuffer();
|
|
|
messageContent.append(record.getImportFileName());
|
|
|
String msg = "";
|
|
|
+ BigInteger siteId = BigInteger.valueOf(loginUser.getSiteId());
|
|
|
+ BigInteger customerId = BigInteger.valueOf(loginUser.getCustomerId());
|
|
|
if(file != null){
|
|
|
try{
|
|
|
InputStream inputStream = new FileInputStream(record.getImportFilePath());
|
|
@@ -942,27 +944,26 @@ public class AsyncTaskImportService {
|
|
|
if(row != null){
|
|
|
|
|
|
Cell accountnumberCell = row.getCell(0);//客户编码
|
|
|
- Cell accountnameCell = row.getCell(1);//客户名称
|
|
|
- Cell telephoneCell = row.getCell(2);//手机号码
|
|
|
- Cell metercodeCell = row.getCell(3);//水表档案号
|
|
|
- Cell calculatewayCell = row.getCell(4);//结算方式
|
|
|
- Cell fixedamountCell = row.getCell(5);//固定量
|
|
|
- Cell customergroupCell = row.getCell(6);//开户分组
|
|
|
- Cell officeNameCell = row.getCell(7);//机构名称
|
|
|
- Cell propertyNameCell = row.getCell(8);//用水性质
|
|
|
- Cell idtypeCell = row.getCell(9);//证件类型
|
|
|
- Cell idcardnoCell = row.getCell(10);//证件号码
|
|
|
- Cell housetypeCell = row.getCell(11);//住房类型
|
|
|
- Cell vatnoCell = row.getCell(12);//公司税号
|
|
|
- Cell emailCell = row.getCell(13);//邮箱
|
|
|
- //Cell c_remark = row.getCell(11);//备注
|
|
|
-
|
|
|
-
|
|
|
- if (accountnumberCell == null || StringUtils.isBlank(accountnumberCell.getStringCellValue())) {
|
|
|
+ Cell metercodeCell = row.getCell(2);//水表档案号
|
|
|
+ Cell propertyNameCell = row.getCell(4);//用水性质
|
|
|
+ Cell calculatewayCell = row.getCell(6);//结算方式
|
|
|
+ Cell fixedamountCell = row.getCell(8);//固定量
|
|
|
+ Cell accountnameCell = row.getCell(9);//客户名称
|
|
|
+ Cell idtypeCell = row.getCell(10);//证件类型
|
|
|
+ Cell idcardnoCell = row.getCell(12);//证件号码
|
|
|
+ Cell telephoneCell = row.getCell(13);//手机号码
|
|
|
+ Cell officeNameCell = row.getCell(14);//机构名称
|
|
|
+ Cell housetypeCell = row.getCell(16);//住房类型
|
|
|
+ Cell customergroupCell = row.getCell(18);//开户分组
|
|
|
+ Cell vatnoCell = row.getCell(20);//公司税号
|
|
|
+ Cell emailCell = row.getCell(21);//电子邮箱
|
|
|
+ Cell c_remark = row.getCell(22);//备注
|
|
|
+
|
|
|
+ if (accountnumberCell == null || StringUtils.equals("",accountnumberCell.getStringCellValue())) {
|
|
|
//throw new ServiceException(-900, "客户编码不能为空");
|
|
|
continue;
|
|
|
}
|
|
|
- if (accountnameCell == null || StringUtils.isBlank(accountnameCell.getStringCellValue())) {
|
|
|
+ if (accountnameCell == null || StringUtils.equals("",accountnameCell.getStringCellValue())) {
|
|
|
//throw new ServiceException(-900, "客户名称不能为空");
|
|
|
continue;
|
|
|
}
|
|
@@ -991,9 +992,6 @@ public class AsyncTaskImportService {
|
|
|
//throw new ServiceException(-900, "用水性质不能为空");
|
|
|
continue;
|
|
|
}
|
|
|
- if(customergroupCell == null || StringUtils.isBlank(customergroupCell.getStringCellValue())){
|
|
|
- continue;
|
|
|
- }
|
|
|
|
|
|
String accountnumber = accountnumberCell.getStringCellValue().trim();
|
|
|
String accountname = accountnameCell.getStringCellValue().trim();
|
|
@@ -1007,6 +1005,9 @@ public class AsyncTaskImportService {
|
|
|
String telephone = telephoneCell.getStringCellValue().trim();
|
|
|
String vatno = vatnoCell.getStringCellValue().trim();
|
|
|
String email = emailCell.getStringCellValue().trim();
|
|
|
+ String housetype = housetypeCell.getStringCellValue().trim();
|
|
|
+ String customerGroup = customergroupCell.getStringCellValue().trim();
|
|
|
+
|
|
|
PayBaseCustomerandmeterrela customer = new PayBaseCustomerandmeterrela();//实例化开户实体
|
|
|
//根据客户编码寻找客户id
|
|
|
PayBaseAccount accounts = payBaseCustomerandmeterrelaMapper.getAccountId(loginUser.getSiteId(),loginUser.getCustomerId(),accountnumber);
|
|
@@ -1026,8 +1027,8 @@ public class AsyncTaskImportService {
|
|
|
|
|
|
if(property == null){
|
|
|
failTime++ ;
|
|
|
- msg +="客户编码【"+accountnumber+"】住房类型不能为空,";
|
|
|
- log.info("客户编码【"+accountnumber+"】住房类型不能为空,");
|
|
|
+ msg +="客户编码【"+accountnumber+"】用水性质不能为空,";
|
|
|
+ log.info("客户编码【"+accountnumber+"】用水性质不能为空,");
|
|
|
//c_remark.setCellValue("客户编码【"+accountnumber+"】住房类型不能为空,");
|
|
|
continue;
|
|
|
}
|
|
@@ -1077,7 +1078,7 @@ public class AsyncTaskImportService {
|
|
|
customer.setAccountnumber(accountnumber);
|
|
|
customer.setAccountname(accountname);
|
|
|
customer.setBusinessstate(1);//1已开户 2 销户 3未开户
|
|
|
- value = paySysDictService.getDictValue("结算方式",calculateway,new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("结算方式",calculateway,siteId,customerId);
|
|
|
customer.setCalculateway(value);//结算方式
|
|
|
if(value != null && value == 2){
|
|
|
if(StringUtils.isBlank(fixedamount)){
|
|
@@ -1094,9 +1095,9 @@ public class AsyncTaskImportService {
|
|
|
customer.setOfficeId(BigInteger.valueOf(office.getId()));
|
|
|
customer.setUpdateBy(loginUser.getId());
|
|
|
customer.setUpdateDate(LocalDateTime.now());
|
|
|
- value = paySysDictService.getDictValue("住房类型",housetypeCell.getStringCellValue(),new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("住房类型",housetype,siteId,customerId);
|
|
|
customer.setHousetype(value);//住房类型
|
|
|
- value = paySysDictService.getDictValue("开户分组",customergroupCell.getStringCellValue(),new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("开户分组",customerGroup,siteId,customerId);
|
|
|
customer.setCustomergroup(value);//开户分组
|
|
|
|
|
|
customer.setOpendate(LocalDateTime.now());
|
|
@@ -1118,7 +1119,7 @@ public class AsyncTaskImportService {
|
|
|
customer.setAccountname(accountname);
|
|
|
customer.setAccountnumber(accountnumber);
|
|
|
customer.setBusinessstate(1);//1已开户 2 销户 3未开户
|
|
|
- value = paySysDictService.getDictValue("结算方式",calculateway,new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("结算方式",calculateway,siteId,customerId);
|
|
|
customer.setCalculateway(value);//结算方式
|
|
|
if(value != null && value == 2){
|
|
|
if(StringUtils.isBlank(fixedamount)){
|
|
@@ -1141,9 +1142,9 @@ public class AsyncTaskImportService {
|
|
|
customer.setRemarks("");
|
|
|
customer.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
|
|
|
customer.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
|
|
|
- value = paySysDictService.getDictValue("住房类型",housetypeCell.getStringCellValue(),new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("住房类型",housetype,siteId,customerId);
|
|
|
customer.setHousetype(value);//住房类型
|
|
|
- value = paySysDictService.getDictValue("开户分组",customergroupCell.getStringCellValue(),new BigInteger(String.valueOf(loginUser.getSiteId())),new BigInteger(String.valueOf(loginUser.getCustomerId())));
|
|
|
+ value = paySysDictService.getDictValue("开户分组",customerGroup,siteId,customerId);
|
|
|
customer.setCustomergroup(value);//开户分组
|
|
|
customer.setOpendate(LocalDateTime.now());
|
|
|
customer.setWaterPropertyId(property.getWaterPropertyId());
|
|
@@ -1162,7 +1163,7 @@ public class AsyncTaskImportService {
|
|
|
PayBaseAccount saveAccount = payBaseAccountMapper.get(accounts.getId());
|
|
|
saveAccount.setName(accountnameCell.getStringCellValue());
|
|
|
if(idtype != null && idtype != ""){
|
|
|
- value = paySysDictService.getDictValue("证件类型",idtype,BigInteger.valueOf(loginUser.getSiteId()),BigInteger.valueOf(loginUser.getCustomerId()));
|
|
|
+ value = paySysDictService.getDictValue("证件类型",idtype,siteId,customerId);
|
|
|
saveAccount.setIdtype(value);
|
|
|
if(value != null && StringUtils.isBlank(idcardno)){
|
|
|
failTime++ ;
|
|
@@ -1176,8 +1177,8 @@ public class AsyncTaskImportService {
|
|
|
saveAccount.setTelephone(telephone);
|
|
|
saveAccount.setMobilephone(telephone);
|
|
|
saveAccount.setId(accounts.getId());
|
|
|
- saveAccount.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
|
|
|
- saveAccount.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
|
|
|
+ saveAccount.setSiteId(siteId);
|
|
|
+ saveAccount.setCustomerId(customerId);
|
|
|
saveAccount.setUpdateBy(BigInteger.valueOf(loginUser.getId()));
|
|
|
saveAccount.setUpdateDate(LocalDateTime.now());
|
|
|
saveAccount.setEmail(email);
|
|
@@ -1189,8 +1190,8 @@ public class AsyncTaskImportService {
|
|
|
rechargeaccountDto.setOfficeId(BigInteger.valueOf(office.getId()));
|
|
|
rechargeaccountDto.setBusinessstate(1);
|
|
|
rechargeaccountDto.setAccountname(accountname);
|
|
|
- rechargeaccountDto.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
|
|
|
- rechargeaccountDto.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
|
|
|
+ rechargeaccountDto.setSiteId(siteId);
|
|
|
+ rechargeaccountDto.setCustomerId(customerId);
|
|
|
payRechargeaccountMapper.update(rechargeaccountDto);
|
|
|
//修改水表安装信息为已开户
|
|
|
payBaseCustomerandmeterrelaMapper.updateMeterInstallOpen(2,loginUser.getUpdateBy(),LocalDateTime.now(),device.getId());
|