Commit e8cae298 by kangxiaoshan

修改合同编号生成规则

parent de0b315c
...@@ -71,8 +71,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -71,8 +71,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
List<Contract> contractCodePlatformNot(List<String> plats, List<Long> ids); List<Contract> contractCodePlatformNot(List<String> plats, List<Long> ids);
@Query(value = "select contract_code from contract where my_body_code = ?1 order by code_num desc limit 1", nativeQuery = true) @Query(value = "select contract_code from contract where my_body_code = ?1 and product=?2 order by code_num desc limit 1", nativeQuery = true)
String findLastCode(String code); String findLastCode(String code, String platform);
@Query(value = "select * from contract where id = ?1 union all select * from contract where id = ?2", nativeQuery = true) @Query(value = "select * from contract where id = ?1 union all select * from contract where id = ?2", nativeQuery = true)
......
...@@ -332,7 +332,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -332,7 +332,7 @@ public class ContractServiceImpl implements ContractService {
// return code + "-" + platform.toUpperCase() + "-" + DateUtil.getDays2(0) + "-" + lastCode; // return code + "-" + platform.toUpperCase() + "-" + DateUtil.getDays2(0) + "-" + lastCode;
String codeName = contractRepository.findLastCode(code); String codeName = contractRepository.findLastCode(code,platform);
if ("fake".equals(platform)) { if ("fake".equals(platform)) {
platform = "FZBWS"; platform = "FZBWS";
} }
......
...@@ -97,13 +97,13 @@ public class ShareIncomeServiceImpl implements ShareIncomeService { ...@@ -97,13 +97,13 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
DateTime end = new DateTime(endDate); DateTime end = new DateTime(endDate);
long start_ = System.currentTimeMillis(); long start_ = System.currentTimeMillis();
/* for (Contract contract : contracts) { // for (Contract contract : contracts) {
this.shareIncome4Contract(contract, start, end); // this.shareIncome4Contract(contract, start, end);
contract.setMyBodyName(bodiesNameMap.get(contract.getMyBodyCode())); // contract.setMyBodyName(bodiesNameMap.get(contract.getMyBodyCode()));
}*/ // }
try (Stream<Contract> streamContract = contracts.parallelStream()) { try (Stream<Contract> streamContract = contracts.parallelStream()) {
streamContract.forEach(v -> { streamContract.forEachOrdered(v -> {
this.shareIncome4Contract(v, start, end); this.shareIncome4Contract(v, start, end);
v.setMyBodyName(bodiesNameMap.get(v.getMyBodyCode())); v.setMyBodyName(bodiesNameMap.get(v.getMyBodyCode()));
}); });
......
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