Commit 912438e7 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/master'

parents 2ad1b101 28e83adb
package com.github.wxiaoqi.security.admin.bo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/30 17:42
*/
@Data
public class UserBo implements Serializable {
private static final long serialVersionUID = 1L;
@JSONField(serialize = false)
private String orderNo;
private Integer userId;
private String phone;
private String name;
private String leaderName;
private String leaderPhone;
private Integer facilitateId;
private String facilitateName;
}
package com.github.wxiaoqi.security.admin.feign;
import com.github.wxiaoqi.security.admin.bo.UserBo;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel;
......@@ -129,4 +130,12 @@ public interface UserFeign {
@GetMapping("/app/user/finduserIdsByphones")
Map<String, Integer> findAppusersByUserNames(@RequestParam(value = "phones") List<String> phones);
@GetMapping(value = "/app/user/users")
List<Integer> findAppUserIds(@RequestParam(value = "phone",required = false) String phone,
@RequestParam(value = "leaderPhone",required = false) String leaderPhone,
@RequestParam(value = "name",required = false) String name);
@PostMapping(value = "/app/user/users/info")
List<UserBo> findUserDetailByUserBo(@RequestBody(required = false) List<UserBo> userBos);
}
......@@ -171,4 +171,19 @@ public class AppUserManageVo {
* 身份信息
*/
private String positionName;
/**
* 上级名称
*/
private String nameOfSuperior;
/**
* 上级id
*/
private Integer parentId;
/**
* 上级手机号
*/
private String superiorMobileNumber;
}
......@@ -4,17 +4,22 @@ import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.dto.AccountBindDTO;
import com.github.wxiaoqi.security.admin.bo.UserBo;
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.mapper.AppUserLoginMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.constant.UserConstant;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.utils.StringUtil;
import com.xxfc.platform.universal.entity.IdInformation;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import com.xxfc.platform.universal.feign.ThirdFeign;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
......@@ -24,9 +29,7 @@ import tk.mybatis.mapper.entity.Example;
import javax.servlet.http.HttpServletRequest;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Function;
......@@ -57,6 +60,9 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
@Autowired
private AppUserAlipayBiz appUserAlipayBiz;
@Autowired
private AppUserRelationBiz appUserRelationBiz;
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
@Override
public void insertSelective(AppUserLogin entity) {
......@@ -325,7 +331,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public List<AppUserLogin> getUserByUsernameAndRealName(String username, String realName) {
return mapper.getUserByUsernameAndRealName(username, realName);
return mapper.getUserByUsernameAndRealName(username,realName);
}
......@@ -397,4 +403,67 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
appUserLogin.setUpdatetime(Instant.now().getEpochSecond());
mapper.updateByPrimaryKeySelective(appUserLogin);
}
public List<Integer> findAppuser(String phone, String leaderPhone, String name) {
List<Integer> memberIds = null;
//1.根据leader手机号查询userid
boolean isNoNullLeaderPhone = StringUtils.isNotEmpty(leaderPhone) && leaderPhone.trim().length()>0;
if (isNoNullLeaderPhone) {
List<AppUserLogin> appUserLogins = mapper.selectbyPhones(Arrays.asList(leaderPhone));
Integer leaderId = null;
if (CollectionUtils.isEmpty(appUserLogins)) {
return Collections.EMPTY_LIST;
}
leaderId = appUserLogins.get(0).getId();
//2.根据leader userId查询下级 userid
if (Objects.nonNull(leaderId)) {
List<AppUserRelation> appUserRelationList = appUserRelationBiz.findMemberPageByLeaderId(leaderId);
if(CollectionUtils.isEmpty(appUserRelationList)){
return Collections.EMPTY_LIST;
}
memberIds = appUserRelationList.stream().map(AppUserRelation::getUserId).collect(Collectors.toList());
}
}
List<Integer> userIds = mapper.findAppUser(phone, name, memberIds);
return userIds==null?Collections.EMPTY_LIST:userIds;
}
public List<UserBo> findUserDetailInfo(List<UserBo> userBos) {
Map<String, Integer> userIdAndFacilitateIdMap = userBos.stream().filter(x->Objects.nonNull(x.getFacilitateId())).collect(Collectors.toMap(UserBo::getOrderNo, UserBo::getFacilitateId));
List<Integer> userIdList = userBos.stream().map(UserBo::getUserId).distinct().collect(Collectors.toList());
//查询上级人
List<AppUserRelation> appUserRelationList = appUserRelationBiz.findLeaderByUserIds(userIdList);
Map<Integer, Integer> memberIdAndParentMap = appUserRelationList.stream().collect(Collectors.toMap(AppUserRelation::getUserId, AppUserRelation::getParentId));
List<Integer> uids = new ArrayList<>();
uids.addAll(userIdAndFacilitateIdMap==null?Collections.EMPTY_LIST:userIdList);
uids.addAll(userIdAndFacilitateIdMap==null?Collections.EMPTY_LIST:userIdAndFacilitateIdMap.values());
uids.addAll(memberIdAndParentMap==null?Collections.EMPTY_LIST:memberIdAndParentMap.values());
List<UserBo> userBoList = mapper.selectByUserIds(uids);
Map<Integer, UserBo> userMap = userBoList==null?Collections.EMPTY_MAP:userBoList.stream().collect(Collectors.toMap(UserBo::getUserId, Function.identity()));
if (userMap.isEmpty()){
return Collections.EMPTY_LIST;
}
for (UserBo userBo : userBos) {
UserBo bo = userMap.get(userBo.getUserId());
if (Objects.nonNull(bo)) {
userBo.setPhone(bo.getPhone());
userBo.setName(bo.getName());
}
Integer leaderId = memberIdAndParentMap.get(userBo.getUserId());
UserBo leader = userMap.get(leaderId);
if (Objects.nonNull(leader)) {
userBo.setLeaderName(leader.getName());
userBo.setLeaderPhone(leader.getPhone());
}
UserBo facilitate = userMap.get(userBo.getFacilitateId());
if (Objects.nonNull(facilitate)) {
userBo.setFacilitateName(facilitate.getName());
}
}
return userBos;
}
}
......@@ -335,7 +335,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
public List<AppUserRelation> findLeaderByUserIds(List<Integer> userIds) {
List<AppUserRelation> appUserRelationList = mapper.selectByUserIds(userIds);
return appUserRelationList==null?Collections.EMPTY_LIST:appUserRelationList;
}
}
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.bo.UserBo;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserManage;
import org.apache.ibatis.annotations.Param;
......@@ -31,4 +32,8 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList
List<AppUserLogin> getUserByUsernameAndRealName(@Param("username") String username, @Param("realName")String realName);
List<Integer> findAppUser(@Param("phone") String phone,@Param("name") String name,@Param("memberIds") List<Integer> memberIds);
List<UserBo> selectByUserIds(@Param("userIds") List<Integer> uids);
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Set;
/**
* 用户关系表
......@@ -20,4 +21,6 @@ public interface AppUserRelationMapper extends Mapper<AppUserRelation> {
//获取有效的下级
public int countByParentId(@Param("parentId")Integer parentId,@Param("bindTime")Long bindTime);
List<AppUserRelation> selectByUserIds(@Param("userIds") List<Integer> userIds);
}
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.*;
import com.github.wxiaoqi.security.admin.bo.UserBo;
import com.github.wxiaoqi.security.admin.dto.AccountBindDTO;
import com.github.wxiaoqi.security.admin.entity.*;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
......@@ -23,8 +24,6 @@ import com.xxfc.platform.order.feign.OrderFeign;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -72,9 +71,6 @@ public class AppUserController extends CommonBaseController{
@Autowired
private OrderFeign orderFeign;
@Autowired
private AppUserAlipayBiz appUserAlipayBiz;
@GetMapping("page")
......@@ -160,6 +156,7 @@ public class AppUserController extends CommonBaseController{
String icon=memberLevel.getIcon();
userDTO.setIcon(icon);
userDTO.setBigIcon(memberLevel.getBigIcon());
userDTO.setItemImg(memberLevel.getItemImg());
}
}
}
......@@ -167,14 +164,7 @@ public class AppUserController extends CommonBaseController{
if (userPosition!=null&&userPosition.getLevel()>0){
userDTO.setPositionName(userPosition.getName());
}
List<AppUserAlipay> appUserAlipays = appUserAlipayBiz.getByUserId(request);
long count = appUserAlipays.stream().filter(appUserAlipay -> appUserAlipay.getType() == 1).count();
userDTO.setIsBindAliPay(count>0);
userDTO.setId(id);
userDTO.setAliPayNickName(userDTO.getIsBindAliPay()?appUserAlipays.get(0).getNickname():"");
AppUserLogin appUserLogin = appUserLoginBiz.selectById(userid);
userDTO.setIsBindWx(StringUtils.isNotEmpty(appUserLogin.getWxOpenid()));
userDTO.setIsBindQQ(StringUtils.isNotEmpty(appUserLogin.getOpenid()));
return ObjectRestResponse.succ(userDTO);
}
......@@ -212,9 +202,10 @@ public class AppUserController extends CommonBaseController{
* @throws Exception
*/
@PostMapping("/edit")
public ObjectRestResponse edit(@RequestBody AppUserVo userVo,HttpServletRequest request)throws Exception {
String id = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId();
userVo.setUserid(Integer.valueOf(id));
public ObjectRestResponse edit(@RequestBody AppUserVo userVo)throws Exception {
if(userVo==null||userVo.getId()==null){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
userDetailBiz.updUuserInfoById(userVo);
Integer userid=userVo.getUserid();
if (userid!=null){
......@@ -224,13 +215,8 @@ public class AppUserController extends CommonBaseController{
appUserLogin.setOpenid(userVo.getOpenid());
appUserLogin.setId(userid);
appUserLogin.setUsername(userVo.getUsername());
appUserLoginBiz.updateAppuserLogin(appUserLogin);
//支付宝绑定
if (StringUtils.isNotEmpty(userVo.getAliCode()) && userVo.getAliCode().trim().length()>0){
appUserAlipayBiz.getUserInfo(userVo.getAliCode(),request);
}
appUserLoginBiz.bindOpenid(appUserLogin);
}
return ObjectRestResponse.succ();
}
......@@ -339,7 +325,7 @@ public class AppUserController extends CommonBaseController{
}
@PostMapping("/bind")
private ObjectRestResponse accountBinding(@RequestBody AccountBindDTO accountBindDTO,HttpServletRequest request){
private ObjectRestResponse accountBinding(@RequestBody AccountBindDTO accountBindDTO, HttpServletRequest request){
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
return appUserLoginBiz.bindAccount(accountBindDTO, Integer.valueOf(infoFromToken.getId()), request);
......@@ -347,4 +333,20 @@ public class AppUserController extends CommonBaseController{
throw new BaseException(ex);
}
}
@GetMapping("/users")
List<Integer> findAppUserIds(@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "leaderPhone", required = false) String leaderPhone,
@RequestParam(value = "name", required = false) String name) {
return appUserLoginBiz.findAppuser(phone, leaderPhone, name);
}
@PostMapping("/users/info")
List<UserBo> findUserDetailByUserBo(@RequestBody(required = false) List<UserBo> userBos) {
return appUserLoginBiz.findUserDetailInfo(userBos);
}
}
......@@ -82,7 +82,10 @@
m.recent_recharge as recentRecharge,
m.name as memberName,
ul.username as inviter,
aup.name as `positionName`
aup.name as `positionName`,
p.nameOfSuperior,
p.username AS superiorMobileNumber,
p.parent_id as parentId
from
app_user_login l
inner join
......@@ -123,6 +126,23 @@
left join
`app_user_position` as aup
on aup.id = d.position_id
left join (
SELECT
r.user_id,
r.parent_id,
l.username,
IFNULL(d.realname,d.nickname) as nameOfSuperior
FROM
app_user_relation r
LEFT JOIN app_user_login l ON r.parent_id = l.id
LEFT JOIN app_user_detail d ON l.id = d.userid
WHERE
l.isdel = 0
AND
r.is_del = 0
) p
on
l.id=p.user_id
where l.isdel = 0
<if test="mobile !=null and mobile !='' ">
and l.username like CONCAT('%',#{mobile},'%')
......
......@@ -3,7 +3,7 @@
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper">
<select id="selectbyPhones" resultType="com.github.wxiaoqi.security.admin.entity.AppUserLogin">
select `id`,`username` from `app_user_login` where `username` in
select `id`,`username` from `app_user_login` where `isdel`=0 and `username` in
<foreach collection="phones" item="phone" open="(" close=")" separator=",">
#{phone}
</foreach>
......@@ -27,4 +27,32 @@
and d.realname like concat('%',#{realName},'%')
</if>
</select>
<select id="findAppUser" resultType="integer">
select aul.`id` from (select `id` from `app_user_login` where `isdel`=0
<if test="phone!=null and phone!=''">
and `username`=#{phone}
</if>
<if test="memberIds!=null and memberIds.size()>0">
and `id` IN
<foreach collection="memberIds" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</if>
) AS `aul`
INNER JOIN
`app_user_detail` AS `aud` ON aud.userid=aul.id
<if test="name!=null and name!=''">
and ( aud.realname like CONCAT('%',#{name},'%') OR aud.nickname like CONCAT('%',#{name},'%'))
</if>
</select>
<select id="selectByUserIds" resultType="com.github.wxiaoqi.security.admin.bo.UserBo">
select aul.`id` AS `userId`,aul.username AS `phone`,IFNULL(aud.realname,aud.nickname) AS `name` from ( select `id`,`username` from `app_user_login` where `isdel`=0 and `id` IN
<foreach collection="userIds" item="uid" separator="," open="(" close=")">
#{uid}
</foreach>) AS `aul`
INNER JOIN
`app_user_detail` AS `aud` ON aud.userid=aul.id
</select>
</mapper>
\ No newline at end of file
......@@ -14,4 +14,11 @@
and (is_forever=1 or bind_time>#{bindTime})
</if>
</select>
<select id="selectByUserIds" resultType="com.github.wxiaoqi.security.admin.entity.AppUserRelation">
select `user_id`,`parent_id` from `app_user_relation` where `is_del`=0 and `user_id` IN
<foreach collection="userIds" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</select>
</mapper>
\ No newline at end of file
package com.xxfc.platform.order.pojo.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/30 15:48
*/
@Data
public class MemberOrderBo {
private Integer id;
private String orderNo;
private Date creatTime;
private Integer status;
private String name;
private BigDecimal goodsAmount;
private Integer userId;
private String userName;
private String phone;
private String leaderName;
private String leaderPhone;
private Integer memberLevel;
/**
* 促成人
*/
@JSONField(serialize = false)
private Integer facilitateId;
private String facilitateName;
private String facilitatePhone;
/**
* 订单金额
*/
private BigDecimal orderAmount;
/**
* 优惠金额
*/
private BigDecimal couponAmount;
private BigDecimal realAmount;
private Long payTime;
private Integer hasPay;
private String desc;
}
package com.xxfc.platform.order.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/30 14:48
*/
@Data
public class MemberOrderFindDTO extends PageParam {
private String orderNo;
private String name;
private String phone;
private Integer state;
private Integer level;
/**
* 下单的开始时间
*/
private Date startOrderTime;
private Date endOrderTime;
/**
* 支付的开始时间
*/
private Long startPayTime;
private Long endPayTime;
private String leaderPhone;
/**
* 促成人的手机号
*/
private String facilitatePhone;
private Boolean isExport;
private List<Integer> userIds;
private Boolean isPay;
private String levelName;
}
package com.xxfc.platform.order.pojo.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/30 14:48
*/
@Data
public class MemberOrderStatisticsBo {
private Integer orderNum;
private BigDecimal totalAmount;
/**
* 钻石
*/
private Integer diamondOrderNum;
private BigDecimal totalDiamondAmount;
/**
* 黄金
*/
private Integer goldOrderNum;
private BigDecimal totalGoldAmount;
/**
* 普通
*/
private Integer generalOrderNum;
private BigDecimal totalGeneralAmount;
}
package com.xxfc.platform.order.pojo.vo;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.order.pojo.dto.MemberOrderBo;
import com.xxfc.platform.order.pojo.dto.MemberOrderStatisticsBo;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/30 15:58
*/
@Data
public class MemberOrderPageVo {
private MemberOrderStatisticsBo memberOrderStatisticsBo;
private PageDataVO<MemberOrderBo> memberOrderPage;
}
......@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
......@@ -26,6 +27,8 @@ import com.xxfc.platform.order.mapper.BaseOrderMapper;
import com.xxfc.platform.order.pojo.DedDetailDTO;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import com.xxfc.platform.order.pojo.calculate.InProgressVO;
import com.xxfc.platform.order.pojo.dto.MemberOrderBo;
import com.xxfc.platform.order.pojo.dto.MemberOrderFindDTO;
import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
......@@ -141,6 +144,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
return mapper.getTourList(paramMap);
}
public PageDataVO<MemberOrderBo> findMemberOrderPage(MemberOrderFindDTO memberOrderFindDTO){
return PageDataVO.pageInfo(memberOrderFindDTO.getPage(),memberOrderFindDTO.getLimit(),()->mapper.findMemberOrders(memberOrderFindDTO));
}
public List<MemberOrderBo> findMemberOrders(MemberOrderFindDTO memberOrderFindDTO) {
return mapper.findMemberOrders(memberOrderFindDTO);
}
// public List<MemberOrderBo>
/**
* 获取订单详情
*
......@@ -692,6 +706,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
}
}
// /**
// * 更新(不成功抛异常)
// * @param baseOrder
......@@ -764,6 +780,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
return userFeign;
}
/**
* 订单查询类
*/
......
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.pojo.dto.MemberOrderBo;
import com.xxfc.platform.order.pojo.dto.MemberOrderFindDTO;
import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.math.BigDecimal;
......@@ -32,4 +35,6 @@ public interface BaseOrderMapper extends Mapper<BaseOrder> {
public List<OrderPageVO> selectAllTourOrder(Map<String, Object> paramMap);
List<MemberOrderBo> findMemberOrders(MemberOrderFindDTO memberOrderFindDTO);
}
......@@ -9,23 +9,24 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.order.biz.OrderMemberDetailBiz;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderMemberDetail;
import com.xxfc.platform.order.pojo.dto.MemberOrderFindDTO;
import com.xxfc.platform.order.pojo.order.add.AddMemberDTO;
import com.xxfc.platform.order.pojo.order.MemberBO;
import com.xxfc.platform.order.pojo.vo.MemberOrderPageVo;
import com.xxfc.platform.order.service.OrderMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("orderMember")
@Api(value="会员订单",tags={"会员订单"})
@Api(value = "会员订单", tags = {"会员订单"})
@IgnoreClientToken
public class OrderMemberController extends BaseController<OrderMemberDetailBiz,OrderMemberDetail> {
public class OrderMemberController extends BaseController<OrderMemberDetailBiz, OrderMemberDetail> {
@Autowired
OrderMemberService orderMemberService;
......@@ -33,10 +34,10 @@ public class OrderMemberController extends BaseController<OrderMemberDetailBiz,O
@Autowired
UserFeign userFeign;
@RequestMapping(value = "add",method = RequestMethod.POST)
@RequestMapping(value = "add", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "确认会员订单")
public ObjectRestResponse<BaseOrder> add(@RequestBody AddMemberDTO dto){
public ObjectRestResponse<BaseOrder> add(@RequestBody AddMemberDTO dto) {
MemberBO bo = BeanUtil.toBean(dto, MemberBO.class);
//查询会员等级实体
......@@ -52,4 +53,22 @@ public class OrderMemberController extends BaseController<OrderMemberDetailBiz,O
return ObjectRestResponse.succ(bo.getOrder());
}
/**
* 会员订单列表
*
* @param memberOrderFindDTO
* @return
*/
@PostMapping("/page")
@ResponseBody
public ObjectRestResponse<MemberOrderPageVo> listMemberOrderPage(@RequestBody MemberOrderFindDTO memberOrderFindDTO) {
MemberOrderPageVo memberOrderPageVo = orderMemberService.listMemberOrderPage(memberOrderFindDTO);
return ObjectRestResponse.succ(memberOrderPageVo);
}
@PostMapping("/export")
@ResponseBody
public void exportMemberOrders(@RequestBody MemberOrderFindDTO memberOrderFindDTO, HttpServletResponse response){
// orderMemberService.exportMemberOrderData(memberOrderFindDTO);
}
}
\ No newline at end of file
......@@ -153,7 +153,8 @@
or t.start_time between #{startTime} and #{endTime})
</if>
<if test="vehicleIds != null and vehicleIds.size() > 0">
AND r.vehicle_id IN <foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=",">
AND r.vehicle_id IN
<foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=",">
#{vehicleId}
</foreach>
</if>
......@@ -282,4 +283,64 @@
and r.start_time between #{startTime} and #{endTime}
</if>
</select>
<select id="findMemberOrders" resultType="com.xxfc.platform.order.pojo.dto.MemberOrderBo">
SELECT
`id`,
`no` AS `orderNo`,
`name`,
`status`,
`goods_amount` AS `goodsAmount`,
`real_amount` AS `realAmount`,
`order_amount` AS `orderAmount`,
`crt_time` AS `creatTime`,
`pay_time` AS `payTime`,
`coupon_amount` AS `couponAmount`,
`user_id` AS `userId`,
`has_pay` AS `hasPay`,
`member_level` AS `memberLevel`,
`facilitate_id` AS `facilitateId`,
`facilitate_phone` AS `facilitatePhone`
FROM
`base_order`
WHERE
type = 3
<if test="orderNo!=null and orderNo!=''">
and `no`=#{orderNo}
</if>
<if test="state!=null">
and `status`=#{state}
</if>
<if test="facilitatePhone!=null and facilitatePhone!=''">
and `facilitate_phone`=#{facilitatePhone}
</if>
<if test="startOrderTime!=null and endOrderTime!=null">
and `crt_time` between #{startOrderTime} and #{endOrderTime}
</if>
<if test="startOrderTime!=null and endOrderTime==null">
and `crt_time` <![CDATA[>=#{startOrderTime}]]>
</if>
<if test="endOrderTime!=null and startOrderTime==null">
and `crt_time` <![CDATA[<=#{endOrderTime}]]>
</if>
<if test="startPayTime!=null and endPayTime!=null">
and `pay_time` between #{startPayTime} and #{endPayTime}
</if>
<if test="startPayTime!=null and endPayTime==null">
and `pay_time` <![CDATA[>=#{startPayTime}]]>
</if>
<if test="endPayTime!=null and startPayTime==null">
and `pay_time` <![CDATA[<=#{endPayTime}]]>
</if>
<if test="levelName!=null and levelName!=''">
and `name` like CONCAT('%',#{levelName},'%')
</if>
<if test="userIds!=null and userIds.size()>0">
and `user_id` IN
<foreach collection="userIds" item="userId" separator="," open="(" close=")">
#{userId}
</foreach>
</if>
ORDER BY `crt_time` DESC
</select>
</mapper>
\ No newline at end of file
......@@ -225,7 +225,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
try {
vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson, VehiclePageQueryVo.class);
UserDTO userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
UserBo userDTO = userFeign.userinfoByToken(userAuthConfig.getToken(request)).getData();
if (userDTO != null) {
if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
......
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