修改登录页
This commit is contained in:
parent
e9e1bad6a5
commit
4bfb07e7c0
@ -3,6 +3,7 @@ package cn.com.tenlion.operator.controller.app.api.account;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.dictionary.service.IDataService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
@ -34,6 +35,7 @@ public class AccountAppController extends DefaultBaseController {
|
||||
@Autowired
|
||||
private IAccountService accountService;
|
||||
|
||||
|
||||
// @ApiOperation(value = "新增客户账户", notes = "新增客户账户接口")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
|
@ -9,17 +9,18 @@ import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
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.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
|
||||
/**
|
||||
* @ClassName: SystemUserlController
|
||||
* @Description: 系统用户
|
||||
@ -41,6 +42,20 @@ public class SystemUserAppController extends DefaultBaseController {
|
||||
@Autowired
|
||||
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
|
||||
|
@ -47,6 +47,41 @@ public class AccountItemResourceController extends DefaultBaseController {
|
||||
@Autowired
|
||||
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 = "代理商订单完成接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
|
||||
|
@ -30,8 +30,8 @@ public class AccountItemVO {
|
||||
@ApiModelProperty(name = "mode", value = "方式1:入账,2:出账")
|
||||
@CheckNumberAnnotation(name = "方式1:入账,2:出账")
|
||||
private Integer mode;
|
||||
@ApiModelProperty(name = "type", value = "流水类型(充值1|支出2|提现3|系统扣款4)")
|
||||
@CheckNumberAnnotation(name = "流水类型(充值1|支出2|提现3|系统扣款4)")
|
||||
@ApiModelProperty(name = "type", value = "流水类型(充值1|支出2|提现3|系统扣款4|入账5)")
|
||||
@CheckNumberAnnotation(name = "流水类型(充值1|支出2|提现3|系统扣款4|入账5)")
|
||||
private Integer type;
|
||||
@ApiModelProperty(name = "description", value = "流水描述")
|
||||
private String description;
|
||||
|
@ -28,6 +28,8 @@ public interface IAccountItemService {
|
||||
*/
|
||||
String saveItemInReturnId(AccountItemOrderVO accountItemOrderVO, String orderType);
|
||||
|
||||
void saveShopReturnId(AccountItemVO accountItemVO);
|
||||
|
||||
/**
|
||||
* 保存账户减钱流水 , 如果没有跟order关联 , 无需传入orderId 和 orderType
|
||||
* @param accountItemOrderVO
|
||||
|
@ -279,6 +279,25 @@ public class AccountItemServiceImpl extends DefaultBaseService implements IAccou
|
||||
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
|
||||
public SuccessResultList<List<AccountItemBO>> listPageBO(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.com.tenlion.operator.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import ink.wgink.module.sms.factory.sms.SmsSendFactory;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import javax.crypto.Cipher;
|
||||
|
@ -201,6 +201,12 @@
|
||||
operator_account_item t1
|
||||
WHERE
|
||||
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 != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
|
Loading…
Reference in New Issue
Block a user