Commit fda84c42 by lzxry

bugfix

parent 3fcab69d
...@@ -2706,8 +2706,8 @@ public class ContractServiceImpl implements ContractService { ...@@ -2706,8 +2706,8 @@ public class ContractServiceImpl implements ContractService {
s_data[w] = false; s_data[w] = false;
}else{ }else{
s_data[w] = true; s_data[w] = true;
}
filter.put("validStartDate",formatter.formatCellValue(row_data.getCell(14)).trim()); filter.put("validStartDate",formatter.formatCellValue(row_data.getCell(14)).trim());
}
filter.put("one_time",dataSTR); filter.put("one_time",dataSTR);
}else { }else {
//主账号不为空,按照之前逻辑不变 //主账号不为空,按照之前逻辑不变
...@@ -2766,13 +2766,18 @@ public class ContractServiceImpl implements ContractService { ...@@ -2766,13 +2766,18 @@ public class ContractServiceImpl implements ContractService {
String start_date = filter.get("start_date"); String start_date = filter.get("start_date");
String end_date = filter.get("end_date"); String end_date = filter.get("end_date");
String rowIndex = filter.get("rowIndex"); String rowIndex = filter.get("rowIndex");
String validStartDateStr="";
if(filter.get("one_time").equals("否")){
validStartDateStr = start_date;
}else{
validStartDateStr = filter.get("validStartDate");
}
//if(filter.get("one_time").equals("否")){ //if(filter.get("one_time").equals("否")){
String validStartDateStr = filter.get("validStartDate");
if(!StringUtils.isEmpty(validStartDateStr)){ if(!StringUtils.isEmpty(validStartDateStr)){
DateTime dateTime = new DateTime(validStartDateStr); DateTime dateTime = new DateTime(validStartDateStr);
DateTime startDate = new DateTime(start_date); DateTime startDate = new DateTime(start_date);
DateTime endDate = new DateTime(end_date); DateTime endDate = new DateTime(end_date);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数 int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数-1 ,用于计算结束日期
filter.put("valid_start_date",dateTime.toString("yyyy-MM-dd")); filter.put("valid_start_date",dateTime.toString("yyyy-MM-dd"));
filter.put("valid_end_date",dateTime.plusDays(contractAllDay).toString("yyyy-MM-dd")); filter.put("valid_end_date",dateTime.plusDays(contractAllDay).toString("yyyy-MM-dd"));
}else{ }else{
...@@ -2939,15 +2944,10 @@ public class ContractServiceImpl implements ContractService { ...@@ -2939,15 +2944,10 @@ public class ContractServiceImpl implements ContractService {
public static void main(String[] args) { public static void main(String[] args) {
// String dateStr1 = "2019-04-30"; DateTime startDate = new DateTime("2020-01-01");
// String dateStr2 = "2019-04-01"; DateTime endDate = new DateTime("2020-01-20");
// int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数
// System.out.println(new DateTime(dateStr2).compareTo(new DateTime(dateStr1))); System.out.println(contractAllDay+" | "+startDate.plusDays(contractAllDay).toString("yyyy-MM-dd"));
// System.out.println(Days.daysBetween(new DateTime(dateStr2), new DateTime(dateStr1)).getDays());
System.out.println(10023L * 1.0 / 100);
System.out.println((129 * 100 / 111) * 1.0 / 100);
System.out.println();
} }
} }
...@@ -226,7 +226,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService { ...@@ -226,7 +226,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}else{ }else{
oneTimeRecognizedRevenue = bigDecimal.multiply(new BigDecimal("0.9")); oneTimeRecognizedRevenue = bigDecimal.multiply(new BigDecimal("0.9"));
} }
BigDecimal dailyRevenueRecognition = bigDecimal.multiply(new BigDecimal("0.1")); BigDecimal dailyRevenueRecognition = bigDecimal.multiply(new BigDecimal("10"));//0.1*100=10,前端拿到区间分摊收入/100得到最终的值
contract.setOneTimeRecognizedRevenue(oneTimeRecognizedRevenue.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); contract.setOneTimeRecognizedRevenue(oneTimeRecognizedRevenue.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
int contractAllDay = getDayRange(contractPart[0], contractPart[1]) + 1;//合同总天数 int contractAllDay = getDayRange(contractPart[0], contractPart[1]) + 1;//合同总天数
......
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