|
|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.annotation.Log;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
+import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.BusinessType;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
@@ -378,15 +379,22 @@ public class DistributeController {
|
|
|
* 商务人员提成详情
|
|
|
*/
|
|
|
@GetMapping("/get/takeMoney/detail")
|
|
|
- public Result<SearchResult<BusinessTakeMoneyDetail>> getTakeMoneyDetail(String monthDate) {
|
|
|
+ public Result<SearchResult<BusinessTakeMoneyDetail>> getTakeMoneyDetail(String firstMonthDate, String secondMonthDate) {
|
|
|
long adminId = StpUtil.getLoginIdAsLong();
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
//是否是商务人员
|
|
|
if (userBusinessRateService.isBusiness(adminId)) {
|
|
|
builder.field(BusinessTakeMoneyDetail::getBusinessId, adminId);
|
|
|
}
|
|
|
- if (StrUtil.isNotBlank(monthDate)) {
|
|
|
- builder.put("time", String.format("date_format(ubr.order_created_time,'%%Y-%%m') = '%s'", monthDate));
|
|
|
+ String timeSql = StringUtil.EMPTY;
|
|
|
+ if (StrUtil.isNotBlank(firstMonthDate)) {
|
|
|
+ timeSql += String.format("date_format(ubr.order_created_time,'%%Y-%%m') >= '%s'", firstMonthDate);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(secondMonthDate)) {
|
|
|
+ timeSql += String.format("and date_format(ubr.order_created_time,'%%Y-%%m') <= '%s'", secondMonthDate);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(timeSql)) {
|
|
|
+ builder.put("time", timeSql);
|
|
|
}
|
|
|
SearchResult<BusinessTakeMoneyDetail> search = beanSearcher.search(BusinessTakeMoneyDetail.class, builder.build());
|
|
|
search.getDataList().forEach(data -> {
|
|
|
@@ -401,6 +409,31 @@ public class DistributeController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 商务提成head
|
|
|
+ */
|
|
|
+ @GetMapping("/get/business/headData")
|
|
|
+ public Result<BusinessTakeMoneyHeadView> getTakeMoneyHeadDetail(String firstMonthDate, String secondMonthDate) {
|
|
|
+ long adminId = StpUtil.getLoginIdAsLong();
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
+ //是否是商务人员
|
|
|
+ if (userBusinessRateService.isBusiness(adminId)) {
|
|
|
+ builder.field(BusinessTakeMoneyHeadView::getBusinessId, adminId);
|
|
|
+ }
|
|
|
+ String timeSql = StringUtil.EMPTY;
|
|
|
+ if (StrUtil.isNotBlank(firstMonthDate)) {
|
|
|
+ timeSql += String.format("date_format(ubr.order_created_time,'%%Y-%%m') >= '%s'", firstMonthDate);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(secondMonthDate)) {
|
|
|
+ timeSql += String.format("and date_format(ubr.order_created_time,'%%Y-%%m') <= '%s'", secondMonthDate);
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(timeSql)) {
|
|
|
+ builder.put("time", timeSql);
|
|
|
+ }
|
|
|
+ BusinessTakeMoneyHeadView headView = beanSearcher.searchFirst(BusinessTakeMoneyHeadView.class, builder.build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(headView);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查看商务人员提成比例
|
|
|
*/
|