Commit 14829d7d authored by machengbo's avatar machengbo

提现审核

parent 58c74275
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- mybatis plus --> <!-- mybatis plus -->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
......
...@@ -167,6 +167,9 @@ public class PlatformTradeFlowInfoController extends BaseController { ...@@ -167,6 +167,9 @@ public class PlatformTradeFlowInfoController extends BaseController {
if (StringUtils.isEmpty(cashOutAuditRequest.getCashOutId())) { if (StringUtils.isEmpty(cashOutAuditRequest.getCashOutId())) {
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
if (StringUtils.isEmpty(cashOutAuditRequest.getAuditStatus())) {
return Result.error("参数不能为空!");
}
Result<Object> dto = platformTradeFlowInfoService.uptCashOutInfoAuditByid(cashOutAuditRequest); Result<Object> dto = platformTradeFlowInfoService.uptCashOutInfoAuditByid(cashOutAuditRequest);
return dto; return dto;
} }
......
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -20,6 +22,7 @@ public class FinanceCustomerAssets implements Serializable { ...@@ -20,6 +22,7 @@ public class FinanceCustomerAssets implements Serializable {
/** /**
* 资产id * 资产id
*/ */
@TableId(value = "assets_id",type = IdType.AUTO)
private Long assetsId; private Long assetsId;
/** /**
* 企业id * 企业id
......
package com.jz.manage.moduls.mapper; package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.FinanceCustomerAssets; import com.jz.manage.moduls.entity.FinanceCustomerAssets;
/** /**
* 商城企业客户资产(TFinanceCustomerAssets)表数据库访问层 * 商城企业客户资产(TFinanceCustomerAssets)表数据库访问层
......
...@@ -5,18 +5,24 @@ import com.github.pagehelper.PageInfo; ...@@ -5,18 +5,24 @@ import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.finance.platForm.*; import com.jz.manage.moduls.controller.finance.platForm.*;
import com.jz.manage.moduls.entity.FinanceCashOut; import com.jz.manage.moduls.entity.FinanceCashOut;
import com.jz.manage.moduls.entity.FinanceCustomerAssets;
import com.jz.manage.moduls.mapper.FinanceCashOutDao; import com.jz.manage.moduls.mapper.FinanceCashOutDao;
import com.jz.manage.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.manage.moduls.mapper.PlatformTradeFlowInfoDao; import com.jz.manage.moduls.mapper.PlatformTradeFlowInfoDao;
import com.jz.manage.moduls.service.PlatformTradeFlowInfoService; import com.jz.manage.moduls.service.PlatformTradeFlowInfoService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -32,12 +38,17 @@ import java.util.Map; ...@@ -32,12 +38,17 @@ import java.util.Map;
@Transactional @Transactional
public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoService { public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoService {
private static final Logger logger = LoggerFactory.getLogger(PlatformTradeFlowInfoServiceImpl.class);
@Autowired @Autowired
private PlatformTradeFlowInfoDao platformTradeFlowInfoDao; private PlatformTradeFlowInfoDao platformTradeFlowInfoDao;
@Autowired @Autowired
private FinanceCashOutDao financeCashOutDao; private FinanceCashOutDao financeCashOutDao;
@Autowired
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
@Override @Override
public PlatFormMoneyAndDepartDto queryPlatFormMoneyAndDepart(Map map) throws Exception { public PlatFormMoneyAndDepartDto queryPlatFormMoneyAndDepart(Map map) throws Exception {
return platformTradeFlowInfoDao.queryPlatFormMoneyAndDepart(map); return platformTradeFlowInfoDao.queryPlatFormMoneyAndDepart(map);
...@@ -158,8 +169,36 @@ public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoSe ...@@ -158,8 +169,36 @@ public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoSe
cashOut.setAuditStatus(cashOutAuditRequest.getAuditStatus()); cashOut.setAuditStatus(cashOutAuditRequest.getAuditStatus());
cashOut.setAuditTime(new Date()); cashOut.setAuditTime(new Date());
//cashOut.setAuditPerson(); //cashOut.setAuditPerson();
//更新提现状态
int len = financeCashOutDao.updateById(cashOut); int len = financeCashOutDao.updateById(cashOut);
if (len > 0) { if (len > 0) {
logger.info("#####################修改提现状态成功#####################");
//审核通过,修改个人资产,总金额减去提现金额,从冻结金额减去
if (AuditStatusEnum.YSH.getValue().equals(cashOutAuditRequest.getAuditStatus())) {
//查询出提现金额
FinanceCashOut cashOutObj = financeCashOutDao.selectById(cashOutAuditRequest.getCashOutId());
String cashOutMoney = cashOutObj.getCashOutMoney().toString();
BigDecimal txMoney = new BigDecimal(cashOutMoney); //提现金额
if (StringUtils.isNotEmpty(cashOutObj.getAssetsId().toString())) {
FinanceCustomerAssets assetsObj = financeCustomerAssetsDao.selectById(cashOutObj.getAssetsId().toString());
String totalMoney = assetsObj.getTotalMoney().toString();
BigDecimal totalMoneyObj = new BigDecimal(totalMoney); //总金额
totalMoneyObj = totalMoneyObj.subtract(txMoney);
String frozenMoney = assetsObj.getFrozenMoney().toString();//冻结金额
BigDecimal frozenMoneyObJ = new BigDecimal(frozenMoney);
frozenMoneyObJ = frozenMoneyObJ.subtract(txMoney);
FinanceCustomerAssets financeCustomerAssets = new FinanceCustomerAssets();
financeCustomerAssets.setAssetsId(cashOutObj.getAssetsId());
financeCustomerAssets.setTotalMoney(totalMoneyObj);
financeCustomerAssets.setFrozenMoney(frozenMoneyObJ);
//financeCustomerAssets.setUptPerson();
financeCustomerAssets.setUptTime(new Date());
financeCustomerAssetsDao.updateById(financeCustomerAssets);
logger.info("#####################修改资产金额态成功#####################");
}
}
return Result.ok(); return Result.ok();
} else { } else {
return Result.error("提交失败"); return Result.error("提交失败");
......
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