|
@@ -32,6 +32,8 @@ public class BookTestRepo {
|
|
|
private TaskToUserDao taskToUserDao;
|
|
|
@Autowired
|
|
|
private UserDao userDao;
|
|
|
+ @Autowired
|
|
|
+ private BankCardDao bankCardDao;
|
|
|
|
|
|
public Page<BookTest> findAllBookTestByPage(Pageable pageable, Map<String, String> extraCondition, String keyword) {
|
|
|
List<Condition> conditionList = new ArrayList<>();
|
|
@@ -134,6 +136,8 @@ public class BookTestRepo {
|
|
|
}
|
|
|
valueBuilder.append(projectPO.getCode());
|
|
|
}
|
|
|
+ }else{
|
|
|
+ valueBuilder.append("ABCDEFGH");
|
|
|
}
|
|
|
} else if (key.equals("cttcode")) {
|
|
|
List<CrowdTestTaskPO> list = crowdTestTaskDao.findByNameLike("%" + keyword + "%");
|
|
@@ -146,6 +150,8 @@ public class BookTestRepo {
|
|
|
}
|
|
|
valueBuilder.append(taskPO.getCode());
|
|
|
}
|
|
|
+ }else{
|
|
|
+ valueBuilder.append("ABCDEFGH");
|
|
|
}
|
|
|
}
|
|
|
condition = new Condition(key, Condition.IN, valueBuilder.toString());
|
|
@@ -180,6 +186,11 @@ public class BookTestRepo {
|
|
|
}
|
|
|
return bookTest;
|
|
|
}
|
|
|
+ public Balance findBalanceById(int id) {
|
|
|
+ BalancePO balancePO = balanceDao.findById(id);
|
|
|
+ Balance balance = Converter.convert(Balance.class, balancePO);
|
|
|
+ return balance;
|
|
|
+ }
|
|
|
|
|
|
public Page<Balance> findAllBookTestByPage(Pageable pageable, Map<String, String> extraCondition) {
|
|
|
Specifications<BalancePO> where = Specifications.where(Condition.getSpecification(new Condition("uid", Condition.EQ, extraCondition.get("userId"))));
|
|
@@ -231,16 +242,25 @@ public class BookTestRepo {
|
|
|
UserPO user = userDao.findById(uid).orElse(null);
|
|
|
//根据code找项目名字
|
|
|
CrowdTestTaskPO task = crowdTestTaskDao.findByCodeAndIsDeleted(cttcode, 0);
|
|
|
+ //根据id找银行卡号
|
|
|
+ List<BankCardPO> bankCardPOList = bankCardDao.findByUserIdAndIsDeleted(uid,0);
|
|
|
if (taskToUser != null) {
|
|
|
- BalancePO balance = new BalancePO();
|
|
|
- balance.setUid(bookTest.getUid());
|
|
|
- balance.setUname(user == null ? "-" : user.getName());
|
|
|
- balance.setCttcode(taskToUser.getTaskCode());
|
|
|
- balance.setCttname(task.getName());
|
|
|
- balance.setBalvalue(taskToUser.getQuotedPrice() + "");
|
|
|
- balance.setBaltime(new Date());
|
|
|
- balance.setState(state);
|
|
|
- balanceDao.save(balance);
|
|
|
+ if (bankCardPOList != null && bankCardPOList.size() > 0) {
|
|
|
+ for (BankCardPO bankCardPO : bankCardPOList) {
|
|
|
+ BalancePO balance = new BalancePO();
|
|
|
+ balance.setNumber(bankCardPO.getNumber());
|
|
|
+ balance.setCode(bankCardPO.getCode());
|
|
|
+ balance.setSubname(bankCardPO.getSubName());
|
|
|
+ balance.setUid(bookTest.getUid());
|
|
|
+ balance.setUname(user == null ? "-" : user.getName());
|
|
|
+ balance.setCttcode(taskToUser.getTaskCode());
|
|
|
+ balance.setCttname(task.getName());
|
|
|
+ balance.setBalvalue(taskToUser.getQuotedPrice() + "");
|
|
|
+ balance.setBaltime(new Date());
|
|
|
+ balance.setState(state);
|
|
|
+ balanceDao.save(balance);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|