|
@@ -5,9 +5,11 @@ import com.alibaba.excel.ExcelWriter;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
import com.fdkankan.manage.common.ExcelErrorUtil;
|
|
import com.fdkankan.manage.common.ExcelErrorUtil;
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
|
+import com.fdkankan.manage.entity.AgentNew;
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.constant.CameraOutTypeEnum;
|
|
import com.fdkankan.manage.constant.CameraOutTypeEnum;
|
|
import com.fdkankan.manage.entity.Company;
|
|
import com.fdkankan.manage.entity.Company;
|
|
|
|
+import com.fdkankan.manage.service.IAgentNewService;
|
|
import com.fdkankan.manage.service.ICameraService;
|
|
import com.fdkankan.manage.service.ICameraService;
|
|
import com.fdkankan.manage.service.ICompanyService;
|
|
import com.fdkankan.manage.service.ICompanyService;
|
|
import com.fdkankan.manage.service.IExcelService;
|
|
import com.fdkankan.manage.service.IExcelService;
|
|
@@ -41,6 +43,8 @@ public class ExcelServiceImpl implements IExcelService {
|
|
ICompanyService companyService;
|
|
ICompanyService companyService;
|
|
@Autowired
|
|
@Autowired
|
|
ICameraService cameraService;
|
|
ICameraService cameraService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IAgentNewService agentNewService;
|
|
|
|
|
|
public void commonExport(HttpServletRequest request, HttpServletResponse response,String name,List<?> result,ExcelWriter excelWriter) throws Exception {
|
|
public void commonExport(HttpServletRequest request, HttpServletResponse response,String name,List<?> result,ExcelWriter excelWriter) throws Exception {
|
|
response.setContentType("application/vnd.ms-excel");
|
|
response.setContentType("application/vnd.ms-excel");
|
|
@@ -116,6 +120,7 @@ public class ExcelServiceImpl implements IExcelService {
|
|
String outTypeString = map.get(1);
|
|
String outTypeString = map.get(1);
|
|
String companyName = map.get(2);
|
|
String companyName = map.get(2);
|
|
String orderSn = map.get(3);
|
|
String orderSn = map.get(3);
|
|
|
|
+ String agentName = map.get(2);
|
|
CameraOutTypeEnum outTypeEnum = CameraOutTypeEnum.getByMsg(outTypeString);
|
|
CameraOutTypeEnum outTypeEnum = CameraOutTypeEnum.getByMsg(outTypeString);
|
|
if(outTypeEnum == null || StringUtils.isBlank(snCode)){
|
|
if(outTypeEnum == null || StringUtils.isBlank(snCode)){
|
|
errorIndex.add(index -3);
|
|
errorIndex.add(index -3);
|
|
@@ -125,6 +130,14 @@ public class ExcelServiceImpl implements IExcelService {
|
|
int outType = outTypeEnum.getCode();
|
|
int outType = outTypeEnum.getCode();
|
|
param.setOutType(outType);
|
|
param.setOutType(outType);
|
|
}
|
|
}
|
|
|
|
+ if(StringUtils.isNotBlank(agentName)){
|
|
|
|
+ AgentNew agentNew = agentNewService.getByName(agentName);
|
|
|
|
+ if(agentNew == null){
|
|
|
|
+ errorIndex.add(index -3);
|
|
|
|
+ }else {
|
|
|
|
+ param.setAgentId(agentNew.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
param.setCompanyName(companyName);
|
|
param.setCompanyName(companyName);
|
|
param.setOrderSn(orderSn);
|
|
param.setOrderSn(orderSn);
|
|
param.setSnCode(snCode);
|
|
param.setSnCode(snCode);
|