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