Commit 46d3232d by kangxiaoshan

调整金

parent ab3e1539
......@@ -98,21 +98,21 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select contract_code,my_body_code,sale,platform from contract where contract_code in ?1",nativeQuery = true)
List<Object[]> findByContractCode(List<String> codesList);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3",nativeQuery = true)
List<Contract> findShareContranctByDate(String startDate, String endDate, String platform);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3 and my_body_code = ?4",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3 and my_body_code = ?4",nativeQuery = true)
List<Contract> findShareContranctByDate(String startDate, String endDate, String platform, String bodyCode);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%)",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%)",nativeQuery = true)
List<Contract> findShareContranctByDateSerche(String startDate, String endDate, String platform, String serchName);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%)",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%)",nativeQuery = true)
List<Contract> findShareContranctByDate(String startDate, String endDate, String platform, String bodyCode, String serchName);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5",nativeQuery = true)
List<Contract> findShareContranctByDateSercheFinace(String startDate, String endDate, String platform, String serchName, List<String> financeBodies);
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time >= ?1 and platform=?3 and my_body_code in ?4",nativeQuery = true)
@Query(value="select * from contract where start_date >= ?1 and start_date <=?2 and end_date >= ?1 and create_time <= ?2 and platform=?3 and my_body_code in ?4",nativeQuery = true)
List<Contract> findShareContranctByDateFinace(String startDate, String endDate, String platform, List<String> financeBodies);
}
......@@ -540,9 +540,9 @@ public class ContractServiceImpl implements ContractService {
// 自动计算分摊调整金
//当录入时间与合同开始时间不在一个月时。自动生成调分摊输入调整金。
//分摊收入调整金 = 合同金额 * 6% / 合同总天数 *[录入日期前一月最后一日(含) - 合同开始日期]
int day1 = Days.daysBetween(contractStart, contractEnd).getDays();
int day2 = Days.daysBetween(contractStart, new DateTime().plusMonths(-1).dayOfMonth().withMaximumValue()).getDays();
long resultValue = new BigDecimal(resource.getMoney() * 0.06 / day1 * day2)
int day1 = Days.daysBetween(contractStart, contractEnd).getDays()+1;
int day2 = Days.daysBetween(contractStart, new DateTime().plusMonths(-1).dayOfMonth().withMaximumValue()).getDays()+1;
long resultValue = new BigDecimal(resource.getMoney() *(1-0.06)/ day1 * day2)
.setScale(2,BigDecimal.ROUND_HALF_UP)
.multiply(new BigDecimal(100)).longValue();
resource.setAdjustmentFund(resultValue); // 此处为 *100的结果
......
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