确认已收款按钮,添加管理员校验

master
CJYXTX\27961 7 months ago
parent da7247455d
commit 0fab591fa0

@ -1,13 +1,17 @@
package jnpf.controller; package jnpf.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.permission.model.organize.OrganizeCrModel;
import jnpf.permission.service.OrganizeService;
import jnpf.service.*; import jnpf.service.*;
import jnpf.entity.*; import jnpf.entity.*;
import jnpf.util.*; import jnpf.util.*;
@ -70,7 +74,8 @@ public class NxWalletController {
@Autowired @Autowired
private NxWalletService nxWalletService; private NxWalletService nxWalletService;
@Autowired
private OrganizeService organizeService;
@Autowired @Autowired
@ -390,9 +395,28 @@ public class NxWalletController {
entity.setRechargeStatus(status); entity.setRechargeStatus(status);
nxWalletService.update(id, entity); nxWalletService.update(id, entity);
}else if (entity.getRechargeStatus().equals("2")){ }else if (entity.getRechargeStatus().equals("2")){
// String userId=userProvider.get().getUserId();
// String userOrgId=userProvider.get().getOrganizeId();
String userUserAccountId=userProvider.get().getUserAccount();
QueryWrapper<OrganizeEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(OrganizeEntity::getId,entity.getCompanyId());
List<OrganizeEntity> organizeEntityList = organizeService.list(queryWrapper);
if (organizeEntityList.size()>0){
//organize表的json赋值出来
OrganizeCrModel organizeCrModel=new OrganizeCrModel();
organizeCrModel= JSONObject.parseObject(organizeEntityList.get(0).getPropertyJson(),OrganizeCrModel.class);
organizeCrModel.getManagerTelePhone();
//修改人手机号是否等于商户创建人的手机号
boolean areEqual = userUserAccountId.equals(organizeCrModel.getManagerTelePhone());
if (areEqual==false){
return ActionResult.fail("修改数据状态失败,该按钮需要商户管理员修改");
}else {
entity.setOrderStatus(status); entity.setOrderStatus(status);
nxWalletService.update(id, entity); nxWalletService.update(id, entity);
} }
}
}
}catch(Exception e){ }catch(Exception e){
return ActionResult.fail("修改数据状态失败"); return ActionResult.fail("修改数据状态失败");

Loading…
Cancel
Save