|
|
@@ -10,6 +10,7 @@ import com.cyksj.mapper.OrderDonMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserMapper;
|
|
|
import com.cyksj.mapper.manage.coupon.CouponMapper;
|
|
|
import com.cyksj.model.entity.CorpFollowActiveCode;
|
|
|
+import com.cyksj.model.entity.CorpFollowActiveCodeClickRecord;
|
|
|
import com.cyksj.model.entity.CorpFollowServiceRelate;
|
|
|
import com.cyksj.model.entity.CorpUser;
|
|
|
import com.cyksj.model.request.corp.Attachments;
|
|
|
@@ -21,6 +22,7 @@ import com.cyksj.service.corp.CorpFollowDynamicConfigService;
|
|
|
import com.cyksj.service.corp.CorpFollowService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -28,7 +30,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
/** admin/企业微信/客服活码
|
|
|
@@ -177,4 +181,29 @@ public class CmsCorpFollowActiveCodeController {
|
|
|
SearchResult<CorpActiveCodeGoodsOrderView> search = beanSearcher.search(CorpActiveCodeGoodsOrderView.class, mapBuilder.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 活码订单详情头部信息
|
|
|
+ */
|
|
|
+ @GetMapping("/get/active/code/order/headData")
|
|
|
+ public Result<CorpFollowActiveCodeView> getActiveCodeOrderHeadDataView(Long id, String startTime, String endTime) {
|
|
|
+ CorpFollowActiveCodeView view = new CorpFollowActiveCodeView();
|
|
|
+ view.setId(id);
|
|
|
+ MapBuilder builder = MapUtils.builder();
|
|
|
+ if (startTime != null && endTime != null) {
|
|
|
+ builder.field(CorpFollowActiveCodeClickRecord::getCreatedTime, startTime, endTime).op(Operator.Between);
|
|
|
+ }
|
|
|
+ Number clickNumber = beanSearcher.searchCount(CorpFollowActiveCodeClickRecord.class, builder.build());
|
|
|
+ Map<String, Object> map = orderDonMapper.selectActiveCodeOrderDetail(view.getId(), startTime, endTime);
|
|
|
+ Object orderNum = map.get("orderNum");
|
|
|
+ Object orderMoney = map.get("orderMoney");
|
|
|
+ view.setClickNum(clickNumber.intValue());
|
|
|
+ if (orderNum != null) {
|
|
|
+ view.setOrderNum(Integer.parseInt(orderNum.toString()));
|
|
|
+ }
|
|
|
+ if (orderMoney != null) {
|
|
|
+ view.setOrderMoney(BigDecimal.valueOf(Long.valueOf(orderMoney.toString())));
|
|
|
+ }
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(view);
|
|
|
+ }
|
|
|
}
|