门店钱包提现,审核
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package com.ruoyi.baseUser.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -33,11 +37,14 @@ public class ZcBaseWalletChangeController extends BaseController
|
||||
|
||||
@Autowired
|
||||
private IZcBaseWalletChangeService zcBaseWalletChangeService;
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@RequiresPermissions("baseUser:walletChange:view")
|
||||
@GetMapping()
|
||||
public String walletChange()
|
||||
public String walletChange(ModelMap mmap, ZcBaseWalletChange zcBaseWalletChange)
|
||||
{
|
||||
mmap.put("zcBaseWalletChange", zcBaseWalletChange);
|
||||
return prefix + "/walletChange";
|
||||
}
|
||||
|
||||
@ -124,4 +131,41 @@ public class ZcBaseWalletChangeController extends BaseController
|
||||
{
|
||||
return toAjax(zcBaseWalletChangeService.deleteZcBaseWalletChangeByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/verifyPassword")
|
||||
@ResponseBody
|
||||
public AjaxResult verifyPassword(String password) {
|
||||
// 获取当前登录用户
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
|
||||
// 验证密码是否正确
|
||||
if (passwordService.matches(currentUser, password)) {
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
return AjaxResult.error("密码验证失败");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/passWithdrawal")
|
||||
@ResponseBody
|
||||
public AjaxResult passWithdrawal(Long id) {
|
||||
// 执行审核通过的业务逻辑
|
||||
ZcBaseWalletChange change = new ZcBaseWalletChange();
|
||||
change.setId(id);
|
||||
change.setChangeStatus(ZcBaseWalletChange.PASS);
|
||||
zcBaseWalletChangeService.review(change);
|
||||
return AjaxResult.success("审核通过成功");
|
||||
}
|
||||
|
||||
@PostMapping("/rejectWithdrawal")
|
||||
@ResponseBody
|
||||
public AjaxResult rejectWithdrawal(Long id, String rejectReason) {
|
||||
// 执行审核不通过的业务逻辑
|
||||
ZcBaseWalletChange change = new ZcBaseWalletChange();
|
||||
change.setId(id);
|
||||
change.setChangeStatus(ZcBaseWalletChange.REFUSE);
|
||||
zcBaseWalletChangeService.review(change);
|
||||
return AjaxResult.success("审核不通过操作成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.baseUser.domain;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.operation.domain.CompanyStore;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@ -27,13 +28,15 @@ public class ZcBaseWalletChange extends BaseEntity
|
||||
private Long userId;
|
||||
|
||||
@Transient
|
||||
@Excel(name = "用户")
|
||||
@Excel(name = "门店名称")
|
||||
private String userName;
|
||||
|
||||
/** 变更类型 */
|
||||
@Excel(name = "变更类型", dictType = "key_wallet_change_type")
|
||||
private String changeType;
|
||||
|
||||
/** 审核状态 */
|
||||
@Excel(name = "审核状态", dictType = "key_wallet_change_status")
|
||||
private String changeStatus;
|
||||
/** 支付类型 */
|
||||
@Excel(name = "支付类型", dictType = "key_wallet_pay_type")
|
||||
private String payType;
|
||||
@ -54,6 +57,20 @@ public class ZcBaseWalletChange extends BaseEntity
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
@Transient
|
||||
private CompanyStore companyStore;
|
||||
|
||||
@Transient
|
||||
private String password;
|
||||
|
||||
/** 待审核 */
|
||||
public final static String UNREVIEWED = "UNREVIEWED";
|
||||
/** 审核通过 */
|
||||
public final static String PASS = "PASS";
|
||||
/** 审核拒绝 */
|
||||
public final static String REFUSE = "REFUSE";
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -135,6 +152,30 @@ public class ZcBaseWalletChange extends BaseEntity
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public String getChangeStatus() {
|
||||
return changeStatus;
|
||||
}
|
||||
|
||||
public void setChangeStatus(String changeStatus) {
|
||||
this.changeStatus = changeStatus;
|
||||
}
|
||||
|
||||
public CompanyStore getCompanyStore() {
|
||||
return companyStore;
|
||||
}
|
||||
|
||||
public void setCompanyStore(CompanyStore companyStore) {
|
||||
this.companyStore = companyStore;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -58,4 +58,7 @@ public interface ZcBaseWalletChangeMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseWalletChangeByIds(String[] ids);
|
||||
|
||||
public int review(ZcBaseWalletChange zcBaseWalletChange);
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.ruoyi.baseUser.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseWallet;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 钱包信息Mapper接口
|
||||
@ -84,4 +86,14 @@ public interface ZcBaseWalletMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseWalletChangeByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 更新钱包金额(减少可用金额和余额)
|
||||
* @param userId 用户ID
|
||||
* @param amount 提现金额
|
||||
* @return 更新记录数
|
||||
*/
|
||||
public int reduceWalletAmount(@Param("userId") Long userId, @Param("amount") BigDecimal amount);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -58,4 +58,12 @@ public interface IZcBaseWalletChangeService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseWalletChangeById(Long id);
|
||||
|
||||
/**
|
||||
* 钱包变更记录审核
|
||||
* @param zcBaseWalletChange
|
||||
* @return
|
||||
*/
|
||||
public int review(ZcBaseWalletChange zcBaseWalletChange);
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.ruoyi.baseUser.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseWallet;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 钱包信息Service接口
|
||||
@ -58,4 +60,6 @@ public interface IZcBaseWalletService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseWalletByUserId(Long userId);
|
||||
|
||||
public int reduceWalletAmount(Long userId, BigDecimal amount);
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.baseUser.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.baseUser.service.IZcBaseWalletService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -8,6 +10,7 @@ import com.ruoyi.baseUser.mapper.ZcBaseWalletChangeMapper;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseWalletChange;
|
||||
import com.ruoyi.baseUser.service.IZcBaseWalletChangeService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 钱包变更记录Service业务层处理
|
||||
@ -21,6 +24,8 @@ public class ZcBaseWalletChangeServiceImpl implements IZcBaseWalletChangeService
|
||||
@Autowired
|
||||
private ZcBaseWalletChangeMapper zcBaseWalletChangeMapper;
|
||||
|
||||
@Autowired
|
||||
private IZcBaseWalletService zcBaseWalletService;
|
||||
/**
|
||||
* 查询钱包变更记录
|
||||
*
|
||||
@ -94,4 +99,31 @@ public class ZcBaseWalletChangeServiceImpl implements IZcBaseWalletChangeService
|
||||
{
|
||||
return zcBaseWalletChangeMapper.deleteZcBaseWalletChangeById(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int review(ZcBaseWalletChange zcBaseWalletChange) {
|
||||
// 1. 获取提现记录
|
||||
ZcBaseWalletChange walletChange = zcBaseWalletChangeMapper.selectZcBaseWalletChangeById(zcBaseWalletChange.getId());
|
||||
if (walletChange == null) {
|
||||
throw new RuntimeException("提现记录不存在");
|
||||
}
|
||||
if (!ZcBaseWalletChange.UNREVIEWED.equals(walletChange.getChangeStatus())) {
|
||||
throw new RuntimeException("提现记录状态异常");
|
||||
}
|
||||
zcBaseWalletChange.setUpdateTime(DateUtils.getNowDate());
|
||||
int flag = zcBaseWalletChangeMapper.review(zcBaseWalletChange);
|
||||
if(flag > 0 && ZcBaseWalletChange.PASS.equals(zcBaseWalletChange.getChangeStatus())){
|
||||
// 更新钱包金额(减少可用金额和余额)
|
||||
flag = zcBaseWalletService.reduceWalletAmount(
|
||||
walletChange.getUserId(),
|
||||
walletChange.getChangeAmount()
|
||||
);
|
||||
|
||||
if (flag == 0) {
|
||||
throw new RuntimeException("钱包余额不足,无法完成提现");
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.baseUser.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -109,6 +110,11 @@ public class ZcBaseWalletServiceImpl implements IZcBaseWalletService
|
||||
return zcBaseWalletMapper.deleteZcBaseWalletByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reduceWalletAmount(Long userId, BigDecimal amount) {
|
||||
return zcBaseWalletMapper.reduceWalletAmount(userId, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钱包变更记录信息
|
||||
*
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.ruoyi.operation.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.baseUser.domain.ZcBaseWallet;
|
||||
import com.ruoyi.baseUser.service.IZcBaseWalletService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysAreaHn;
|
||||
@ -11,6 +14,7 @@ import com.ruoyi.operation.mapper.CompanyStoreMapper;
|
||||
import com.ruoyi.operation.domain.CompanyStore;
|
||||
import com.ruoyi.operation.service.ICompanyStoreService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 门店Service业务层处理
|
||||
@ -25,6 +29,9 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
private CompanyStoreMapper companyStoreMapper;
|
||||
@Autowired
|
||||
private ISysAreaHnService sysAreaHnService;
|
||||
@Autowired
|
||||
private IZcBaseWalletService zcBaseWalletService;
|
||||
|
||||
/**
|
||||
* 查询门店
|
||||
*
|
||||
@ -73,6 +80,7 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
* @param companyStore 门店
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertCompanyStore(CompanyStore companyStore)
|
||||
{
|
||||
@ -81,7 +89,18 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
companyStore.setStatus("0");
|
||||
|
||||
setAreaInfo(companyStore);
|
||||
return companyStoreMapper.insertCompanyStore(companyStore);
|
||||
int flag = companyStoreMapper.insertCompanyStore(companyStore);
|
||||
if(flag > 0){
|
||||
// 同步创建门店钱包
|
||||
ZcBaseWallet newZcBaseWallet = new ZcBaseWallet();
|
||||
newZcBaseWallet.setUserId(companyStore.getId());
|
||||
newZcBaseWallet.setUserName(companyStore.getName());
|
||||
newZcBaseWallet.setPhoneNumber(companyStore.getPhone());
|
||||
newZcBaseWallet.setCreateTime(DateUtils.getNowDate());
|
||||
zcBaseWalletService.insertZcBaseWallet(newZcBaseWallet);
|
||||
}
|
||||
return flag;
|
||||
|
||||
}
|
||||
|
||||
private void setAreaInfo(CompanyStore companyStore){
|
||||
|
||||
@ -65,6 +65,7 @@ public class ZcCarModelServiceImpl implements IZcCarModelService
|
||||
return zcCarModelMapper.selectZcCarModelList(zcCarModel);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public List<ZcCarModel> selectCarModelListByCarRuleId(Long rentCarRuleId) {
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ import com.ruoyi.operation.mapper.ZcCarMapper;
|
||||
import com.ruoyi.operation.domain.ZcCar;
|
||||
import com.ruoyi.operation.service.IZcCarService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.validation.Validator;
|
||||
|
||||
@ -140,6 +141,7 @@ public class ZcCarServiceImpl implements IZcCarService
|
||||
return zcCarMapper.updateZcCar(zcCar);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public String importCar(List<ZcCar> carList, Boolean isUpdateSupport, SysUser user) {
|
||||
if (StringUtils.isNull(carList) || carList.size() == 0)
|
||||
|
||||
@ -16,6 +16,7 @@ import com.ruoyi.operation.mapper.ZcRentCarRuleMapper;
|
||||
import com.ruoyi.operation.domain.ZcRentCarRule;
|
||||
import com.ruoyi.operation.service.IZcRentCarRuleService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 租车计费规则Service业务层处理
|
||||
@ -97,6 +98,7 @@ public class ZcRentCarRuleServiceImpl implements IZcRentCarRuleService
|
||||
* @param zcRentCarRule 租车计费规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateZcRentCarRule(List<Long> carModelIds,ZcRentCarRule zcRentCarRule)
|
||||
{
|
||||
|
||||
@ -164,6 +164,9 @@ public class ZcOrderMain extends BaseEntity
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 订单是否已分成 */
|
||||
private Integer distribed;
|
||||
|
||||
/** 租车子订单信息 */
|
||||
private List<ZcOrderSub> zcOrderSubList;
|
||||
|
||||
@ -525,6 +528,14 @@ public class ZcOrderMain extends BaseEntity
|
||||
this.zcOrderCarImgList = zcOrderCarImgList;
|
||||
}
|
||||
|
||||
public Integer getDistribed() {
|
||||
return distribed;
|
||||
}
|
||||
|
||||
public void setDistribed(Integer distribed) {
|
||||
this.distribed = distribed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
|
||||
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="changeType" column="change_type" />
|
||||
<result property="changeStatus" column="change_status" />
|
||||
<result property="payType" column="pay_type" />
|
||||
<result property="changeTime" column="change_time" />
|
||||
<result property="changeAmount" column="change_amount" />
|
||||
@ -16,31 +17,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="userName" column="userName" />
|
||||
|
||||
<association property="companyStore" javaType="CompanyStore">
|
||||
<result property="id" column="store_id" />
|
||||
<result property="name" column="store_name" />
|
||||
<result property="contactPerson" column="store_contact_person" />
|
||||
<result property="phone" column="store_phone" />
|
||||
<result property="operatingNature" column="store_operating_nature" />
|
||||
<result property="zucheRatio" column="store_zuche_ratio" />
|
||||
<result property="zudianRatio" column="store_zudian_ratio" />
|
||||
<result property="daishouRatio" column="store_daishou_ratio" />
|
||||
<result property="storeNumber" column="store_store_number" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcBaseWalletChangeVo">
|
||||
select id, user_id, change_type, pay_type, change_time, change_amount, referral_order_no, del_flag, create_time, update_time from zc_base_wallet_change
|
||||
select a.id, a.user_id, a.change_type, a.change_status, a.pay_type, a.change_time, a.change_amount, a.referral_order_no, a.del_flag, a.create_time, a.update_time,
|
||||
s.id as store_id,
|
||||
s.name as store_name,
|
||||
s.contact_person as store_contact_person,
|
||||
s.phone as store_phone,
|
||||
s.operating_nature as store_operating_nature,
|
||||
s.zuche_ratio as store_zuche_ratio,
|
||||
s.zudian_ratio as store_zudian_ratio,
|
||||
s.daishou_ratio as store_daishou_ratio,
|
||||
s.store_number as store_store_number
|
||||
from zc_base_wallet_change a
|
||||
left join zc_company_store s on a.user_id = s.id
|
||||
</sql>
|
||||
|
||||
<select id="selectZcBaseWalletChangeList" parameterType="ZcBaseWalletChange" resultMap="ZcBaseWalletChangeResult">
|
||||
select a.id, a.user_id, a.change_type, a.pay_type, a.change_time, a.change_amount, a.referral_order_no, a.del_flag, a.create_time, a.update_time,
|
||||
b.user_name as userName
|
||||
from zc_base_wallet_change a
|
||||
left join zc_base_user b on a.user_id = b.id
|
||||
<include refid="selectZcBaseWalletChangeVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and a.user_id = #{userId}</if>
|
||||
<if test="changeType != null and changeType != ''"> and a.change_type = #{changeType}</if>
|
||||
<if test="changeStatus != null and changeStatus != ''"> and a.change_status = #{changeStatus}</if>
|
||||
<if test="payType != null and payType != ''"> and a.pay_type = #{payType}</if>
|
||||
<if test="changeTime != null "> and a.change_time = #{changeTime}</if>
|
||||
<if test="changeAmount != null "> and a.change_amount = #{changeAmount}</if>
|
||||
<if test="referralOrderNo != null and referralOrderNo != ''"> and a.referral_order_no = #{referralOrderNo}</if>
|
||||
<if test="userName != null and userName != ''"> and b.user_name = #{userName}</if>
|
||||
<if test="userName != null and userName != ''"> and s.name = #{userName}</if>
|
||||
</where>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectZcBaseWalletChangeById" parameterType="Long" resultMap="ZcBaseWalletChangeResult">
|
||||
<include refid="selectZcBaseWalletChangeVo"/>
|
||||
where id = #{id}
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcBaseWalletChange" parameterType="ZcBaseWalletChange" useGeneratedKeys="true" keyProperty="id">
|
||||
@ -74,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
|
||||
<if test="changeStatus != null and changeStatus != ''">change_status = #{changeStatus},</if>
|
||||
<if test="payType != null and payType != ''">pay_type = #{payType},</if>
|
||||
<if test="changeTime != null">change_time = #{changeTime},</if>
|
||||
<if test="changeAmount != null">change_amount = #{changeAmount},</if>
|
||||
@ -84,6 +108,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="review">
|
||||
update zc_base_wallet_change
|
||||
<set>
|
||||
<if test="changeStatus != null and changeStatus != ''">change_status = #{changeStatus},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcBaseWalletChangeById" parameterType="Long">
|
||||
delete from zc_base_wallet_change where id = #{id}
|
||||
|
||||
@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="userId" column="sub_user_id" />
|
||||
<result property="changeType" column="sub_change_type" />
|
||||
<result property="changeStatus" column="sub_change_status" />
|
||||
<result property="payType" column="sub_pay_type" />
|
||||
<result property="changeTime" column="sub_change_time" />
|
||||
<result property="changeAmount" column="sub_change_amount" />
|
||||
@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectZcBaseWalletByUserId" parameterType="Long" resultMap="ZcBaseWalletZcBaseWalletChangeResult">
|
||||
select a.user_id, a.user_name, a.phone_number, a.balance, a.available_amount, a.freeze_amount, a.del_flag, a.create_time, a.update_time,
|
||||
b.id as sub_id, b.user_id as sub_user_id, b.change_type as sub_change_type, b.pay_type as sub_pay_type, b.change_time as sub_change_time, b.change_amount as sub_change_amount, b.referral_order_no as sub_referral_order_no, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
|
||||
b.id as sub_id, b.user_id as sub_user_id, b.change_type as sub_change_type, b.change_status as sub_change_status, b.pay_type as sub_pay_type, b.change_time as sub_change_time, b.change_amount as sub_change_amount, b.referral_order_no as sub_referral_order_no, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
|
||||
from zc_base_wallet a
|
||||
left join zc_base_wallet_change b on b.user_id = a.user_id
|
||||
where a.user_id = #{userId}
|
||||
@ -124,4 +125,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 减少钱包金额 -->
|
||||
<update id="reduceWalletAmount">
|
||||
UPDATE zc_base_wallet
|
||||
SET
|
||||
available_amount = available_amount - #{amount},
|
||||
balance = balance - #{amount},
|
||||
update_time = NOW()
|
||||
WHERE user_id = #{userId}
|
||||
AND available_amount >= #{amount}
|
||||
AND balance >= #{amount}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="operatorName" column="operator_name" />
|
||||
<result property="storeName" column="store_name" />
|
||||
<result property="licensePlate" column="license_plate" />
|
||||
<result property="distribed" column="distribed" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ZcOrderMainZcOrderSubResult" type="ZcOrderMain" extends="ZcOrderMainResult">
|
||||
@ -87,11 +88,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcOrderMainVo">
|
||||
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, del_flag, create_time, update_time from zc_order_main
|
||||
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, distribed, del_flag, create_time, update_time from zc_order_main
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time,a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
|
||||
from zc_order_main a
|
||||
left join zc_company c on c.id = a.operator_id
|
||||
@ -133,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.pay_status as sub_pay_status,b.transaction_id as sub_transaction_id, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||
@ -147,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectZcOrderMainImgByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderCarImgResult">
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
|
||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||
from zc_order_main a
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<h4 class="form-header h4">钱包信息</h4>
|
||||
<input name="userId" th:field="*{userId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">用户名:</label>
|
||||
<label class="col-sm-2 control-label is-required">门店名称:</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-control-static" th:text="*{userName}"></div>
|
||||
</div>
|
||||
@ -60,7 +60,7 @@
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "baseUser/wallet";
|
||||
var changeTypeDatas = [[${@dict.getType('key_wallet_change_type')}]];
|
||||
var payTypeDatas = [[${@dict.getType('key_wallet_pay_type')}]];
|
||||
var changeStatusDatas = [[${@dict.getType('key_wallet_change_status')}]];
|
||||
$("#form-wallet-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
@ -100,16 +100,6 @@
|
||||
return $.table.selectDictLabel(changeTypeDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'payType',
|
||||
align: 'center',
|
||||
title: '支付类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(payTypeDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'changeTime',
|
||||
align: 'center',
|
||||
@ -128,9 +118,11 @@
|
||||
title: '引荐订单'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
align: 'center',
|
||||
title: '操作时间'
|
||||
field: 'changeStatus',
|
||||
title: '申请状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(changeStatusDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>用户名:</label>
|
||||
<label>门店名称:</label>
|
||||
<input type="text" name="userName"/>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@ -8,33 +8,27 @@
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-walletChange-edit" th:object="${zcBaseWalletChange}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">用户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="userId" th:field="*{userId}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">变更时间:</label>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">提现门店:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="changeTime" th:value="${#dates.format(zcBaseWalletChange.changeTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<div class="form-control-static" th:text="*{companyStore.name}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">变更金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="changeAmount" th:field="*{changeAmount}" class="form-control" type="text" required>
|
||||
<div class="form-control-static" th:text="*{changeAmount}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">引荐订单:</label>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">密码确认:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="referralOrderNo" th:field="*{referralOrderNo}" class="form-control" type="text">
|
||||
<input id="password" name="password" class="form-control" type="password" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
|
||||
@ -10,10 +10,18 @@
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<input type="hidden" name="changeType" th:field="*{zcBaseWalletChange.changeType}"/>
|
||||
<li>
|
||||
<label>用户:</label>
|
||||
<label>门店名称:</label>
|
||||
<input type="text" name="userName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>申请状态:</label>
|
||||
<select name="changeStatus" th:with="type=${@dict.getType('key_wallet_change_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
@ -47,7 +55,10 @@
|
||||
var editFlag = [[${@permission.hasPermi('baseUser:walletChange:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('baseUser:walletChange:remove')}]];
|
||||
var changeTypeDatas = [[${@dict.getType('key_wallet_change_type')}]];
|
||||
var payTypeDatas = [[${@dict.getType('key_wallet_pay_type')}]];
|
||||
var changeStatusDatas = [[${@dict.getType('key_wallet_change_status')}]];
|
||||
var labelDatas = [[${@dict.getType('key_store_level')}]];
|
||||
var operatingNatureDatas = [[${@dict.getType('key_store_operating_nature')}]];
|
||||
|
||||
var prefix = ctx + "baseUser/walletChange";
|
||||
|
||||
$(function() {
|
||||
@ -57,7 +68,7 @@
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "钱包变更记录",
|
||||
modalName: "钱包变更",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
@ -67,48 +78,222 @@
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'userName',
|
||||
title: '用户'
|
||||
field: 'companyStore.storeNumber',
|
||||
title: '门店编码'
|
||||
},
|
||||
{
|
||||
field: 'companyStore.name',
|
||||
title: '门店名称'
|
||||
},
|
||||
{
|
||||
field: 'companyStore.operatingNature',
|
||||
title: '运营性质',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(operatingNatureDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'companyStore.contactPerson',
|
||||
title: '联系人'
|
||||
},
|
||||
{
|
||||
field: 'companyStore.phone',
|
||||
title: '联系电话'
|
||||
},
|
||||
{
|
||||
field: 'companyStore.zucheRatio',
|
||||
title: '租车分成比例',
|
||||
formatter: function(value, row, index) {
|
||||
return value +"%";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'changeType',
|
||||
title: '变更类型',
|
||||
title: '申请类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(changeTypeDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'payType',
|
||||
title: '支付类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(payTypeDatas, value);
|
||||
}
|
||||
field: 'changeAmount',
|
||||
title: '申请提现金额(元)'
|
||||
},
|
||||
{
|
||||
field: 'changeTime',
|
||||
title: '变更时间'
|
||||
title: '申请时间'
|
||||
},
|
||||
{
|
||||
field: 'changeAmount',
|
||||
title: '变更金额(元)'
|
||||
},
|
||||
{
|
||||
field: 'referralOrderNo',
|
||||
title: '引荐订单'
|
||||
field: 'changeStatus',
|
||||
title: '申请状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(changeStatusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
if (row.changeStatus == 'UNREVIEWED') {
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="review(\'' + row.id + '\')"><i class="fa fa-edit"></i>提现审核</a> ');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
|
||||
function review(id){
|
||||
var index = layer.open({
|
||||
type: 2, // iframe模式
|
||||
title: '确认是否通过此门店的提现申请?',
|
||||
area: ['900px', '320px'],
|
||||
content: prefix + "/edit/" + id,
|
||||
btn: ['<i class="fa fa-check"></i> 通过提现申请', '<i class="fa fa-close"></i> 关闭', '<i class="fa fa-close"></i> 审核不通过'],
|
||||
yes: function(index, layero){
|
||||
// 通过提现申请
|
||||
passWithdrawal(index, layero);
|
||||
return false;
|
||||
},
|
||||
btn2: function(index, layero){
|
||||
// 关闭
|
||||
layer.close(index);
|
||||
return false;
|
||||
},
|
||||
btn3: function(index, layero){
|
||||
// 不通过
|
||||
rejectWithdrawal(index, layero);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 通过提现申请的方法
|
||||
function passWithdrawal(index, layero) {
|
||||
// 获取iframe中的表单数据,包括密码
|
||||
var iframeWin = layero.find('iframe')[0].contentWindow;
|
||||
var password = iframeWin.$('#password').val(); // 获取密码字段的值
|
||||
|
||||
if (!password) {
|
||||
layer.msg('请输入登录密码进行验证', {icon: 5});
|
||||
return;
|
||||
}
|
||||
|
||||
// 发送 AJAX 请求验证密码
|
||||
$.ajax({
|
||||
url: prefix + "/verifyPassword",
|
||||
type: "POST",
|
||||
data: {
|
||||
password: password
|
||||
},
|
||||
success: function(result) {
|
||||
if (result.code == 0) { // 密码验证通过
|
||||
// 执行提现审核通过操作
|
||||
executePassWithdrawal(index, iframeWin);
|
||||
} else {
|
||||
layer.msg('密码验证失败: ' + result.msg, {icon: 5});
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.msg('密码验证请求失败', {icon: 5});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 执行提现审核通过的具体操作
|
||||
function executePassWithdrawal(layerIndex, iframeWin) {
|
||||
// 获取审核ID等必要信息
|
||||
var id = iframeWin.$('#id').val(); // 假设有隐藏字段存储ID
|
||||
|
||||
// 发送审核通过的请求
|
||||
$.ajax({
|
||||
url: prefix + "/passWithdrawal",
|
||||
type: "POST",
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function(result) {
|
||||
if (result.code == 0) {
|
||||
layer.msg('审核通过成功', {icon: 1});
|
||||
// 关闭弹窗
|
||||
layer.close(layerIndex);
|
||||
// 刷新表格数据
|
||||
$.table.refresh();
|
||||
} else {
|
||||
layer.msg('审核失败: ' + result.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.msg('审核请求失败', {icon: 2});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 不通过提现申请的方法
|
||||
function rejectWithdrawal(index, layero) {
|
||||
// 获取iframe中的表单数据,包括密码
|
||||
var iframeWin = layero.find('iframe')[0].contentWindow;
|
||||
var password = iframeWin.$('#password').val(); // 获取密码字段的值
|
||||
|
||||
if (!password) {
|
||||
layer.msg('请输入登录密码进行验证', {icon: 5});
|
||||
return;
|
||||
}
|
||||
|
||||
// 发送 AJAX 请求验证密码
|
||||
$.ajax({
|
||||
url: prefix + "/verifyPassword",
|
||||
type: "POST",
|
||||
data: {
|
||||
password: password
|
||||
},
|
||||
success: function(result) {
|
||||
if (result.code == 0) { // 密码验证通过
|
||||
// 执行提现审核不通过操作
|
||||
executeRejectWithdrawal(index, iframeWin);
|
||||
} else {
|
||||
layer.msg('密码验证失败: ' + result.msg, {icon: 5});
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.msg('密码验证请求失败', {icon: 5});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 执行提现审核不通过的具体操作
|
||||
function executeRejectWithdrawal(layerIndex, iframeWin) {
|
||||
// 获取审核ID等必要信息
|
||||
var id = iframeWin.$('#id').val(); // 假设有隐藏字段存储ID
|
||||
|
||||
// 发送审核不通过的请求
|
||||
$.ajax({
|
||||
url: prefix + "/rejectWithdrawal",
|
||||
type: "POST",
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function(result) {
|
||||
if (result.code == 0) {
|
||||
layer.msg('审核不通过操作成功', {icon: 1});
|
||||
// 关闭弹窗
|
||||
layer.close(layerIndex);
|
||||
// 刷新表格数据
|
||||
$.table.refresh();
|
||||
} else {
|
||||
layer.msg('审核操作失败: ' + result.msg, {icon: 2});
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.msg('审核请求失败', {icon: 2});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -48,7 +48,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">所属运营商:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b">
|
||||
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b" required>
|
||||
<option value="">请选择所属运营商</option>
|
||||
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}"></option>
|
||||
</select>
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">所属运营商:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b">
|
||||
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b" required>
|
||||
<option value="">请选择所属运营商</option>
|
||||
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}" th:field="*{operatingCompanyId}" ></option>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user