修改登录页

This commit is contained in:
java_cuibaocheng@163.com 2024-05-09 15:04:29 +08:00
parent e9e1bad6a5
commit 4bfb07e7c0
8 changed files with 86 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package cn.com.tenlion.operator.controller.app.api.account;
import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResult;
@ -34,6 +35,7 @@ public class AccountAppController extends DefaultBaseController {
@Autowired @Autowired
private IAccountService accountService; private IAccountService accountService;
// @ApiOperation(value = "新增客户账户", notes = "新增客户账户接口") // @ApiOperation(value = "新增客户账户", notes = "新增客户账户接口")
// @ApiImplicitParams({ // @ApiImplicitParams({
// @ApiImplicitParam(name = "token", value = "token", paramType = "header") // @ApiImplicitParam(name = "token", value = "token", paramType = "header")

View File

@ -9,17 +9,18 @@ import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.SearchException; import ink.wgink.exceptions.SearchException;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData; import ink.wgink.pojo.result.SuccessResultData;
import io.swagger.annotations.Api; import io.swagger.annotations.*;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.xml.crypto.Data;
/** /**
* @ClassName: SystemUserlController * @ClassName: SystemUserlController
* @Description: 系统用户 * @Description: 系统用户
@ -41,6 +42,20 @@ public class SystemUserAppController extends DefaultBaseController {
@Autowired @Autowired
private UserUtil userUtil; private UserUtil userUtil;
@Autowired
private IDataService iDataService;
/**
* 数据字典
* @param dataId
* @return
*/
@GetMapping("get" + ISystemConstant.RELEASE_SUFFIX + "/{dataId}")
public DataDTO get(@PathVariable("dataId") String dataId) {
return iDataService.get(dataId);
}
/** /**
* 获取登录跳转地址 * 获取登录跳转地址
* @return * @return

View File

@ -47,6 +47,41 @@ public class AccountItemResourceController extends DefaultBaseController {
@Autowired @Autowired
protected SecurityComponent securityComponent; protected SecurityComponent securityComponent;
@ApiOperation(value = "代理商订单完成", notes = "代理商订单完成接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("pay-in-shop")
@CheckRequestBodyAnnotation
public SuccessResult payInShop(@RequestBody AccountItemOrderVO accountItemOrderVO) throws Exception {
String code = EncryptUtil.decode(accountItemOrderVO.getCode());
JSONObject jsonObject = JSONObject.parseObject(code);
String time = jsonObject.getString("time");
Integer money = jsonObject.getInteger("money");
String userId = jsonObject.getString("userId");
String orderId = jsonObject.getString("orderId");
Date dateTime = sdf.parse(time);
long diffInMillis = Math.abs(System.currentTimeMillis() - dateTime.getTime());
int secondsDiff = (int)(diffInMillis / 1000);
if (secondsDiff > 30) {
throw new SaveException("鉴权失败");
}
if (!money.equals(accountItemOrderVO.getAccountMoney()) || !userId.equals(accountItemOrderVO.getUserId()) || !orderId.equals(accountItemOrderVO.getOrderId())) {
throw new SaveException("鉴权失败");
}
AccountItemVO accountItemVO = new AccountItemVO();
accountItemVO.setMode(1); // 入账
accountItemVO.setType(5); // 收入类型 订单收入
accountItemVO.setAccountId(accountItemOrderVO.getUserId());
accountItemVO.setAccountMoney(accountItemOrderVO.getAccountMoney());
accountItemVO.setDescription(accountItemOrderVO.getDescription());
accountItemVO.setOrderId(accountItemOrderVO.getOrderId());
accountItemVO.setOrderType("shop");
accountItemService.saveShopReturnId( accountItemVO);
return new SuccessResult();
}
@ApiOperation(value = "代理商订单完成", notes = "代理商订单完成接口") @ApiOperation(value = "代理商订单完成", notes = "代理商订单完成接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")

View File

@ -30,8 +30,8 @@ public class AccountItemVO {
@ApiModelProperty(name = "mode", value = "方式1:入账,2:出账") @ApiModelProperty(name = "mode", value = "方式1:入账,2:出账")
@CheckNumberAnnotation(name = "方式1:入账,2:出账") @CheckNumberAnnotation(name = "方式1:入账,2:出账")
private Integer mode; private Integer mode;
@ApiModelProperty(name = "type", value = "流水类型(充值1|支出2|提现3|系统扣款4)") @ApiModelProperty(name = "type", value = "流水类型(充值1|支出2|提现3|系统扣款4|入账5)")
@CheckNumberAnnotation(name = "流水类型(充值1|支出2|提现3|系统扣款4)") @CheckNumberAnnotation(name = "流水类型(充值1|支出2|提现3|系统扣款4|入账5)")
private Integer type; private Integer type;
@ApiModelProperty(name = "description", value = "流水描述") @ApiModelProperty(name = "description", value = "流水描述")
private String description; private String description;

View File

@ -28,6 +28,8 @@ public interface IAccountItemService {
*/ */
String saveItemInReturnId(AccountItemOrderVO accountItemOrderVO, String orderType); String saveItemInReturnId(AccountItemOrderVO accountItemOrderVO, String orderType);
void saveShopReturnId(AccountItemVO accountItemVO);
/** /**
* 保存账户减钱流水 , 如果没有跟order关联 , 无需传入orderId orderType * 保存账户减钱流水 , 如果没有跟order关联 , 无需传入orderId orderType
* @param accountItemOrderVO * @param accountItemOrderVO

View File

@ -279,6 +279,25 @@ public class AccountItemServiceImpl extends DefaultBaseService implements IAccou
saveReturnId(accountItemVO1); saveReturnId(accountItemVO1);
} }
@Override
public void saveShopReturnId(AccountItemVO accountItemVO) {
Map<String, Object> params = super.getHashMap(2);
params.put("orderId", accountItemVO.getOrderId());
List<AccountItemDTO> list = list(params);
for(AccountItemDTO dto : list) {
if(dto.getType().equals("2")) {
if (accountItemVO.getAccountMoney() >= dto.getAccountMoney()) {
throw new SaveException("金额错误");
}
}
if (dto.getType().equals("5")) {
throw new SaveException("请勿重复操作");
}
}
accountItemVO.setType(5);
saveReturnId(accountItemVO);
}
@Override @Override
public SuccessResultList<List<AccountItemBO>> listPageBO(ListPage page) { public SuccessResultList<List<AccountItemBO>> listPageBO(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());

View File

@ -1,6 +1,7 @@
package cn.com.tenlion.operator.util; package cn.com.tenlion.operator.util;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import ink.wgink.module.sms.factory.sms.SmsSendFactory;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import javax.crypto.Cipher; import javax.crypto.Cipher;

View File

@ -201,6 +201,12 @@
operator_account_item t1 operator_account_item t1
WHERE WHERE
t1.account_id = #{accountId} t1.account_id = #{accountId}
<if test="type != null and type != ''">
AND t1.type = #{type}
</if>
<if test="orderId != null and orderId != ''">
AND t1.order_id = #{orderId}
</if>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
AND ( AND (
<!-- 这里添加其他条件 --> <!-- 这里添加其他条件 -->