Commit cba9c447 by lzxry

Revert "Merge branch 'master' of http://git.minrow.com/reyun/manager"

This reverts commit 7ecc1eb7, reversing changes made to a1559e22.
parent 7ecc1eb7
......@@ -156,10 +156,10 @@
<redis.ip.requesttimes>5</redis.ip.requesttimes>
<redis.ip.unknown.requesttimes>5</redis.ip.unknown.requesttimes>
<redis.surl.host>localhost</redis.surl.host>
<redis.surl.host>10.3.20.33</redis.surl.host>
<redis.surl.port>6379</redis.surl.port>
<redis.event.host>localhost</redis.event.host>
<redis.event.host>10.3.20.33</redis.event.host>
<redis.event.port>6379</redis.event.port>
<redis.event.database>13</redis.event.database>
<!--Redis setting//end-->
......
......@@ -128,8 +128,4 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "SELECT * from contract where platform = ?1 and email = ?2", nativeQuery = true)
List<Contract> findByPlatformAndEmail(String platform, String email);
@Query(value = "select id from contract where (email is null or email='') and ( end_date >= ?1 and end_date <= ?2 )", nativeQuery = true)
List<Long> findAllEmailIsNull(String startDate, String endDate);
}
......@@ -1466,7 +1466,6 @@ public class ContractServiceImpl implements ContractService {
result.add(c);
}
}
return result;
}
......@@ -2428,16 +2427,8 @@ public class ContractServiceImpl implements ContractService {
Cell cell = row_data.getCell(w);
int line_num = j + 1;
if (null == cell || cell.getCellTypeEnum().equals(CellType.BLANK)) {
//主账号为空,额外处理
if ("email".equals(sheetTitle) && "tkio".equals(platformexcl)) {
String dataSTR = formatter.formatCellValue(cell).trim();
s_data[w] = dataSTR;
moreEmail.add(dataSTR.trim());
accountsEmail.add(dataSTR.trim());
}else{
//非主账号 按照之前逻辑不变
return ResultModel.ERROR("第" + line_num + "行【" + SHEET_TITLE_RESERVE.get(sheetTitle) + "】不能为空,请重新上传");
}
return ResultModel.ERROR("第" + line_num + "行【" +
SHEET_TITLE_RESERVE.get(sheetTitle) + "】不能为空,请重新上传");
} else {
String dataSTR = formatter.formatCellValue(cell).trim();
//校验合同编号
......@@ -2445,12 +2436,14 @@ public class ContractServiceImpl implements ContractService {
if (!codeUniqueDic.containsKey(dataSTR)) {
codeUniqueDic.put(dataSTR, "1");
} else {
return ResultModel.ERROR(ResultStatus.CCODE_EXITS.getCode(),"合同编号【" + dataSTR + "】已存在,请重新上传");
return ResultModel.ERROR(ResultStatus.CCODE_EXITS.getCode(),
"合同编号【" + dataSTR + "】已存在,请重新上传");
}
Contract contractExist = contractRepository.checkByCode(dataSTR);
if (contractExist != null) {
return ResultModel.ERROR(ResultStatus.CCODE_EXITS.getCode(),"合同编号【" + dataSTR + "】已存在,请重新上传");
return ResultModel.ERROR(ResultStatus.CCODE_EXITS.getCode(),
"合同编号【" + dataSTR + "】已存在,请重新上传");
}
}
......@@ -2530,8 +2523,8 @@ public class ContractServiceImpl implements ContractService {
return ResultModel.ERROR("第" + line_num + "行【行政区域】code错误");
}
} else {
//主账号不为空,按照之前逻辑不变
s_data[w] = dataSTR;
if ("email".equals(sheetTitle) && !StringUtils.isEmpty(dataSTR) && "tkio".equals(platformexcl)) {
if (!accountsEmail.contains(dataSTR.trim())) {
moreEmail.add(dataSTR.trim());
......@@ -2564,13 +2557,8 @@ public class ContractServiceImpl implements ContractService {
for (int i = 0; i < accountsEmail.size(); i++) {
String e = accountsEmail.get(i);
if ("tkio".equals(platformexcl) && "".equals(e)) {
// tiko允许主账号email是空
}else{
//按照之前逻辑
if (!emailDic.containsKey(e)) {
return ResultModel.ERROR("第" + (i + 1) + "行 客户主账号【" + e + "】在Office运营后台未找到,请重新上传");
}
if (!emailDic.containsKey(e)) {
return ResultModel.ERROR("第" + (i + 1) + "行 客户主账号【" + e + "】在Office运营后台未找到,请重新上传");
}
}
}
......@@ -2579,7 +2567,7 @@ public class ContractServiceImpl implements ContractService {
s_data[row_already] = platform;
s_data[row_already + 1] = "tkio".equals(platform) ? "trackingio" : platform;
s_data[row_already + 2] = bodyCode;
s_data[row_already + 3] = DateUtil.getCurrentDateStr();
s_data[row_already + 3] = createTime;
s_data[row_already + 4] = 0;
s_data[row_already + 5] = "main";
s_data[row_already + 6] = ContractStatusEnum.NFORMAL.getKey(); //常规合同
......
......@@ -22,7 +22,6 @@ import tkio.repository.AppRepository;
import tkio.service.AccountFlowRestrictService;
import util.ContractBranchUtil;
import util.DateUtil;
import util.StringUtil;
import java.math.BigDecimal;
import java.math.BigInteger;
......@@ -153,25 +152,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
logger.info("计算分摊收入耗时:{}", (System.currentTimeMillis() - start_));
//结果集result二次加工
if ("tkio".equals(platform)) {
//查询主账号为空的 并且 结束日期在查询范围内的
List<Long> allEmailIsNullIds = contractRepository.findAllEmailIsNull(startDate, endDate);
for(Contract contract : contracts){
if(StringUtil.isEmpty(contract.getEmail())){
//不在查询范围内的数据,全部置空
if(allEmailIsNullIds ==null || !allEmailIsNullIds.contains(BigInteger.valueOf(contract.getId()))) {
contract.setClickFlow(0D); //区间点击数(万次)
contract.setIntervaIncomeShare(0L);//区间分摊收入
contract.setAdjustmentFund(0L);//区间调整金额
contract.setIncomeShareAll(0L);//区间总收入
contract.setIncomeGross(0L);//累计总收入(元)
}
}
}
}
return contracts;
}
......@@ -193,7 +173,8 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract.setIncomeExcludingTax(excludTax);
//计算单价,精准保留16位数
BigDecimal unitPriceAccurate = new BigDecimal(contract.getMoney()/1.06/contract.getTrackFlow()).setScale(16, BigDecimal.ROUND_HALF_UP);
BigDecimal unitPriceAccurate = new BigDecimal(contract.getMoney()/1.06/contract.getTrackFlow())
.setScale(16, BigDecimal.ROUND_HALF_UP);
//四舍五入单价
double unitPrice = unitPriceAccurate.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
//不限量套餐会在方法里面重新赋值单价
......
......@@ -63,7 +63,7 @@ public class DateUtil {
Calendar cal = Calendar.getInstance();
Date currDate = cal.getTime();
return format(currDate,C_TIME_PATTON_DEFAULT);
return format(currDate);
}
/**
......@@ -1518,8 +1518,8 @@ public class DateUtil {
//
// String newdate = DateUtil.format(date,DateUtil.C_TIME_PATTON_DEFAULT);
// System.out.println(newdate);
// System.out.print(DateUtil.getBeforeDays("2017-03-31",-70));
System.out.println(DateUtil.getCurrentDateStr());
System.out.print(DateUtil.getBeforeDays("2017-03-31",-70));
}
}
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