|
@@ -24,6 +24,8 @@ import com.gree.mall.miniapp.logic.common.CommonLogic;
|
|
|
import com.gree.mall.miniapp.logic.common.outside.WorkOrderApiLogic;
|
|
|
import com.gree.mall.miniapp.plus.entity.*;
|
|
|
import com.gree.mall.miniapp.plus.service.*;
|
|
|
+import com.gree.mall.miniapp.utils.ApplicationContextUtils;
|
|
|
+import com.gree.mall.miniapp.utils.CommonUtils;
|
|
|
import com.gree.mall.miniapp.utils.DateUtils;
|
|
|
import com.gree.mall.miniapp.utils.StringUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -31,6 +33,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Function;
|
|
@@ -60,6 +63,13 @@ public class OrderBaseLogic {
|
|
|
* @return
|
|
|
*/
|
|
|
public CountOrderStatusBean countOrderStatus(String pgIncreOrderId, Boolean isYb, Boolean isWb) {
|
|
|
+ HttpServletRequest request = ApplicationContextUtils.getHttpServletRequest();
|
|
|
+ String userId = CommonUtils.getUserId(request);
|
|
|
+
|
|
|
+ if (StringUtil.isEmpty(userId)){
|
|
|
+ throw new RemoteServiceException("身份已过期,请从右上角点击重新进入小程序");
|
|
|
+ }
|
|
|
+
|
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
CountOrderStatusBean countOrderStatusBean = orderBaseCMapper.countOrderStatus(currentCompanyWechat.getUserId(),
|
|
|
currentCompanyWechat.getUser().getWorkerNumber(), pgIncreOrderId, isYb, isWb, currentCompanyWechat.getCompanyWechatId());
|
|
@@ -197,7 +207,8 @@ public class OrderBaseLogic {
|
|
|
return new Page<>(pageNum,pageSize);
|
|
|
}
|
|
|
|
|
|
- List<String> websitIds = websitUserService.lambdaQuery().eq(WebsitUser::getUserId, currentCompanyWechat.getUserId()).select(WebsitUser::getWebsitId).list().stream().map(WebsitUser::getWebsitId).collect(Collectors.toList());
|
|
|
+ List<String> websitIds = websitUserService.lambdaQuery().eq(WebsitUser::getUserId, currentCompanyWechat.getUserId()).
|
|
|
+ select(WebsitUser::getWebsitId).list().stream().map(WebsitUser::getWebsitId).collect(Collectors.toList());
|
|
|
List<String> orderBaseIds = pgOrderWorkerService.lambdaQuery()
|
|
|
.and(item -> item.eq(PgOrderWorker::getWorkerNumber, currentCompanyWechat.getUser().getWorkerNumber()).or()
|
|
|
.eq(PgOrderWorker::getWorkerId,currentCompanyWechat.getUserId()))
|
|
@@ -288,7 +299,7 @@ public class OrderBaseLogic {
|
|
|
.in(CollectionUtils.isNotEmpty(websitIds),PgOrderBase::getWebsitId,websitIds)
|
|
|
.eq(StringUtils.isNotBlank(pgIncreOrderId),PgOrderBase::getPgIncreOrderId,pgIncreOrderId)
|
|
|
.and(v -> v.eq(PgOrderBase::getOrderStatus,OrderBaseStatusEnum.DQD.getKey())
|
|
|
- .or().in(CollectionUtils.isNotEmpty(orderBaseIds),PgOrderBase::getId,orderBaseIds))
|
|
|
+ .or(CollectionUtils.isNotEmpty(orderBaseIds)).in(CollectionUtils.isNotEmpty(orderBaseIds),PgOrderBase::getId,orderBaseIds))
|
|
|
.and(StringUtils.isNotBlank(keyword),
|
|
|
v -> v.like(PgOrderBase::getId,keyword).or()
|
|
|
.like(PgOrderBase::getUserName,keyword).or()
|