Commit ec7ac5e2 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/dev' into dev

parents f49d992c aff0dcc5
......@@ -135,9 +135,11 @@ public class AuthController {
return appAuthService.checkBindWechat(username);
}
@RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
public JSONObject wxlogin(@RequestParam(value="openid",defaultValue="")String openid,@RequestParam(value="isQQ",defaultValue="0")Integer isQQ)throws Exception{
public JSONObject wxlogin(@RequestParam(value="openid",defaultValue="")String openid,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(openid+"----require wxlogin...");
JSONObject data=appAuthService.wxlogin(openid,isQQ);
JSONObject data=appAuthService.wxlogin(openid,isQQ,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data");
if(result==null){
......@@ -154,10 +156,11 @@ public class AuthController {
public JSONObject login(@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)throws Exception{
@RequestParam(value="type",defaultValue="1")Integer type,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(username+"----require login...");
JSONObject data=appAuthService.tlogin(username,password,mobilecode,type);
JSONObject data=appAuthService.tlogin(username,password,mobilecode,type,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data");
if(result==null){
......
......@@ -42,12 +42,15 @@ public interface IUserService {
@RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST)
public JSONObject checkBindWechat( @RequestParam(value="username")String username);
@RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST)
public JSONObject wxlogin(@RequestParam(value="openid")String openid,@RequestParam(value="isQQ")Integer isQQ);
public JSONObject wxlogin(@RequestParam(value="openid")String openid,
@RequestParam(value="isQQ")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code);
@RequestMapping(value = "/api/app/user/login", method = RequestMethod.POST)
public JSONObject login( @RequestParam(value="username")String username,
@RequestParam(value="password")String password,
@RequestParam(value="mobilecode")String mobilecode,
@RequestParam(value="type")Integer type);
@RequestParam(value="type")Integer type,
@RequestParam(value="")String code);
@RequestMapping(value = "/api/app/user/reset", method = RequestMethod.POST)
public JSONObject reset( @RequestParam(value="username")String username,
@RequestParam(value="mobilecode")String mobilecode,
......
......@@ -15,8 +15,8 @@ public interface AuthService {
JSONObject register(String username, String mobilecode, String password,String code) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception;
JSONObject checkBindWechat(String username) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type,String code) throws Exception;
String getToken(String username,Integer id) throws Exception;
JSONObject reset(String username, String mobilecode, String password) throws Exception;
......
......@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public JSONObject wxlogin(String openid,Integer isQQ) throws Exception {
return userService.wxlogin(openid,isQQ);
public JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception {
return userService.wxlogin(openid,isQQ,code);
}
@Override
public JSONObject tlogin(String username, String password, String mobilecode, Integer type) throws Exception {
return userService.login(username,password,mobilecode,type);
public JSONObject tlogin(String username, String password, String mobilecode, Integer type,String code) throws Exception {
return userService.login(username,password,mobilecode,type,code);
}
@Override
......
......@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
}
@Override
public JSONObject wxlogin(String openid,Integer isQQ) throws Exception {
return userService.wxlogin(openid,isQQ);
public JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception {
return userService.wxlogin(openid,isQQ,code);
}
@Override
public JSONObject tlogin(String username, String password, String mobilecode, Integer type) throws Exception {
return userService.login(username,password,mobilecode,type);
public JSONObject tlogin(String username, String password, String mobilecode, Integer type,String code) throws Exception {
return userService.login(username,password,mobilecode,type,code);
}
@Override
......
......@@ -30,6 +30,8 @@ public class AppUserPositionTempVo {
@ApiModelProperty(value = "职位名")
private String positionName;
private Integer positionId;
@ApiModelProperty(value = "数据状态 1:已核销 2:未核销")
private Integer status;
......
package com.github.wxiaoqi.security.admin.vo;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -57,8 +58,27 @@ public class SellingWalletVo {
@ApiModelProperty("'类别:0-正;1-负(退款时)")
private Integer status;
@JSONField(serialize = false)
private Integer sourceId;
@JSONField(serialize = false)
private BigDecimal commissionnm;
/**
* 所获佣金
*/
private BigDecimal commission;
/**
* 订单状态
*/
private Integer sellerStatus;
/**
* 订单文案
*/
private String statusText;
/**
* 是否显示 默认false
*/
private Boolean isShow;
}
......@@ -128,9 +128,10 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
for (AppUserPositionTemp appUserPositionTemp : data) {
appUserPositionTempVo = new AppUserPositionTempVo();
BeanUtils.copyProperties(appUserPositionTemp, appUserPositionTempVo);
String postionName = postionMap == null ? "" : postionMap.get(appUserPositionTemp.getPositionId()).getName();
String postionName = postionMap == null ? "" : postionMap.get(appUserPositionTemp.getPositionId())==null?"":postionMap.get(appUserPositionTemp.getPositionId()).getName();
appUserPositionTempVo.setPositionName(postionName);
appUserPositionTempVo.setStatus(appUserPositionTemp.getUserId() == null ? DataStatus.NO_USERED.code : DataStatus.USERED.code);
appUserPositionTempVos.add(appUserPositionTempVo);
}
dataVO.setData(appUserPositionTempVos);
......
......@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
import com.github.wxiaoqi.security.admin.entity.AppUserDetail;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.apache.commons.collections.CollectionUtils;
......
......@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import com.github.wxiaoqi.security.admin.entity.AppUserSellingWater;
import com.github.wxiaoqi.security.admin.vo.SellingWalletVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
......@@ -20,4 +21,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
List<UserIncomeBo> accquireIncomeByMemberIds(@Param("parentId") Integer parentId);
BigDecimal selectTotalIncomeByUserId(@Param("userId") Integer userId);
List<SellingWalletVo> selectSellerWalterByUserIdAndWating(@Param("userId") Integer userId, @Param("wating") Integer wating);
}
......@@ -2,14 +2,12 @@ package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.UserBusinessBiz;
import com.github.wxiaoqi.security.admin.bo.PromoteBO;
import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......
......@@ -48,4 +48,17 @@ public class UserSellingWaterController {
}
}
@GetMapping("/pagea")
public ObjectRestResponse<SellingWalletPagVo> findSellingWaterPagea(@RequestParam(required = false,value = "type") Integer wating,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
HttpServletRequest request) {
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
SellingWalletPagVo sellingWalletPagVo = appUserSellingWaterBiz.findSellingWaterPageForAppByWaiting(wating, Integer.valueOf(infoFromToken.getId()), pageNo, pageSize);
return ObjectRestResponse.succ(sellingWalletPagVo);
} catch (Exception e) {
throw new BaseException(e);
}
}
}
......@@ -316,8 +316,8 @@ public class AppPermissionService {
}*/
//临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username);
/*//参加新人活动
jionActivity(userid);*/
//参加新人活动
jionActivity(userid);
//创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理
......@@ -950,8 +950,8 @@ public class AppPermissionService {
relationBiz.bindByUserId(userid, small_id);
//发送短信通知用户
thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE);
/* //参加新人活动
jionActivity(userid);*/
//参加新人活动
jionActivity(userid);
// 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,null,null,2);
// 到im注册,获取返回结果
......
......@@ -7,14 +7,14 @@
SELECT
aur.user_id,
aur.bind_time as `leagueTime`,
ausww.income
IFNULL(ausww.income,0) AS `income`
FROM
`app_user_relation` AS `aur`
LEFT JOIN (SELECT DISTINCT
`source_id` AS userId,
IFNULL(
(
( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 AND `waiting` = 1 ) - ( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 AND `waiting` = 1 )
( SELECT IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 ) - ( SELECT IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 )
),
0
) AS `income`
......@@ -31,4 +31,47 @@ FROM
( SELECT IFNULL(SUM( commission ),0) AS upIncome FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id` = #{userId} ) AS `auswu`,
( SELECT IFNULL(SUM( commission ),0) AS `dowIncome` FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id` = #{userId} ) AS `auswd`;
</select>
<select id="selectSellerWalterByUserIdAndWating" resultType="com.github.wxiaoqi.security.admin.vo.SellingWalletVo">
<!-- SELECT
*
FROM
(
SELECT
ausw.*,
IFNULL( ausw.commission, 0 ) - IFNULL( auswt.commission, 0 ) AS `commissionnm`,
auswt.status AS sellerStatus,
IFNULL(auswt.status,0) AS `isShow`
FROM
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
AND `waiting`=#{wating} &lt;!&ndash;AND `status`=0&ndash;&gt;
</if>) AS `ausw`
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
test="wating!=null">
AND `waiting`=#{wating} &lt;!&ndash;AND `status`=0&ndash;&gt;
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
) AS `auswres`
ORDER BY crt_time DESC-->
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT t.order_no,IFNULL(SUM(t.z),0)-IFNULL(SUM(t.f),0) as commission,IF(SUM(t.f)>0,'1',0)as type FROM (
SELECT order_no,commission as z,0 as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=0 and commission>0
UNION
SELECT order_no,0 as z,commission as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=1 and commission>0
) as t
GROUP BY t.order_no
) o LEFT JOIN ( SELECT DISTINCT order_no,user_id,source_id,order_type,img,price,title,waiting,`crt_time` FROM
app_user_selling_water ) w
ON o.order_no=w.order_no
where 1=1
<if test="wating!=null">
and `waiting`= #{wating} and <![CDATA[
o.`type`<>1 ]]>
</if>
ORDER BY `crt_time`
</select>
</mapper>
\ No newline at end of file
......@@ -64,9 +64,12 @@ public class ActivityRuleBiz extends BaseBiz<ActivityRuleMapper,ActivityRule> {
if(array.size()>0){
for(int i=0;i<array.size();i++){
Integer id=array.getJSONObject(i).getInteger("id");
Coupon coupon=couponBiz.selectById(id);
if (coupon!=null&&coupon.getIsDel()==0&&coupon.getStatus()==1){
coupons.add(couponBiz.selectById(id));
}
}
}
ruleVo.setCoupons(coupons);
}
}
......
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