Commit 85ce37a1 by kangxiaoshan

合同调整金

parent c14432c0
......@@ -117,6 +117,6 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code in ?4 and status!='del' ", nativeQuery = true)
List<Contract> findShareContranctByDateFinace(String startDate, String endDate, String platform, List<String> financeBodies);
@Query(value = "select contract_code from contract where customer_body =? limit 3 ",nativeQuery = true)
List<String> findContractBodyNames(String customerBody);
@Query(value = "select contract_code from contract where customer_body =?1 and contract_code <> ?2 limit 3 ", nativeQuery = true)
List<String> findContractBodyNames(String customerBody, String contractCode);
}
......@@ -1586,6 +1586,7 @@ public class ContractServiceImpl implements ContractService {
Contract contract = contractRepository.findByCode(resource.getContractCode());
Map<Long, String> packageMap = getPackageMap(contract);
boolean showTip = false;
if (resource.getType().equals("price")) {
resource.setContent(packageMap.get(contract.getPriceLevel()) + "改为" + packageMap.get(resource.getLevel()));
......@@ -1614,10 +1615,12 @@ public class ContractServiceImpl implements ContractService {
//合同作废
resource.setContent(ContractStatusEnum.CANCEL.getValue());
contract.setStatus(ContractStatusEnum.CANCEL.getKey());
showTip = true;
} else if (ContractStatusEnum.SUSPEND.getKey().equals(resource.getStatus())) {
//合同中止
resource.setContent(ContractStatusEnum.SUSPEND.getValue());
contract.setStatus(ContractStatusEnum.SUSPEND.getKey());
showTip = true;
}
}
......@@ -1625,6 +1628,7 @@ public class ContractServiceImpl implements ContractService {
resource.setCreateAccount(loginUser.getId());
resource.setUser(loginUser.getId());
if (ContractStatusEnum.SUSPEND.getKey().equals(resource.getStatus())) {
resource.setCreateTime(new Date());
} else {
......@@ -1639,10 +1643,12 @@ public class ContractServiceImpl implements ContractService {
contractRepository.save(contract);
if (ContractStatusEnum.SUSPEND.getKey().equals(contract.getStatus())) {
if (showTip) {
//获取相关执行合同名称
List<String> codes = contractRepository.findContractBodyNames(contract.getCustomerBody());
List<String> codes = contractRepository.findContractBodyNames(contract.getCustomerBody(),contract.getContractCode());
contract.setCustomBodyNames(codes);
}else{
contract.setCustomBodyNames(new ArrayList<>());
}
return contract;
......
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