Browse Source

对接拼团数据1

master
wangfukang 7 days ago
parent
commit
59f4aa0fce
  1. 1
      hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java
  2. 7
      hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java
  3. 20
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallDeliveryOrderController.java
  4. 24
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java
  5. 2
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/MallDeliveryOrderMapper.java
  6. 7
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/MallOrder.java
  7. 8
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/MallRefundRecord.java
  8. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java
  9. 2
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/MallOrderVO.java
  10. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/ShopService.java
  11. 7
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/MallDeliveryOrderService.java
  12. 14
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java
  13. 28
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallDeliveryOrderServiceImpl.java
  14. 32
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallOrderServiceImpl.java
  15. 36
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallRefundRecordServiceImpl.java
  16. 16
      hiver-modules/hiver-mall/src/main/resources/mapper/MallDeliveryOrderMapper.xml
  17. 1
      hiver-modules/hiver-mall/src/main/resources/mapper/MallRefundRecordMapper.xml
  18. 22
      hiver-modules/hiver-mall/src/main/resources/mapper/ShopMapper.xml

1
hiver-core/src/main/java/cc/hiver/core/serviceimpl/JPushServiceImpl.java

@ -35,7 +35,6 @@ public class JPushServiceImpl implements JPushService {
.addExtra("timestamp", System.currentTimeMillis())
.build())
.build();
try {
// 这里获取的是最后一次登录的设备id,如果没有登录过,那么就不发送订单
if(registrationId != null && !registrationId.isEmpty()){

7
hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/AuthController.java

@ -127,8 +127,8 @@ public class AuthController {
@RequestMapping(value = "/login", method = RequestMethod.POST)
@SystemLog(description = "账号登录", type = LogType.LOGIN)
@ApiOperation("账号/手机/邮箱登录")
@Transactional(readOnly = true)
public Result login(@RequestParam String username,
@Transactional
public Result login(@RequestParam String username,@RequestParam String clientId,
@RequestParam String password,
@RequestParam(required = false) String type,
@RequestParam(required = false) Boolean saveLogin) {
@ -181,6 +181,9 @@ public class AuthController {
for (ShopUser shopUser : shopUsers) {
final Shop shop = shopService.findById(shopUser.getShop().getId());
if (shop != null && shop.getShopOwnerId() != null && StringUtils.isNotEmpty(shop.getShopOwnerId())) {
shop.setClientId(clientId);
shopService.update(shop);
shopService.refreshShopCache(shop.getId(), shop.getRegionId());
final User shopOwner = userService.findById(shop.getShopOwnerId());
if(shopOwner != null){
shopUser.setShopOwnerName(shopOwner.getNickname());

20
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallDeliveryOrderController.java

@ -7,6 +7,7 @@ import cc.hiver.core.common.vo.Result;
import cc.hiver.core.entity.User;
import cc.hiver.core.entity.Worker;
import cc.hiver.core.service.WorkerService;
import cc.hiver.core.serviceimpl.JPushServiceImpl;
import cc.hiver.mall.entity.MallDeliveryOrder;
import cc.hiver.mall.pojo.query.MallDeliveryOrderPageQuery;
import cc.hiver.mall.service.mybatis.MallDeliveryOrderService;
@ -37,6 +38,9 @@ public class MallDeliveryOrderController {
@Autowired
private SecurityUtil securityUtil;
@Autowired
JPushServiceImpl jPushService;
@Autowired
private WorkerService workerService;
/**
@ -190,6 +194,7 @@ public class MallDeliveryOrderController {
@RequestParam String workerId) {
try {
mallDeliveryOrderService.workerPickup(deliveryId, workerId);
//jPushService.sendPushNotification("1507bfd3f6e2c0dbc0a", "您有一笔新的订单");
return ResultUtil.success("取货成功");
} catch (Exception e) {
log.error("取货失败: {}", e.getMessage(), e);
@ -213,6 +218,21 @@ public class MallDeliveryOrderController {
}
}
/**
* 取消配送单
*/
@PostMapping("/reject")
@ApiOperation("配送员拒绝接指派单")
public Result reject(@RequestParam String deliveryId) {
try {
mallDeliveryOrderService.rejectDelivery(deliveryId);
return ResultUtil.success("已拒绝");
} catch (Exception e) {
log.error("取消配送失败: {}", e.getMessage(), e);
return ResultUtil.error(e.getMessage());
}
}
/**
* 取消配送单
*/

24
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java

@ -460,12 +460,32 @@ public class ShopController {
*/
@RequestMapping(value = "/getShopInfoById", method = RequestMethod.POST)
@ApiOperation("根据店铺id获取店铺信息")
public Result getShopInfoById(String id) {
public Result getShopInfoById(String id,String regionId) {
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("店铺id不能为空");
}
String redisKey = "SHOP_CACHE:" + regionId;
String jsonStr = (String) redisTemplateHelper.hGet(redisKey, id);
if (jsonStr != null) {
// 4. 将 JSON 字符串反序列化为你的 DTO 对象
// 假设你的工具类是 JSONUtil,且目标类是 ShopCacheDTO.class
ShopCacheDTO result = JSONUtil.toBean(jsonStr, ShopCacheDTO.class);
String productsRedisKey = "SHOP_PRODUCTS:" + id;
String productsJson = redisTemplateHelper.get(productsRedisKey);
List<ProductPageVO> products = JSONUtil.toList(productsJson, ProductPageVO.class);
result.setProducts(products);
return ResultUtil.data(result);
} else {
final Shop shop = shopService.findById(id);
return ResultUtil.data(shop);
ShopCacheDTO result = new ShopCacheDTO();
String productsRedisKey = "SHOP_PRODUCTS:" + id;
String productsJson = redisTemplateHelper.get(productsRedisKey);
List<ProductPageVO> products = JSONUtil.toList(productsJson, ProductPageVO.class);
result.setProducts(products);
result.setShop(shop);
return ResultUtil.data(result);
}
}
/**

2
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/MallDeliveryOrderMapper.java

@ -35,4 +35,6 @@ public interface MallDeliveryOrderMapper extends BaseMapper<MallDeliveryOrder> {
List<Map<String, Object>> countOrdersByStatus(@Param("workerId") String workerId);
MallDeliveryOrder selectByGroupId(@Param("orderId") String orderId);
}

7
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/MallOrder.java

@ -1,6 +1,7 @@
package cc.hiver.mall.entity;
import cc.hiver.core.common.utils.SnowFlakeUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@ -10,6 +11,7 @@ import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -75,4 +77,9 @@ public class MallOrder implements Serializable {
private Date shopMakeTime;
@ApiModelProperty(value = "学校id")
private String regionId;
@ApiModelProperty(value = "面对面配送 退款 参团用户订单id集合")
@Transient
@TableField(exist = false)
private String groupOrderIds;
}

8
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/MallRefundRecord.java

@ -48,6 +48,9 @@ public class MallRefundRecord implements Serializable {
private Date createTime;
@ApiModelProperty(value = "退款成功时间")
private Date successTime;
@ApiModelProperty(value = "面对面配送 退款 参团用户订单id集合")
private String groupOrderIds;
@ApiModelProperty("售后商品列表")
@Transient
@TableField(exist = false)
@ -63,6 +66,11 @@ public class MallRefundRecord implements Serializable {
@TableField(exist = false)
private Integer deliveryType;
@ApiModelProperty("订单类型")
@Transient
@TableField(exist = false)
private Integer orderType;
@ApiModelProperty("店铺id")
@Transient
@TableField(exist = false)

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Shop.java

@ -80,6 +80,9 @@ public class Shop extends HiverBaseEntity {
@ApiModelProperty(value = "充值时间")
private String chargeTime;
@ApiModelProperty(value = "推送机器id")
private String clientId;
@ApiModelProperty(value = "起始日")
private String startTime;

2
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/MallOrderVO.java

@ -29,5 +29,5 @@ public class MallOrderVO extends MallOrder {
private String addressDetail;
@ApiModelProperty("售后信息")
private MallRefundRecord mallRefundRecord;
private List<MallRefundRecord> mallRefundRecord;
}

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/ShopService.java

@ -17,6 +17,7 @@ package cc.hiver.mall.service;
import cc.hiver.core.base.HiverBaseService;
import cc.hiver.mall.entity.Shop;
import cc.hiver.mall.pojo.dto.ShopCacheDTO;
import cc.hiver.mall.pojo.dto.ShopRevenue;
import cc.hiver.mall.pojo.query.ProductPageQuery;
import cc.hiver.mall.pojo.vo.ProductPageVO;
@ -49,6 +50,8 @@ public interface ShopService extends HiverBaseService<Shop, String> {
*/
Shop findByShopName(String shopName);
ShopCacheDTO findShop(String shopId,String regionId);
/**
* 更新圈层名称
*

7
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/MallDeliveryOrderService.java

@ -48,6 +48,11 @@ public interface MallDeliveryOrderService extends IService<MallDeliveryOrder> {
*/
void cancelDelivery(String deliveryId);
/**
* 拒绝配送单
*/
void rejectDelivery(String deliveryId);
/**
* 统计抢单大厅未被接单的数量
* @param deliveryType 1:外卖 2:快递
@ -57,4 +62,6 @@ public interface MallDeliveryOrderService extends IService<MallDeliveryOrder> {
List<Map<Integer, Integer>> countOrdersByType(String regionId);
List<Map<String, Object>> countOrdersByStatus(String workerId);
MallDeliveryOrder selectByGroupId(String orderId);
}

14
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/ShopServiceImpl.java

@ -162,6 +162,20 @@ public class ShopServiceImpl implements ShopService {
return shopDao.findByShopName(ShopName);
}
@Override
public ShopCacheDTO findShop(String shopId,String regionId) {
String redisKey = "SHOP_CACHE:" + regionId;
String jsonStr = (String) redisTemplateHelper.hGet(redisKey, shopId);
if(jsonStr != null){
return JSONUtil.toBean(jsonStr, ShopCacheDTO.class);
}else{
ShopCacheDTO result = new ShopCacheDTO();
final Shop shop = this.findById(shopId);
result.setShop(shop);
return result;
}
}
@Override
public void updateShopAreaTitle(String shopArea, String shopAreaTitle) {
shopDao.updateShopAreaTitle(shopArea, shopAreaTitle);

28
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallDeliveryOrderServiceImpl.java

@ -184,7 +184,19 @@ public class MallDeliveryOrderServiceImpl extends ServiceImpl<MallDeliveryOrderM
.set(MallDeliveryOrder::getStatus, STATUS_DELIVERING)
.set(MallDeliveryOrder::getGetTime, new Date());
this.update(uw);
//如果groupID有值 ,需要更新所有子订单状态
if(delivery.getGroupId() != null){
LambdaQueryWrapper<MallOrderGroup> gq = new LambdaQueryWrapper<>();
gq.eq(MallOrderGroup::getId, delivery.getGroupId());
MallOrderGroup group = mallOrderGroupMapper.selectOne(gq);
if(group.getIsFace() == 1){
List<String> orderIds = Arrays.asList(group.getGroupOrderIds().split(","));
//批量更新
LambdaUpdateWrapper<MallOrder> oUw = new LambdaUpdateWrapper<>();
oUw.in(MallOrder::getId, orderIds).set(MallOrder::getStatus, ORDER_STATUS_DELIVERING);
mallOrderService.update(oUw);
}
}else{
// 同步订单状态 -> 配送中
if (StringUtils.isNotBlank(delivery.getOrderId())) {
LambdaUpdateWrapper<MallOrder> oUw = new LambdaUpdateWrapper<>();
@ -193,6 +205,7 @@ public class MallDeliveryOrderServiceImpl extends ServiceImpl<MallDeliveryOrderM
mallOrderService.update(oUw);
}
}
}
@Override
public void arriveShop(String deliveryId, String workerId) {
@ -249,6 +262,14 @@ public class MallDeliveryOrderServiceImpl extends ServiceImpl<MallDeliveryOrderM
this.update(uw);
}
@Override
public void rejectDelivery(String deliveryId) {
LambdaUpdateWrapper<MallDeliveryOrder> uw = new LambdaUpdateWrapper<>();
uw.eq(MallDeliveryOrder::getId, deliveryId)
.set(MallDeliveryOrder::getWorkerId, null);
this.update(uw);
}
// ================================================================
// 私有工具
// ================================================================
@ -374,4 +395,9 @@ public class MallDeliveryOrderServiceImpl extends ServiceImpl<MallDeliveryOrderM
}
return returnList;
}
@Override
public MallDeliveryOrder selectByGroupId(String orderId) {
return this.baseMapper.selectByGroupId(orderId);
}
}

32
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallOrderServiceImpl.java

@ -61,7 +61,7 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
// 订单类型常量
private static final int ORDER_TYPE_NORMAL = 1; // 直接购买
private static final int ORDER_TYPE_GROUP = 2; // 拼团购买
private static final int ORDER_TYPE_FACETOFACE = 3; // 拼团购买
private static final int ORDER_TYPE_FACETOFACE = 3; // 面对面购买
// 拼团状态常量
private static final int GROUP_STATUS_FORMING = 0; // 拼团中
@ -734,8 +734,8 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
for (String oid : allOrderIds) {
MallOrder subOrder = getById(oid);
if (subOrder != null && subOrder.getStatus() != STATUS_CANCELLED
&& subOrder.getStatus() != STATUS_REFUNDED
&& subOrder.getStatus() != STATUS_WAIT_REFUND) {
&& subOrder.getStatus() != STATUS_REFUNDED) {
subOrder.setGroupOrderIds(group.getGroupOrderIds());
applyMerchantRefund(delivery.getWorkerId(),subOrder, "面对面团团长申请取消,待商家同意",refundType,refundTypeStatus);
}
}
@ -898,10 +898,13 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
vo.setGoodsList(mallOrderGoodsMapper.selectByOrderId(orderId));
// 配送信息
if(order.getOrderType() == ORDER_TYPE_FACETOFACE){
vo.setDeliveryInfo(mallDeliveryOrderMapper.selectByGroupId(orderId));
}else{
LambdaQueryWrapper<MallDeliveryOrder> dq = new LambdaQueryWrapper<>();
dq.eq(MallDeliveryOrder::getOrderId, orderId).last("LIMIT 1");
vo.setDeliveryInfo(mallDeliveryOrderMapper.selectOne(dq));
}
// 拼团信息(拼团订单才查)
if (ORDER_TYPE_GROUP == order.getOrderType() || GROUP_STATUS_FACE2FACE == order.getOrderType()) {
// 通过 headOrderId 或 groupUserIds 中包含此 userId 查找拼团
@ -913,22 +916,23 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
MallOrderGroup group = mallOrderGroupMapper.selectOne(gq2);
vo.setGroupInfo(group);
}
// 售后信息
if(order.getStatus() == STATUS_WAIT_RETURN || order.getStatus() == STATUS__RETURNED){
// 售后、退款信息
if(order.getStatus() == STATUS_REFUNDED || order.getStatus() == STATUS_DONE || order.getStatus() == STATUS_WAIT_REFUND || order.getStatus() == STATUS_WAIT_RETURN || order.getStatus() == STATUS__RETURNED){
LambdaQueryWrapper<MallRefundRecord> rq = new LambdaQueryWrapper<>();
rq.eq(MallRefundRecord::getOrderId, orderId)
.last("LIMIT 1");
MallRefundRecord sallRefundRecord = mallRefundRecordMapper.selectOne(rq);
rq.eq(MallRefundRecord::getOrderId, orderId);
List<MallRefundRecord> sallRefundRecord = mallRefundRecordMapper.selectList(rq);
if(sallRefundRecord != null){
if(sallRefundRecord.getRefundType() == 1){
sallRefundRecord.forEach(item -> {
if(item.getRefundType() == 1){
//售后商品详情
sallRefundRecord.setItems(mallReturnOrderGoodsMapper.selectList(new LambdaQueryWrapper<MallReturnOrderGoods>()
item.setItems(mallReturnOrderGoodsMapper.selectList(new LambdaQueryWrapper<MallReturnOrderGoods>()
.eq(MallReturnOrderGoods::getOrderId, orderId)));
}
}
});
vo.setMallRefundRecord(sallRefundRecord);
}
}
return vo;
}
@ -1034,7 +1038,6 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
delivery.setStatus(initialStatus);
delivery.setRemark(dto.getRemark());
delivery.setDeliveryType(1); // 外卖单
// 总配送费放入 delivery
delivery.setDeliveryFee(overrideDeliveryFee != null ? overrideDeliveryFee : order.getDeliveryFee());
delivery.setCreateTime(new Date());
@ -1156,6 +1159,9 @@ public class MallOrderServiceImpl extends ServiceImpl<MallOrderMapper, MallOrder
record.setUserId(order.getUserId());
record.setRefundAmount(amount);
record.setReason(reason);
if(order.getGroupOrderIds() != null){
record.setGroupOrderIds(order.getGroupOrderIds());
}
record.setStatus(0); // 待同意
record.setCreateTime(new Date());
record.setRefundType(refundType);

36
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/MallRefundRecordServiceImpl.java

@ -164,10 +164,21 @@ public class MallRefundRecordServiceImpl extends ServiceImpl<MallRefundRecordMap
if(mallRefundRecord.getDeliveryType() == DELIVERY_TYPE_SELF){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else{
MallDeliveryOrder delivery = findDeliveryByOrderId(mallRefundRecord.getOrderId());
if(delivery == null){
//去查团长的配送单
//面对面拼团
if(mallRefundRecord.getOrderType() == STATUS_WAIT_PICKUP){
MallDeliveryOrder delivery = mallDeliveryOrderMapper.selectByGroupId(mallRefundRecord.getOrderId());
if(delivery.getStatus() == STATUS_WAIT_SHOP){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else if(delivery.getStatus() == DELIVERY_TYPE_SELF){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_DELIVERING);
}
//更新配送单isReturn
LambdaUpdateWrapper<MallDeliveryOrder> duw = new LambdaUpdateWrapper<>();
duw.eq(MallDeliveryOrder::getOrderId, mallRefundRecord.getOrderId())
.set(MallDeliveryOrder::getIsReturn, 0);
mallDeliveryOrderMapper.update(null, duw);
}else{
MallDeliveryOrder delivery = findDeliveryByOrderId(mallRefundRecord.getOrderId());
if(delivery.getStatus() == STATUS_WAIT_SHOP){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else if(delivery.getStatus() == DELIVERY_TYPE_SELF){
@ -181,6 +192,7 @@ public class MallRefundRecordServiceImpl extends ServiceImpl<MallRefundRecordMap
}
}
}
}
}else{
//售后
if(mallRefundRecord.getStatus() == 4){
@ -203,10 +215,21 @@ public class MallRefundRecordServiceImpl extends ServiceImpl<MallRefundRecordMap
if(mallRefundRecord.getDeliveryType() == DELIVERY_TYPE_SELF){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else{
MallDeliveryOrder delivery = findDeliveryByOrderId(mallRefundRecord.getOrderId());
if(delivery == null){
//去查团长的配送单
//面对面拼团
if(mallRefundRecord.getOrderType() == STATUS_WAIT_PICKUP){
MallDeliveryOrder delivery = mallDeliveryOrderMapper.selectByGroupId(mallRefundRecord.getOrderId());
if(delivery.getStatus() == STATUS_WAIT_SHOP){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else if(delivery.getStatus() == DELIVERY_TYPE_SELF){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_DELIVERING);
}
//更新配送单isReturn
LambdaUpdateWrapper<MallDeliveryOrder> duw = new LambdaUpdateWrapper<>();
duw.eq(MallDeliveryOrder::getOrderId, mallRefundRecord.getOrderId())
.set(MallDeliveryOrder::getIsReturn, 0);
mallDeliveryOrderMapper.update(null, duw);
}else{
MallDeliveryOrder delivery = findDeliveryByOrderId(mallRefundRecord.getOrderId());
if(delivery.getStatus() == STATUS_WAIT_SHOP){
updateOrderStatusAndReturn(mallRefundRecord.getOrderId(), STATUS_WAIT_PICKUP);
}else if(delivery.getStatus() == DELIVERY_TYPE_SELF){
@ -218,6 +241,7 @@ public class MallRefundRecordServiceImpl extends ServiceImpl<MallRefundRecordMap
.set(MallDeliveryOrder::getIsReturn, 0);
mallDeliveryOrderMapper.update(null, duw);
}
}
}else{
//同意退款
//MallOrder order = mallOrderService.getById(mallRefundRecord.getOrderId());

16
hiver-modules/hiver-mall/src/main/resources/mapper/MallDeliveryOrderMapper.xml

@ -152,6 +152,22 @@
ORDER BY (CASE WHEN d.must_finish_time IS NULL THEN 1 ELSE 0 END) ASC
</select>
<select id="selectByGroupId" resultMap="deliveryMap">
SELECT
d.id, d.order_id, d.group_id, d.worker_id, d.shop_id,
d.get_area_id, d.put_area_id, d.delivery_fee, d.delivery_fee_marketplace,
d.status, d.create_time, d.accept_time, d.get_time, d.must_finish_time, d.finish_time,
d.receiver_name, d.receiver_phone, d.receiver_address,
d.shop_name, d.shop_phone, d.shop_address, d.delivery_type, d.number_code,
d.region_id,d.remark, d.all_count, d.phone_number, d.get_codes, d.get_pictures, d.is_big,d.is_return,d.worker_name,d.arrive_time
FROM mall_delivery_order d
where d.group_id = (select id from mall_order_group where 1 = 1
<if test='orderId != null and orderId.trim() neq ""'>
AND group_order_ids like concat('%',#{orderId},'%')
</if>
)
</select>
<!--
统计配送员当前活跃单量
返回:waitPickup(待取货数)、delivering(配送中数)

1
hiver-modules/hiver-mall/src/main/resources/mapper/MallRefundRecordMapper.xml

@ -16,6 +16,7 @@
<result column="refund_type" property="refundType"/>
<result column="refund_type_status" property="refundTypeStatus"/>
<result column="link_id" property="linkId"/>
<result column="group_order_ids" property="groupOrderIds"/>
</resultMap>
<select id="selectPageVO" resultMap="refundMap">

22
hiver-modules/hiver-mall/src/main/resources/mapper/ShopMapper.xml

@ -42,6 +42,7 @@
<result column="shoprank" property="shoprank" jdbcType="INTEGER" />
<result column="sale_count" property="saleCount" jdbcType="INTEGER" />
<result column="is_student" property="isStudent" jdbcType="INTEGER" />
<result column="client_id" property="clientId" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="cc.hiver.mall.entity.Shop" extends="BaseResultMap" >
<result column="remark" property="remark" jdbcType="LONGVARCHAR" />
@ -50,7 +51,7 @@
id, create_by, create_time, del_flag, update_by, update_time, shop_name, shop_owner_id, shop_manger_id, region,
region_id, shop_area, shop_area_title, shop_type, shop_type_title, shop_address, year_fee, charge_time, start_time,
end_time, status, remark, business_district_level, contact_phone, shop_icon, defaulted, ali_account, ali_name,
rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop_score,isbrandflag,subtitle,shoprank,sale_count,is_student
rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop_score,isbrandflag,subtitle,shoprank,sale_count,is_student,client_id
</sql>
<sql id="Blob_Column_List" >
remark
@ -71,11 +72,11 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
insert into t_shop (id, create_by, create_time, del_flag, update_by, update_time, shop_name, shop_owner_id, shop_manger_id, region,
region_id, shop_area, shop_area_title, shop_type, shop_type_title, shop_address, year_fee, charge_time, start_time,
end_time, status, remark, business_district_level, contact_phone, shop_icon, defaulted, ali_account, ali_name,
rebate_amount, attr_id, printing_method, shop_images, shop_lename, shop_lecard, shop_score, isbrandflag, subtitle,shoprank, sale_count,is_student)
rebate_amount, attr_id, printing_method, shop_images, shop_lename, shop_lecard, shop_score, isbrandflag, subtitle,shoprank, sale_count,is_student,client_id)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{shopName,jdbcType=VARCHAR}, #{shopOwnerId,jdbcType=VARCHAR}, #{shopMangerId,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR},
#{regionId,jdbcType=VARCHAR}, #{shopArea,jdbcType=VARCHAR}, #{shopAreaTitle,jdbcType=VARCHAR}, #{shopType,jdbcType=VARCHAR}, #{shopTypeTitle,jdbcType=VARCHAR}, #{shopAddress,jdbcType=VARCHAR}, #{yearFee,jdbcType=VARCHAR}, #{chargeTime,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR},
#{endTime,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{remark,jdbcType=LONGVARCHAR}, #{businessDistrictLevel,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, #{shopIcon,jdbcType=VARCHAR}, #{defaulted,jdbcType=INTEGER}, #{aliAccount,jdbcType=VARCHAR}, #{aliName,jdbcType=VARCHAR},
#{rebateAmount,jdbcType=VARCHAR}, #{attrId,jdbcType=VARCHAR}, #{printingMethod,jdbcType=VARCHAR}, #{shopImages,jdbcType=VARCHAR}, #{shopLename,jdbcType=VARCHAR}, #{shopLecard,jdbcType=VARCHAR}, #{shopScore,jdbcType=DECIMAL}, #{isbrandflag,jdbcType=INTEGER}, #{subtitle,jdbcType=VARCHAR}, #{shoprank,jdbcType=INTEGER}, #{saleCount,jdbcType=INTEGER}, #{isStudent,jdbcType=INTEGER})
#{rebateAmount,jdbcType=VARCHAR}, #{attrId,jdbcType=VARCHAR}, #{printingMethod,jdbcType=VARCHAR}, #{shopImages,jdbcType=VARCHAR}, #{shopLename,jdbcType=VARCHAR}, #{shopLecard,jdbcType=VARCHAR}, #{shopScore,jdbcType=DECIMAL}, #{isbrandflag,jdbcType=INTEGER}, #{subtitle,jdbcType=VARCHAR}, #{shoprank,jdbcType=INTEGER}, #{saleCount,jdbcType=INTEGER}, #{isStudent,jdbcType=INTEGER},#{clientId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Shop" >
insert into t_shop
@ -176,6 +177,9 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
<if test="isStudent != null" >
is_student
</if>
<if test="clientId != null" >
client_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
@ -274,6 +278,9 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
<if test="isStudent != null" >
#{isStudent,jdbcType=INTEGER},
</if>
<if test="clientId != null" >
#{clientId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.Shop" >
@ -372,6 +379,9 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
<if test="isStudent != null" >
is_student = #{isStudent,jdbcType=INTEGER},
</if>
<if test="clientId != null" >
client_id = #{clientId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@ -407,7 +417,8 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
subtitle = #{subtitle,jdbcType=VARCHAR},
shoprank = #{shoprank,jdbcType=INTEGER},
sale_count = #{saleCount,jdbcType=INTEGER},
is_student = #{isStudent,jdbcType=INTEGER}
is_student = #{isStudent,jdbcType=INTEGER},
client_id = #{clientId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.Shop" >
@ -450,7 +461,8 @@ rebate_amount, attr_id, printing_method,shop_images,shop_lename,shop_lecard,shop
subtitle = #{subtitle,jdbcType=VARCHAR},
shoprank = #{shoprank,jdbcType=INTEGER},
sale_count = #{saleCount,jdbcType=INTEGER},
is_student = #{isStudent,jdbcType=INTEGER}
is_student = #{isStudent,jdbcType=INTEGER},
client_id = #{clientId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="findByUserId" resultType="cc.hiver.mall.entity.Shop">

Loading…
Cancel
Save