Commit 0ae9b4cb authored by hanfeng's avatar hanfeng

Merge branch 'base-modify' of http://10.5.52.3/youjj/cloud-platform into base-modify

parents 8c1bc421 cf68aea7
package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 支付宝账号表
*/
@Table(name = "app_user_alipay")
@Data
public class AppUserAlipay {
@Id
@GeneratedValue(generator = "JDBC")//此处加上注解
private Integer id;
@ApiModelProperty("用户id")
@Column(name = "user_id")
private Integer userId;
@ApiModelProperty("支付宝账号")
@Column(name = "tx_alipay")
private String txAlipay;
@ApiModelProperty("0-否;1-是")
@Column(name = "is_default")
private Integer isDefault;
@ApiModelProperty("创建时间")
@Column(name = "crt_time")
private Long crtTime;
@ApiModelProperty("是否删除;0-正常;1-删除")
@Column(name = "is_del")
private Integer isDel;
}
\ No newline at end of file
......@@ -42,6 +42,14 @@ public class MyWallet implements Serializable {
@ApiModelProperty(value = "余额(元)")
private BigDecimal balance;
/**
* 支付密码
*/
@Column(name = "pay_password")
@ApiModelProperty(value = "支付密码")
private String payPassword;
/**
* 已提现金额
*/
......
......@@ -12,6 +12,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -46,6 +47,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
@Value("${temamember.failureTime:60}")
private Long failureTime;
@Autowired
private AppUserDetailBiz appUserDetailBiz;
/**
* 关系绑定
* @param userId
......@@ -76,6 +80,23 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
}
}
//首页关系绑定
public ObjectRestResponse appBindRelation(Integer userId,String code){
Integer parentId=0;
if (StringUtils.isNotBlank(code)){
//判断处理活动关键字
String[] codes = code.split("_");
if(codes.length > 1) {
code = codes[0];
}
parentId=appUserDetailBiz.getUserByCode(code);
}
if (parentId!=null&&parentId>0&&userId!=null&&userId>0){
getMyBiz().bindRelation(userId,parentId,1);
}
return ObjectRestResponse.succ();
}
//永久稳定关系
public void foreverBind(Integer user_id ){
AppUserRelation relation=getMyBiz().getRelationByUserId(user_id);
......
......@@ -9,12 +9,14 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashSet;
@RestController
@RequestMapping("relation")
......@@ -37,6 +39,20 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
return baseBiz.shareParentByUserId(userid,pid,platform_userid);
}
@RequestMapping(value = "/bind",method = RequestMethod.POST)
@ApiModelProperty("app分享绑定")
public ObjectRestResponse bind(
@RequestParam(value = "code",defaultValue = "")String code,
HttpServletRequest request){
try {
Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return baseBiz.appBindRelation(userid,code);
} catch (Exception e) {
e.printStackTrace();
throw new BaseException(e);
}
}
@ApiOperation("查询邀请的成员")
@GetMapping("/pages")
public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state,
......
......@@ -273,20 +273,14 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if (StringUtils.isEmpty(userCouponFindDTO.getPhone())) {
List<Integer> userIds = data.stream().map(UserCouponDTO::getUserId).distinct().collect(Collectors.toList());
if (log.isDebugEnabled()){
log.debug("查询的用户ids【{}】",userIds);
}
userIdAndAppuserLoginMap = userFeign.findAppUsersByUserIds(userIds);
if (log.isDebugEnabled()){
log.debug("查询的用户信息【{}】",userIdAndAppuserLoginMap);
}
}
List<UserCouponPageVo> userCouponPageVos = new ArrayList<>();
UserCouponPageVo userCouponPageVo;
for (UserCouponDTO userCouponDTO : data) {
userCouponPageVo = new UserCouponPageVo();
BeanUtils.copyProperties(userCouponDTO, userCouponPageVo);
if (Objects.nonNull(userCouponFindDTO.getPhone())) {
if (StringUtils.isNotEmpty(userCouponFindDTO.getPhone())) {
userCouponPageVo.setPhone(userCouponFindDTO.getPhone());
} else {
userCouponPageVo.setPhone(userIdAndAppuserLoginMap.get(userCouponDTO.getUserId()) == null ? "" : userIdAndAppuserLoginMap.get(userCouponDTO.getUserId()).getUsername());
......
......@@ -24,6 +24,7 @@ public class DateController {
@Autowired
private ActivityPopularizeUserBiz activityPopularizeUserBiz;
@Autowired
private UserCouponBiz userCouponBiz;
......
......@@ -65,5 +65,6 @@ public class Cofig implements Serializable {
@ApiModelProperty(value = "标题")
private String title;
@Column(name = "params")
private String params;
}
......@@ -14,14 +14,39 @@ import java.math.BigDecimal;
public class WithDrawRuleVo {
/**
* 提现金额
* 最低提现金额
*/
private BigDecimal amount;
private BigDecimal minAmount;
/**
* 手续费率
* 提现手续费率
*/
private double proceduReates;
private BigDecimal proceduReates;
/**
* 月额度
*/
private BigDecimal amountOfMonth;
/**
* 日额度
*/
private BigDecimal amountOfDay;
/**
* 最多提现次数(月)
*/
private Integer maxNumberOfMonth;
/**
* 最多提现次数(日)
*/
private Integer maxNumberOfDay;
/**
* 1. 线上 2.线下
*/
private Integer withdrawWay;
/**
* 规则说明
......
package com.xxfc.platform.app.biz;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
......@@ -37,11 +39,13 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
* @param cofig
* @return
*/
@CacheClear(pre = "app:withdrawrule:",key = "config{1}")
public int updateConfig(Cofig cofig) {
EntityUtils.setUpdatedInfo(cofig);
return mapper.updateByPrimaryKeySelective(cofig);
}
@Cache(key = "app:withdrawrule:88")
public WithDrawRuleVo getWithDrawRule(){
WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo();
Example example = new Example(Cofig.class);
......
......@@ -83,6 +83,11 @@ public class MsgBiz {
}
public ObjectRestResponse getHotMsgList(Integer page, Integer limit) {
AppUserDTO appUserDTO = userBiz.getUserInfo();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
}
log.info("获取消息列表: page = {}, limit = {}, type = {}", page, limit);
page = page == null ? 1 : page;
limit = limit == null ? 10 : limit;
......@@ -94,7 +99,7 @@ public class MsgBiz {
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = mongoTemplate.find(query, Msg.class, "s_msg");
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
goodPageInfo.setPageSize(totalSize%limit == 0 ?totalSize/limit : totalSize/limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
......@@ -158,7 +163,7 @@ public class MsgBiz {
public boolean exists(int userId, ObjectId msgId) {
Query query = new Query(Criteria.where("msgId").is(msgId).and("userId").is(userId));
List<Praise> praise = mongoTemplate.find(query, Praise.class, "s_praise");
return 0 != praise.size();
return praise.size() > 0 ? true :false;
}
/**
......@@ -171,7 +176,7 @@ public class MsgBiz {
public boolean existsCollect(int userId, ObjectId msgId) {
Query query = new Query(Criteria.where("msgId").is(msgId).and("userId").is(userId));
List<Comment> comments = mongoTemplate.find(query, Comment.class, "s_comment");
return 0 != comments.size();
return comments.size() > 0 ? true :false;
}
public List<MsgVo> replaceMsgResult(List<Msg> list) {
......
......@@ -22,7 +22,7 @@ public class ImCommentController {
return imCommentBiz.add(imComment);
}
@DeleteMapping(value = "/delete")
@PostMapping(value = "/delete")
@ApiOperation(value = "删除评论")
public ObjectRestResponse deleteById(ImComment imComment) {
return imCommentBiz.deleteById(imComment);
......
......@@ -22,7 +22,7 @@ public class ImPraiseController {
return imPraiseBiz.add(imPraise);
}
@DeleteMapping(value = "/delete")
@PostMapping(value = "/delete")
@ApiOperation(value = "取消点赞")
public ObjectRestResponse deleteById(ImPraiseDto imPraiseDto) {
return imPraiseBiz.deleteById(imPraiseDto);
......
......@@ -19,6 +19,7 @@
<select id="selectByQuestionId" resultType="com.xxfc.platform.im.entity.ImComment" parameterType="java.lang.Long">
select * from im_comment
where question_id = #{questionId} and is_del = 0
order by time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -17,6 +17,7 @@
<select id="selectByQuestionId" resultType="com.xxfc.platform.im.entity.ImPraise" parameterType="java.lang.Long">
select * from im_praise
where question_id = #{questionId} and is_del = 0 and visible = 1
order by time DESC
</select>
<select id="selectByQuestionIdAndTime" resultType="com.xxfc.platform.im.entity.ImPraise" parameterType="com.xxfc.platform.im.dto.ImPraiseDto">
......
package com.xxfc.platform.order.pojo.pay;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class NotifyUrlDTO {
public static final int TYPE_APP = 1;
public static final int TYPE_WX = 2;
//订单号
@ApiModelProperty(value = "订单号")
private String orderNo;
//订单号
@ApiModelProperty(value = "支付订单(流水)号")
private String tradeNo;
//支付类型
@ApiModelProperty(value = "支付类型")
private Integer type;
}
\ No newline at end of file
......@@ -375,13 +375,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param refundStatus
*/
public void refundSubProcess(BaseOrder baseOrder, String refundDesc, BigDecimal refundAmount, Integer refundType, Integer refundStatus) {
String refundTradeNo = null;
//0 小于 退款金额
if(BigDecimal.ZERO.compareTo(refundAmount) < 0) {
OrderRefundVo orv = new OrderRefundVo(){{
setAmount(baseOrder.getRealAmount().multiply(new BigDecimal("100")).intValue());
setOrderNo(baseOrder.getNo());
}};
orv.setRefundDesc(refundDesc+ refundAmount.toString());
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
String refundTradeNo = thirdFeign.refund(orv).getData();
refundTradeNo = thirdFeign.refund(orv).getData();
}
//记录订单退款记录
Integer flag = addOrderRefund(baseOrder.getId(), refundDesc, refundAmount, refundTradeNo, refundType);
......
......@@ -28,6 +28,7 @@ import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderUserLicense;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.order.*;
import com.xxfc.platform.order.pojo.pay.NotifyUrlDTO;
import com.xxfc.platform.order.pojo.pay.OrderPayDTO;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
......@@ -470,19 +471,4 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@ApiModelProperty("每页限制")
Integer limit;
}
@Data
public class NotifyUrlDTO {
//订单号
@ApiModelProperty(value = "订单号")
private String orderNo;
//订单号
@ApiModelProperty(value = "支付订单(流水)号")
private String tradeNo;
//支付类型
@ApiModelProperty(value = "支付类型")
private Integer type;
}
}
......@@ -14,6 +14,7 @@ import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.inter.OrderDetail;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.pay.NotifyUrlDTO;
import com.xxfc.platform.order.pojo.price.OrderPriceVO;
import com.xxfc.platform.universal.entity.Dictionary;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -118,8 +119,16 @@ public abstract class AbstractOrderHandle<Biz extends BaseBiz, Detail extends Or
return v;
}).collect(Collectors.toList()));
}
}
//判断是否价格为0
BigDecimal realAmount = detail.getOrder().getRealAmount();
if(BigDecimal.ZERO.compareTo(realAmount) > 0) {
throw new BaseException(ResultCode.FAILED_CODE);
}else if(BigDecimal.ZERO.compareTo(realAmount) == 0) {
//直接支付
baseOrderBiz.payNotifyHandle(detail.getOrder().getNo(), null, detail.getOrderOrigin());
}
}
/**
* 计算价格
* @param detail
......
......@@ -38,6 +38,8 @@ public class UsableVeicleDTO extends PageParam {
String catasStr;
@ApiModelProperty(value = "分类列表", hidden = true)
Map<Integer, List<VehiclePlatCata>> catas;
@ApiModelProperty("停靠公司")
String parkBranchCompanyId;
@ApiModelProperty(hidden = true)
Boolean yearNo4Where;
......
......@@ -991,10 +991,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
if(StrUtil.isNotBlank(dto.getStartDate()) && StrUtil.isNotBlank(dto.getEndDate())) {
initBookSearchParam(dto, params);
}
// PageHelper.startPage(dto.getPage(), dto.getLimit());
// List<UsableVehicleModelVO> lists = mapper.searchUsableModel(params);
// PageInfo<UsableVehicleModelVO> usableVehicleModel = new PageInfo<>(lists);
// return PageDataVO.pageInfo(usableVehicleModel);
return PageDataVO.pageInfo(dto.getPage(), dto.getLimit(), () -> mapper.searchUsableModel(params));
}
......
......@@ -559,6 +559,9 @@
<if test=" hotSign != null ">
and vm.hot_sign = #{hotSign}
</if>
<if test=" parkBranchCompanyId != null ">
and v.park_branch_company_id = #{parkBranchCompanyId}
</if>
</where>
</sql>
......
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