6 files added
5 files modified
New file |
| | |
| | | package com.xzx.gc.shop.controller; |
| | | |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | 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.service.JhyService; |
| | | import com.xzx.gc.shop.vo.QueryGoodsListVo; |
| | | import com.xzx.gc.shop.vo.QueryJhyOrderListVo; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(tags = {"集物员管理"}) |
| | | @Slf4j |
| | | public class AdminJhyOrderController extends BaseController { |
| | | |
| | | @Resource |
| | | JhyService jhyService; |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * xzx_jhy_order 集货员订单表 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX+"/score/jhy/queryOrderList.json") |
| | | @ApiResponses({@ApiResponse( code = 200, message = "success", response = QueryJhyOrderListVo.class)}) |
| | | @ApiOperation(value = "集物员管理-订单列表", notes = "test: 仅0有正确返回") |
| | | public JsonResult<Map<String, Object>> queryOrderList(@RequestBody QueryJhyOrderListDto model) { |
| | | Map<String, Object> result = jhyService.queryOrderList(model); |
| | | return JsonResult.success(result); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class QueryJhyOrderListDto { |
| | | |
| | | @ApiModelProperty(value="订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value="联系人/手机号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value="状态 1-待接单2-服务中3-已收款4-待入库5-已完成6-已取消") |
| | | private Integer status; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="预约开始时间") |
| | | private Date reserveTimeStart; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="预约结束时间") |
| | | private Date reserveTimeEnd; |
| | | |
| | | @ApiModelProperty(value="第几页",required=true) |
| | | private int page; |
| | | |
| | | @ApiModelProperty(value="每一页数量",required=true) |
| | | private int limit; |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.mapper; |
| | | |
| | | import com.xzx.gc.entity.JhyOrder; |
| | | import com.xzx.gc.shop.dto.QueryJhyOrderListDto; |
| | | import com.xzx.gc.shop.vo.QueryJhyOrderListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface JhyOrderMapper extends GcMapper<JhyOrder> { |
| | | |
| | | List<QueryJhyOrderListVo> queryOrderList(@Param("record") QueryJhyOrderListDto model); |
| | | |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.xzx.gc.shop.dto.QueryJhyOrderListDto; |
| | | import com.xzx.gc.shop.mapper.JhyOrderMapper; |
| | | import com.xzx.gc.shop.vo.QueryGoodsListVo; |
| | | import com.xzx.gc.shop.vo.QueryJhyOrderListVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @Transactional |
| | | @Slf4j |
| | | public class JhyService { |
| | | |
| | | @Resource |
| | | JhyOrderMapper jhyOrderMapper; |
| | | |
| | | public Map<String, Object> queryOrderList(QueryJhyOrderListDto model) { |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<QueryJhyOrderListVo> maps = jhyOrderMapper.queryOrderList(model); |
| | | PageInfo pageInfo = new PageInfo(maps); |
| | | int count = Convert.toInt(pageInfo.getTotal()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", maps); |
| | | map.put("count", count); |
| | | map.put("code", 0); |
| | | return map; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @Transactional |
| | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| | | viewOrderVo = objectMapper.convertValue(scoreOrder, ViewOrderVo.class); |
| | | // String voucherImg = viewOrderVo.getVoucherImg(); |
| | | String voucherImg = scoreOrder.getVoucherImg(); |
| | | List<String> lists = StrUtil.splitTrim(voucherImg, ","); |
| | | viewOrderVo.setVoucherImgs(lists); |
| | | //2-待收货3-已收货4-已完成5-已评价,获取物流信息 |
| | | Integer status = scoreOrder.getStatus() == null ? 0:scoreOrder.getStatus(); |
| | | if(ScoreOrder.STATUS_DOING == status |
| | |
| | | public Long insureOrder(InsureOrderDto model) { |
| | | ScoreOrder scoreOrder = new ScoreOrder(); |
| | | scoreOrder.setId(model.getId()); |
| | | scoreOrder.setVoucherImg(model.getVoucherImgs().toString()); |
| | | scoreOrder.setStatus(ScoreOrder.STATUS_DONE); |
| | | scoreOrder.setVoucherImg(CollUtil.join(model.getVoucherImgs(),",")); |
| | | scoreOrderMapper.updateByPrimaryKeySelective(scoreOrder); |
| | | return scoreOrder.getId(); |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "QueryJhyOrderListVo", description = "返回") |
| | | public class QueryJhyOrderListVo { |
| | | |
| | | private Long id; |
| | | @ApiModelProperty(value="订单号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value="联系人") |
| | | private String name; |
| | | @ApiModelProperty(value="手机号") |
| | | private String mobilePhone; |
| | | @ApiModelProperty(value="区域地址") |
| | | private String area; |
| | | @ApiModelProperty(value="详细地址") |
| | | private String address; |
| | | @ApiModelProperty(value="预约时间") |
| | | private String reserveTime; |
| | | @ApiModelProperty(value="订单总金额") |
| | | private BigDecimal totalPrice; |
| | | @ApiModelProperty(value="状态 1-待接单2-服务中3-已收款4-待入库5-已完成6-已取消") |
| | | private Integer status; |
| | | @ApiModelProperty(value="集物员") |
| | | private String username; |
| | | @ApiModelProperty(value="备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | private BigDecimal totalPrice; |
| | | |
| | | @ApiModelProperty(value="凭证") |
| | | private String voucherImg; |
| | | private List<String> voucherImgs; |
| | | |
| | | /** |
| | | * 2-待收货3-已完成4-已取消 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xzx.gc.shop.mapper.JhyOrderMapper"> |
| | | |
| | | <select id="queryOrderList" resultType="com.xzx.gc.shop.vo.QueryJhyOrderListVo"> |
| | | SELECT |
| | | a.id id, |
| | | a.order_no orderNo, |
| | | a.area area, |
| | | a.address address, |
| | | a.reserve_time reserveTime, |
| | | a.status status, |
| | | a.remark remark, |
| | | b.name name, |
| | | b.mobile_phone mobilePhone, |
| | | (select ifnull(sum(price),0) from xzx_jhy_order_items where order_id = a.id) totalPrice, |
| | | d.username username |
| | | FROM |
| | | xzx_jhy_order a |
| | | left join xzx_user_info b on b.user_id = a.user_id |
| | | left join xzx_jhy_info d on d.id = a.jhy_id |
| | | WHERE 1 = 1 |
| | | <if test="record.orderNo != null and record.orderNo != ''"> |
| | | and a.order_no like concat('%',#{record.orderNo},'%') |
| | | </if> |
| | | <if test="record.status != null and record.status != ''"> |
| | | and a.status = #{record.status} |
| | | </if> |
| | | <if test="record.account != null and record.account != ''"> |
| | | and ( b.name like concat('%',#{record.account},'%') |
| | | or b.mobile_phone like concat('%',#{record.account},'%') ) |
| | | </if> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and a.reserve_time >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and a.reserve_time <= #{record.reserveTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | |
| | | <if test="record.createTimeEnd != null"> |
| | | and a.CREATED_TIME >= #{record.createTimeEnd} |
| | | and a.CREATED_TIME <= #{record.createTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | |
| | | xzx_score_goods_category a |
| | | WHERE 1 = 1 |
| | | <if test="record.name != null and record.name != ''"> |
| | | and a.name=#{record.name} |
| | | and a.name like concat('%',#{record.name},'%') |
| | | </if> |
| | | <if test="record.categoryIden != null and record.categoryIden != ''"> |
| | | and a.category_iden=#{record.categoryIden} |
| | |
| | | </if> |
| | | |
| | | <if test="createdTimeEnd != null"> |
| | | and a.CREATED_TIME >= #{createdTimeEnd} |
| | | and a.CREATED_TIME <= #{createdTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | </select> |