Commit 7b54c073 by lzxry

CAS晚录判断

parent 586a98c6
......@@ -626,6 +626,8 @@ public class ContractServiceImpl implements ContractService {
if (shareIncomeService.checkLateContract(dateTime,
new DateTime(new DateTime().toString("yyyy-MM-dd")))) {
resource.setStatus(ContractStatusEnum.LATE.getKey());
}else{
resource.setStatus(ContractStatusEnum.NFORMAL.getKey());
}
Long relationContract = resource.getRelationContract();
Contract one = contractRepository.findOne(relationContract);
......@@ -670,6 +672,12 @@ public class ContractServiceImpl implements ContractService {
String validEndDateStr = sendTime.plusDays(contractAllDay).toString("yyyy-MM-dd");
resource.setValidStartDate(validStartDateStr);
resource.setValidEndDate(validEndDateStr);
if (shareIncomeService.checkLateContract(new DateTime(validStartDateStr),
new DateTime(new DateTime().toString("yyyy-MM-dd")))) {
resource.setStatus(ContractStatusEnum.LATE.getKey());
}else{
resource.setStatus(ContractStatusEnum.NFORMAL.getKey());
}
}
}
......@@ -928,26 +936,6 @@ public class ContractServiceImpl implements ContractService {
contractExist.setErroMessage("补充协议开始日期不能晚于原始合同的结束日期");
return contractExist;
}
}else if("cas".equals(resource.getPlatform())){
PackageBase one = packageBaseRepository.findOne(resource.getPriceLevel());
ADIUser adiUser = adiAccountService.findOne(resource.getEmail(), one.getPackageName());
if(adiUser==null || StringUtils.isEmpty(adiUser.getSendTime())){
resource.setShareSign(0);
}else{
resource.setShareSign(1);
DateTime sendTime = new DateTime(DateUtil.parseDate(DateUtil.C_TIME_PATTON_DEFAULT,adiUser.getSendTime()));
DateTime startDate = new DateTime(resource.getStartDate());
if(sendTime.isBefore(startDate)){
sendTime = startDate;
}
DateTime endDate = new DateTime(resource.getEndDate());
String validStartDateStr = sendTime.toString(DateUtil.C_DATE_PATTON_DEFAULT);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数-1 ,用于计算结束日期
String validEndDateStr = sendTime.plusDays(contractAllDay).toString("yyyy-MM-dd");
resource.setValidStartDate(validStartDateStr);
resource.setValidEndDate(validEndDateStr);
}
}
if (resource.getContractCode() != null && !resource.getContractCode().equals(contract.getContractCode())) {
......@@ -1068,6 +1056,32 @@ public class ContractServiceImpl implements ContractService {
}
contractRepository.save(bindContract);
}
}else if("cas".equals(resource.getPlatform())){
PackageBase one = packageBaseRepository.findOne(resource.getPriceLevel());
ADIUser adiUser = adiAccountService.findOne(resource.getEmail(), one.getPackageName());
if(adiUser==null || StringUtils.isEmpty(adiUser.getSendTime())){
resource.setShareSign(0);
}else{
resource.setShareSign(1);
DateTime sendTime = new DateTime(DateUtil.parseDate(DateUtil.C_TIME_PATTON_DEFAULT,adiUser.getSendTime()));
DateTime startDate = new DateTime(resource.getStartDate());
if(sendTime.isBefore(startDate)){
sendTime = startDate;
}
DateTime endDate = new DateTime(resource.getEndDate());
String validStartDateStr = sendTime.toString(DateUtil.C_DATE_PATTON_DEFAULT);
int contractAllDay = Days.daysBetween(startDate, endDate).getDays();//合同总天数-1 ,用于计算结束日期
String validEndDateStr = sendTime.plusDays(contractAllDay).toString("yyyy-MM-dd");
resource.setValidStartDate(validStartDateStr);
resource.setValidEndDate(validEndDateStr);
if (shareIncomeService.checkLateContract(new DateTime(validStartDateStr),
new DateTime(new DateTime().toString("yyyy-MM-dd")))) {
resource.setStatus(ContractStatusEnum.LATE.getKey());
}else{
resource.setStatus(ContractStatusEnum.NFORMAL.getKey());
}
}
}
return contractRepository.save(resource);
......
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