Commit 628aae2e by 杨清松

提交

parent 1eb3847a
......@@ -87,12 +87,20 @@ public class WarnSettingDao {
return template.execute(session -> {
StringBuilder hql = new StringBuilder(QUERY_HQL);
if (billId != null) hql.append(" and billId =:billId");
if (billId != null && (target.equals("保证金余额") || target.equals("预付款余额"))) {
hql.append(" and JSON_EXTRACT(memo,'$.contractId')=:billId ");
} else {
hql.append(" and billId =:billId");
}
if (target != null) hql.append(" and target =:target");
Query<KObject> query = session.createQuery(hql.toString(), KObject.class);
query.setParameter("billType", billType);
if (billId != null) query.setParameter("billId", billId);
if (billId != null && (target.equals("保证金余额") || target.equals("预付款余额"))) {
query.setParameter("billId", billId.toString());
} else {
query.setParameter("billId", billId);
}
if (target != null) query.setParameter("target", target);
Optional<KObject> kObject = query.uniqueResultOptional();
return warnSettingToEntity(kObject.orElse(null));
......
......@@ -52,7 +52,7 @@ public class ArtificialRechargeServiceImpl implements ArtificialRechargeService
contract.set("depositBalance", contract.getBigDecimal("depositBalance") == null ? new BigDecimal("0").add(jsonObject.getBigDecimal("rechargeAmount")) : contract.getBigDecimal("depositBalance").add(jsonObject.getBigDecimal("rechargeAmount")));
}
contractDao.update(contract);
BaseBusinessWarn warn = warningService.createWarn("合同", contract.getUuid("contractId"), "预付款余额");
BaseBusinessWarn warn = warningService.createWarn("合同", contract.getUuid("id"), "预付款余额");
warn.setWarningCalculate(new StockAmountWarnCalculate(contract.getDouble("advanceBalance")));
warn.warn();
return ResponseObj.success();
......
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