Commit 02d0d673 by lzxry
parent ae5d5155
...@@ -135,9 +135,11 @@ public class ContractController { ...@@ -135,9 +135,11 @@ public class ContractController {
//创建工作表的行 //创建工作表的行
HSSFRow row = sheet.createRow(0); HSSFRow row = sheet.createRow(0);
List<String> title = Arrays.asList("录入时间,合同编号,客户账号,我方签约主体,签约方,行业分类,销售,开始日期,结束日期,套餐类型,合同金额,签约类型,合同状态,回款状态,关联合同" List<String> title = Arrays.asList("录入时间,合同编号,客户账号,我方签约主体,签约方,行政区域,隶属集团,行业分类,销售,开始日期,结束日期,套餐类型,合同金额,签约类型,合同状态,回款状态,关联合同"
.split(",")); .split(","));
if(platform.equals("tkio")){
title.add("总点击次数(万次)");
}
int lineSize = title.size(); int lineSize = title.size();
for (int i = 0; i < lineSize; i++) { for (int i = 0; i < lineSize; i++) {
row.createCell(i).setCellValue(title.get(i)); row.createCell(i).setCellValue(title.get(i));
...@@ -151,16 +153,22 @@ public class ContractController { ...@@ -151,16 +153,22 @@ public class ContractController {
rowBody.createCell(2).setCellValue(contract.getEmail() == null ? "无" : contract.getEmail()); rowBody.createCell(2).setCellValue(contract.getEmail() == null ? "无" : contract.getEmail());
rowBody.createCell(3).setCellValue(contract.getMyBodyName()); rowBody.createCell(3).setCellValue(contract.getMyBodyName());
rowBody.createCell(4).setCellValue(contract.getCustomerBody()); rowBody.createCell(4).setCellValue(contract.getCustomerBody());
rowBody.createCell(5).setCellValue(contract.getTradeName()); rowBody.createCell(5).setCellValue(contract.getBarrioName());
rowBody.createCell(6).setCellValue(contract.getSaleName()); rowBody.createCell(6).setCellValue(contract.getBelongGroup());
rowBody.createCell(7).setCellValue(contract.getStartDate()); rowBody.createCell(7).setCellValue(contract.getTradeName());
rowBody.createCell(8).setCellValue(contract.getEndDate()); rowBody.createCell(8).setCellValue(contract.getSaleName());
rowBody.createCell(9).setCellValue(contract.getPriceLevelName()); rowBody.createCell(9).setCellValue(contract.getStartDate());
rowBody.createCell(10).setCellValue(contract.getMoney()); rowBody.createCell(10).setCellValue(contract.getEndDate());
rowBody.createCell(11).setCellValue(CONTRACT_STATUS.get(contract.getContractType())); rowBody.createCell(11).setCellValue(contract.getPriceLevelName());
rowBody.createCell(12).setCellValue(CONTRACT_STATUS.get(contract.getStatus())); rowBody.createCell(12).setCellValue(contract.getMoney());
rowBody.createCell(13).setCellValue(CONTRACT_STATUS.get(contract.getBackStatus() + "_back")); rowBody.createCell(13).setCellValue(CONTRACT_STATUS.get(contract.getContractType()));
rowBody.createCell(14).setCellValue(contract.getRelationCode() == null ? "" : contract.getRelationCode()); rowBody.createCell(14).setCellValue(CONTRACT_STATUS.get(contract.getStatus()));
rowBody.createCell(15).setCellValue(CONTRACT_STATUS.get(contract.getBackStatus() + "_back"));
rowBody.createCell(16).setCellValue(contract.getRelationCode() == null ? "" : contract.getRelationCode());
if(platform.equals("tkio")){
rowBody.createCell(17).setCellValue(contract.getTrackFlow());
}
} }
...@@ -484,42 +492,17 @@ public class ContractController { ...@@ -484,42 +492,17 @@ public class ContractController {
List<Contract> contracts = shareIncomeService.shareIncomeList(loginAccount, startDate, endDate, platform, bodyCode, serchName); List<Contract> contracts = shareIncomeService.shareIncomeList(loginAccount, startDate, endDate, platform, bodyCode, serchName);
//byte[] content = new byte[0]; //byte[] content = new byte[0];
DecimalFormat df = new DecimalFormat("##,##0.00");
//StringBuilder sb = new StringBuilder(); //StringBuilder sb = new StringBuilder();
/*sb.append("我方签约主体,签约方,合同编号,合同金额,不含税收入,合同开始时间,合同截止时间,区间使用天数,区间分摊收入,调整额,分摊总收入\r\n");*/ /*sb.append("我方签约主体,签约方,合同编号,合同金额,不含税收入,合同开始时间,合同截止时间,区间使用天数,区间分摊收入,调整额,分摊总收入\r\n");*/
//sb.append("我方签约主体,签约方,合同编号,合同状态,合同金额,不含税收入,合同开始日期,合同截止日期,区间使用天数,区间分摊收入,调整额,分摊总收入\r\n"); //sb.append("我方签约主体,签约方,合同编号,合同状态,合同金额,不含税收入,合同开始日期,合同截止日期,区间使用天数,区间分摊收入,调整额,分摊总收入\r\n");
HSSFWorkbook workbook;
//创建工作薄对象 if(platform.equals("tkio")){
HSSFWorkbook workbook = new HSSFWorkbook();//这里也可以设置sheet的Name workbook = createTKIOExcel(contracts);
//创建工作表对象 }else{
HSSFSheet sheet = workbook.createSheet(); workbook = createCommonExcel(contracts);
//创建工作表的行
HSSFRow row = sheet.createRow(0);
List<String> title = Arrays.asList("我方签约主体,签约方,合同编号,合同状态,合同金额,不含税收入,合同开始日期,合同截止日期,区间使用天数,区间分摊收入,调整额,分摊总收入"
.split(","));
int lineSize = title.size();
for (int i = 0; i < lineSize; i++) {
row.createCell(i).setCellValue(title.get(i));
} }
for (int i = 0; i < contracts.size(); i++) {
Contract contract = contracts.get(i);
HSSFRow rowBody = sheet.createRow(i + 1);
rowBody.createCell(0).setCellValue(contract.getMyBodyName());
rowBody.createCell(1).setCellValue(contract.getCustomerBody());
rowBody.createCell(2).setCellValue(contract.getContractCode());
rowBody.createCell(3).setCellValue(CONTRACT_STATUS.get(contract.getStatus()));
rowBody.createCell(4).setCellValue(df.format(contract.getMoney()));
rowBody.createCell(5).setCellValue(df.format(contract.getIncomeExcludingTax() * 1.0 / 100));
rowBody.createCell(6).setCellValue(contract.getStartDate());
rowBody.createCell(7).setCellValue(contract.getEndDate());
rowBody.createCell(8).setCellValue(contract.getIntervalUseDays());
rowBody.createCell(9).setCellValue(df.format(contract.getIntervaIncomeShare() * 1.0 / 100));
rowBody.createCell(10).setCellValue(df.format(contract.getAdjustmentFund() * 1.0 / 100));
rowBody.createCell(11).setCellValue(df.format(contract.getIncomeShareAll() * 1.0 / 100));
}
String fileName = "分摊收入报表_" + new DateTime(startDate).toString("yyyyMMdd") String fileName = "分摊收入报表_" + new DateTime(startDate).toString("yyyyMMdd")
+ "_" + new DateTime(endDate).toString("yyyyMMdd") + ".xls"; + "_" + new DateTime(endDate).toString("yyyyMMdd") + ".xls";
...@@ -550,6 +533,85 @@ public class ContractController { ...@@ -550,6 +533,85 @@ public class ContractController {
} }
private HSSFWorkbook createCommonExcel(List<Contract> contracts){
DecimalFormat df = new DecimalFormat("##,##0.00");
//创建工作薄对象
HSSFWorkbook workbook = new HSSFWorkbook();//这里也可以设置sheet的Name
//创建工作表对象
HSSFSheet sheet = workbook.createSheet();
//创建工作表的行
HSSFRow row = sheet.createRow(0);
List<String> title = Arrays.asList("我方签约主体,签约方,合同编号,行政区域,隶属集团,合同状态,合同金额,不含税收入,合同开始日期,合同截止日期,区间使用天数,区间分摊收入,调整额,分摊总收入"
.split(","));
int lineSize = title.size();
for (int i = 0; i < lineSize; i++) {
row.createCell(i).setCellValue(title.get(i));
}
for (int i = 0; i < contracts.size(); i++) {
Contract contract = contracts.get(i);
HSSFRow rowBody = sheet.createRow(i + 1);
rowBody.createCell(0).setCellValue(contract.getMyBodyName());
rowBody.createCell(1).setCellValue(contract.getCustomerBody());
rowBody.createCell(2).setCellValue(contract.getContractCode());
rowBody.createCell(3).setCellValue(contract.getBarrioName());
rowBody.createCell(4).setCellValue(contract.getBelongGroup());
rowBody.createCell(5).setCellValue(CONTRACT_STATUS.get(contract.getStatus()));
rowBody.createCell(6).setCellValue(df.format(contract.getMoney()));
rowBody.createCell(7).setCellValue(df.format(contract.getIncomeExcludingTax() * 1.0 / 100));
rowBody.createCell(8).setCellValue(contract.getStartDate());
rowBody.createCell(9).setCellValue(contract.getEndDate());
rowBody.createCell(10).setCellValue(contract.getIntervalUseDays());
rowBody.createCell(11).setCellValue(df.format(contract.getIntervaIncomeShare() * 1.0 / 100));
rowBody.createCell(12).setCellValue(df.format(contract.getAdjustmentFund() * 1.0 / 100));
rowBody.createCell(13).setCellValue(df.format(contract.getIncomeShareAll() * 1.0 / 100));
}
return workbook;
}
private HSSFWorkbook createTKIOExcel(List<Contract> contracts){
DecimalFormat df = new DecimalFormat("##,##0.00");
DecimalFormat df2 = new DecimalFormat("##,##0.0000");
//创建工作薄对象
HSSFWorkbook workbook = new HSSFWorkbook();//这里也可以设置sheet的Name
//创建工作表对象
HSSFSheet sheet = workbook.createSheet();
//创建工作表的行
HSSFRow row = sheet.createRow(0);
List<String> title = Arrays.asList("我方签约主体,签约方,合同编号,行政区域,隶属集团,合同开始日期,合同截止日期,合同状态,合同金额(元),总点击次数(万次),单价(元/万次),区间点击数(万次),区间分摊收入(元),区间调整金额(元),区间总收入(元),累计总收入(元),赠送点击量(万次)"
.split(","));
int lineSize = title.size();
for (int i = 0; i < lineSize; i++) {
row.createCell(i).setCellValue(title.get(i));
}
for (int i = 0; i < contracts.size(); i++) {
Contract contract = contracts.get(i);
HSSFRow rowBody = sheet.createRow(i + 1);
rowBody.createCell(0).setCellValue(contract.getMyBodyName());
rowBody.createCell(1).setCellValue(contract.getCustomerBody());
rowBody.createCell(2).setCellValue(contract.getContractCode());
rowBody.createCell(3).setCellValue(contract.getBarrioName());
rowBody.createCell(4).setCellValue(contract.getBelongGroup());
rowBody.createCell(5).setCellValue(contract.getStartDate());
rowBody.createCell(6).setCellValue(contract.getEndDate());
rowBody.createCell(7).setCellValue(CONTRACT_STATUS.get(contract.getStatus()));
rowBody.createCell(8).setCellValue(df.format(contract.getMoney()));
rowBody.createCell(9).setCellValue(contract.getTrackFlow());
rowBody.createCell(10).setCellValue(contract.getUnitPrice());
rowBody.createCell(11).setCellValue(contract.getClickFlow());
rowBody.createCell(12).setCellValue(df.format(contract.getIntervaIncomeShare() / 100.0));
rowBody.createCell(13).setCellValue(df.format(contract.getAdjustmentFund() / 100.0));
rowBody.createCell(14).setCellValue(df.format(contract.getIncomeShareAll() / 100.0));
rowBody.createCell(15).setCellValue(df.format(contract.getIncomeGross() / 100.0));
rowBody.createCell(16).setCellValue(df2.format(contract.getExtraFlow() / 10000.0));
}
return workbook;
}
private void exportWrite(String fileName, HSSFWorkbook workbook, String exportName, HttpServletResponse response) { private void exportWrite(String fileName, HSSFWorkbook workbook, String exportName, HttpServletResponse response) {
OutputStream os = null; OutputStream os = null;
try { try {
......
...@@ -99,22 +99,22 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -99,22 +99,22 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select contract_code,my_body_code,sale,platform from contract where contract_code in ?1", nativeQuery = true) @Query(value = "select contract_code,my_body_code,sale,platform from contract where contract_code in ?1", nativeQuery = true)
List<Object[]> findByContractCode(List<String> codesList); List<Object[]> findByContractCode(List<String> codesList);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate3(String startDate, String endDate, String platform); List<Contract> findShareContranctByDate3(String startDate, String endDate, String platform);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate2(String startDate, String endDate, String platform, String bodyCode); List<Contract> findShareContranctByDate2(String startDate, String endDate, String platform, String bodyCode);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%) and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%) and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateSerche(String startDate, String endDate, String platform, String serchName); List<Contract> findShareContranctByDateSerche(String startDate, String endDate, String platform, String serchName);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%) and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%) and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate1(String startDate, String endDate, String platform, String bodyCode, String serchName); List<Contract> findShareContranctByDate1(String startDate, String endDate, String platform, String bodyCode, String serchName);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5 and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateSercheFinace(String startDate, String endDate, String platform, String serchName, List<String> financeBodies); List<Contract> findShareContranctByDateSercheFinace(String startDate, String endDate, String platform, String serchName, List<String> financeBodies);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code in ?4 and status!='del' and share_sign <> 0 ", nativeQuery = true) @Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code in ?4 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateFinace(String startDate, String endDate, String platform, List<String> financeBodies); List<Contract> findShareContranctByDateFinace(String startDate, String endDate, String platform, List<String> financeBodies);
@Query(value = "select contract_code from contract where customer_body =?1 and contract_code <> ?2 and status in ('backfirst','normal','late') limit 3 ", nativeQuery = true) @Query(value = "select contract_code from contract where customer_body =?1 and contract_code <> ?2 and status in ('backfirst','normal','late') limit 3 ", nativeQuery = true)
......
...@@ -82,8 +82,11 @@ public class ContractServiceImpl implements ContractService { ...@@ -82,8 +82,11 @@ public class ContractServiceImpl implements ContractService {
private static final Map<String, String> SHEET_TITLE = new HashMap() {{ private static final Map<String, String> SHEET_TITLE = new HashMap() {{
put("我方签约主体", "my_body_name"); put("我方签约主体", "my_body_name");
put("客户签约主体", "customer_body"); put("客户签约主体", "customer_body");
put("行政区域", "barrio_id");
put("隶属集团", "belong_group");
put("行业分类", "trade_type"); put("行业分类", "trade_type");
put("合同金额", "money"); put("合同金额", "money");
put("总点击次数", "track_flow");
put("客户主账号", "email"); put("客户主账号", "email");
put("合同编号", "contract_code"); put("合同编号", "contract_code");
put("签约类型", "contract_type"); put("签约类型", "contract_type");
...@@ -97,8 +100,11 @@ public class ContractServiceImpl implements ContractService { ...@@ -97,8 +100,11 @@ public class ContractServiceImpl implements ContractService {
private static final Map<String, String> SHEET_TITLE_RESERVE = new HashMap() {{ private static final Map<String, String> SHEET_TITLE_RESERVE = new HashMap() {{
put("my_body_name", "我方签约主体"); put("my_body_name", "我方签约主体");
put("customer_body", "客户签约主体"); put("customer_body", "客户签约主体");
put("barrio_id", "行政区域");
put("belong_group", "隶属集团");
put("trade_type", "行业分类"); put("trade_type", "行业分类");
put("money", "合同金额"); put("money", "合同金额");
put("track_flow", "总点击次数");
put("email", "客户主账号"); put("email", "客户主账号");
put("contract_code", "合同编号"); put("contract_code", "合同编号");
put("contract_type", "签约类型"); put("contract_type", "签约类型");
...@@ -2218,7 +2224,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -2218,7 +2224,12 @@ public class ContractServiceImpl implements ContractService {
public ResultModel uploadBatchInfo(MultipartFile file, String platform) { public ResultModel uploadBatchInfo(MultipartFile file, String platform) {
InputStream stream = null; InputStream stream = null;
try { try {
int row_length = 11; int row_length;
if(platform.equals("tkio")){
row_length = 14;
}else{
row_length = 13;
}
stream = file.getInputStream(); stream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(stream); Workbook workbook = WorkbookFactory.create(stream);
// Iterator<Sheet> sheetIter = workbook.sheetIterator(); // Iterator<Sheet> sheetIter = workbook.sheetIterator();
...@@ -2262,7 +2273,13 @@ public class ContractServiceImpl implements ContractService { ...@@ -2262,7 +2273,13 @@ public class ContractServiceImpl implements ContractService {
.stream().collect(Collectors.toMap(TradeType::getName, TradeType::getId)); .stream().collect(Collectors.toMap(TradeType::getName, TradeType::getId));
Map<String, Long> salseMap = salesRepository.findSaleByStatus(0) Map<String, Long> salseMap = salesRepository.findSaleByStatus(0)
.stream().collect(Collectors.toMap(Sales::getName, Sales::getId)); .stream().collect(Collectors.toMap(Sales::getName, Sales::getId));
Map<String, Long> packageMap = null;
Map<String, Long> packageMap = packageBaseRepository.findByPlatAndStatus(platform, 1)
.stream().collect(Collectors.toMap(PackageBase::getPackageName, PackageBase::getId));
Map<Long, BarrioCity> barrioCityMap = barrioCityRepository.findAll()
.stream().collect(Collectors.toMap(BarrioCity::getId, Function.identity()));
/*Map<String, Long> packageMap = null;
if ("tkio".equals(platform) || "io".equals(platform)) { if ("tkio".equals(platform) || "io".equals(platform)) {
packageMap = packageTypeRepository.findIsNewAll() packageMap = packageTypeRepository.findIsNewAll()
...@@ -2270,7 +2287,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -2270,7 +2287,7 @@ public class ContractServiceImpl implements ContractService {
} else { } else {
packageMap = packageBaseRepository.findByPlatAndStatus(platform, 1) packageMap = packageBaseRepository.findByPlatAndStatus(platform, 1)
.stream().collect(Collectors.toMap(PackageBase::getPackageName, PackageBase::getId)); .stream().collect(Collectors.toMap(PackageBase::getPackageName, PackageBase::getId));
} }*/
Map<String, String> cBodyMap = null; Map<String, String> cBodyMap = null;
if ("abtest".equals(platform) || "ads".equals(platform)) { if ("abtest".equals(platform) || "ads".equals(platform)) {
...@@ -2286,6 +2303,10 @@ public class ContractServiceImpl implements ContractService { ...@@ -2286,6 +2303,10 @@ public class ContractServiceImpl implements ContractService {
if (!parseRowData(row, row_length, null, titleKey)) { if (!parseRowData(row, row_length, null, titleKey)) {
return ResultModel.ERROR(ResultStatus.FORMAT_FILE_ERRO); return ResultModel.ERROR(ResultStatus.FORMAT_FILE_ERRO);
} }
if(!platform.equals("tkio")){
titleKey.remove("总点击次数");
titleKey.remove("track_flow");
}
int row_already = titleKey.size(); int row_already = titleKey.size();
String extend_row_sql = "platform,product,my_body_code,create_time,code_num,type,status,back_status,ds," + String extend_row_sql = "platform,product,my_body_code,create_time,code_num,type,status,back_status,ds," +
...@@ -2360,11 +2381,15 @@ public class ContractServiceImpl implements ContractService { ...@@ -2360,11 +2381,15 @@ public class ContractServiceImpl implements ContractService {
s_data[w] = CONTRACT_TYPE_NAME.get(dataSTR); s_data[w] = CONTRACT_TYPE_NAME.get(dataSTR);
} }
} else if ("price_level".equals(sheetTitle)) { } else if ("price_level".equals(sheetTitle)) {
if (packageMap != null && !packageMap.containsKey(dataSTR)) { if (packageMap != null && (!packageMap.containsKey(dataSTR) && !packageMap.containsValue(Long.parseLong(dataSTR)))) {
return ResultModel.ERROR("第" + line_num + "行【套餐】错误"); return ResultModel.ERROR("第" + line_num + "行【套餐】错误");
} else { } else {
if(platform.equals("tkio")){
s_data[w] = dataSTR;
}else{
s_data[w] = packageMap.get(dataSTR); s_data[w] = packageMap.get(dataSTR);
} }
}
} else if ("start_date".equals(sheetTitle) || "end_date".equals(sheetTitle)) { } else if ("start_date".equals(sheetTitle) || "end_date".equals(sheetTitle)) {
String dfmate = cell.getCellStyle().getDataFormatString(); String dfmate = cell.getCellStyle().getDataFormatString();
...@@ -2394,6 +2419,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -2394,6 +2419,12 @@ public class ContractServiceImpl implements ContractService {
} else if ("money".equals(sheetTitle)) { } else if ("money".equals(sheetTitle)) {
s_data[w] = dataSTR.replace(",", ""); s_data[w] = dataSTR.replace(",", "");
} else if ("barrio_id".equals(sheetTitle)) {
if(barrioCityMap.containsKey(Long.parseLong(dataSTR))){
s_data[w] = dataSTR;
}else{
return ResultModel.ERROR("第" + line_num + "行【行政区域】code错误");
}
} else { } else {
s_data[w] = dataSTR; s_data[w] = dataSTR;
......
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