Commit 76c1e08d by lzxry

bugfix

parent e3e6b2b8
......@@ -211,6 +211,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
if(checkTwoTime(new DateTime(v.getEndDate()),end)||checkTwoTime(start,new DateTime(v.getEndDate()))){
v.setIntervaIncomeShare(new BigDecimal(v.getMoney()/1.06*100).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
v.setIncomeGross(v.getIntervaIncomeShare());
v.setIncomeShareAll(v.getIntervaIncomeShare());
}
}
});
......@@ -633,7 +634,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}else{
Contract contractMaster = contractsArray[i];
if(contracts.contains(contractMaster)){
String endDate = contractMaster.getEndDate();
contractMaster.setEndDate(contractMaster.getNextSignedDate());
shareIncome4ContractTKIO(contractMaster,start,end,true);//到结束的前一天
contractMaster.setEndDate(endDate);
}
}
}
......@@ -666,24 +670,18 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
return contractsArray;
}
private void shareIncome4ContractTKIO(Contract contract, DateTime start, DateTime end,Boolean isNew) {
private void shareIncome4ContractTKIO(Contract contract, DateTime start, DateTime end,Boolean isMore) {
DateTime[] selected = new DateTime[]{
start,
end};//用户筛选开始/结束日期
DateTime[] contractPart=null;
if(isNew){
contractPart = new DateTime[]{
new DateTime(contract.getStartDate()),
new DateTime(StringUtil.isEmpty(contract.getNextSignedDate())?contract.getEndDate():contract.getNextSignedDate())};//合同开始结束 时间
}else{
contractPart = new DateTime[]{
DateTime[] contractPart= new DateTime[]{
new DateTime(contract.getStartDate()),
new DateTime(contract.getEndDate())};//合同开始结束 时间
}
DateTime[] usePart = new DateTime[]{
selected[0].compareTo(contractPart[0]) <= 0 ? contractPart[0] : selected[0],
selected[1].compareTo(contractPart[1]) >= 0 ? contractPart[1] : selected[1]
};
usePart[0] = usePart[0].compareTo(usePart[1]) >= 0 ? usePart[1] : usePart[0];
Long excludTax = new BigDecimal(contract.getMoney() / 1.06)
......@@ -715,6 +713,17 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
if (suspendContract != null) {
return;
}
//补充协议的主合同特殊处理
if (isMore&&new DateTime(contract.getNextSignedDate()).isBefore(selected[0])) {
contract.setIntervaIncomeShare(0L);
contract.setAdjustmentFund(0L);
contract.setIncomeShareAll(contract.getIntervaIncomeShare());
contract.setClickFlow(0.0);
contract.setIncomeGross(0L);
return;
}
//晚录合同处理//正常合同处理
DateTime create = new DateTime(new DateTime(contract.getCreateTime()).toString("yyyy-MM-dd")); //录入时间点
DateTime[] creatPoints = new DateTime[]{
......
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