feat:充值申请删除
This commit is contained in:
1 parent
d7615c1bde
commit
73efbfc4c9
3 files changed
+38
-1
No files matched your search
+2
-1
@@ -117,7 +117,8 @@ public class WalletRechargeApplyController {
|
|||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_del')")
|
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_del')")
|
||||||
public R removeById(@RequestBody Long[] ids) {
|
public R removeById(@RequestBody Long[] ids) {
|
||||||
return R.ok(walletRechargeApplyService.removeBatchByIds(CollUtil.toList(ids)));
|
walletRechargeApplyService.delByIds(CollUtil.toList(ids));
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+6
@@ -12,6 +12,7 @@ import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
|||||||
import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo;
|
import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface WalletRechargeApplyService extends IService<WalletRechargeApplyEntity> {
|
public interface WalletRechargeApplyService extends IService<WalletRechargeApplyEntity> {
|
||||||
@@ -20,6 +21,11 @@ public interface WalletRechargeApplyService extends IService<WalletRechargeApply
|
|||||||
|
|
||||||
Boolean edit(WalletRechargeApplyDto dto);
|
Boolean edit(WalletRechargeApplyDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除充值/扣款申请
|
||||||
|
*/
|
||||||
|
void delByIds(ArrayList<Long> list);
|
||||||
|
|
||||||
Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto);
|
Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto);
|
||||||
|
|
||||||
Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto);
|
Page<WalletRechargeApplyVo> scopePageList(Page page, WalletRechargeApplyDto dto);
|
||||||
|
|||||||
+30
@@ -29,6 +29,7 @@ import com.bsd.pjcloud.flow.task.constant.NodeStatusEnum;
|
|||||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||||
import com.bsd.pjcloud.flow.task.dto.TaskDto;
|
import com.bsd.pjcloud.flow.task.dto.TaskDto;
|
||||||
|
import com.bsd.pjcloud.flow.task.dto.TaskParamDto;
|
||||||
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
|
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
|
||||||
import com.bsd.pjcloud.wallet.api.constant.WalletBizRechargeEnum;
|
import com.bsd.pjcloud.wallet.api.constant.WalletBizRechargeEnum;
|
||||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||||
@@ -37,6 +38,7 @@ import com.bsd.pjcloud.wallet.api.dto.WalletTypeDto;
|
|||||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
|
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
|
||||||
import com.bsd.pjcloud.wallet.api.dto.recharge.excel.WalletRechargeExcelDto;
|
import com.bsd.pjcloud.wallet.api.dto.recharge.excel.WalletRechargeExcelDto;
|
||||||
|
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||||
@@ -118,6 +120,34 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除充值/扣款申请
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delByIds(ArrayList<Long> list) {
|
||||||
|
if (ObjectUtil.isEmpty(list)) return;
|
||||||
|
for (Long v : list) {
|
||||||
|
// 只有未审批和审核中能删除
|
||||||
|
WalletRechargeApplyEntity detail = baseMapper.selectById(v);
|
||||||
|
if (ObjectUtil.isEmpty(detail)) continue;
|
||||||
|
if (ObjectUtil.isNotEmpty(detail.getProcessStatus()) && ObjectUtil.notEqual(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||||
|
UserInfo userInfo = userService.getByUserId(detail.getUserId()).getData();
|
||||||
|
throw new RuntimeException("用户<" + userInfo.getSysUser().getName() + ">发起的审批不能删除");
|
||||||
|
}
|
||||||
|
// 如果是审批中就取消审批
|
||||||
|
if (ObjectUtil.equals(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||||
|
TaskParamDto dto = new TaskParamDto();
|
||||||
|
dto.setProcessInstanceIdList(List.of(detail.getProcessId()));
|
||||||
|
flowEngineService.stopProcessInstance(dto).getData();
|
||||||
|
}
|
||||||
|
// 删除申请记录
|
||||||
|
baseMapper.deleteById(v);
|
||||||
|
// 删除申请记录条目
|
||||||
|
rechargeImportService.remove(new LambdaQueryWrapper<WalletRechargeImportEntity>().eq(WalletRechargeImportEntity::getApplyId, v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto) {
|
public Page<WalletRechargeApplyVo> pageJoin(Page page, WalletRechargeApplyDto dto) {
|
||||||
Page<WalletRechargeApplyVo> list = baseMapper.pageJoin(page, dto);
|
Page<WalletRechargeApplyVo> list = baseMapper.pageJoin(page, dto);
|
||||||
|
|||||||
Reference in new issue
Block a user