Commit c64a51d9 by lzxry

ip发送日导入判断

parent d233581e
......@@ -2704,9 +2704,11 @@ public class ContractServiceImpl implements ContractService {
}else if("one_time".equals(sheetTitle)){
if(dataSTR.equals("否")){
s_data[w] = false;
filter.put("validStartDate",formatter.formatCellValue(row_data.getCell(14)).trim());
}else{
s_data[w] = true;
}
filter.put("one_time",dataSTR);
}else {
//主账号不为空,按照之前逻辑不变
s_data[w] = dataSTR;
......@@ -2764,30 +2766,44 @@ public class ContractServiceImpl implements ContractService {
String start_date = filter.get("start_date");
String end_date = filter.get("end_date");
String rowIndex = filter.get("rowIndex");
Map<String, Object> adiAccount = checkAccount( email,platform);
if(adiAccount!=null){
Object result = adiAccount.get("result");
if(result.equals(1)){
Object validStartDate = adiAccount.get("validStartDate");
if(validStartDate==null||StringUtils.isEmpty(validStartDate) || validStartDate.equals("null")){
return ResultModel.ERROR("第" + rowIndex + "行主账号【" + email + "】未进行IP发送");
if(filter.get("one_time").equals("否")){
String validStartDateStr = filter.get("validStartDate");
if(!StringUtils.isEmpty(validStartDateStr)){
DateTime dateTime = new DateTime(validStartDateStr);
DateTime startDate = new DateTime(start_date);
DateTime endDate = new DateTime(end_date);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数
filter.put("valid_start_date",dateTime.toString("yyyy-MM-dd"));
filter.put("valid_end_date",dateTime.plusDays(contractAllDay).toString("yyyy-MM-dd"));
}else{
return ResultModel.ERROR("第" + rowIndex + "行主账号【" + email + "】未填写IP发送");
}
}else{
Map<String, Object> adiAccount = checkAccount( email,platform);
if(adiAccount!=null){
Object result = adiAccount.get("result");
if(result.equals(1)){
Object validStartDate = adiAccount.get("validStartDate");
if(validStartDate==null||StringUtils.isEmpty(validStartDate) || validStartDate.equals("null")){
return ResultModel.ERROR("第" + rowIndex + "行主账号【" + email + "】未进行IP发送");
}else{
String validStartDateStr = validStartDate.toString().split(" ")[0];
DateTime dateTime = new DateTime(validStartDateStr);
DateTime startDate = new DateTime(start_date);
DateTime endDate = new DateTime(end_date);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数
filter.put("valid_start_date",dateTime.toString("yyyy-MM-dd"));
filter.put("valid_end_date",dateTime.plusDays(contractAllDay).toString("yyyy-MM-dd"));
}
}else{
String validStartDateStr = validStartDate.toString().split(" ")[0];
DateTime dateTime = new DateTime(validStartDateStr);
DateTime startDate = new DateTime(start_date);
DateTime endDate = new DateTime(end_date);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数
filter.put("valid_start_date",dateTime.toString("yyyy-MM-dd"));
filter.put("valid_end_date",dateTime.plusDays(contractAllDay).toString("yyyy-MM-dd"));
return ResultModel.ERROR("第" + rowIndex + "行主账号【" + email + "】不存在");
}
}else{
return ResultModel.ERROR("第" + rowIndex + "行主账号【" + email + "】不存在");
return ResultModel.ERROR("第" + rowIndex + "行ADI主账号校验URL失效");
}
}else{
return ResultModel.ERROR("第" + rowIndex + "行ADI主账号校验URL失效");
}
}
if (!accountsEmail.isEmpty()) {
......
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