|
|
@@ -14,7 +14,6 @@ import com.fs.company.domain.CompanyDeduct;
|
|
|
import com.fs.company.domain.CompanyMoneyLogs;
|
|
|
import com.fs.company.service.ICompanyDeductService;
|
|
|
import com.fs.company.service.ICompanyMoneyLogsService;
|
|
|
-import com.fs.company.service.ICompanyRechargeService;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.vo.CompanyDeductExportVO;
|
|
|
import com.fs.company.vo.CompanyDeductVO;
|
|
|
@@ -46,10 +45,6 @@ public class CompanyDeductController extends BaseController
|
|
|
private ICompanyService companyService;
|
|
|
@Autowired
|
|
|
private ICompanyMoneyLogsService moneyLogsService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ICompanyRechargeService companyRechargeService;
|
|
|
-
|
|
|
/**
|
|
|
* 查询扣款列表
|
|
|
*/
|
|
|
@@ -112,7 +107,7 @@ public class CompanyDeductController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('company:companyDeduct:remove')")
|
|
|
@Log(title = "扣款", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{deductIds}")
|
|
|
+ @DeleteMapping("/{deductIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] deductIds)
|
|
|
{
|
|
|
return toAjax(companyDeductService.deleteCompanyDeductByIds(deductIds));
|
|
|
@@ -133,15 +128,7 @@ public class CompanyDeductController extends BaseController
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
if(deduct.getIsAudit()==1){
|
|
|
Company company=companyService.selectCompanyByIdForUpdate(deduct.getCompanyId());
|
|
|
-
|
|
|
- // 同步redis缓存
|
|
|
- R r = companyRechargeService.syncUpdateRedisCompanyRecharge(company, deduct.getMoney(), 2);
|
|
|
- if(!"200".equals(r.get("code").toString())){
|
|
|
- return r;
|
|
|
- }
|
|
|
- // 充值后,需要同步更新余额到数据库,否则余额与缓存中的不一致
|
|
|
- String newMoney = r.get("newMoney").toString();
|
|
|
- company.setMoney(new BigDecimal(newMoney));
|
|
|
+ company.setMoney(company.getMoney().subtract(deduct.getMoney()));
|
|
|
companyService.updateCompany(company);
|
|
|
CompanyMoneyLogs log=new CompanyMoneyLogs();
|
|
|
log.setCompanyId(deduct.getCompanyId());
|