提交 aebfde68 作者: 刘明祎-运维用途

Merge branch 'develop'

package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BuyPointsVO implements Serializable {
private static final long serialVersionUID = -1481188328848093579L;
@ApiModelProperty(value = "购买积分类型展示", example = "1")
@NotNull(message = "类型不能为空")
private Integer id;
@ApiModelProperty(value = "微信支付金额", example = "10")
private BigDecimal money;
@ApiModelProperty(value = "购买的积分数额", example = "200")
private Integer points;
private Date createTime;
private Date updateTime;
}
package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageTimePointsVO implements Serializable {
private static final long serialVersionUID = -1481188328848093579L;
@ApiModelProperty(value = "购买聊天时长的类型id,唯一识别id", example = "1")
@NotNull(message = "类型id不能为空")
private Integer id;
@ApiModelProperty(value = "购买的积分数额", example = "200")
private Integer points;
@ApiModelProperty(value = "聊天时长,单位(天)", example = "7")
private Integer chatDuration;
}
package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageTimeVO implements Serializable {
private static final long serialVersionUID = -1481188328848093579L;
@ApiModelProperty(value = "购买聊天时长的类型id,唯一识别id", example = "1")
@NotNull(message = "类型id不能为空")
private Integer id;
@ApiModelProperty(value = "微信支付金额,单位(元)", example = "5")
private BigDecimal money;
@ApiModelProperty(value = "购买的积分数额", example = "200")
private Integer points;
@ApiModelProperty(value = "聊天时长,单位(天)", example = "7")
private Integer chatDuration;
}
package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderRequestParamsVO implements Serializable {
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商品描述")
private String description;
@ApiModelProperty(value = "订单金额(分为单位)")
private Integer amount;
@ApiModelProperty(value = "订单来源 0:产品商城 1:租赁订单 2:培训订单 3:充值云享金 ...其他后续加")
private Integer orderPort;
@ApiModelProperty(value = "附加参数 :附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,实际情况下只有支付完成状态才会返回该字段。")
private String attach;
}
......@@ -66,6 +66,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR("8012", "绑定企业为加盟公司,禁止使用该单位"),
NO_RIGHT_UPDATE_ERROR("8013", "无权限操作"),
NO_CHAT_ERROR("9001", "请先花费积分购买聊天时长"),
ID_INFO_AND_ID_card_MISMATCH("3904", "身份信息与身份证不匹配"),
INTERFACE_ACCESS_EXCEPTION("36894", "接口访问异常/次数用尽"),
FRONT_BACK_VAGUE("35556", "身份证正反面不明确"),
......
......@@ -39,7 +39,30 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- 引入 Feign, 可以以声明的方式调用微服务 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
<!-- 使用okhttp-feign-连接池技术 -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
<version>10.12</version>
</dependency>
<!-- 引入服务容错 Hystrix 的依赖 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
<version>2.2.9.RELEASE</version>
</dependency>
<!-- mybatis驱动&Druid数据源-start -->
<dependency>
......
......@@ -2,16 +2,17 @@ package com.mmc.iuav.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
/**
* @author:zhenjie
* @Date:2023/5/15 15:35
*/
@EnableScheduling
@SpringBootApplication
@EnableFeignClients(basePackages = "com.mmc.iuav.user.feign") // 所有FeignClient放在client-feign-springboot-starter里面进行管理
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);
......
package com.mmc.iuav.user.controller;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.qo.MessageQO;
import com.mmc.iuav.user.model.qo.MessageUserQO;
import com.mmc.iuav.user.model.vo.MessageTimePointsVO;
import com.mmc.iuav.user.model.vo.MessageTimeVO;
import com.mmc.iuav.user.model.vo.SystemMessageVO;
import com.mmc.iuav.user.model.vo.UserMessageVO;
import com.mmc.iuav.user.service.MessageService;
......@@ -76,6 +79,13 @@ public class MessageController extends BaseController{
return messageService.insertUserMessage(messageVO,this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "查看用户是否购买聊天")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/isPurchaseTime")
public ResultBody isPurchaseTime(HttpServletRequest request){
return messageService.isPurchaseTime(this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "用户聊天详细信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/selectUserMessage")
......@@ -102,4 +112,55 @@ public class MessageController extends BaseController{
return messageService.removeUserMessage(id);
}
// @ApiOperation(value = "购买聊天时长(积分或微信支付)")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @PostMapping("/purchaseTime")
// public ResultBody purchaseTime(HttpServletRequest request,@RequestBody MessageTimeVO messageTimeVO){
// LoginSuccessDTO userLoginInfoFromRedis = this.getUserLoginInfoFromRedis(request);
// Integer userAccountId = userLoginInfoFromRedis.getUserAccountId();
// String token = userLoginInfoFromRedis.getToken();
// return messageService.purchaseTime(userAccountId,messageTimeVO,token);
// }
@ApiOperation(value = "购买聊天时长(积分)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/purchaseTimeByPoints")
public ResultBody purchaseTimeByPoints(HttpServletRequest request,@RequestBody MessageTimePointsVO messageTimeVO){
LoginSuccessDTO userLoginInfoFromRedis = this.getUserLoginInfoFromRedis(request);
Integer userAccountId = userLoginInfoFromRedis.getUserAccountId();
return messageService.purchaseTimeByPoints(userAccountId,messageTimeVO);
}
@ApiOperation(value = "购买聊天时长(微信支付成功)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/purchaseTimeByWechat")
public ResultBody purchaseTimeByWechat(HttpServletRequest request,@ApiParam(value = "购买聊天时长的类型id,唯一识别id", required = true) @RequestParam Integer typeId){
LoginSuccessDTO userLoginInfoFromRedis = this.getUserLoginInfoFromRedis(request);
Integer userAccountId = userLoginInfoFromRedis.getUserAccountId();
return messageService.purchaseTimeByWechat(userAccountId,typeId);
}
@ApiOperation(value = "返回给小程序端聊天时长选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/listTimeType")
public ResultBody listTimeType(){
return messageService.listTimeType();
}
@ApiOperation(value = "后台管理——修改聊天时长选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/updateTimeType")
public ResultBody updateTimeType(@RequestBody MessageTimeVO messageTimeVO){
return messageService.updateTimeType(messageTimeVO);
}
@ApiOperation(value = "后台管理——新增聊天时长选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/insertTimeType")
public ResultBody insertTimeType(@RequestBody MessageTimeVO messageTimeVO){
return messageService.insertTimeType(messageTimeVO);
}
@ApiOperation(value = "根据类型ID返回聊天时长选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/timeTypeById")
public Integer timeTypeById(@ApiParam(value = "购买聊天时长的类型id,唯一识别id", required = true) Integer typeId){
return messageService.timeTypeById(typeId);
}
}
......@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.dto.userpoints.UserPointsDetailsDTO;
import com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO;
import com.mmc.iuav.user.model.vo.BuyPointsVO;
import com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO;
import com.mmc.iuav.user.service.userpoints.UserPointsService;
import io.swagger.annotations.*;
......@@ -86,4 +87,39 @@ public class UserPointsController extends BaseController {
public ResultBody feignChangeUserPoints(HttpServletRequest request,@RequestParam("id") int changePoint,String reason) {
return userPointsService.changeUserPoints(this.getUserLoginInfoFromRedis(request).getUserAccountId(), null,changePoint,reason);
}
@ApiOperation(value = "用户购买积分(微信支付已成功)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/weixinBuyPoints")
public ResultBody weixinBuyPoints(@RequestBody BuyPointsVO buyPointsVO,HttpServletRequest request) {
return userPointsService.weixinBuyPoints(buyPointsVO,this.getUserLoginInfoFromRedis(request).getUserAccountId(),this.getUserLoginInfoFromRedis(request).getToken());
}
@ApiOperation(value = "返回购买积分选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/selectAllBuyPointsType")
public ResultBody selectAllBuyPointsType(){
return userPointsService.selectAllBuyPointsType();
}
@ApiOperation(value = "后台管理——修改购买积分选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/updateBuyPointsType")
public ResultBody updateBuyPointsType(@RequestBody BuyPointsVO buyPointsVO){
return userPointsService.updateBuyPointsType(buyPointsVO);
}
@ApiOperation(value = "后台管理——新增购买积分选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/insertBuyPointsType")
public ResultBody insertBuyPointsType(@RequestBody BuyPointsVO buyPointsVO){
return userPointsService.insertBuyPointsType(buyPointsVO);
}
@ApiOperation(value = "根据类型ID返回购买积分选购类型")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/buyPointsTypeById")
public Integer buyPointsTypeById(@ApiParam(value = "购买积分的类型id,唯一识别id", required = true) Integer typeId){
return userPointsService.buyPointsTypeById(typeId);
}
}
......@@ -15,8 +15,9 @@ public enum UserPointsEnum {
OTHER_CHANGE(5, "其他变动"),
USER_USE(6, "使用"),
INVITE_USER(7, "邀请用户"),
BUY_TIME(8,"购买聊天时长"),
BUY_POINT(9,"购买积分")
;
private int code;
private String message;
......
......@@ -5,6 +5,7 @@ import com.mmc.iuav.user.entity.UserMessageDO;
import com.mmc.iuav.user.entity.UserMessageLogDO;
import com.mmc.iuav.user.model.qo.MessageQO;
import com.mmc.iuav.user.model.qo.MessageUserQO;
import com.mmc.iuav.user.model.vo.MessageTimeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -113,4 +114,8 @@ public interface MessageDao {
void removeUserMessageLog(@Param("id") Integer logId);
UserMessageDO selectUserMessageById(@Param("id") Integer id);
MessageTimeVO selectUserMessageTimeType(@Param("id")Integer id);
List<MessageTimeVO> listTimeType();
void updateTimeType(MessageTimeVO messageTimeVO);
void insertTimeType(MessageTimeVO messageTimeVO);
}
......@@ -2,7 +2,9 @@ package com.mmc.iuav.user.dao.userpoints;
import com.mmc.iuav.user.entity.userpoints.UserPointsDO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointQO;
import com.mmc.iuav.user.model.vo.BuyPointsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -22,5 +24,11 @@ public interface UserPointsDao {
List<UserPointsDO> userPointList(UserPointQO param);
int count(UserPointQO param);
BuyPointsVO selectBuyPointsType(@Param("id") Integer id);
List<BuyPointsVO> selectAllBuyPointsType();
void insertBuyPointsType(BuyPointsVO buyPointsVO);
void updateBuyPointsType(BuyPointsVO buyPointsVO);
}
package com.mmc.iuav.user.feign;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.feign.hystrix.PaymentAppApiHystrix;
import com.mmc.iuav.user.model.vo.OrderRequestParamsVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@FeignClient(url = "${iuav.pay.uri}", name = "payment-svc", fallback = PaymentAppApiHystrix.class)
public interface PaymentAppApi {
@PostMapping("/payment/wechat/pay")
Map orderPay(@RequestBody OrderRequestParamsVO orderRequestParamsVO, @RequestHeader("token") String token);
}
package com.mmc.iuav.user.feign.config;
import com.mmc.iuav.user.feign.hystrix.PaymentAppApiHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author: zj
* @Date: 2023/5/18 18:21
*/
@ComponentScan(basePackages = "com.mmc.iuav.user.feign")
@Configuration
public class FeignConfiguration {
@Bean(name = "paymentAppApiHystrix")
public PaymentAppApiHystrix userAppApi(){
return new PaymentAppApiHystrix();
}
}
package com.mmc.iuav.user.feign.hystrix;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.feign.PaymentAppApi;
import com.mmc.iuav.user.model.vo.OrderRequestParamsVO;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* @author: zj
* @Date: 2023/6/10 20:24
*/
@Slf4j
public class PaymentAppApiHystrix implements PaymentAppApi {
@Override
public Map orderPay(OrderRequestParamsVO orderRequestParamsVO, String token) {
log.info("熔断--feignOrderPay:");
return null;
}
}
......@@ -4,6 +4,8 @@ import com.mmc.iuav.page.PageResult;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.qo.MessageQO;
import com.mmc.iuav.user.model.qo.MessageUserQO;
import com.mmc.iuav.user.model.vo.MessageTimePointsVO;
import com.mmc.iuav.user.model.vo.MessageTimeVO;
import com.mmc.iuav.user.model.vo.SystemMessageVO;
import com.mmc.iuav.user.model.vo.UserMessageVO;
......@@ -63,6 +65,16 @@ public interface MessageService {
*/
ResultBody insertUserMessage(UserMessageVO messageVO,Integer senderUserId);
/**
* 查看用户是否购买聊天时长
* @param UserId
* @return {@link ResultBody}
*/
ResultBody isPurchaseTime(Integer UserId);
PageResult selectUserMessage(MessageUserQO messageQO,Integer senderUserId);
ResultBody selectUserList(Integer senderUserId);
......@@ -70,4 +82,16 @@ public interface MessageService {
ResultBody removeUserMessage(Integer id);
ResultBody removeUser(Integer senderUserId, Integer receiverUserId);
// ResultBody purchaseTime(Integer userAccountId, MessageTimeVO messageTimeVO, String token);
ResultBody purchaseTimeByPoints(Integer userAccountId, MessageTimePointsVO messageTimeVO);
ResultBody purchaseTimeByWechat(Integer userAccountId, Integer id);
ResultBody listTimeType();
ResultBody updateTimeType(MessageTimeVO messageTimeVO);
ResultBody insertTimeType(MessageTimeVO messageTimeVO);
Integer timeTypeById(Integer id);
}
......@@ -5,6 +5,7 @@ import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO;
import com.mmc.iuav.user.model.vo.BuyPointsVO;
import com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO;
/**
......@@ -34,4 +35,13 @@ public interface UserPointsService {
*/
ResultBody changeUserPoints(Integer userId,Integer pointChangeTypeId,int changePoint,String reason);
ResultBody weixinBuyPoints(BuyPointsVO buyPointsVO, Integer userAccountId,String token);
ResultBody insertBuyPointsType(BuyPointsVO buyPointsVO);
ResultBody updateBuyPointsType(BuyPointsVO buyPointsVO);
ResultBody selectAllBuyPointsType();
Integer buyPointsTypeById(Integer typeId);
}
......@@ -8,21 +8,31 @@ import com.mmc.iuav.user.dao.userpoints.UserPointsDetailsDao;
import com.mmc.iuav.user.entity.userpoints.UserPointChangeTypeDO;
import com.mmc.iuav.user.entity.userpoints.UserPointsDO;
import com.mmc.iuav.user.entity.userpoints.UserPointsDetails;
import com.mmc.iuav.user.feign.PaymentAppApi;
import com.mmc.iuav.user.model.dto.userpoints.UserPointsDTO;
import com.mmc.iuav.user.model.dto.userpoints.UserPointsDetailsDTO;
import com.mmc.iuav.user.model.qo.userpoints.AppPointsDetailsQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointQO;
import com.mmc.iuav.user.model.qo.userpoints.UserPointsDetailsQO;
import com.mmc.iuav.user.model.vo.BuyPointsVO;
import com.mmc.iuav.user.model.vo.MessageTimeVO;
import com.mmc.iuav.user.model.vo.OrderRequestParamsVO;
import com.mmc.iuav.user.model.vo.userpoints.ChangeUserPointVO;
import com.mmc.iuav.user.model.vo.userpoints.PointTypeVO;
import com.mmc.iuav.user.service.userpoints.UserPointsService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -39,6 +49,10 @@ public class UserPointsServiceImpl implements UserPointsService {
@Autowired
private UserPointsDetailsDao userPointsDetailsDao;
@Qualifier("com.mmc.iuav.user.feign.PaymentAppApi")
@Autowired
private PaymentAppApi paymentAppApi;
@Override
public PageResult userPointList(UserPointQO param) {
int count = userPointsDao.count(param);
......@@ -85,10 +99,18 @@ public class UserPointsServiceImpl implements UserPointsService {
public ResultBody change(ChangeUserPointVO changePoint) {
UserPointsDO userPointsDO = userPointsDao.selectUserPoints(changePoint.getUserAccountId());
//如果邀请人没有绑定手机号 是没有积分的
if(userPointsDO == null) {
return ResultBody.success();
if (userPointsDO == null) {
userPointsDO = new UserPointsDO();
userPointsDO.setUserAccountId(changePoint.getUserAccountId());
userPointsDO.setTotalPoints(0);
userPointsDao.insertPoints(userPointsDO);
}
userPointsDO.setTotalPoints(userPointsDO.getTotalPoints() + changePoint.getChangePoint());
//改变后的用户总积分
Integer userNowPoints = userPointsDO.getTotalPoints() + changePoint.getChangePoint();
if(userNowPoints < 0) {
return ResultBody.error("积分不足,请先去赚取积分");
}
userPointsDO.setTotalPoints(userNowPoints);
// 修改用户积分
userPointsDao.updatePoints(userPointsDO);
// 添加记录
......@@ -147,4 +169,56 @@ public class UserPointsServiceImpl implements UserPointsService {
userPointsDetailsDao.insertPointsDetails(userPointsDetails);
return ResultBody.success();
}
@Override
public ResultBody weixinBuyPoints(BuyPointsVO buyPointsVO, Integer userAccountId,String token) {
if(buyPointsVO.getId() == null){
return ResultBody.error("购买积分类型不能传递为空");
}
BuyPointsVO buyPointsVO1 = userPointsDao.selectBuyPointsType(buyPointsVO.getId());
// OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
// SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
// String content = "WP" + sdf.format(new Date());
// orderRequestParamsVO.setOrderNo(content);
// orderRequestParamsVO.setDescription("购买积分");
// BigDecimal money = buyPointsVO1.getMoney();
// BigDecimal amountInFen = money.multiply(new BigDecimal("100")).setScale(0, RoundingMode.DOWN);
// orderRequestParamsVO.setAmount(amountInFen.intValue());
// orderRequestParamsVO.setOrderPort(4);
// // 扣除金额
// Map map = paymentAppApi.orderPay(orderRequestParamsVO, token);
// 增加积分
ChangeUserPointVO changeUserPointVO = new ChangeUserPointVO();
changeUserPointVO.setUserAccountId(userAccountId);
changeUserPointVO.setChangePoint(buyPointsVO1.getPoints());
changeUserPointVO.setChangeType(9);
ResultBody change = change(changeUserPointVO);
return change;
}
@Override
public ResultBody insertBuyPointsType(BuyPointsVO buyPointsVO) {
userPointsDao.insertBuyPointsType(buyPointsVO);
return ResultBody.success();
}
@Override
public ResultBody updateBuyPointsType(BuyPointsVO buyPointsVO) {
userPointsDao.updateBuyPointsType(buyPointsVO);
return ResultBody.success();
}
@Override
public ResultBody selectAllBuyPointsType() {
List<BuyPointsVO> buyPointsVOS = userPointsDao.selectAllBuyPointsType();
return ResultBody.success(buyPointsVOS);
}
@Override
public Integer buyPointsTypeById(Integer typeId) {
BuyPointsVO buyPointsVO = userPointsDao.selectBuyPointsType(typeId);
BigDecimal money = buyPointsVO.getMoney();
BigDecimal amountInFen = money.multiply(new BigDecimal("100")).setScale(0, RoundingMode.DOWN);
return amountInFen.intValue();
}
}
......@@ -692,7 +692,7 @@ public class PayWalletServiceImpl implements PayWalletService {
}
@Transactional(rollbackFor = Exception.class)
ResultBody handleGiveBackPledge(PayUavWalletVO payUavWalletVO, PayWalletDO userWalletInfo, PayLogDO payLogDO, PayWalletDO payWalletDO) {
public ResultBody handleGiveBackPledge(PayUavWalletVO payUavWalletVO, PayWalletDO userWalletInfo, PayLogDO payLogDO, PayWalletDO payWalletDO) {
payLogDO.setPayMethod(payUavWalletVO.getOrderStatus());
payLogDO.setCashAmtPaid(payUavWalletVO.getCashAmount());
payLogDO.setSalaryAmtPaid(payUavWalletVO.getSalaryAmount());
......
......@@ -92,6 +92,15 @@
order by create_time desc
LIMIT 1
</select>
<select id="selectUserMessageTimeType" resultType="com.mmc.iuav.user.model.vo.MessageTimeVO">
select *
from user_message_time_type
where id = #{id}
</select>
<select id="listTimeType" resultType="com.mmc.iuav.user.model.vo.MessageTimeVO">
select *
from user_message_time_type
</select>
<insert id="insertSystemMessage">
insert into message
......@@ -143,6 +152,19 @@
<if test="messageCount != null">#{messageCount,jdbcType=VARCHAR},</if>
</trim>
</insert>
<insert id="insertTimeType">
insert into user_message_time_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="money != null">money,</if>
<if test="points != null">points,</if>
<if test="chatDuration != null">chat_duration,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="money != null">#{money},</if>
<if test="points != null">#{points},</if>
<if test="chatDuration != null">#{chatDuration},</if>
</trim>
</insert>
<update id="removeMessage">
update message
set is_deleted = 1, deleted_time = NOW()
......@@ -161,12 +183,14 @@
<update id="updateSystemMessage">
UPDATE message
<set>
<if test="subject != null">subject,</if>
<if test="content != null">content</if>
<if test="subject != null">
subject = #{subject},
</if>
<if test="content != null">
content = #{content}
</if>
</set>
<where>
id = #{id}
</where>
WHERE id = #{id}
</update>
<update id="removeUserMessage">
update user_message
......@@ -192,5 +216,20 @@
message_count = message_count - 1
where id = #{id}
</update>
<update id="updateTimeType">
update user_message_time_type
<set>
<if test="money != null">
money = #{money},
</if>
<if test="points != null">
points = #{points},
</if>
<if test="chatDuration != null">
chat_duration = #{chatDuration}
</if>
</set>
where id = #{id}
</update>
</mapper>
......@@ -27,11 +27,35 @@
</set>
where user_account_id = #{userAccountId}
</update>
<update id="updateBuyPointsType">
update user_points_buy
<set>
<if test="money != null">
money = #{money},
</if>
<if test="points != null">
points = #{points},
</if>
update_time = NOW()
</set>
where id = #{id}
</update>
<insert id="insertPoints" parameterType="com.mmc.iuav.user.entity.userpoints.UserPointsDO">
insert into user_points(total_points, user_account_id, create_time,
update_time)
values (#{totalPoints}, #{userAccountId}, NOW(), NOW())
</insert>
<insert id="insertBuyPointsType">
insert into user_points_buy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="money != null">money,</if>
<if test="points != null">points</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="money != null">#{money},</if>
<if test="points != null">#{points}</if>
</trim>
</insert>
<select id="userPointList" resultMap="pointList" parameterType="com.mmc.iuav.user.model.qo.userpoints.UserPointQO">
SELECT up.id,
......@@ -66,6 +90,15 @@
and ua.nick_name like CONCAT("%",#{nickName},"%")
</if>
</select>
<select id="selectBuyPointsType" resultType="com.mmc.iuav.user.model.vo.BuyPointsVO">
select *
from user_points_buy
where id = #{id}
</select>
<select id="selectAllBuyPointsType" resultType="com.mmc.iuav.user.model.vo.BuyPointsVO">
select *
from user_points_buy
</select>
</mapper>
......@@ -48,4 +48,6 @@ data-filter:
- /userapp/auth/getVerifyCode
- /userapp/auth/webRegister
- /userapp/auth/webLogin
- /userapp/message/timeTypeById
- /userapp/userPoint/buyPointsTypeById
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 6f3df64d961dc539e9da0d90ee09f4c5603f6085
newTag: d09e9d1d159f90fefe98d9993c70839d0122f4f7
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论