Commit 065258b1 by kangxiaoshan

修改晚录判断逻辑

parent fcccdc70
......@@ -535,16 +535,16 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//if(contract==null){
List<Contract> contractList = contractRepository.findByCreateTimeAndCodeNotOwn(groupContract.getRelationCode(), DateUtil.format(groupContract.getCreateTime(), DateUtil.C_TIME_PATTON_DEFAULT), groupContract.getId());
for (Contract contract1 : contractList) {
if(StringUtils.isEmpty(map.get(contract1.getContractCode()))){
if (StringUtils.isEmpty(map.get(contract1.getContractCode()))) {
map.put(contract1.getContractCode(), contract1);
}
}
groupContracts = map.values();//只要不加入传进来的那个list里面就不会影响查询的列表
break;
}else if((groupContracts.size()==1&&!StringUtils.isEmpty(groupContract.getNextSignedDate()))||(!"2".equals(groupContract.getContractType()) && map.get(groupContract.getNextSignedContractCode())==null)){
} else if ((groupContracts.size() == 1 && !StringUtils.isEmpty(groupContract.getNextSignedDate())) || (!"2".equals(groupContract.getContractType()) && map.get(groupContract.getNextSignedContractCode()) == null)) {
List<Contract> contractList = contractRepository.findByRelationCode(groupContract.getContractCode());
for (Contract contract1 : contractList) {
if(StringUtils.isEmpty(map.get(contract1.getContractCode()))){
if (StringUtils.isEmpty(map.get(contract1.getContractCode()))) {
map.put(contract1.getContractCode(), contract1);
}
}
......@@ -1895,7 +1895,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
@Override
public boolean checkLateContract(DateTime dateTime, DateTime creatTime) {
int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 9;
//int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 9;
//修改晚录判断逻辑
int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 1;
return dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays).isBefore(creatTime);
}
......@@ -1962,12 +1964,14 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
public static void main(String[] args) {
DateTime dateTime = new DateTime("2020-10-30");
DateTime creatTime = new DateTime("2020-11-9");
int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 9;
System.out.println(dateTime.monthOfYear().get());
System.out.println(dateTime.dayOfMonth().withMaximumValue());
System.out.println(dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays));
System.out.println(dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays).isBefore(creatTime));
DateTime creatTime = new DateTime("2020-11-02");
int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 1;
System.out.println("合同开始时间" + dateTime);
System.out.println("合同录入时间" + creatTime);
System.out.println("合同开始时间在第" + dateTime.monthOfYear().get() + "月");
System.out.println("合同录入当月的最后一天日期:" + dateTime.dayOfMonth().withMaximumValue());
System.out.println("合同录入当月的最后一天日期后第" + aferDays + "天" + dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays));
System.out.println("是否是晚录:" + dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays).isBefore(creatTime));
dateTime.dayOfMonth().withMaximumValue().plusDays(aferDays).isBefore(creatTime);
}
......
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