'修改订单'

dev-discount
= 4 years ago
parent daaeb8eecd
commit c25cc69098
  1. 37
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 11
      hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java
  3. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  4. 25
      hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java
  5. 31
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  6. 14
      hai-service/src/main/java/com/hai/entity/HighMerchantStore.java
  7. 12
      hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java
  8. 9
      hai-service/src/main/java/com/hai/model/HighOrderModel.java
  9. 7
      hai-service/src/main/java/com/hai/service/HighMerchantService.java
  10. 5
      hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java

@ -147,6 +147,7 @@ public class HighOrderController {
@ResponseBody @ResponseBody
@ApiOperation(value = "查询商品订单列表") @ApiOperation(value = "查询商品订单列表")
public ResponseData getGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, public ResponseData getGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merchantId", required = false) Long merchantId,
@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "paySerialNo", required = false) String paySerialNo, @RequestParam(name = "paySerialNo", required = false) String paySerialNo,
@RequestParam(name = "payModel", required = false) Integer payModel, @RequestParam(name = "payModel", required = false) Integer payModel,
@ -155,10 +156,26 @@ public class HighOrderController {
@RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try { try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商
if(userInfoModel.getSecUser().getObjectType() == 0) {
map.put("companyId", companyId); map.put("companyId", companyId);
} else if (userInfoModel.getSecUser().getObjectType() == 1) {
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("merchantId", merchantId);
} else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId());
}
map.put("orderNo", orderNo); map.put("orderNo", orderNo);
map.put("paySerialNo", paySerialNo); map.put("paySerialNo", paySerialNo);
map.put("payModel", payModel); map.put("payModel", payModel);
@ -180,6 +197,7 @@ public class HighOrderController {
@ResponseBody @ResponseBody
@ApiOperation(value = "导出商品订单列表") @ApiOperation(value = "导出商品订单列表")
public ResponseData exportGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, public ResponseData exportGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merchantId", required = false) Long merchantId,
@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "paySerialNo", required = false) String paySerialNo, @RequestParam(name = "paySerialNo", required = false) String paySerialNo,
@RequestParam(name = "payModel", required = false) Integer payModel, @RequestParam(name = "payModel", required = false) Integer payModel,
@ -187,11 +205,24 @@ public class HighOrderController {
@RequestParam(name = "orderStatus", required = false) Integer orderStatus, @RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE, @RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum, HttpServletRequest request) {
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商
if(userInfoModel.getSecUser().getObjectType() == 0) {
map.put("companyId", companyId); map.put("companyId", companyId);
map.put("merchantId", merchantId);
} else if (userInfoModel.getSecUser().getObjectType() == 1) {
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("merchantId", merchantId);
} else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId());
}
map.put("orderNo", orderNo); map.put("orderNo", orderNo);
map.put("paySerialNo", paySerialNo); map.put("paySerialNo", paySerialNo);
map.put("payModel", payModel); map.put("payModel", payModel);

@ -7,6 +7,9 @@ import java.util.Date;
public class ExportHighOrderModel { public class ExportHighOrderModel {
@ExcelProperty("商户名称")
private String merchantName;
@ExcelProperty("商品类型") @ExcelProperty("商品类型")
private String goodsType; private String goodsType;
@ -64,6 +67,14 @@ public class ExportHighOrderModel {
@ExcelProperty("取消时间") @ExcelProperty("取消时间")
private Date cancelTime; private Date cancelTime;
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public String getGoodsType() { public String getGoodsType() {
return goodsType; return goodsType;
} }

@ -99,6 +99,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/discount/getDiscountByDiscountAgentId") .excludePathPatterns("/discount/getDiscountByDiscountAgentId")
.excludePathPatterns("/highMerchantStore/getMerchantStoreById") .excludePathPatterns("/highMerchantStore/getMerchantStoreById")
.excludePathPatterns("/highMerchantStore/getStoreListByCoupon") .excludePathPatterns("/highMerchantStore/getStoreListByCoupon")
.excludePathPatterns("/highMerchantStore/getStoreList")
.excludePathPatterns("/highMerchantStore/getMerchantList") .excludePathPatterns("/highMerchantStore/getMerchantList")
.excludePathPatterns("/highMerchantStore/getStoreListByMerchant") .excludePathPatterns("/highMerchantStore/getStoreListByMerchant")
.excludePathPatterns("/wechat/*") .excludePathPatterns("/wechat/*")

@ -1,5 +1,6 @@
package com.cweb.controller; package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
@ -153,5 +154,29 @@ public class HighMerchantStoreController {
} }
} }
@RequestMapping(value="/getStoreList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询门店列表")
public ResponseData getStoreList(@RequestParam(name = "storeName", required = false) String storeName,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String,Object> map = new HashMap<>();
map.put("storeName", storeName);
PageHelper.startPage(pageNum,pageSize);
PageInfo<HighMerchantStore> pageInfo = new PageInfo<>(highMerchantStoreService.getMerchantStoreList(map));
for (HighMerchantStore store : pageInfo.getList()) {
store.setHighMerchant(highMerchantService.getDetailById(store.getMerchantId()));
}
return ResponseMsgUtil.success(pageInfo);
} catch (Exception e) {
log.error("HighMerchantStoreController -> getStoreList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -94,21 +94,22 @@ public interface HighOrderMapperExt {
@Select({"<script>" + @Select({"<script>" +
" SELECT" + " SELECT" +
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' end goodsType, " + " case a.goods_type when 1 then '卡券' when 2 then '金币充值' end goodsType, " +
" a.goods_name goodsName, " + " a.goods_name goodsName, " +
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType, " + " case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType," +
" b.order_no orderNo," + " b.order_no orderNo," +
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " +
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType, " + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" b.total_price totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
" b.deduction_price deductionPrice," + " b.deduction_price deductionPrice," +
" case when b.pay_gold is null then 0 else pay_gold end payGold," + " case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold," +
" b.pay_price payPrice," + " case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice," +
" b.pay_real_price payRealPrice, " + " case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice," +
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' end orderStatus, " + " case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' end orderStatus, " +
" b.create_time createTime," + " b.create_time createTime," +
" b.pay_time payTime," + " b.pay_time payTime," +
@ -120,14 +121,16 @@ public interface HighOrderMapperExt {
" a.order_id = b.id" + " a.order_id = b.id" +
" and a.goods_type = 1" + " and a.goods_type = 1" +
" and a.giveaway_type = 0" + " and a.giveaway_type = 0" +
"<if test='map.companyId != null'> and EXISTS (select 1 from high_coupon c where c.company_id = #{map.companyId} and c.id = a.goods_id)</if>", " and EXISTS (select 1 from high_coupon c where c.id = a.goods_id " +
"<if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>", " <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
"<if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>", " <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +
"<if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>", " <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
"<if test='map.payType != null'> and b.pay_type = #{map.payType} </if>", " <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
"<if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>", " <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>", " <if test='map.payType != null'> and b.pay_type = #{map.payType} </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>", " <if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>",
" <if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>",
" <if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>",
" GROUP BY a.id" + " GROUP BY a.id" +
" ORDER BY b.create_time desc" + " ORDER BY b.create_time desc" +
"</script>"}) "</script>"})

@ -106,6 +106,20 @@ public class HighMerchantStore implements Serializable {
private Double distance; private Double distance;
private HighMerchant highMerchant;
public HighMerchant getHighMerchant() {
return highMerchant;
}
public void setHighMerchant(HighMerchant highMerchant) {
this.highMerchant = highMerchant;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Double getDistance() { public Double getDistance() {

@ -1,5 +1,6 @@
package com.hai.model; package com.hai.model;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighMerchantStore; import com.hai.entity.HighMerchantStore;
import com.hai.entity.SecUser; import com.hai.entity.SecUser;
@ -13,6 +14,9 @@ public class HighMerchantStoreModel extends HighMerchantStore {
// 账号 // 账号
private SecUser secUser; private SecUser secUser;
// 商户
private HighMerchant highMerchant;
public SecUser getSecUser() { public SecUser getSecUser() {
return secUser; return secUser;
} }
@ -20,4 +24,12 @@ public class HighMerchantStoreModel extends HighMerchantStore {
public void setSecUser(SecUser secUser) { public void setSecUser(SecUser secUser) {
this.secUser = secUser; this.secUser = secUser;
} }
public HighMerchant getHighMerchant() {
return highMerchant;
}
public void setHighMerchant(HighMerchant highMerchant) {
this.highMerchant = highMerchant;
}
} }

@ -5,6 +5,7 @@ import java.util.Date;
public class HighOrderModel { public class HighOrderModel {
private String merchantName;
private String goodsType; private String goodsType;
private String goodsName; private String goodsName;
private String giveawayType; private String giveawayType;
@ -25,6 +26,14 @@ public class HighOrderModel {
private Date payTime; private Date payTime;
private Date cancelTime; private Date cancelTime;
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public String getGoodsType() { public String getGoodsType() {
return goodsType; return goodsType;
} }

@ -39,6 +39,13 @@ public interface HighMerchantService {
*/ */
HighMerchantModel getMerchantById(Long id); HighMerchantModel getMerchantById(Long id);
/**
* 根据id 查询
* @param id
* @return
*/
HighMerchant getDetailById(Long id);
/** /**
* 查询列表 * 查询列表
* @param map * @param map

@ -94,6 +94,11 @@ public class HighMerchantServiceImpl implements HighMerchantService {
return merchantModel; return merchantModel;
} }
@Override
public HighMerchant getDetailById(Long id) {
return highMerchantMapper.selectByPrimaryKey(id);
}
@Override @Override
public List<HighMerchant> getMerchantList(Map<String, Object> map) { public List<HighMerchant> getMerchantList(Map<String, Object> map) {
HighMerchantExample example = new HighMerchantExample(); HighMerchantExample example = new HighMerchantExample();

Loading…
Cancel
Save