dev-discount
199901012 4 years ago
commit 18f92b4839
  1. 16
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 51
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  3. 85
      hai-service/src/main/java/com/hai/model/HighOrderData.java
  4. 3
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  5. 32
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -109,11 +109,21 @@ public class HighOrderController {
HttpServletRequest request) { HttpServletRequest request) {
try { try {
// // 用户 SessionObject sessionObject = userCenter.getSessionObject(request);
// SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
if (userInfoModel.getSecRole().getRoleType() == 5) {
map.put("companyId" , userInfoModel.getBsCompany().getId());
}
if (userInfoModel.getSecRole().getRoleType() == 2) {
map.put("merchantId" , userInfoModel.getMerchant().getId());
}
if (userInfoModel.getSecRole().getRoleType() == 3) {
map.put("storeId" , userInfoModel.getMerchantStore().getId());
}
map.put("status", status); map.put("status", status);
map.put("orderNo", orderNo); map.put("orderNo", orderNo);
map.put("phone", phone); map.put("phone", phone);

@ -1,12 +1,15 @@
package com.hai.dao; package com.hai.dao;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.model.HighOrderData;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
@ -38,4 +41,52 @@ public interface HighOrderMapperExt {
}) })
List<HighOrder> getCloseOrder(); List<HighOrder> getCloseOrder();
@Select({
"<script>",
"select",
"coupon_code_id, child_order_id,order_no,mem_name,mem_phone,pay_model,a.pay_type as pay_type, coupon.merchant_id as merchant_id, store_id,pay_gold,pay_price,pay_real_price, ",
"pay_serial_no,order_status,total_price,a.create_time as create_time ,order_id,company_id, goods_type ",
"from high_coupon coupon join ( select * from high_order od ",
"join (select cc.id as coupon_code_id, cc.child_order_id, merchant_id,coupon_id,order_id,store_id, goods_type ",
"from high_coupon_code cc join high_child_order co on cc.child_order_id = co.id) cocc on cocc.order_id = od.id ",
") a on coupon.id = a.coupon_id ",
"where ",
"1=1 ",
"<if test='map.companyId != null'> AND company_id = #{map.companyId} </if>",
"<if test='map.merchantId != null'> AND merchant_id = #{map.merchantId} </if>",
"<if test='map.storeId != null'> AND store_id = #{map.storeId} </if>",
"<if test='map.mem_phone != null'> AND mem_phone = #{map.memName} </if>",
"<if test='map.order_no != null'> AND order_no = #{map.orderNo} </if>",
"<if test='map.pay_model != null'> AND pay_model = #{map.payModel} </if>",
"<if test='map.pay_type != null'> AND pay_type = #{map.payType} </if>",
"<if test='map.order_status != null'> AND order_status = #{map.orderStatus} </if>",
" order by create_time desc ",
"</script>"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT),
@Result(column="mem_name", property="memName", jdbcType=JdbcType.VARCHAR),
@Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_model", property="payModel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER),
@Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER),
})
List<HighOrderData> selectOrderDataList(@Param("map") Map<String,Object> map);
} }

@ -0,0 +1,85 @@
package com.hai.model;
import com.hai.entity.HighOrder;
public class HighOrderData extends HighOrder {
/**
* 子订单id
*/
private Long childOrderId;
/**
* 区域ID
*/
private Long companyId;
/**
* 商户ID
*/
private Long merchantId;
/**
* 门店ID
*/
private Long storeId;
/**
* 订单ID
*/
private Long orderId;
/**
* 商品类型 1:卡卷 2.充值
*/
private Integer goodsType;
public Long getChildOrderId() {
return childOrderId;
}
public void setChildOrderId(Long childOrderId) {
this.childOrderId = childOrderId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getMerchantId() {
return merchantId;
}
public void setMerchantId(Long merchantId) {
this.merchantId = merchantId;
}
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Integer getGoodsType() {
return goodsType;
}
public void setGoodsType(Integer goodsType) {
this.goodsType = goodsType;
}
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.hai.entity.HighChildOrder; import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.model.HighOrderData;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -74,7 +75,7 @@ public interface HighOrderService {
* @Description 查询订单列表 * @Description 查询订单列表
* @Date 2021/3/26 23:06 * @Date 2021/3/26 23:06
**/ **/
List<HighOrder> getOrderList(Map<String,Object> map); List<HighOrderData> getOrderList(Map<String,Object> map);
/** /**
* @Author 胡锐 * @Author 胡锐

@ -13,6 +13,7 @@ import com.hai.dao.HighUserCouponMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponHandselModel;
import com.hai.model.HighCouponModel; import com.hai.model.HighCouponModel;
import com.hai.model.HighOrderData;
import com.hai.service.*; import com.hai.service.*;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -56,6 +57,7 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource @Resource
private HighUserCouponMapper highUserCouponMapper; private HighUserCouponMapper highUserCouponMapper;
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertOrder(HighOrder highOrder) throws Exception { public void insertOrder(HighOrder highOrder) throws Exception {
@ -257,35 +259,9 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
@Override @Override
public List<HighOrder> getOrderList(Map<String, Object> map) { public List<HighOrderData> getOrderList(Map<String, Object> map) {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "memId") != null) {
criteria.andMemIdEqualTo(MapUtils.getLong(map, "memId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andOrderStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getString(map, "orderNo") != null) { return highOrderMapperExt.selectOrderDataList(map);
criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo"));
}
if (MapUtils.getString(map, "phone") != null) {
criteria.andMemPhoneEqualTo(MapUtils.getString(map, "phone"));
}
example.setOrderByClause("create_time desc");
List<HighOrder> list = highOrderMapper.selectByExample(example);
if (list.size() > 0) {
for (HighOrder order : list) {
order.setHighChildOrderList(getChildOrderByOrder(order.getId()));
}
}
return list;
} }
@Override @Override

Loading…
Cancel
Save