|
@@ -5,6 +5,7 @@ import com.bz.smart_city.commom.util.FileUtil;
|
|
|
import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.commom.util.Util;
|
|
|
import com.bz.smart_city.dao.pay.PayBaseAccountMapper;
|
|
|
+import com.bz.smart_city.dao.pay.PayControlRuleMapper;
|
|
|
import com.bz.smart_city.dao.pay.PayRechargeaccountMapper;
|
|
|
import com.bz.smart_city.dao.pay.archives.PayBaseCustomerandmeterrelaMapper;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
@@ -13,6 +14,7 @@ import com.bz.smart_city.entity.Import;
|
|
|
import com.bz.smart_city.entity.Message;
|
|
|
import com.bz.smart_city.entity.Organization;
|
|
|
import com.bz.smart_city.entity.pay.PayBaseAccount;
|
|
|
+import com.bz.smart_city.entity.pay.PayControlRule;
|
|
|
import com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela;
|
|
|
import com.bz.smart_city.excel.resolver.InstallPlanResolverExcelTemplate;
|
|
|
import com.bz.smart_city.service.ImportService;
|
|
@@ -67,6 +69,8 @@ public class AsyncTaskImportService {
|
|
|
private PayBaseAccountService payBaseAccountService;
|
|
|
@Autowired
|
|
|
private InstallPlanResolverExcelTemplate installPlanResolverExcelTemplate;
|
|
|
+ @Resource
|
|
|
+ private PayControlRuleMapper payControlRuleMapper;
|
|
|
|
|
|
@Value("${files.path}")
|
|
|
private String filesPath;
|
|
@@ -131,8 +135,9 @@ public class AsyncTaskImportService {
|
|
|
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 vatnoCell = row.getCell(19);//公司税号
|
|
|
+ Cell emailCell = row.getCell(20);//电子邮箱
|
|
|
+ Cell controlCell = row.getCell(21);//阀控规则
|
|
|
Cell c_remark = row.getCell(22);//备注
|
|
|
|
|
|
if (accountnumberCell == null || StringUtils.equals("",accountnumberCell.getStringCellValue())) {
|
|
@@ -183,6 +188,7 @@ public class AsyncTaskImportService {
|
|
|
String email = emailCell.getStringCellValue().trim();
|
|
|
String housetype = housetypeCell.getStringCellValue().trim();
|
|
|
String customerGroup = customergroupCell.getStringCellValue().trim();
|
|
|
+ String contollName = controlCell.getStringCellValue().trim();
|
|
|
|
|
|
//去重
|
|
|
if(!number_maps.containsKey(accountnumber)){
|
|
@@ -240,6 +246,8 @@ public class AsyncTaskImportService {
|
|
|
PayBaseCustomerandmeterrela device = payBaseCustomerandmeterrelaMapper.getDeviceId(loginUser.getSiteId(),loginUser.getCustomerId(),metercode);
|
|
|
//根据用水性质名称寻找用水性质id
|
|
|
PayBaseCustomerandmeterrela property = payBaseCustomerandmeterrelaMapper.getWaterPropertyId(loginUser.getSiteId(),loginUser.getCustomerId(),propertyName);
|
|
|
+ //根据阀控规则名称寻找阀控ID
|
|
|
+ List<PayControlRule> contollList = payControlRuleMapper.findList(null,contollName,customerId);
|
|
|
//根据机构名称寻找机构id
|
|
|
Organization office = null;
|
|
|
if(StringUtils.isNotBlank(officeName)){
|
|
@@ -329,7 +337,9 @@ public class AsyncTaskImportService {
|
|
|
customer.setHousetype(value);//住房类型
|
|
|
value = paySysDictService.getDictValue("开户分组",customerGroup,siteId,customerId);
|
|
|
customer.setCustomergroup(value);//开户分组
|
|
|
-
|
|
|
+ customer.setValveRuleName(contollName);
|
|
|
+ customer.setValveRuleName(contollName);
|
|
|
+ customer.setValveRuleId(contollList != null && contollList.size() >0 ? String.valueOf(contollList.get(0).getId()) : "");
|
|
|
customer.setOpendate(LocalDateTime.now());
|
|
|
customer.setWaterPropertyId(property.getWaterPropertyId());
|
|
|
payBaseCustomerandmeterrelaMapper.update(customer);
|
|
@@ -378,6 +388,8 @@ public class AsyncTaskImportService {
|
|
|
customer.setCustomergroup(value);//开户分组
|
|
|
customer.setOpendate(LocalDateTime.now());
|
|
|
customer.setWaterPropertyId(property.getWaterPropertyId());
|
|
|
+ customer.setValveRuleName(contollName);
|
|
|
+ customer.setValveRuleId(contollList != null && contollList.size() >0 ? String.valueOf(contollList.get(0).getId()) : "");
|
|
|
customerList.add(customer);
|
|
|
}
|
|
|
|