Commit 264fac02 authored by 周健威's avatar 周健威

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

parents 96a42bb0 7833928c
......@@ -74,4 +74,8 @@ public class AppUserDetail {
@ApiModelProperty(value = "邀请人账号:")
@Column(name = "inviter_account")
private Integer inviterAccount;
@ApiModelProperty(value = "1-新人用户;2-未激活;3-激活")
@Column(name = "state")
private Integer state;
}
......@@ -63,7 +63,9 @@ public class AppUserDTO {
private String code;
@ApiModelProperty(value = "邀请人id:")
private String inviterAccount;
private Integer inviterAccount;
@ApiModelProperty(value = "1-新人用户;2-未激活;3-激活:")
private Integer state;
private Integer imUserid;
private String wxOpenid;
private String unionid;
......
......@@ -38,4 +38,5 @@ public class AppUserInfoVo {
private Long updatetime;
private Integer isdel;
}
......@@ -80,6 +80,9 @@ public class AppUserVo {
private String code;
@ApiModelProperty(value = "邀请人id:")
private String inviterAccount;
private Integer inviterAccount;
@ApiModelProperty(value = "1-新人用户;2-未激活;3-激活:")
private Integer state;
}
......@@ -105,7 +105,7 @@ public class UserBusinessBiz {
promoteBO.setActivatedNumber(memberStateAndCountMap.get(1));
BigDecimal totalIncome = appUserSellingWaterBiz.selectTotalIncomeByUserId(userId);
promoteBO.setTotalIncome(totalIncome);
promoteBO.setTotalIncome(totalIncome==null?new BigDecimal(0):totalIncome);
return promoteBO;
}
}
......@@ -144,8 +144,11 @@ public class AppUserRest {
@RequestMapping(value = "/user/wxlogin")
public @ResponseBody JSONObject wxlogin(@RequestParam(value="openid",defaultValue="")String openid,@RequestParam(value="isQQ",defaultValue="0")Integer isQQ) {
return appPermissionService.weCahtLogin(openid,isQQ);
public @ResponseBody JSONObject wxlogin(
@RequestParam(value="openid",defaultValue="")String openid,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code) {
return appPermissionService.weCahtLogin(openid,isQQ,code);
}
/**
......@@ -162,10 +165,11 @@ public class AppUserRest {
@RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="type",defaultValue="1")Integer type
@RequestParam(value="type",defaultValue="1")Integer type,
@RequestParam(value="code",defaultValue="")String code
){
return appPermissionService.login(username,password,mobilecode,type);
return appPermissionService.login(username,password,mobilecode,type,code);
}
@RequestMapping(value = "/user/reset", method = RequestMethod.POST)
......
......@@ -70,7 +70,7 @@ public class AppPermissionService {
ThirdFeign thirdFeign;
@Autowired
private MQSenderFeign mqSenderFeign;
MQSenderFeign mqSenderFeign;
@Autowired
ImFeign imFeign;
......
......@@ -17,7 +17,7 @@ WHERE
</foreach>
</select>
<select id="selectTotalIncomeByUserId">
<select id="selectTotalIncomeByUserId" resultType="java.math.BigDecimal">
SELECT SUM(commission) FROM app_user_selling_water WHERE `user_id`=#{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -45,7 +45,10 @@ public class MsgBiz {
public ObjectRestResponse getMsgList(Integer page, Integer limit, Integer type) throws Exception {
//获取所有朋友圈
AppUserDTO appUserDTO = userBiz.getUserInfo();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
}
log.info("获取消息列表: page = {}, limit = {}, type = {}", page, limit, type);
page = page == null ? 1 : page;
limit = limit == null ? 10 : limit;
......@@ -54,12 +57,7 @@ public class MsgBiz {
List<Msg> msgList = null;
if (type != null) {
query = new Query(Criteria.where("body.type").is(type));
if (appUserDTO != null) {
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
msgList = mongoTemplate.find(query, Msg.class, "s_msg");
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
} else {
......@@ -67,12 +65,7 @@ public class MsgBiz {
ids.add(2);
ids.add(4);
query = new Query(Criteria.where("body.type").in(ids));
if (appUserDTO != null) {
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
msgList = mongoTemplate.find(query, Msg.class, "s_msg");
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
......@@ -97,21 +90,15 @@ public class MsgBiz {
public ObjectRestResponse get(String id){
//获取所有朋友圈
AppUserDTO appUserDTO = userBiz.getUserInfo();
if (appUserDTO == null) {
appUserDTO = new AppUserDTO();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
}
if(id == null) {
return ObjectRestResponse.paramIsEmpty();
}
List<Msg> msgList = null;
Query query = new Query(Criteria.where("id").is(new ObjectId(id)));
if (appUserDTO != null) {
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
msgList = mongoTemplate.find(query, Msg.class, "s_msg");
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
List<MsgVo> msgVoList = replaceMsgResult(msgList);
if(msgVoList.size() > 0) {
return ObjectRestResponse.succ(msgVoList.get(0));
......@@ -136,9 +123,13 @@ public class MsgBiz {
//添加点赞
List<Praise> praise = mongoTemplate.find(query, Praise.class, "s_praise");
msg.setPraises(replacePraiseResult(praise));
msg.setIsPraise(this.exists(userId, msg.getId()) ? 1 : 0);
msg.setIsCollect(this.existsCollect(userId, msg.getId()) ? 1 : 0);
if(userId != null) {
msg.setIsPraise(this.exists(userId, msg.getId()) ? 1 : 0);
msg.setIsCollect(this.existsCollect(userId, msg.getId()) ? 1 : 0);
} else {
msg.setIsPraise(0);
msg.setIsCollect(0);
}
}
return list;
}
......
......@@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
......@@ -60,6 +61,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
@Autowired
MQServiceBiZ mqServiceBiZ;
@Value("${universal.url}")
String weixinHost;
public JSONObject preparepay( OrderPayVo orderPayVo) {
if(null == orderPayVo) {
......@@ -89,7 +92,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
}
Integer type=orderPayVo.getType();
String jsParam="";
String notify_url="https://"+ SystemConfig.weixinHost+"/api/universal/pay/app/unauth/notify";
String notify_url=weixinHost+"/api/universal/pay/app/unauth/notify";
log.info("报名费回调路径notify_url:"+notify_url);
if(type!=null&&type==2){
jsParam=WXPay.webPay( amount+"",orderPayVo.getBody(),notify_url,trade_no,orderPayVo.getBuyerIp(), orderPayVo.getBuyerAccount());
}else {
......
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