4 files added
16 files modified
| | |
| | | private String weight; |
| | | |
| | | /** |
| | | * 订单状态 状态 1-待接单2-已接单3-已完成(用户)/待入库(集物员)4-已完成5-已取消 |
| | | * 订单状态 状态 1-待接单2-已接单3-已完成(用户)/待入库(集物员)5-已取消 |
| | | */ |
| | | private Integer status; |
| | | public static final Integer ORDER_STATUS_WAITING = 1; |
| | |
| | | import lombok.Data;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | @Data
|
| | |
| | | * 登陆时间
|
| | | */
|
| | | String loginTime;
|
| | | @ApiModelProperty("推广人数")
|
| | | Integer extensionNum;
|
| | | @ApiModelProperty("订单数")
|
| | | Integer allOrderNum;
|
| | | @ApiModelProperty("环保金")
|
| | | BigDecimal money;
|
| | | @ApiModelProperty("积分数")
|
| | | BigDecimal collectScore;
|
| | |
|
| | | @ApiModelProperty("1:已删除 0:未删除")
|
| | | String delFlag;
|
| | |
|
| | | @ApiModelProperty("1:已删除 0:未删除")
|
| | | Integer orderStatus3;
|
| | | Integer orderStatus5;
|
| | | //入库重量
|
| | |
| | | package com.xzx.gc.shop.controller; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.xzx.gc.common.constant.CommonEnum; |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.dto.log.OperationAppLog; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.entity.JhyInfo; |
| | | import com.xzx.gc.entity.JhyOrder; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.shop.dto.QueryGoodsListDto; |
| | | import com.xzx.gc.shop.dto.QueryJhyOrderListDto; |
| | | import com.xzx.gc.shop.dto.ViewGoodsDto; |
| | | import com.xzx.gc.shop.dto.ViewJhyOrderDto; |
| | | import com.xzx.gc.shop.dto.*; |
| | | import com.xzx.gc.shop.mapper.JhyOrderMapper; |
| | | import com.xzx.gc.shop.service.JhyService; |
| | | import com.xzx.gc.shop.vo.*; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @Resource |
| | | JhyService jhyService; |
| | | |
| | | @Resource |
| | | JhyOrderMapper jhyOrderMapper; |
| | | |
| | | /** |
| | | * 订单列表 |
| | |
| | | return JsonResult.success(viewJhyOrderVo); |
| | | } |
| | | |
| | | /** |
| | | * 取消订单 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/jhy/cancelJhyOrder.json") |
| | | @ApiOperation(value="集物员订单管理-取消订单", notes="test: 仅0有正确返回") |
| | | public JsonResult cancelJhyOrder(@RequestBody CancelJhyOrderDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | JhyOrder jhyOrder = jhyOrderMapper.selectByPrimaryKey(id); |
| | | if(ObjectUtil.isEmpty(jhyOrder)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | Integer status = jhyOrder.getStatus(); |
| | | if(JhyOrder.ORDER_STATUS_WAITING != status){ |
| | | return JsonResult.failMessage("订单不是待接单状态,不允许取消!"); |
| | | } |
| | | jhyService.cancelJhyOrder(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("集物员管理-取消订单-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | if(ScoreOrder.STATUS_READY != status){ |
| | | return JsonResult.failMessage("当前订单不是待发货状态!"); |
| | | } |
| | | ScoreOrder order = scoreOrderMapper.selectByPrimaryKey(model.getId()); |
| | | Example exampleDetails = new Example(ScoreDetails.class); |
| | | Example.Criteria criteriaDetails = exampleDetails.createCriteria(); |
| | | criteriaDetails.andEqualTo("orderNo",order.getOrderNo()); |
| | | criteriaDetails.andEqualTo("userId",order.getUserId()); |
| | | criteriaDetails.andEqualTo("type",ScoreDetails.SCORE_TYPE_SHOPPING_RETURN); |
| | | |
| | | orderService.cancelOrder(id,scoreOrder.getUserId()); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-取消-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | List<ScoreDetails> scoreDetails = scoreDetailsMapper.selectByExample(exampleDetails); |
| | | if(CollUtil.isNotEmpty(scoreDetails)){ |
| | | return JsonResult.failMessage("当前订单已经取消过了!"); |
| | | } |
| | | Long aLong = orderService.cancelOrder(model); |
| | | if(aLong > 0){ |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-取消-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | }else{ |
| | | return JsonResult.success("操作失败!"); |
| | | } |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.xzx.gc.shop.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CancelJhyOrderDto { |
| | | |
| | | @ApiModelProperty(value="订单ID") |
| | | private Long id; |
| | | } |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.xzx.gc.common.utils.StringUtils; |
| | | import com.xzx.gc.entity.JhyOrder; |
| | | import com.xzx.gc.entity.JhyOrderItems; |
| | | import com.xzx.gc.entity.ScoreOrderDetails; |
| | | import com.xzx.gc.shop.dto.CancelJhyOrderDto; |
| | | import com.xzx.gc.shop.dto.QueryJhyOrderListDto; |
| | | import com.xzx.gc.shop.mapper.JhyOrderItemsMapper; |
| | | import com.xzx.gc.shop.mapper.JhyOrderMapper; |
| | |
| | | |
| | | return viewJhyOrderVo; |
| | | } |
| | | |
| | | public void cancelJhyOrder(CancelJhyOrderDto model) { |
| | | Long id = model.getId(); |
| | | JhyOrder jhyOrder = jhyOrderMapper.selectByPrimaryKey(id); |
| | | jhyOrder.setStatus(JhyOrder.ORDER_STATUS_CANCEL); |
| | | jhyOrderMapper.updateByPrimaryKey(jhyOrder); |
| | | } |
| | | } |
| | |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.entity.UserInfo; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.user.dto.AddScoreNumDto; |
| | | import com.xzx.gc.user.dto.ExamineJwyDto; |
| | | import com.xzx.gc.user.dto.GetScoreNumDto; |
| | | import com.xzx.gc.user.dto.JhyInfoListDto; |
| | | import com.xzx.gc.user.dto.*; |
| | | import com.xzx.gc.user.mapper.AccountMapper; |
| | | import com.xzx.gc.user.mapper.JhyInfoMapper; |
| | | import com.xzx.gc.user.mapper.UserMapper; |
| | | import com.xzx.gc.user.service.JhyInfoService; |
| | | import com.xzx.gc.user.vo.GetScoreNumVo; |
| | | import com.xzx.gc.user.vo.JhyInfoListVo; |
| | | import com.xzx.gc.user.vo.ViewJhyInfoVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查看集货员信息详情 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/jhy/viewJhyInfo.json") |
| | | @ApiResponses({@ApiResponse( code = 200, message = "success", response = ViewJhyInfoVo.class)}) |
| | | @ApiOperation(value="集物员管理-查看集货员信息详情", notes="test: 仅0有正确返回") |
| | | public JsonResult<ViewJhyInfoVo> viewJhyInfo(@RequestBody ViewJhyInfoDto viewJhyInfoDto) { |
| | | Long id = viewJhyInfoDto.getId(); |
| | | ViewJhyInfoVo viewJhyInfoVo = jhyInfoService.viewJhyInfo(id); |
| | | return JsonResult.success(viewJhyInfoVo); |
| | | } |
| | | |
| | | /** |
| | | * 编辑集货员信息 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/jhy/updateJhyInfo.json") |
| | | @ApiOperation(value="集物员管理--编辑集货员信息", notes="test: 仅0有正确返回") |
| | | public JsonResult updateJhyInfo(@RequestBody UpdateJhyInfoDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | JhyInfo jhyInfo = jhyInfoMapper.selectByPrimaryKey(id); |
| | | if(ObjectUtil.isEmpty(jhyInfo)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | jhyInfoService.updateJhyInfo(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("集物员管理--编辑集货员信息-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/jhy/getScoreNum.json") |
New file |
| | |
| | | package com.xzx.gc.user.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | public class UpdateJhyInfoDto { |
| | | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @NotBlank(message = "手机号不能为空") |
| | | private String mobile; |
| | | |
| | | @NotBlank(message = "是否集物员 1-是 2-否") |
| | | private String isJhy; |
| | | |
| | | } |
New file |
| | |
| | | package com.xzx.gc.user.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ViewJhyInfoDto { |
| | | private Long id; |
| | | } |
| | |
| | | List<OrderInfo> findArea(); |
| | | |
| | | void insertScoreDetailsRet(ScoreDetails scoreDetailsRet); |
| | | |
| | | AccountInfo selectOneByUserId(@Param("userId")String userId); |
| | | } |
| | | |
| | |
| | | package com.xzx.gc.user.mapper; |
| | | |
| | | import com.xzx.gc.entity.JhyOrder; |
| | | import com.xzx.gc.entity.OrderInfo; |
| | | import com.xzx.gc.entity.OrderItemInfo; |
| | | import com.xzx.gc.model.admin.PromoterModel; |
| | |
| | | |
| | | List<OrderInfo> findListOrderReceiveTime(@Param("receiver")String receiver); |
| | | |
| | | List<JhyOrder> selectJhyOrderByUserId(@Param("userId")String userId); |
| | | |
| | | } |
| | | |
| | |
| | | Map<String, Object> queryUserDayCount1(); |
| | | |
| | | Map<String, Object> queryUserDayCount(@Param("townIds") List<String> townIds); |
| | | |
| | | List<UserLoginInfo> selectOneByUserId(@Param("userId")String userId); |
| | | } |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.xzx.gc.common.exception.RestException; |
| | | import com.xzx.gc.entity.AccountInfo; |
| | | import com.xzx.gc.entity.JhyInfo; |
| | | import com.xzx.gc.entity.ScoreDetails; |
| | | import com.xzx.gc.common.utils.StringUtils; |
| | | import com.xzx.gc.entity.*; |
| | | import com.xzx.gc.user.dto.*; |
| | | import com.xzx.gc.user.mapper.AccountMapper; |
| | | import com.xzx.gc.user.mapper.JhyInfoMapper; |
| | | import com.xzx.gc.user.mapper.UserLoginInfoMapper; |
| | | import com.xzx.gc.user.mapper.UserMapper; |
| | | import com.xzx.gc.user.vo.GetScoreNumVo; |
| | | import com.xzx.gc.user.vo.JhyInfoListVo; |
| | | import com.xzx.gc.user.vo.ViewJhyInfoVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private JhyInfoMapper jhyInfoMapper; |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private UserLoginInfoMapper userLoginInfoMapper; |
| | | @Autowired |
| | | private AccountMapper accountMapper; |
| | | |
| | |
| | | public Map<String, Object> queryList(JhyInfoListDto jhyInfoListDto) { |
| | | PageHelper.startPage(jhyInfoListDto.getPage(), jhyInfoListDto.getLimit()); |
| | | List<JhyInfoListVo> jhyInfoListVos = jhyInfoMapper.selectJhyInfoList(jhyInfoListDto); |
| | | if(CollUtil.isNotEmpty(jhyInfoListVos)){ |
| | | for(JhyInfoListVo jhyInfoListVo : jhyInfoListVos){ |
| | | String userId = jhyInfoListVo.getUserId(); |
| | | if(StrUtil.isNotEmpty(userId)){ |
| | | AccountInfo accountInfo = accountMapper.selectOneByUserId(userId); |
| | | String collectScore = StrUtil.isEmpty(accountInfo.getCollectScore()) ? "0" : accountInfo.getCollectScore(); |
| | | jhyInfoListVo.setScore(new BigDecimal(collectScore).setScale( 2, BigDecimal.ROUND_DOWN )); |
| | | } |
| | | } |
| | | } |
| | | PageInfo<JhyInfoListVo> pageInfo = new PageInfo<>(jhyInfoListVos); |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | |
| | | } |
| | | return getScoreNumVo; |
| | | } |
| | | |
| | | public ViewJhyInfoVo viewJhyInfo(Long id) { |
| | | JhyInfo jhyInfo = jhyInfoMapper.selectByPrimaryKey(id); |
| | | ViewJhyInfoVo viewJhyInfoVo = new ViewJhyInfoVo(); |
| | | viewJhyInfoVo.setIsJhy(jhyInfo.getIsJhy()); |
| | | viewJhyInfoVo.setUsername(jhyInfo.getUsername()); |
| | | viewJhyInfoVo.setMobile(jhyInfo.getMobile()); |
| | | viewJhyInfoVo.setIdCard(jhyInfo.getIdentity()); |
| | | viewJhyInfoVo.setIdCardImg(jhyInfo.getCardPos()); |
| | | viewJhyInfoVo.setAddress(jhyInfo.getAddress()); |
| | | String userId = jhyInfo.getUserId(); |
| | | AccountInfo accountInfo = accountMapper.selectOneByUserId(userId); |
| | | String collectScore = accountInfo.getCollectScore(); |
| | | BigDecimal bigDecimal = new BigDecimal(StrUtil.isEmpty(collectScore) ? "0" : collectScore).setScale( 2, BigDecimal.ROUND_DOWN ); |
| | | viewJhyInfoVo.setScore(bigDecimal); |
| | | viewJhyInfoVo.setCreateTime(jhyInfo.getCreatedTime().toString()); |
| | | |
| | | UserInfo userInfo = userMapper.selectByPrimaryKey(userId); |
| | | String nickName = userInfo.getNickName(); |
| | | if(StrUtil.isNotEmpty(nickName)){ |
| | | String decode = StringUtils.decode(nickName); |
| | | viewJhyInfoVo.setNickname(decode); |
| | | } |
| | | |
| | | List<UserLoginInfo> userLoginInfos = userLoginInfoMapper.selectOneByUserId(userId); |
| | | if(CollUtil.isNotEmpty(userLoginInfos)){ |
| | | String loginTime = userLoginInfos.get(0).getLoginTime(); |
| | | viewJhyInfoVo.setLoginTime(loginTime); |
| | | } |
| | | return viewJhyInfoVo; |
| | | } |
| | | |
| | | public void updateJhyInfo(UpdateJhyInfoDto model) { |
| | | JhyInfo jhyInfo = jhyInfoMapper.selectByPrimaryKey(model.getId()); |
| | | String mobile = model.getMobile(); |
| | | String isJhy = model.getIsJhy(); |
| | | jhyInfo.setIsJhy(isJhy); |
| | | jhyInfo.setMobile(mobile); |
| | | jhyInfoMapper.updateByPrimaryKey(jhyInfo); |
| | | } |
| | | } |
| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | orderStatus2.add("5"); |
| | | orderStatus2.add("7"); |
| | | for (UserModel mx : map) { |
| | | |
| | | //推广人数(暂时没有推广关系为空),订单数,环保金,积分 |
| | | if (userModel.getExportFlag() == 0) { |
| | | //订单数 |
| | | Integer orderNum = 0; |
| | | Example exampleOrder = new Example(OrderInfo.class); |
| | | Example.Criteria criteriaOrder = exampleOrder.createCriteria(); |
| | | criteriaOrder.andEqualTo("userId",mx.getUserId()); |
| | | criteriaOrder.andNotEqualTo("orderStatus",6); |
| | | List<OrderInfo> orderInfos = orderMapper.selectByExample(exampleOrder); |
| | | if(CollUtil.isNotEmpty(orderInfos)){ |
| | | orderNum = orderNum + orderInfos.size(); |
| | | } |
| | | |
| | | List<JhyOrder> jhyOrders = orderMapper.selectJhyOrderByUserId(mx.getUserId()); |
| | | if(CollUtil.isNotEmpty(jhyOrders)){ |
| | | orderNum = orderNum + jhyOrders.size(); |
| | | } |
| | | mx.setAllOrderNum(orderNum); |
| | | //环保金,积分 |
| | | AccountInfo accountInfo = accountService.findByUserId(mx.getUserId()); |
| | | if(ObjectUtil.isNotEmpty(accountInfo)){ |
| | | String money = accountInfo.getMoney(); |
| | | mx.setMoney(new BigDecimal(StrUtil.isEmpty(money) ? "0" : money).setScale( 2, BigDecimal.ROUND_DOWN )); |
| | | |
| | | String collectScore = StrUtil.isEmpty(accountInfo.getCollectScore()) ? "0":accountInfo.getCollectScore(); |
| | | mx.setCollectScore(new BigDecimal(collectScore).setScale( 2, BigDecimal.ROUND_DOWN )); |
| | | } |
| | | |
| | | } |
| | | |
| | | //设置登录时间 |
| | | if (userModel.getExportFlag() == 0) { |
| | |
| | | List<Map<String, Object>> odlist = orderMapper.queryCuserOrderFinishList(userId, x); |
| | | PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(odlist); |
| | | for (Map<String, Object> map : odlist) { |
| | | map.put("money", DoubleUtil.roundTwo(map.get("money").toString())); |
| | | map.put("weight", DoubleUtil.roundThree(map.get("weight").toString())); |
| | | map.put("orderid", map.get("orderId").toString()); |
| | | map.put("address", map.get("address").toString()); |
| | | map.put("status", map.get("status")); |
| | | map.put("type", map.get("type")); |
| | | map.put("money", DoubleUtil.roundTwo(map.get("money").toString())); |
| | | map.put("score", DoubleUtil.roundTwo(map.get("score").toString())); |
| | | map.put("weight", DoubleUtil.roundThree(map.get("weight").toString())); |
| | | map.put("name", map.get("name").toString()); |
| | | map.put("createtime", map.get("createTime").toString()); |
| | | } |
| | | m.put("orderList", odlist); |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value = "审核状态 1-待审核 2-审核通过 3-审核拒绝") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "集物员积分数") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "申请时间") |
| | | private String createTime; |
| | | |
New file |
| | |
| | | package com.xzx.gc.user.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ViewJhyInfoVo", description = "集物员详情") |
| | | public class ViewJhyInfoVo { |
| | | |
| | | //微信昵称 |
| | | private String nickname; |
| | | |
| | | //注册时间 |
| | | private String createTime; |
| | | |
| | | //最近登录时间 |
| | | private String loginTime; |
| | | |
| | | //账户积分 |
| | | private BigDecimal Score; |
| | | |
| | | //姓名 |
| | | private String username; |
| | | |
| | | //手机号码 |
| | | private String mobile; |
| | | |
| | | //身份证号码 |
| | | private String idCard; |
| | | |
| | | //身份证图片 |
| | | private String idCardImg; |
| | | |
| | | //地址(微信地址) |
| | | private String address; |
| | | |
| | | /** |
| | | * 是否集物员 1-是 2-否 |
| | | */ |
| | | private String isJhy; |
| | | |
| | | } |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <select id="selectOneByUserId" resultType="com.xzx.gc.entity.AccountInfo"> |
| | | select * from xzx_account_info where user_id = #{userId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | GROUP BY a.order_id order by a.create_time |
| | | </select> |
| | | |
| | | <!-- <select id="queryCuserOrderCount" resultType="java.util.HashMap">--> |
| | | <!-- SELECT COUNT(*) as count FROM xzx_order_info WHERE create_user_id=#{userId}--> |
| | | <!-- <if test="status != null">--> |
| | | <!-- and order_status in--> |
| | | <!-- <foreach collection="status" index="index" item="id" open="(" separator="," close=")">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | <!-- GROUP BY order_type--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="queryCuserOrderCount" resultType="java.util.HashMap"> |
| | | SELECT COUNT(*) as count FROM xzx_order_info WHERE create_user_id=#{userId} |
| | | <if test="status != null"> |
| | | and order_status in |
| | | <foreach collection="status" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | SELECT |
| | | COUNT(*) as count |
| | | FROM |
| | | ( |
| | | ( |
| | | SELECT |
| | | a.order_id orderId, |
| | | a.order_status STATUS, |
| | | '1' type, |
| | | ifnull(sum(d.money), 0) money, |
| | | '0' score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | e. NAME NAME, |
| | | a.create_time createTime |
| | | FROM |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id |
| | | LEFT JOIN xzx_user_info e ON e.user_id = a.receiver |
| | | WHERE |
| | | a.create_user_id=#{userId} |
| | | GROUP BY |
| | | a.order_id |
| | | ) |
| | | UNION |
| | | ( |
| | | SELECT |
| | | a.id orderId, |
| | | a. STATUS STATUS, |
| | | '2' type, |
| | | '0' money, |
| | | ifnull(sum(d.score), 0) score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | a.username NAME, |
| | | a.CREATED_TIME createTime |
| | | FROM |
| | | xzx_jhy_order a |
| | | LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id |
| | | WHERE |
| | | a.user_id = #{userId} |
| | | GROUP BY |
| | | a.id |
| | | ) |
| | | ) v |
| | | ORDER BY |
| | | createTime DESC |
| | | GROUP BY order_type |
| | | </select> |
| | | |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryCuserOrderFinishList" resultType="java.util.HashMap"> |
| | | SELECT a.order_id as orderId, sum(d.money) as money,sum(d.weight) as weight,a.create_time as createTime FROM |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d on a.order_id = d.order_id |
| | | WHERE a.create_user_id=#{userId} |
| | | <if test="status != null"> |
| | | and a.order_status in |
| | | <foreach collection="status" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <!-- <select id="queryCuserOrderFinishList" resultType="java.util.HashMap">--> |
| | | <!-- SELECT a.order_id as orderId,--> |
| | | <!-- sum(d.money) as money,--> |
| | | <!-- a.address as address,--> |
| | | <!-- a.order_type as orderType,--> |
| | | <!-- sum(d.weight) as weight,--> |
| | | <!-- a.create_time as createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_order_info a--> |
| | | <!-- LEFT JOIN xzx_order_item_info d on a.order_id = d.order_id--> |
| | | <!-- WHERE a.create_user_id=#{userId}--> |
| | | <!-- <if test="status != null">--> |
| | | <!-- and a.order_status in--> |
| | | <!-- <foreach collection="status" index="index" item="id" open="(" separator="," close=")">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | |
| | | GROUP BY a.order_id |
| | | <!-- GROUP BY a.order_id--> |
| | | <!-- </select>--> |
| | | <select id="queryCuserOrderFinishList" resultType="java.util.HashMap"> |
| | | SELECT |
| | | orderId, |
| | | address, |
| | | status, |
| | | type, |
| | | money, |
| | | score, |
| | | weight, |
| | | name, |
| | | createTime |
| | | FROM |
| | | ( |
| | | ( |
| | | SELECT |
| | | a.order_id orderId, |
| | | a.order_status STATUS, |
| | | '1' type, |
| | | ifnull(sum(d.money), 0) money, |
| | | '0' score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | e. NAME NAME, |
| | | a.create_time createTime |
| | | FROM |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id |
| | | LEFT JOIN xzx_user_info e ON e.user_id = a.receiver |
| | | WHERE |
| | | a.create_user_id = #{userId} |
| | | GROUP BY |
| | | a.order_id |
| | | ) |
| | | UNION |
| | | ( |
| | | SELECT |
| | | a.id orderId, |
| | | a. STATUS STATUS, |
| | | '2' type, |
| | | '0' money, |
| | | ifnull(sum(d.score), 0) score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | a.username NAME, |
| | | a.CREATED_TIME createTime |
| | | FROM |
| | | xzx_jhy_order a |
| | | LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id |
| | | WHERE |
| | | a.user_id = #{userId} |
| | | GROUP BY |
| | | a.id |
| | | ) |
| | | ) v |
| | | ORDER BY |
| | | createTime DESC |
| | | |
| | | </select> |
| | | |
| | | |
| | |
| | | b.receive_time ASC |
| | | </select> |
| | | |
| | | <select id="selectJhyOrderByUserId" resultType="com.xzx.gc.entity.JhyOrder"> |
| | | SELECT |
| | | a.* |
| | | FROM |
| | | xzx_jhy_order a |
| | | WHERE |
| | | a.status != '5' |
| | | and a.user_id = #{userId} |
| | | </select> |
| | | </mapper> |
| | |
| | | AND DATE_FORMAT(a.login_time, '%Y-%m-%d')=DATE_FORMAT(CURDATE()-1, '%Y-%m-%d') |
| | | GROUP BY DATE_FORMAT(a.login_time, '%Y-%m-%d') ORDER BY a.login_id DESC |
| | | </select> |
| | | |
| | | <select id="selectOneByUserId" resultType="com.xzx.gc.entity.UserLoginInfo"> |
| | | SELECT * |
| | | FROM xzx_user_login_info |
| | | where user_id = #{userId} |
| | | ORDER BY login_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <select id="queryCuserDetail" resultType="java.util.HashMap"> |
| | | SELECT a.*, b.money, b.withdraw_money, c.pay_type, SUM(c.money) as moneyx FROM xzx_user_info a |
| | | SELECT a.*, b.money,b.collect_score collectScore, b.withdraw_money, c.pay_type, SUM(c.money) as moneyx FROM xzx_user_info a |
| | | LEFT JOIN xzx_account_info b ON a.user_id=b.user_id |
| | | LEFT JOIN xzx_pay_info c ON b.account_id=c.account_id |
| | | LEFT JOIN xzx_sys_config_info d ON c.pay_type=d.config_value AND d.config_type_code='PAY_TYPE' |