diff --git a/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java b/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
index 3fa39e40..a38e443b 100644
--- a/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
+++ b/hiver-core/src/main/java/cc/hiver/core/common/constant/DealingsRecordConstant.java
@@ -8,13 +8,18 @@ package cc.hiver.core.common.constant;
*/
public interface DealingsRecordConstant {
/**
- * 类型( 0-上游供货商;1-下游客户)
+ * 类型类型0 用户 1 é…é€å‘˜ 2商家
*/
- Integer[] TYPE = {0, 1};
+ Integer[] TYPE = {0,1,2};
/**
- * 交易类型:0:å¼€å•ï¼›1:退货(应该是没用到)ï¼›2:回款,3:新增客户/ä¾›åº”å•†æ¬ æ¬¾ï¼Œ4:充值;5ï¼šè¿½åŠ æ¬ æ¬¾;6:撤销订å•;7:入库;8ï¼šåˆ é™¤äº¤æ˜“è®°å½•; 9:入库退货;10:撤销入库退货;99:æ’¤é”€æ¬ æ¬¾è®°å½•
+ *
*/
- Integer[] DEALINGS_TYPE = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,99};
+ String[] TYPE_REMARK = {"é…é€è®¢å•佣金","å”®åŽé€€æ¬¾","é…逿ޒå奖励","商家æçް","é…é€å‘˜æçް","å…å•奖励","商家结算","用户æçް"};
+
+ /**
+ *交易类型:0:å¢žåŠ 1 æçް 2消费 3å”®åŽ
+ */
+ Integer[] DEALINGS_TYPE = {0, 1, 2,3};
}
diff --git a/hiver-core/src/main/java/cc/hiver/core/dao/WorkerDao.java b/hiver-core/src/main/java/cc/hiver/core/dao/WorkerDao.java
index cb630622..4264f859 100644
--- a/hiver-core/src/main/java/cc/hiver/core/dao/WorkerDao.java
+++ b/hiver-core/src/main/java/cc/hiver/core/dao/WorkerDao.java
@@ -15,6 +15,10 @@ public interface WorkerDao extends HiverBaseDao
{
Worker findByUserId(String userId);
+ @Modifying
+ @Query("update Worker w set w.geolocation=?2 where w.workerId=?1")
+ void changeLocation(String workerId, String geolocation);
+
@Modifying
@Query("update Worker w set w.isOnLine=?2 where w.workerId=?1")
void changeOnLine(String id, Integer onLine);
diff --git a/hiver-core/src/main/java/cc/hiver/core/entity/User.java b/hiver-core/src/main/java/cc/hiver/core/entity/User.java
index 3dc6c4f1..24d921f1 100644
--- a/hiver-core/src/main/java/cc/hiver/core/entity/User.java
+++ b/hiver-core/src/main/java/cc/hiver/core/entity/User.java
@@ -22,6 +22,7 @@ import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -140,4 +141,7 @@ public class User extends HiverBaseEntity {
@ApiModelProperty(value = "邀请人Id")
private String inviterId;
+
+ @ApiModelProperty("当å‰è´¦æˆ·ä½™é¢")
+ private BigDecimal depoBal = new BigDecimal(0);
}
diff --git a/hiver-core/src/main/java/cc/hiver/core/entity/Worker.java b/hiver-core/src/main/java/cc/hiver/core/entity/Worker.java
index f5593495..fd978bdc 100644
--- a/hiver-core/src/main/java/cc/hiver/core/entity/Worker.java
+++ b/hiver-core/src/main/java/cc/hiver/core/entity/Worker.java
@@ -60,6 +60,13 @@ public class Worker implements Serializable {
@Column(name = "depo_bal")
private BigDecimal depoBal = new BigDecimal(0);
+ /**
+ * 当å‰å¯æçް佣金余é¢
+ */
+ @ApiModelProperty("当å‰å¯æçް佣金余é¢")
+ @Column(name = "depo_bal_rel")
+ private BigDecimal depoBalRel = new BigDecimal(0);
+
/**
* 接å•çŠ¶æ€ 1-å¯æŠ¢å• 2-ä¸å¯æŽ¥å•() 3-å·²ç¦ç”¨(手工预置状æ€)
*/
diff --git a/hiver-core/src/main/java/cc/hiver/core/service/WorkerService.java b/hiver-core/src/main/java/cc/hiver/core/service/WorkerService.java
index 65f5881f..497cbf92 100644
--- a/hiver-core/src/main/java/cc/hiver/core/service/WorkerService.java
+++ b/hiver-core/src/main/java/cc/hiver/core/service/WorkerService.java
@@ -32,6 +32,8 @@ public interface WorkerService extends HiverBaseService {
Worker findByWorkerId(String workerId);
+ void changeLocation(String workerId, String geolocation);
+
List getWXByCondition(WorkerQueryVO worker);
/**
diff --git a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/WorkerServiceImpl.java b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/WorkerServiceImpl.java
index 7d310f94..be65f64c 100644
--- a/hiver-core/src/main/java/cc/hiver/core/serviceimpl/WorkerServiceImpl.java
+++ b/hiver-core/src/main/java/cc/hiver/core/serviceimpl/WorkerServiceImpl.java
@@ -162,6 +162,11 @@ public class WorkerServiceImpl implements WorkerService {
return workerDao.findByWorkerId(orderId);
}
+ @Override
+ public void changeLocation(String workerId, String geolocation) {
+ workerDao.changeLocation(workerId, geolocation);
+ }
+
@Override
public List getWXByCondition(WorkerQueryVO worker) {
final List workerList = workerDao.findAll(new Specification() {
diff --git a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
index 0839cf66..b3480f8b 100644
--- a/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
+++ b/hiver-modules/hiver-base/src/main/java/cc/hiver/base/controller/manage/UserController.java
@@ -695,7 +695,7 @@ public class UserController {
resultMap.put("shop", shop);
}
Worker worker = workerService.findByUserId(wechatUser.getId());
- if(worker!= null && worker.getGetPushOrder() == 1){
+ if(worker!= null && worker.getGetPushOrder() != null && worker.getGetPushOrder() == 1){
final List workerRelaPriceList = workerRelaPriceService.selectByWorkerId(worker.getWorkerId());
List workerRelaPriceListWaimai = new ArrayList<>();
List workerRelaPriceListKuaidi = new ArrayList<>();
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
index c6755601..00a07a7b 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/service/impl/BillServiceImpl.java
@@ -78,9 +78,9 @@ public class BillServiceImpl implements BillService {
}
final CustomerBillDataVo customerBillDataVo = new CustomerBillDataVo();
- customerBillDataVo.setUserId(customerBillQueryVo.getCustomerId());
+ customerBillDataVo.setUserId(customerBillQueryVo.getRegionId());
// 获å–客户信æ¯
- final Customer customer = customerService.getById(customerBillQueryVo.getCustomerId());
+ final Customer customer = customerService.getById(customerBillQueryVo.getRegionId());
customerBillDataVo.setUserName(customer.getName());
customerBillDataVo.setQueryDate(DateUtil.COMMON_FULL.getDateText(new Date()));
// èŽ·å–æœ¬æœŸå…¨éƒ¨æ¬ æ¬¾åŠæ‹¿è´§æ€»é‡‘é¢
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/vo/CustomerBillQueryVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/vo/CustomerBillQueryVo.java
index 0e189bef..ffccd6ed 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/vo/CustomerBillQueryVo.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/bill/vo/CustomerBillQueryVo.java
@@ -12,15 +12,24 @@ import lombok.Data;
@Data
public class CustomerBillQueryVo extends HiverBasePageQuery {
- @ApiModelProperty(value = "客户id")
- private String customerId;
+ @ApiModelProperty(value = "店铺id")
+ private String regionId;
@ApiModelProperty(value = "店铺id")
private String shopId;
+ @ApiModelProperty(value = "店铺id")
+ private String customerId;
+
+ @ApiModelProperty(value = "å…³è”id")
+ private String linkUserId;
+
@ApiModelProperty(value = "开始时间")
private String startDate;
@ApiModelProperty(value = "ç»“æŸæ—¶é—´")
private String endDate;
+
+ @ApiModelProperty(value = "ç»“æŸæ—¶é—´")
+ private String dealingsWay;
}
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
index b83628f1..e8b5b107 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
@@ -2,14 +2,22 @@ package cc.hiver.mall.controller;
import cc.hiver.core.common.utils.ResultUtil;
import cc.hiver.core.common.vo.Result;
+import cc.hiver.mall.bill.vo.CustomerBillQueryVo;
+import cc.hiver.mall.entity.DealingsRecord;
import cc.hiver.mall.entity.MallCoupon;
import cc.hiver.mall.entity.MallUserCoupon;
import cc.hiver.mall.mq.CouponMqConfig;
import cc.hiver.mall.pojo.query.MallCouponQuery;
+import cc.hiver.mall.pojo.vo.MallOrderFreeVO;
+import cc.hiver.mall.pojo.vo.WorkerRewardVO;
+import cc.hiver.mall.service.mybatis.DealingsRecordService;
import cc.hiver.mall.service.mybatis.MallCouponService;
import cc.hiver.mall.service.mybatis.MallUserCouponService;
+import cc.hiver.mall.utils.FreeOrderCacheUtil;
+import cc.hiver.mall.utils.WorkerRewardCacheUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
@@ -36,6 +44,15 @@ public class MallCouponController {
@Autowired
private RabbitTemplate rabbitTemplate;
+ @Autowired
+ private WorkerRewardCacheUtil workerRewardCacheUtil;
+
+ @Autowired
+ private DealingsRecordService dealingsRecordService;
+
+ @Autowired
+ private FreeOrderCacheUtil freeOrderCacheUtil;
+
@Data
public static class SendCouponReq {
private String userPhones;
@@ -101,4 +118,60 @@ public class MallCouponController {
public Result> list(MallCouponQuery query) {
return new ResultUtil>().setData(mallUserCouponService.selectPageVO(query));
}
+ @PostMapping("/addFreeOrder")
+ @ApiOperation(value = "å¼€å¯å…å•ä¼˜æƒ ")
+ public Result