|
|
@ -113,7 +113,10 @@ public class BsSgcYxjdDynamicCreditController extends BaseController { |
|
|
|
IPage<BsSgcYxjdDynamicCredit> page = bsSgcYxjdDynamicCreditService.selectPage(sp); |
|
|
|
creditList.addAll(list); |
|
|
|
creditList.addAll(page.getRecords()); |
|
|
|
if (sp.getData().getType().equals("1")) { |
|
|
|
creditList = creditList.stream().filter(x -> !x.getStatus().equals("0")).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
creditList = creditList.stream().distinct().collect(Collectors.toList()); |
|
|
|
page.setRecords(creditList); |
|
|
|
page.setTotal(creditList.size()); |
|
|
@ -166,11 +169,11 @@ public class BsSgcYxjdDynamicCreditController extends BaseController { |
|
|
|
creditApproval.setApprovalTime(new Date()); |
|
|
|
BaseEntityUtils.preInsert(creditApproval); |
|
|
|
return toAjax(bsSgcYxjdCreditApprovalService.save(creditApproval)); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
BsSgcYxjdEnterpriseInfo byId = bsSgcYxjdEnterpriseInfoService.getById(bsSgcYxjdDynamicCredit.getEnterpriseId()); |
|
|
|
Double idScore = Double.valueOf(byId.getScore()); |
|
|
|
Double bonusPoints = Double.valueOf(bsSgcYxjdDynamicCredit.getBonusPoints()); |
|
|
|
byId.setScore(String.valueOf(idScore-bonusPoints)); |
|
|
|
byId.setScore(String.valueOf(idScore - bonusPoints)); |
|
|
|
return toAjax(bsSgcYxjdDynamicCreditService.save(bsSgcYxjdDynamicCredit)); |
|
|
|
} |
|
|
|
|
|
|
@ -186,13 +189,13 @@ public class BsSgcYxjdDynamicCreditController extends BaseController { |
|
|
|
if (bsSgcYxjdDynamicCredit.getType().equals("1")) { |
|
|
|
String status = bsSgcYxjdDynamicCredit.getStatus(); |
|
|
|
String loginId = StpUtil.getLoginIdAsString(); |
|
|
|
Thread thread = new Thread(new MyRunnable(bsSgcYxjdDynamicCredit.getId(), status,bsSgcYxjdDynamicCredit.getBonusPoints(), |
|
|
|
bsSgcYxjdDynamicCredit.getRemark(),loginId)); |
|
|
|
Thread thread = new Thread(new MyRunnable(bsSgcYxjdDynamicCredit.getId(), status, bsSgcYxjdDynamicCredit.getBonusPoints(), |
|
|
|
bsSgcYxjdDynamicCredit.getRemark(), loginId)); |
|
|
|
thread.start(); |
|
|
|
/* AsyncFactory.recordDynamicCredit(bsSgcYxjdDynamicCredit.getId(), status,bsSgcYxjdDynamicCredit.getBonusPoints(), |
|
|
|
bsSgcYxjdDynamicCredit.getRemark());*/ |
|
|
|
return toAjax(bsSgcYxjdDynamicCreditService.updateById(bsSgcYxjdDynamicCredit)); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return toAjax(bsSgcYxjdDynamicCreditService.updateById(bsSgcYxjdDynamicCredit)); |
|
|
|
} |
|
|
|
|
|
|
@ -219,13 +222,14 @@ public class BsSgcYxjdDynamicCreditController extends BaseController { |
|
|
|
|
|
|
|
private String loginId; |
|
|
|
|
|
|
|
public MyRunnable(String id,String status,String score,String remark,String loginId) { |
|
|
|
public MyRunnable(String id, String status, String score, String remark, String loginId) { |
|
|
|
this.id = id; |
|
|
|
this.status = status; |
|
|
|
this.score = score; |
|
|
|
this.remark = remark; |
|
|
|
this.loginId = loginId; |
|
|
|
} |
|
|
|
|
|
|
|
public void run() { |
|
|
|
// 线程需要执行的任务
|
|
|
|
if (status.equals("1")) { |
|
|
@ -264,7 +268,7 @@ public class BsSgcYxjdDynamicCreditController extends BaseController { |
|
|
|
BsSgcYxjdEnterpriseInfo byId = SpringUtils.getBean(BsSgcYxjdEnterpriseInfoService.class).getById(id); |
|
|
|
String idScore = byId.getScore(); |
|
|
|
double v = Double.parseDouble(idScore); |
|
|
|
byId.setScore(String.valueOf(v+Double.parseDouble(score))); |
|
|
|
byId.setScore(String.valueOf(v + Double.parseDouble(score))); |
|
|
|
SpringUtils.getBean(BsSgcYxjdEnterpriseInfoService.class).updateById(byId); |
|
|
|
} else if (status.equals("2")) { |
|
|
|
LambdaQueryWrapper<BsSgcYxjdCreditApproval> lambdaQuery = Wrappers.lambdaQuery(BsSgcYxjdCreditApproval.class); |
|
|
|