|
@@ -11,6 +11,7 @@ import com.fdkankan.agent.entity.Camera;
|
|
|
import com.fdkankan.agent.entity.CameraDetail;
|
|
|
import com.fdkankan.agent.exception.BusinessException;
|
|
|
import com.fdkankan.agent.request.AuthModelingParam;
|
|
|
+import com.fdkankan.agent.response.AgentNewVo;
|
|
|
import com.fdkankan.agent.service.*;
|
|
|
import com.fdkankan.agent.util.ExcelErrorUtil;
|
|
|
import com.fdkankan.agent.util.ExcelUtil;
|
|
@@ -47,6 +48,8 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
ICameraDetailService cameraDetailService;
|
|
|
@Autowired
|
|
|
IAgentAuthorizeModelingService agentAuthorizeModelingService;
|
|
|
+ @Autowired
|
|
|
+ IAgentNewService agentNewService;
|
|
|
|
|
|
public void commonExport(HttpServletRequest request, HttpServletResponse response,String name,List<?> result,ExcelWriter excelWriter) throws Exception {
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
@@ -148,7 +151,7 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
if(!mapt.equals(map1)){
|
|
|
throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
|
|
|
}
|
|
|
-
|
|
|
+ HashMap<String,AgentNewVo> agentMap = new HashMap<>();
|
|
|
List<Integer> errorIndex = new ArrayList<>();
|
|
|
List<AuthModelingParam> params = new ArrayList();
|
|
|
HashSet<String> authSet = new HashSet<>();
|
|
@@ -162,18 +165,15 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- String authSn = map.get(0);
|
|
|
- String type = map.get(1);
|
|
|
- String createDate = map.get(2);
|
|
|
- String activated = map.get(3);
|
|
|
- String activateDate = map.get(4);
|
|
|
- String disabled = map.get(5);
|
|
|
- String transfer = map.get(6);
|
|
|
- String borrow = map.get(7);
|
|
|
- String startDate = map.get(8);
|
|
|
- String endDate = map.get(9);
|
|
|
- String expirationDay = map.get(10);
|
|
|
- if(StringUtils.isBlank(authSn) ){
|
|
|
+ String customerAccount = map.get(0);
|
|
|
+ String endCustomer = map.get(1);
|
|
|
+ String authSn = map.get(2);
|
|
|
+ String distributorName = map.get(3);
|
|
|
+ String createDate = map.get(4);
|
|
|
+ String acitvated = map.get(5);
|
|
|
+ String activateDate = map.get(6);
|
|
|
+ String expirationDay = map.get(7);
|
|
|
+ if(StringUtils.isBlank(authSn) || StringUtils.isBlank(customerAccount) || StringUtils.isBlank(endCustomer) || StringUtils.isBlank(activateDate) || StringUtils.isBlank(expirationDay)){
|
|
|
log.info("数据错误:{}",map);
|
|
|
errorIndex.add(index);
|
|
|
continue;
|
|
@@ -195,9 +195,24 @@ public class ExcelServiceImpl implements IExcelService {
|
|
|
errorIndex.add(index);
|
|
|
continue;
|
|
|
}
|
|
|
+ param.setCreateAgentId(agentId);
|
|
|
+ if(StringUtils.isNotBlank(distributorName)){
|
|
|
+ AgentNewVo agentNewVo;
|
|
|
+ if(agentMap.containsKey(distributorName)){
|
|
|
+ agentNewVo = agentMap.get(distributorName);
|
|
|
+ }else {
|
|
|
+ agentNewVo =agentNewService.getByUserName(distributorName);
|
|
|
+ agentMap.put(distributorName,agentNewVo);
|
|
|
+ }
|
|
|
+ if(agentNewVo!=null){
|
|
|
+ param.setAgentId(agentNewVo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
authSet.add(authSn);
|
|
|
param.setAuthCode(authSn);
|
|
|
- param.setAgentId(agentId);
|
|
|
+ param.setCustomerAccount(customerAccount);
|
|
|
+ param.setEndCustomer(endCustomer);
|
|
|
params.add(param);
|
|
|
|
|
|
}
|