Commit 46661c89 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents e803dac5 d713dd25
......@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
/**
* 用户会员
......@@ -57,7 +59,12 @@ public class UserMemberDTO {
@ApiModelProperty(value = "购买次数")
private Integer buyCount;
/**
* 有效期;0代表永久
*/
@Column(name = "valid_time")
@ApiModelProperty(value = "有效期;0代表永久")
private Long validTime;
}
......@@ -40,4 +40,7 @@ public class WalletCathListDTO {
@ApiModelProperty(value = "审核日期")
private Long finishTime;
@ApiModelProperty("单号")
private String cono;
}
......@@ -29,6 +29,9 @@ public class WalletCathSumDto {
//钱包id
private Integer walletId;
//钱包版本
private Integer version;
......
......@@ -133,6 +133,8 @@ public class BaseUserMember implements Serializable {
@ApiModelProperty(value = "是否删除;0-正常;1-删除")
private Integer isDel;
@Column(name = "recent_recharge")
private Long recentRecharge;
......
......@@ -2,15 +2,15 @@ package com.github.wxiaoqi.security.admin.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 钱包提现表
*
*
* @author zjw
* @email 18178966185@163.com
* @date 2019-07-11 14:14:54
......@@ -18,102 +18,109 @@ import lombok.Data;
@Data
@Table(name = "my_wallet_cath")
public class MyWalletCath implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键ID")
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键ID")
private Long id;
/**
* 用户iD
/**
* 用户iD
*/
@Column(name = "user_id")
@ApiModelProperty(value = "用户iD")
@ApiModelProperty(value = "用户iD")
private Integer userId;
/**
* 提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)
/**
* 提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)
*/
@Column(name = "cath_type")
@ApiModelProperty(value = "提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)")
@ApiModelProperty(value = "提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)")
private Integer cathType;
/**
* 商户订单号
*/
@Column(name = "account_number")
@ApiModelProperty(value = "用户账号")
@ApiModelProperty(value = "用户账号")
private String accountNumber;
/**
* 第三方订单号:如微信,支付宝,银行卡等
/**
* 第三方订单号:如微信,支付宝,银行卡等
*/
@Column(name = "cono")
@ApiModelProperty(value = "第三方订单号:如微信,支付宝,银行卡等")
@ApiModelProperty(value = "第三方订单号:如微信,支付宝,银行卡等")
private String cono;
/**
* 提现金额
*/
@Column(name = "balance")
@ApiModelProperty(value = "当前钱包余额")
private BigDecimal balance;
/**
* 提现金额
*/
@Column(name = "balance")
@ApiModelProperty(value = "当前钱包余额")
private BigDecimal balance;
/**
* 提现金额
* 提现金额
*/
@Column(name = "amount")
@ApiModelProperty(value = "提现金额")
@ApiModelProperty(value = "提现金额")
private BigDecimal amount;
/**
* 到账金额
*/
@Column(name = "real_amount")
@ApiModelProperty(value = "到账金额")
private BigDecimal realAmount;
/**
* 手续费
*/
@Column(name = "commission")
@ApiModelProperty(value = "手续费")
private BigDecimal commission;
/**
* 订单状态:0-未提现,待审核,1-已审核
/**
* 到账金额
*/
@Column(name = "real_amount")
@ApiModelProperty(value = "到账金额")
private BigDecimal realAmount;
/**
* 手续费
*/
@Column(name = "commission")
@ApiModelProperty(value = "手续费")
private BigDecimal commission;
/**
* 订单状态:0-未提现,待审核,1-已审核
*/
@Column(name = "stauts")
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
private Integer stauts;
/**
* 提现日期
/**
* 失败原因
*/
@Column(name = "reason")
@ApiModelProperty(value = "失败原因")
private String reason;
/**
* 提现日期
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "提现日期", hidden = true )
@ApiModelProperty(value = "提现日期", hidden = true)
private Long crtTime;
/**
* 审核日期
/**
* 审核日期
*/
@Column(name = "finish_time")
@ApiModelProperty(value = "审核日期")
@ApiModelProperty(value = "审核日期")
private Long finishTime;
/**
* 操作者ID
/**
* 操作者ID
*/
@Column(name = "upd_user")
@ApiModelProperty(value = "操作者ID")
@ApiModelProperty(value = "操作者ID")
private String updUser;
}
......@@ -37,4 +37,7 @@ public class WalletCathAdminVo {
@ApiModelProperty(value = "审核日期")
private Long finishTime;
@ApiModelProperty("单号")
private String cono;
}
......@@ -29,4 +29,10 @@ public class WalletCathDetailVo {
*/
@ApiModelProperty(value = "审核日期")
private Long finishTime;
@ApiModelProperty(value = "帐号")
private String accountNumber;
@ApiModelProperty("审核失败原因")
private String reason;
}
......@@ -236,6 +236,12 @@
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-app-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>ace-admin</finalName>
......
......@@ -140,7 +140,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
return ObjectRestResponse.succ(flag);
}
//设置密码type 1-设置密码;2-设置密码
//设置密码type 1-设置密码;2-修改密码
public ObjectRestResponse setPwd(Integer userId,String phone,String mobilecod,String password,Integer type){
if (StringUtils.isBlank(phone)||StringUtils.isBlank(mobilecod)||StringUtils.isBlank(password)){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
......@@ -156,7 +156,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
if (myWallet==null){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "钱包不存在");
}
if(type==1||StringUtils.isNotBlank(myWallet.getPayPassword())){
if(type==1&&StringUtils.isNotBlank(myWallet.getPayPassword())){
return ObjectRestResponse.createFailedResult(ResultCode.EXIST_CODE, "密码已存在");
}
password=new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(password);
......@@ -189,13 +189,13 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
myWallet.setUserId(userId);
myWallet = selectOne(myWallet);
if (myWallet==null){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "钱包不存在");
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "钱包不存在");
}
if (amount.compareTo(myWallet.getBalance())>0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "提现金额不能大于钱包金额");
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额不能大于钱包金额");
}
if (StringUtils.isNotBlank(password)&&!encoder.matches(password,myWallet.getPayPassword())){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "支付密码错误");
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "支付密码错误");
}
WithDrawRuleVo ruleVo=configFeign.getWithDrawRule();
BigDecimal proceduReates=BigDecimal.ZERO;
......@@ -214,7 +214,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
//每日次数
Integer maxNumberOfDay=ruleVo.getMaxNumberOfDay()==null?0:ruleVo.getMaxNumberOfDay();
//查询当日次数和金额
sumDto=myWalletCathBiz.sumCathAmount(1);
sumDto=myWalletCathBiz.sumCathAmount(userId,1);
BigDecimal ramount=amount.add(sumDto.getSumAmount());
if (amountOfDay.compareTo(BigDecimal.ZERO)>0&&ramount.compareTo(amountOfDay)>0){
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过日额度"+amountOfDay+"元");
......@@ -230,7 +230,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
Integer maxNumberOfMonth=ruleVo.getMaxNumberOfMonth();
//查询当月次数和金额
sumDto=myWalletCathBiz.sumCathAmount(2);
sumDto=myWalletCathBiz.sumCathAmount(userId,2);
BigDecimal yamount=amount.add(sumDto.getSumAmount());
if (amountOfMonth.compareTo(BigDecimal.ZERO)>0&&yamount.compareTo(amountOfMonth)>0){
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过月额度"+amountOfMonth+"元");
......@@ -244,6 +244,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
sumDto.setBalance(myWallet.getBalance());
sumDto.setProceduReates(proceduReates);
sumDto.setWalletId(myWallet.getId());
sumDto.setVersion(myWallet.getVersion());
return ObjectRestResponse.succ(sumDto);
}
......@@ -270,16 +271,17 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
if (restResponse.getStatus()!=ResultCode.SUCCESS_CODE){
return restResponse;
}
WalletCathSumDto sumDto=JSONUtil.toBean( restResponse.getData().toString(),WalletCathSumDto.class);
String data=JSONObject.toJSONString(restResponse.getData());
WalletCathSumDto sumDto=JSONUtil.toBean( data,WalletCathSumDto.class);
if (sumDto==null){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空");
}
BigDecimal commission=amount.divide(sumDto.getProceduReates()).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
BigDecimal commission=amount.multiply(sumDto.getProceduReates()).divide(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
BigDecimal balnece=sumDto.getBalance();
//到账金额
BigDecimal realAmount=balnece.subtract(commission);
BigDecimal realAmount=amount;
if (amount.compareTo(realAmount)>0){
realAmount=amount;
realAmount=balnece.subtract(commission);
}
log.info("-----提现申请-----proceduReates==="+sumDto.getProceduReates()+"----commission===="+commission+"---realAmount==="+realAmount);
//添加账号
......@@ -302,22 +304,24 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
myWallet.setUserId(userId);
myWallet.setBalance(balnece);
myWallet.setWithdrawals(withdrawals);
myWallet.setVersion(sumDto.getVersion());
mapper.updMyWater(myWallet);
return ObjectRestResponse.succ();
return ObjectRestResponse.succ(walletCath.getId());
}
//提现审核
public ObjectRestResponse verifyCath(Integer cathId,String cono){
if (StringUtils.isBlank(cono)||cathId==null||cathId==0){
public ObjectRestResponse verifyCath(Integer cathId,String cono,String reason,Integer status){
if ((status==1&&StringUtils.isBlank(cono))||(status==2&&StringUtils.isBlank(reason))||cathId==null||cathId==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空");
}
MyWalletCath cath=myWalletCathBiz.selectById(cathId);
if (cath==null){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录不存在");
}
cath.setStauts(1);
cath.setStauts(status);
cath.setCono(cono);
cath.setReason(reason);
cath.setFinishTime(System.currentTimeMillis());
int num=myWalletCathBiz.updateSelectiveByIdRe(cath);
if (num>0){
......@@ -326,23 +330,34 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
wallet.setUserId(userId);
wallet=selectOne(wallet);
if (wallet!=null){
//当时钱包的余额
BigDecimal balance=cath.getBalance();
BigDecimal realAmount=cath.getRealAmount();
BigDecimal commission=cath.getCommission();
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setItype(1);
detail.setCono(cathId);
detail.setBalance(balance);
detail.setAmount(realAmount);
detail.setSource(10);
myWalletDetailBiz.insertSelective(detail);
detail.setId(null);
detail.setSource(13);
balance=balance.subtract(realAmount).setScale(2, RoundingMode.HALF_UP);
detail.setBalance(balance);
detail.setAmount(commission);
myWalletDetailBiz.insertSelective(detail);
if (status==1){
MyWalletDetail detail=new MyWalletDetail();
detail.setUserId(userId);
detail.setItype(1);
detail.setCono(cathId);
detail.setBalance(balance);
detail.setAmount(realAmount);
detail.setSource(10);
myWalletDetailBiz.insertSelective(detail);
detail.setId(null);
detail.setSource(13);
balance=balance.subtract(realAmount).setScale(2, RoundingMode.HALF_UP);
detail.setBalance(balance);
detail.setAmount(commission);
myWalletDetailBiz.insertSelective(detail);
}else {
BigDecimal amount=realAmount.add(commission);
balance=wallet.getBalance().add(amount);
BigDecimal withdrawals=wallet.getWithdrawals().subtract(amount);
wallet.setBalance(balance);
wallet.setWithdrawals(withdrawals);
mapper.updMyWater(wallet);
}
}
}
return ObjectRestResponse.succ();
......
......@@ -12,7 +12,6 @@ import com.github.wxiaoqi.security.admin.vo.WalletCathPageVo;
import com.github.wxiaoqi.security.admin.vo.WalletCathVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
......@@ -40,7 +39,9 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
Example example = new Example(MyWalletCath.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("stauts", state);
if (Objects.nonNull(state)) {
criteria.andEqualTo("stauts", state);
}
criteria.andEqualTo("userId", userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
......@@ -122,7 +123,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
return userIdAndPersonalConsumptionMap;
}
public WalletCathSumDto sumCathAmount(Integer type){
return mapper.sumCathAmount(type);
public WalletCathSumDto sumCathAmount(Integer userId,Integer type){
return mapper.sumCathAmount(userId,type);
}
}
package com.github.wxiaoqi.security.admin.config;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* xxl-job config
*
* @author xuxueli 2017-04-28
*/
@Slf4j
@Configuration
public class XxlJobConfig {
@Value("${xxl.job.admin.addresses}")
private String adminAddresses;
@Value("${xxl.job.executor.appname}")
private String appName;
@Value("${xxl.job.executor.ip}")
private String ip;
@Value("${xxl.job.executor.port}")
private int port;
@Value("${xxl.job.accessToken}")
private String accessToken;
@Value("${xxl.job.executor.logpath}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Bean(initMethod = "start", destroyMethod = "destroy")
public XxlJobSpringExecutor xxlJobExecutor() {
log.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppName(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
/**
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
*
* 1、引入依赖:
* <dependency>
* <groupId>org.springframework.cloud</groupId>
* <artifactId>spring-cloud-commons</artifactId>
* <version>${version}</version>
* </dependency>
*
* 2、配置文件,或者容器启动变量
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
*
* 3、获取IP
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
*/
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.jobhandler;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 跨平台Http任务
*
* @author xuxueli 2018-09-16 03:48:34
*/
@JobHandler(value = "walletHandler")
@Component
@Slf4j
public class RentDepositJobHandler extends IJobHandler {
@Override
public ReturnT<String> execute(String var1) throws Exception {
try {
ReturnT returnT = new ReturnT(){{
setCode(100);
setMsg("成功");
}};
return returnT;
} catch (Exception e) {
XxlJobLogger.log(e);
return FAIL;
} finally {
}
}
}
\ No newline at end of file
......@@ -29,5 +29,5 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
* @param type 1-日;2-月
* @return
*/
WalletCathSumDto sumCathAmount(@Param("type") int type);
WalletCathSumDto sumCathAmount(@Param("userId") Integer userId,@Param("type") int type);
}
......@@ -51,7 +51,7 @@ public class MyWalletController {
}
@GetMapping
@GetMapping("/checkCode")
@ApiOperation("检查验证码")
public ObjectRestResponse checkCode(
@RequestParam(value = "phone",defaultValue = "")String phone,
......@@ -105,23 +105,14 @@ public class MyWalletController {
public ObjectRestResponse applyCath(@RequestBody ApplyCathVo applyCathVo, HttpServletRequest request){
try {
Integer userId=Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
applyCathVo.setUserId(userId);
return myWalletBiz.applyCath(applyCathVo);
}catch (Exception e) {
throw new BaseException(e);
}
}
@PostMapping("/verifyCath")
@ApiOperation("提现审核")
public ObjectRestResponse verifyCath(
@RequestParam(value = "cathId",defaultValue = "0") Integer cathId,
@RequestParam(value = "cono",defaultValue = "") String cono){
try {
return myWalletBiz.verifyCath(cathId,cono);
}catch (Exception e) {
throw new BaseException(e);
}
}
@GetMapping("/txAlipayList")
@ApiOperation("获取支付账号列表")
......@@ -134,13 +125,4 @@ public class MyWalletController {
}
}
}
......@@ -35,7 +35,7 @@ public class WalletCathController {
@ApiOperation("提现记录列表")
@GetMapping("/page")
public ObjectRestResponse<WalletCathPageVo> findWatchCatchByWithdrawalState(@RequestParam("state") Integer state,
public ObjectRestResponse<WalletCathPageVo> findWatchCatchByWithdrawalState(@RequestParam(value = "state",required = false) Integer state,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
HttpServletRequest request) {
......
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.MyWalletBiz;
import com.github.wxiaoqi.security.admin.biz.MyWalletCathBiz;
import com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO;
import com.github.wxiaoqi.security.admin.vo.WalletCathAdminVo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author libin
......@@ -23,11 +24,26 @@ public class WalletCathAdminController {
@Autowired
private MyWalletCathBiz myWalletCathBiz;
@Autowired
private MyWalletBiz myWalletBiz;
@GetMapping("/page")
public ObjectRestResponse<PageDataVO<WalletCathAdminVo>> listWalletCathWithPage(WalletCathFindDTO walletCathFindDTO){
PageDataVO<WalletCathAdminVo> walletCathAdminVoPage = myWalletCathBiz.listWalletCathWithPage(walletCathFindDTO);
return ObjectRestResponse.succ(walletCathAdminVoPage);
}
@PostMapping("/verifyCath")
@ApiOperation("提现审核")
public ObjectRestResponse verifyCath(
@RequestParam(value = "cathId",defaultValue = "0") Integer cathId,
@RequestParam(value = "cono",defaultValue = "") String cono,
@RequestParam(value = "reason",defaultValue = "") String reason,
@RequestParam(value = "status",defaultValue = "1") Integer status){
try {
return myWalletBiz.verifyCath(cathId,cono,reason,status);
}catch (Exception e) {
throw new BaseException(e);
}
}
}
......@@ -13,7 +13,8 @@
wc.cath_type AS `cathType`,
wc.stauts,
wc.crt_time AS `crtTime`,
wc.finish_time AS `finishTime`
wc.finish_time AS `finishTime`,
wc.cono
FROM
(SELECT * FROM `my_wallet_cath` <if test="state != null">
WHERE `stauts`=#{state}
......@@ -38,7 +39,7 @@
<select id="sumCathAmount" resultType="com.github.wxiaoqi.security.admin.dto.WalletCathSumDto">
select IFNULL(SUM(amount),0) as sumAmount,COUNT(*) as `number` from my_wallet_cath
<where>
user_id=#{userId} and stauts in(0,1)
<choose>
<when test="type ==1 ">
AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
......
......@@ -102,4 +102,20 @@ public class ActivityPopularize implements Serializable {
@ApiModelProperty(value = "活动结束时间")
@JSONField(serializeUsing= ToStringSerializer.class)
private Long endTime;
/**
* 人数限制 -1--无限制
*/
@Column(name = "num_limit")
@ApiModelProperty(value = "人数限制 -1--无限制")
private Integer numLimit;
/**
* 当前状态 1--上架 2--下架
*/
@Column(name = "status")
@ApiModelProperty(value = "当前状态 1--上架 2--下架")
private Integer status;
}
......@@ -5,6 +5,8 @@ import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.activity.entity.ActivityList;
import com.xxfc.platform.activity.entity.ActivityManagement;
import com.xxfc.platform.activity.entity.ActivityPopularize;
import com.xxfc.platform.activity.entity.ActivityRule;
import com.xxfc.platform.activity.mapper.ActivityManagementMapper;
import com.xxfc.platform.activity.vo.ActivityManagementQuery;
import lombok.extern.slf4j.Slf4j;
......@@ -26,6 +28,11 @@ public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, Act
@Autowired
private ActivityListBiz activityListBiz;
@Autowired
private ActivityPopularizeBiz activityPopularizeBiz;
@Autowired
private ActivityRuleBiz activityRuleBiz;
/**
* 查询所有活动
* @return
......@@ -83,5 +90,22 @@ public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, Act
ActivityList activityList= new ActivityList();
BeanUtilsBean.getInstance().copyProperties(activityList,activityManagement);
activityListBiz.updateSelectiveByIdRe(activityList);
if (activityList.getType()==1) {
ActivityRule activityRule = new ActivityRule();
// activityRule.setStartTime(activityList.getStartTime());
// activityRule.setEndTime(activityList.getEndTime());
activityRule.setStatus(activityList.getStatus());
activityRule.setNumber(activityList.getNumLimit());
activityRuleBiz.updateSelectiveByIdRe(activityRule);
}
if (activityList.getType()==2) {
ActivityPopularize activityPopularize = new ActivityPopularize();
activityPopularize.setStartTime(activityList.getStartTime());
activityPopularize.setEndTime(activityList.getEndTime());
activityPopularize.setStatus(activityList.getStatus());
activityPopularize.setNumLimit(activityList.getNumLimit());
activityPopularizeBiz.updateSelectiveByIdRe(activityPopularize);
}
}
}
package com.xxfc.platform.app.entity;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -94,7 +95,7 @@ public class AppVersion implements Serializable {
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "版本上传时间", hidden = true )
private Long crtTime;
private BigInteger crtTime;
/**
* 是否删除;0-正常;1-删除
......
......@@ -17,6 +17,6 @@ public interface ConfigFeign {
@RequestMapping(value = "/cofig/app/unauth/types",method = RequestMethod.GET)
ObjectRestResponse<Cofig> getAllByType(String types);
@GetMapping("/app/unauth/withdraw_rule")
@GetMapping("/cofig/app/unauth/withdraw_rule")
WithDrawRuleVo getWithDrawRule();
}
......@@ -5,12 +5,15 @@ import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.app.vo.appVersionQuery;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.RowBounds;
......@@ -38,6 +41,7 @@ import tk.mybatis.mapper.weekend.WeekendSqls;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.util.List;
import java.util.concurrent.TimeUnit;
......@@ -49,6 +53,7 @@ import java.util.concurrent.TimeUnit;
* @date 2019-06-24 10:34:00
*/
@Service
@Slf4j
public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
@Value("${app.uploadPath}")
......@@ -59,6 +64,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
private RedisTemplate redisTemplate;
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
private AppVersion entity;
public ObjectRestResponse getVersion(String version,Integer type){
......@@ -125,9 +131,12 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
*/
public ResponseEntity<byte[]> downloadInstallationPackage(String realFileRelPath) throws Exception{
String filePath = uploadPath + realFileRelPath;
File file = new File(filePath);//新建一个文件
HttpHeaders headers = new HttpHeaders();//http头信息
String downloadFileName = new String(file.getName());//设置编码
//新建一个文件
File file = new File(filePath);
//http头信息
HttpHeaders headers = new HttpHeaders();
//设置编码
String downloadFileName = new String(file.getName());
headers.setContentDispositionFormData("attachment", downloadFileName);
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
......@@ -137,11 +146,14 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
* 添加版本信息
* @param appVersion
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public void insertAppVersion(AppVersion appVersion) {
appVersion.setDownloadSwitch(0);
if ( appVersion.getDownloadSwitch()==null){
appVersion.setDownloadSwitch(1);
}
insertSelective(appVersion);
}
public AppVersion get(Integer id) {
if (id==null) {
throw new IllegalArgumentException("Parameter is null");
......@@ -164,17 +176,21 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
*/
public void remove(Integer id) {
AppVersion appVersion = new AppVersion();
appVersion.setId(id);
appVersion.setIsDel(1);
Example example = Example.builder(AppVersion.class)
.where(WeekendSqls.<AppVersion>custom().andEqualTo(AppVersion::getId,id))
.build();
mapper.updateByExampleSelective(appVersion,example);
mapper.updateByPrimaryKeySelective(appVersion);
// mapper.updateByExampleSelective(appVersion,example);
}
public PageInfo<AppVersion> getAll(appVersionQuery query) {
PageHelper.startPage(query.getPage(),query.getLimit());
List<AppVersion> appVersionList = mapper.getAllByquery(query);
return PageInfo.of(appVersionList);
}
@Override
public int insertSelectiveRe(AppVersion entity) {
entity.setCrtTime(BigInteger.valueOf(System.currentTimeMillis()));
return mapper.insertSelective(entity);
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
* @param cofig
* @return
*/
@CacheClear(pre = "app:withdrawrule:",key = "config{1}")
@CacheClear(pre = "app:withdrawrule{1.type}")
public int updateConfig(Cofig cofig) {
EntityUtils.setUpdatedInfo(cofig);
return mapper.updateByPrimaryKeySelective(cofig);
......
......@@ -20,7 +20,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
public class RedisConfiguration {
@Bean
public RedisTemplate<String, Object> customRedisTemplate(RedisConnectionFactory factory) {
public RedisTemplate<String, Object> configRedisTemplate(RedisConnectionFactory factory) {
RedisTemplate redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(factory);
RedisSerializer<String> stringSerializer = new StringRedisSerializer();
......
......@@ -40,7 +40,16 @@ public class CofigController extends BaseController<CofigBiz,Cofig> {
}
@GetMapping("/app/unauth/withdraw_rule")
@IgnoreUserToken
public WithDrawRuleVo getWithDrawRule(){
return baseBiz.getWithDrawRule();
}
@GetMapping("/app/unauth/wallet_rule")
@IgnoreUserToken
public ObjectRestResponse getWalletRule(){
return ObjectRestResponse.succ(baseBiz.getWithDrawRule());
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
<select id="getAllByquery" parameterType="com.xxfc.platform.app.vo.appVersionQuery"
resultType="com.xxfc.platform.app.entity.AppVersion">
select * from app_version
where 1=1
where is_del=0
<if test="versionName !=null and versionName != ''">
and version_name like concat('%',#{versionName},'%')
</if>
......@@ -19,6 +19,6 @@
<if test="content != null and content != ''">
and content like concat('%',#{content},'%')
</if>
order by crt_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -135,6 +135,13 @@
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!-- 分布式锁 -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.11.0</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -85,5 +85,12 @@
<artifactId>beetl</artifactId>
<version>2.9.3</version>
</dependency>
<!-- xxl-job-core -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -3,12 +3,23 @@ package com.xxfc.platform.order.entity;
import lombok.Data;
import javax.persistence.Column;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
@Data
public class DailyOrderStatistics {
@Column()
private Date oneDay;
@Column(name = "one_day")
private System oneDay;
@Column(name = "total_orders")
private BigInteger totalOrders;
@Column(name = "actual_total_income")
private BigDecimal actualTotalIncome;
}
......@@ -77,12 +77,24 @@ public class OrderRefund implements Serializable {
@ApiModelProperty(value = "退款说明")
private String refundDesc;
/**
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
/**
* 创建时间
*/
@Column(name = "original_refund_amount")
@ApiModelProperty(value = "原来要退款的金额", hidden = true )
private BigDecimal originalRefundAmount;
/**
* 创建时间
*/
@Column(name = "deduct_amount")
@ApiModelProperty(value = "扣除的金额", hidden = true )
private BigDecimal deductAmount;
}
......@@ -26,13 +26,6 @@
<scope>compile</scope>
</dependency>
<!-- xxl-job-core -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
......
......@@ -335,18 +335,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
private void rentRefundProcess(BaseOrder baseOrder, BigDecimal depositAmount, Long timeLag, String dicParentKey) {
//计算退款金额
// 1、押金 + 租金(规则扣除)
//BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
BigDecimal originalRefundAmount = BigDecimal.ZERO.add(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()));
StringBuilder refundDescBuilder = new StringBuilder("取消订单退款:");
if(null == depositAmount) {
depositAmount = BigDecimal.ZERO;
}
//商品价格 - 优惠券减免的价格
BigDecimal refundGoodsAmount = calculateRefund(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()), timeLag, dicParentKey, refundDescBuilder);
BigDecimal refundGoodsAmount = calculateRefund(originalRefundAmount, timeLag, dicParentKey, refundDescBuilder);
//退款金额
BigDecimal refundAmount = depositAmount.add(refundGoodsAmount);
originalRefundAmount = depositAmount.add(originalRefundAmount);
//退款子流程: 订单基础,退款描述,退款金额
refundSubProcess(baseOrder, refundDescBuilder.toString(), refundAmount, RefundTypeEnum.ORDER_FUND.getCode(), RefundStatusEnum.ALL.getCode());
refundSubProcess(baseOrder, refundDescBuilder.toString(), originalRefundAmount, refundAmount, RefundTypeEnum.ORDER_FUND.getCode(), RefundStatusEnum.ALL.getCode());
}
public BigDecimal calculateRefund(BigDecimal goodsAmount, Long timeLag, String dicParentKey, StringBuilder refundDescBuilder) {
......@@ -390,7 +392,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param refundType
* @param refundStatus
*/
public void refundSubProcess(BaseOrder baseOrder, String refundDesc, BigDecimal refundAmount, Integer refundType, Integer refundStatus) {
public void refundSubProcess(BaseOrder baseOrder, String refundDesc, BigDecimal originalRefundAmount, BigDecimal refundAmount, Integer refundType, Integer refundStatus) {
String refundTradeNo = null;
//0 小于 退款金额
if(BigDecimal.ZERO.compareTo(refundAmount) < 0) {
......@@ -404,7 +406,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
}
//记录订单退款记录
Integer flag = addOrderRefund(baseOrder.getId(), refundDesc, refundAmount, refundTradeNo, refundType);
Integer flag = addOrderRefund(baseOrder.getId(), refundDesc, originalRefundAmount, refundAmount, refundTradeNo, refundType);
//更新订单的退款状态和退款时间
if(SYS_TRUE.equals(flag) && null != refundStatus) {
......@@ -424,7 +426,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param refundAmount
* @param refundTradeNo
*/
private Integer addOrderRefund(Integer orderId, String refundDesc, BigDecimal refundAmount, String refundTradeNo, Integer refundType) {
private Integer addOrderRefund(Integer orderId, String refundDesc, BigDecimal originalRefundAmount, BigDecimal refundAmount, String refundTradeNo, Integer refundType) {
//如果返回的流水为空,则当做失败
Integer refundStatus = SYS_TRUE;
if(StrUtil.isBlank(refundTradeNo)) {
......@@ -438,6 +440,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
setTradeNo(refundTradeNo);
setRefundType(RefundTypeEnum.ORDER_FUND.getCode());
}};
orderRefund.setOriginalRefundAmount(originalRefundAmount);
orderRefund.setDeductAmount(originalRefundAmount.subtract(refundAmount));
orderRefund.setRefundAmount(refundAmount);
orderRefund.setRefundDesc(refundDesc);
orderRefund.setRefundStatus(refundStatus);
......@@ -619,10 +623,10 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
log.error(e.getMessage(), e);
}
}
// @Scheduled(cron = "0 0 2 * * ? ")
// private void countDailyOrdersRegularly(){
// DailyOrderStatistics dailyOrderStatistics= mapper.getTotalOrder();
// }
//
}
\ No newline at end of file
......@@ -56,19 +56,20 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
}});
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal refundAmont = crosstown.getRestDeposit().subtract(illegalReserve);
BigDecimal originalRefundAmount = crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
List<DedDetailDTO> dddList = JSONUtil.toBean(crosstown.getDedDetail(), List.class);
String refundDesc = "退还押金:"+ refundAmont.toString()+ "(已扣除 违章预备金:"+ illegalReserve.toString();
for(DedDetailDTO ddd : dddList) {
refundDesc += ", "+ ddd.getDeductions()+ ":"+ ddd.getCost();
}
refundDesc += ")";
refundTrigger(orderMQDTO, orderMQDTO.getOrderRentVehicleDetail(), illegalReserve, refundAmont, refundDesc, RefundStatusEnum.RESIDUE_ILLEGAL.getCode());
refundTrigger(orderMQDTO, orderMQDTO.getOrderRentVehicleDetail(), illegalReserve, originalRefundAmount, refundAmont, refundDesc, RefundStatusEnum.RESIDUE_ILLEGAL.getCode());
}
}
public void refundTrigger(BaseOrder baseOrder, OrderRentVehicleDetail orvd, BigDecimal residueAmount, BigDecimal refundAmont, String refundDesc, Integer refundStatus) {
public void refundTrigger(BaseOrder baseOrder, OrderRentVehicleDetail orvd, BigDecimal residueAmount, BigDecimal originalRefundAmount, BigDecimal refundAmont, String refundDesc, Integer refundStatus) {
//退款子流程: 订单基础,退款描述,退款金额
baseOrderBiz.refundSubProcess(baseOrder, refundDesc, refundAmont, RefundTypeEnum.DEPOSIT.getCode(), refundStatus);
baseOrderBiz.refundSubProcess(baseOrder, refundDesc, originalRefundAmount, refundAmont, RefundTypeEnum.DEPOSIT.getCode(), refundStatus);
//设置剩余没有返还的钱
orderRentVehicleBiz.updateSelectiveById(new OrderRentVehicleDetail(){{
setId(orvd.getId());
......
......@@ -88,11 +88,8 @@ public class RentDepositJobHandler extends IJobHandler {
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal refundAmont = orvd.getReturnPayResidue().subtract(orderViolation.getPrice());
String refundDesc = "退还押金:"+ refundAmont.toString()+ "(已扣除 违章扣款:"+ refundAmont.toString();
// for(DedDetailDTO ddd : dddList) {
// refundDesc += ", "+ ddd.getDeductions()+ ":"+ ddd.getCost();
// }
refundDesc += ")";
orderRefundBiz.refundTrigger(baseOrder, orvd, refundAmont, refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode());
orderRefundBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode());
}
}
......
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.DailyOrderStatistics;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import tk.mybatis.mapper.common.Mapper;
......@@ -27,5 +28,5 @@ public interface BaseOrderMapper extends Mapper<BaseOrder> {
public OrderPageVO getOrderDetail(String no);
Integer getTotalOrder();
DailyOrderStatistics getTotalOrder();
}
......@@ -206,15 +206,32 @@
</select>
<select id="getTotalOrder" resultType="com.xxfc.platform.order.entity.DailyOrderStatistics">
select
date_format(crt_time,'%Y-%c-%d') as oneDay,
SUM(1)
select
date_format(pay_time,'%Y-%c-%d') as oneDay,
sum(1) as totalOrders,
sum(pay_time)as actualTotalIncome
from
base_order
where
date(crt_time)=date(now())-1
date(pay_time)=date(now())-1
group by
date_format(crt_time,'%d')
date_format(pay_time,'%d')
</select>
<!-- <select id="getTotalOrder" resultType="com.xxfc.platform.order.entity.DailyOrderStatistics">-->
<!-- select-->
<!-- date_format(refund_time,'%Y-%c-%d') as oneDay,-->
<!-- sum(1) as totalOrders,-->
<!-- sum(refund_time)as actualTotalIncome-->
<!-- from-->
<!-- base_order-->
<!-- where-->
<!-- date(refund_time)=date(now())-1-->
<!-- group by-->
<!-- date_format(refund_time,'%d')-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -28,40 +28,79 @@ public class IdInformation implements Serializable {
private Integer id;
//证件号
/**
* 证件号
*/
@Column(name ="id_number")
private String idNumber;
//用户真实姓名
private String name;
/**
* 用户真实姓名
*/
private String name;
//用户id
/**
*
*/
/**
* 用户id
*/
@Column(name = "user_login_id")
private Integer userLonginId;
//证件类型
/**
*
*/
/**
* 证件类型
*/
@Column(name = "certificate_type")
private Integer certificateType;
//正面url
/**
* 正面url
*/
@Column(name = "front_url")
private String frontUrl;
//背面url
/**
* 背面url
*/
@Column(name = "back_url")
private String backUrl;
//到期时间
/**
*到期时间
*/
@Column(name = "expiration_date")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyyMMdd",timezone="GMT+8")
private Date expirationDate;
//认证方式
/**
* 认证方式
*/
@Column(name = "authentication_methods")
private Integer authenticationMethods;
/**
*创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH;mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH;mm:ss",timezone = "GMT+8")
@Column(name = "crt_time")
private Date crtTime;
/**
* 修改时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH;mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH;mm:ss",timezone = "GMT+8")
@Column(name = "upd_time")
private Date updTime;
}
......@@ -48,9 +48,12 @@ public class CertificationController {
MQServiceBiZ mqServiceBiZ;
/**
* 实名认证
* @param idInformation
* @param request
* @return
*/
@PostMapping("/app/certificate")
public ObjectRestResponse certificate(@RequestBody IdInformation idInformation, HttpServletRequest request) {
......
......@@ -12,6 +12,7 @@ import com.xxfc.platform.universal.utils.CertifHttpUtils;
import com.xxfc.platform.universal.utils.Validation;
import javafx.application.Application;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
......@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import tk.mybatis.mapper.entity.Example;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -287,10 +289,8 @@ public class CertificationService {
try {
expirationDate = formatter.parse(endDate);
} catch (ParseException e) {
e.printStackTrace();
return ObjectRestResponse.createDefaultFail();
}
}
idInformation.setExpirationDate(expirationDate);
......@@ -401,7 +401,20 @@ public class CertificationService {
//保存认证信息
try {
idInformationMapper.insertSelective(idInformation);
Example exa = new Example(IdInformation.class);
Example.Criteria criteria = exa.createCriteria();
criteria.andEqualTo("idNumber",idInformation.getIdNumber());
criteria.andEqualTo("userLonginId",idInformation.getUserLonginId());
List<IdInformation> idInformations = idInformationMapper.selectByExample(exa);
if (CollectionUtils.isEmpty(idInformations)) {
idInformation.setCrtTime(new Date());
idInformationMapper.insertSelective(idInformation);
}else {
IdInformation idInformation1 = idInformations.get(0);
idInformation.setId(idInformation1.getId());
idInformation.setUpdTime(new Date());
idInformationMapper.updateByPrimaryKeySelective(idInformation);
}
//认证成功后修改用户,用户认证状态
ObjectRestResponse authentication = userFeign.authentication(idInformation.getUserLonginId(), idInformation.getName(), idInformation.getIdNumber(), 1);
return ObjectRestResponse.succ(idInformation.getId());
......
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