|
@@ -9,13 +9,19 @@ import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.modules.admin.dao.SysDeptAccountWithdrawMapper;
|
|
import com.ydtech.modules.admin.dao.SysDeptAccountWithdrawMapper;
|
|
|
import com.ydtech.modules.admin.model.SysDeptAccount;
|
|
import com.ydtech.modules.admin.model.SysDeptAccount;
|
|
|
|
|
+import com.ydtech.modules.admin.model.SysDeptAccountHistory;
|
|
|
import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
|
|
import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
|
|
|
import com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo;
|
|
import com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo;
|
|
|
|
|
+import com.ydtech.modules.admin.service.SysDeptAccountHistoryService;
|
|
|
import com.ydtech.modules.admin.service.SysDeptAccountService;
|
|
import com.ydtech.modules.admin.service.SysDeptAccountService;
|
|
|
import com.ydtech.modules.admin.service.SysDeptAccountWithdrawService;
|
|
import com.ydtech.modules.admin.service.SysDeptAccountWithdrawService;
|
|
|
|
|
+import com.ydtech.modules.base.controller.BaseController;
|
|
|
|
|
+import com.ydtech.utils.idgen.IdGenerate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class SysDeptAccountWithdrawServiceImpl extends ServiceImpl<SysDeptAccountWithdrawMapper, SysDeptAccountWithdraw> implements SysDeptAccountWithdrawService {
|
|
public class SysDeptAccountWithdrawServiceImpl extends ServiceImpl<SysDeptAccountWithdrawMapper, SysDeptAccountWithdraw> implements SysDeptAccountWithdrawService {
|
|
@@ -27,6 +33,9 @@ public class SysDeptAccountWithdrawServiceImpl extends ServiceImpl<SysDeptAccoun
|
|
|
private SysDeptAccountWithdrawService sysDeptAccountWithdrawService;
|
|
private SysDeptAccountWithdrawService sysDeptAccountWithdrawService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SysDeptAccountService sysDeptAccountService;
|
|
private SysDeptAccountService sysDeptAccountService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysDeptAccountHistoryService sysDeptAccountHistoryService;
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<SysDeptAccountWithdraw> getList(SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo) {
|
|
public IPage<SysDeptAccountWithdraw> getList(SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo) {
|
|
|
PageRequest pageRequest = new PageRequest();
|
|
PageRequest pageRequest = new PageRequest();
|
|
@@ -41,8 +50,22 @@ public class SysDeptAccountWithdrawServiceImpl extends ServiceImpl<SysDeptAccoun
|
|
|
public HttpResult updateByStatus(SysDeptAccountWithdraw sysDeptAccountWithdraw) {
|
|
public HttpResult updateByStatus(SysDeptAccountWithdraw sysDeptAccountWithdraw) {
|
|
|
if (sysDeptAccountWithdraw.getStatus().equals(SysDeptAccountStatus.PASS.getCode())) {
|
|
if (sysDeptAccountWithdraw.getStatus().equals(SysDeptAccountStatus.PASS.getCode())) {
|
|
|
SysDeptAccount sysDeptAccount = sysDeptAccountService.getById(sysDeptAccountWithdraw.getDeptId());
|
|
SysDeptAccount sysDeptAccount = sysDeptAccountService.getById(sysDeptAccountWithdraw.getDeptId());
|
|
|
- sysDeptAccount.setManagementFee(sysDeptAccount.getManagementFee().subtract(sysDeptAccountWithdraw.getAmount()));
|
|
|
|
|
|
|
+ sysDeptAccount.setManagementFee(sysDeptAccount.getManagementFee());
|
|
|
sysDeptAccountService.updateById(sysDeptAccount);
|
|
sysDeptAccountService.updateById(sysDeptAccount);
|
|
|
|
|
+ // 机构历史明细生成提现明细
|
|
|
|
|
+ SysDeptAccountHistory sysDeptAccountHistory = new SysDeptAccountHistory();
|
|
|
|
|
+ sysDeptAccountHistory.setId(IdGenerate.nextId());
|
|
|
|
|
+ sysDeptAccountHistory.setDeptId(sysDeptAccount.getDeptId());
|
|
|
|
|
+ sysDeptAccountHistory.setAmount(sysDeptAccountWithdraw.getAmount());
|
|
|
|
|
+ sysDeptAccountHistory.setSurplusAmount(sysDeptAccount.getManagementFee());
|
|
|
|
|
+ sysDeptAccountHistory.setSuborder(sysDeptAccountWithdraw.getId());
|
|
|
|
|
+ sysDeptAccountHistory.setDocumentary("1"); //提现
|
|
|
|
|
+ sysDeptAccountHistory.setFromBankCard(null);
|
|
|
|
|
+ sysDeptAccountHistory.setToBankCard(null);
|
|
|
|
|
+ sysDeptAccountHistory.setUserId(BaseController.getUser().getId());
|
|
|
|
|
+ sysDeptAccountHistory.setCreateTime(new Date());
|
|
|
|
|
+ sysDeptAccountHistory.setRemark("从" + sysDeptAccountWithdraw.getName() + "机构账户中提现" + sysDeptAccountWithdraw.getAmount() + "元");
|
|
|
|
|
+ sysDeptAccountHistoryService.save(sysDeptAccountHistory);
|
|
|
}
|
|
}
|
|
|
if (sysDeptAccountWithdraw.getStatus().equals(SysDeptAccountStatus.REJECT.getCode())) {
|
|
if (sysDeptAccountWithdraw.getStatus().equals(SysDeptAccountStatus.REJECT.getCode())) {
|
|
|
SysDeptAccount sysDeptAccount = sysDeptAccountService.getById(sysDeptAccountWithdraw.getDeptId());
|
|
SysDeptAccount sysDeptAccount = sysDeptAccountService.getById(sysDeptAccountWithdraw.getDeptId());
|