Commit d9f1e3f3 authored by zhengyi's avatar zhengyi

Merge remote-tracking branch 'origin/release-fix' into release-fix

parents 559ef3df 810fe9c9
......@@ -11,4 +11,6 @@ public interface ScoreProducerApi {
void sendRecommendMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String referralCode);
void sendRegisterMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String userNameZh, String userNameEn, String phone, Integer registerPlatform);
void sendShareMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, Long ruleId, String ipAddr);
}
......@@ -128,7 +128,6 @@ public class ScoreRuleController {
@GetMapping("/test-score-rule")
@ApiOperation("测试订单V值触发")
public CommonResult<Void> testScoreRule(@RequestParam Long orderId, @RequestParam String orderNo) {
//applicationContext.publishEvent(new OrderInShippingEvent(orderId, orderNo));
scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId <= 0 ? null : orderId, orderNo);
return success(null);
}
......
package cn.iocoder.yudao.module.member.controller.admin.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO;
import cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord.ScoreRuleShareRecordService;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailReqVO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailVO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordPageVO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 分享记录")
@RequestMapping("/member/score-rule/share-record")
public class ScoreRuleShareRecordController {
@Resource
private ScoreRuleShareRecordService scoreRuleShareRecordService;
@PostMapping("/detail")
@ApiOperation("获得分享记录详情")
public CommonResult<PageResult<ScoreRuleShareRecordDetailVO>> getRuleShareRecordDetail(@Valid @RequestBody ScoreRuleShareRecordDetailReqVO reqVO) {
return success(scoreRuleShareRecordService.getRuleShareRecordDetail(reqVO));
}
@PostMapping("/page")
@ApiOperation("获得分享记录分页")
public CommonResult<PageResult<ScoreRuleShareRecordPageVO>> getRuleShareRecordPage(@Valid @RequestBody ScoreRuleShareRecordQueryVO query) {
return success(scoreRuleShareRecordService.getRuleShareRecordPage(query));
}
}
package cn.iocoder.yudao.module.member.controller.app.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.common.util.ip.IPHelper;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.api.ScoreProducerApi;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleBackDetailVO;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListBackVO;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListReqVO;
import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
import cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService;
import cn.iocoder.yudao.module.member.vo.scoreRule.IdReqVo;
import cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleBackVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.ApplicationContext;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
......@@ -43,6 +40,7 @@ public class AppScoreRuleController {
@PostMapping("/get")
@ApiOperation("客户端获得积分规则详情")
@Idempotent(timeout = 5)
public CommonResult<AppScoreRuleBackDetailVO> getScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
AppScoreRuleBackDetailVO scoreRuleBackDetailVO = scoreRuleService.appGetScoreRule(idReqVo.getId());
return success(scoreRuleBackDetailVO);
......@@ -50,11 +48,21 @@ public class AppScoreRuleController {
@PostMapping("/list")
@ApiOperation("客户端获得积分规则列表")
@Idempotent(timeout = 5)
public CommonResult<List<AppScoreRuleListBackVO>> getScoreRuleList(@Valid @RequestBody AppScoreRuleListReqVO reqVO) {
List<AppScoreRuleListBackVO> list = scoreRuleService.appGetScoreRuleList(reqVO);
return success(list);
}
@GetMapping("/trigger/share")
@ApiOperation("分享规则触发")
@Idempotent(timeout = 5)
public void triggerShareScoreRule(HttpServletRequest request, @RequestParam Long userId, @RequestParam Long ruleId) {
if (ruleId == null || userId == null) {
return;
}
scoreProducerApi.sendShareMessage(ScoreRuleTypeEnum.SHARE, userId, ruleId, IPHelper.getIpAddr(request));
}
//@PostMapping("/page")
//@ApiOperation("获得积分规则分页")
//public CommonResult<PageResult<ScoreRuleBackVO>> getScoreRulePage(@Valid @RequestBody ScoreRuleQueryVO query, PageVO page) {
......
package cn.iocoder.yudao.module.member.controller.app.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord.ScoreRuleShareRecordService;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordCreateReqVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 分享记录")
@RequestMapping("/member/score-rule/share-record")
public class AppScoreRuleShareRecordController {
@Resource
private ScoreRuleShareRecordService scoreRuleShareRecordService;
@PostMapping("/create")
@ApiOperation("创建分享记录")
@Idempotent(timeout = 5)
public CommonResult<Long> createRuleShareRecord(@Valid @RequestBody ScoreRuleShareRecordCreateReqVO createReqVO) {
return success(scoreRuleShareRecordService.createRuleShareRecord(createReqVO));
}
}
......@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -14,6 +15,7 @@ import lombok.Data;
*/
@Data
@ApiModel("客户端 - 积分规则列表 Response VO")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AppScoreRuleListBackVO {
@ApiModelProperty(value = "主键", required = true)
......@@ -46,6 +48,8 @@ public class AppScoreRuleListBackVO {
@ApiModelProperty(value = "推荐扩展字段")
private ScoreRulerRecommendExtraVO extraRecommend;
@ApiModelProperty(value = "推荐链接")
private String recommendUrl;
@ApiModelProperty(value = "分享扩展字段")
private ScoreRuleShareExtraVO extraShare;
@ApiModelProperty(value = "订单V值扩展字段")
......
......@@ -17,4 +17,7 @@ public class AppScoreRuleListReqVO {
@ApiModelProperty(value = "平台入口(2APP,3WEB)", required = true)
@NotNull(message = "平台入口不能为空")
private Integer platform;
@ApiModelProperty(value = "会员id", required = true)
@NotNull(message = "会员id不能为空")
private Long memberId;
}
package cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.util.Date;
/**
* 分享记录 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("score_rule_share_record")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ScoreRuleShareRecordDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 分享编号
*/
private String code;
/**
* 会员id
*/
private Long memberId;
/**
* 积分规则id
*/
private Long ruleId;
/**
* 总积分
*/
private Integer totalScore;
/**
* 最后触发时间
*/
private Date lastTriggerTime;
}
package cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailVO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordPageVO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 分享记录 Mapper
*
* @author 系统管理员
*/
@Mapper
public interface ScoreRuleShareRecordMapper extends AbstractMapper<ScoreRuleShareRecordDO> {
List<ScoreRuleShareRecordPageVO> getScoreRuleShareRecordList(@Param("start") int start, @Param("size") int size, @Param("query") ScoreRuleShareRecordQueryVO query);
int countScoreRuleShareRecord(@Param("query") ScoreRuleShareRecordQueryVO query);
List<ScoreRuleShareRecordDetailVO> getRuleShareRecordDetail(@Param("start") int start, @Param("size") int size, @Param("id") Long id);
int countScoreRuleShareRecordDetail(@Param("id") Long id);
String getCurrentMaxShareRecordCode();
}
\ No newline at end of file
package cn.iocoder.yudao.module.member.mq.consumer.score.core;
import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApi;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO;
import cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO;
import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import cn.iocoder.yudao.module.member.mq.message.ScoreMessage;
import cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord.ScoreRuleShareRecordService;
import cn.iocoder.yudao.module.member.service.scoreLog.MemberUserScoreLogService;
import cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.GET_LOCK_FAILED;
/**
* @author zhangfeng
*/
@Service
@Slf4j
public class ShareStrategy extends AbstractScoreRuleStrategy {
@Resource
private MemberUserService memberUserService;
@Resource
private ScoreRuleShareRecordService scoreRuleShareRecordService;
@Resource
private RedissonClient redissonClient;
public ShareStrategy(ScoreRuleService scoreRuleService, MemberUserScoreLogService memberUserScoreLogService, MemberUserService memberUserService, MemberUserScoreApi memberUserScoreApi) {
super(scoreRuleService, memberUserScoreLogService, memberUserService, memberUserScoreApi);
}
@Override
public void addScore(ScoreMessage message) {
Long userId = message.getUserId();
Long shareRuleId = message.getShareRuleId();
log.info("Received Share message,memberId:{},shareRuleId:{}", userId, shareRuleId);
// 根据分享人和规则id获取分享记录
ScoreRuleShareRecordDO scoreRuleShareRecordDO = scoreRuleShareRecordService.selectOne("member_id", userId, "rule_id", shareRuleId);
if (scoreRuleShareRecordDO == null) {
log.info("Share listener: The user not share the activity,userId:{},ruleId:{}", userId, shareRuleId);
return;
}
// 获取分享规则信息
ScoreRuleDO scoreRuleDO = scoreRuleService.getById(shareRuleId);
if (scoreRuleDO == null) {
log.info("Share rule is not exist,shareRuleId:{}", shareRuleId);
return;
}
// 校验规则
if (!verifyScoreRule(scoreRuleDO)) {
return;
}
// 校验累计最高分
Integer userScoreTotalCount = getUserScoreTotalCount(scoreRuleDO.getId(), userId);
if (scoreRuleDO.getMaxScoreTotal() > 0 && userScoreTotalCount >= scoreRuleDO.getMaxScoreTotal()) {
log.info("Share listener: The user has reached the maximum score,userId:{},scoreRuleId:{}", userId, scoreRuleDO.getId());
return;
}
// 更新积分和分享记录
String lockKey = "score:rule:share:lock:" + scoreRuleShareRecordDO.getId();
RLock lock = redissonClient.getLock(lockKey);
try {
if (!lock.tryLock(2, 10, TimeUnit.SECONDS)) {
throw exception(GET_LOCK_FAILED);
}
ShareStrategy currentProxy = (ShareStrategy) AopContext.currentProxy();
currentProxy.executeScoreRule(message.getTriggerIp(), shareRuleId, userId, scoreRuleDO, scoreRuleShareRecordDO);
} catch (InterruptedException e) {
throw exception(GET_LOCK_FAILED);
} finally {
lock.unlock();
}
log.info("Share rule add score success,ruleID:{},userID:{}", scoreRuleDO.getId(), userId);
}
@Transactional(rollbackFor = Exception.class)
public void executeScoreRule(String triggerIp, Long shareRuleId, Long userId, ScoreRuleDO scoreRuleDO, ScoreRuleShareRecordDO scoreRuleShareRecordDO) {
scoreRuleShareRecordDO.setTotalScore(scoreRuleShareRecordDO.getTotalScore() + scoreRuleDO.getGetScoreOnce());
scoreRuleShareRecordDO.setLastTriggerTime(new Date());
scoreRuleShareRecordService.updateById(scoreRuleShareRecordDO);
HashMap<String, Object> map = new HashMap<>(1);
map.put("scoreRuleId", shareRuleId);
memberUserScoreApi.operateScore(MemberUserScoreOperateReqDTO.builder()
.memberId(userId)
.scoreCount(scoreRuleDO.getGetScoreOnce())
.sourceType(ScoreSourceTypeEnum.SHARE)
.ruleId(scoreRuleDO.getId())
.uniqueId(userId + "_" + shareRuleId + "_" + triggerIp)
.expireDays(scoreRuleDO.getScorePeriod())
.extParam(map)
.build());
}
private boolean verifyScoreRule(ScoreRuleDO scoreRuleDO) {
if (scoreRuleDO.getStatus() != 1) {
log.info("Share listener: The rule is not enable,ruleId:{}", scoreRuleDO.getId());
return false;
}
if (scoreRuleDO.getType() != ScoreRuleTypeEnum.SHARE.getValue()) {
log.info("Share listener: Not share rule,ruleId:{}", scoreRuleDO.getId());
return false;
}
Date date = new Date();
if (date.before(scoreRuleDO.getStartTime()) || date.after(scoreRuleDO.getEndTime())) {
log.info("Share listener: The rule is not in the time range,ruleId:{}", scoreRuleDO.getId());
return false;
}
return true;
}
@Override
public ScoreRuleTypeEnum getStrategyScoreRuleType() {
return ScoreRuleTypeEnum.SHARE;
}
}
......@@ -16,6 +16,14 @@ public class ScoreMessage extends AbstractStreamMessage {
* 积分规则类型所有消息必填
*/
private ScoreRuleTypeEnum scoreRuleType;
/**
* 分享规则id
*/
private Long shareRuleId;
/**
* 分享规则id
*/
private String triggerIp;
/**
* 订单ID:订单V值消息必填
*/
......@@ -25,7 +33,7 @@ public class ScoreMessage extends AbstractStreamMessage {
*/
private String orderNo;
/**
* userID:注册必填
* userID:注册,分享必填
*/
private Long userId;
/**
......
......@@ -50,4 +50,15 @@ public class ScoreProducer implements ScoreProducerApi {
.build();
redisMQTemplate.send(message);
}
@Override
public void sendShareMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, Long ruleId, String ipAddr) {
ScoreMessage message = ScoreMessage.builder()
.scoreRuleType(scoreRuleType)
.userId(userId)
.shareRuleId(ruleId)
.triggerIp(ipAddr)
.build();
redisMQTemplate.send(message);
}
}
package cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.*;
import javax.validation.Valid;
/**
* 分享记录 Service 接口
*
* @author 系统管理员
*/
public interface ScoreRuleShareRecordService extends IService<ScoreRuleShareRecordDO> {
/**
* 创建分享记录
* @param createReqVO 创建信息
* @return 编号
*/
Long createRuleShareRecord(@Valid ScoreRuleShareRecordCreateReqVO createReqVO);
/**
* 获得分享记录详情
* @param reqVO
* @return 分享记录详情
*/
PageResult<ScoreRuleShareRecordDetailVO> getRuleShareRecordDetail(ScoreRuleShareRecordDetailReqVO reqVO);
/**
* 获得分享记录分页
* @param query 查询
* @return 分享记录分页
*/
PageResult<ScoreRuleShareRecordPageVO> getRuleShareRecordPage(ScoreRuleShareRecordQueryVO query);
}
package cn.iocoder.yudao.module.member.service.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.module.member.dal.dataobject.ScoreRuleShareRecord.ScoreRuleShareRecordDO;
import cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord.ScoreRuleShareRecordMapper;
import cn.iocoder.yudao.module.member.util.ScoreRuleGenCodeUtils;
import cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.*;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
/**
* 分享记录 Service 实现类
*
* @author 系统管理员
*/
@Service
@Validated
public class ScoreRuleShareRecordServiceImpl extends AbstractService<ScoreRuleShareRecordMapper, ScoreRuleShareRecordDO> implements ScoreRuleShareRecordService {
@Resource
private ScoreRuleShareRecordMapper scoreRuleShareRecordMapper;
@Resource
private ScoreRuleGenCodeUtils scoreRuleGenCodeUtils;
@Override
public Long createRuleShareRecord(ScoreRuleShareRecordCreateReqVO createReqVO) {
// 校验是否已存在分享记录
Long count = scoreRuleShareRecordMapper.selectCount(new LambdaQueryWrapperX<ScoreRuleShareRecordDO>()
.eq(ScoreRuleShareRecordDO::getRuleId, createReqVO.getRuleId())
.eq(ScoreRuleShareRecordDO::getMemberId, createReqVO.getMemberId()));
if (count > 0) {
return null;
}
ScoreRuleShareRecordDO scoreRuleShareRecordDO = new ScoreRuleShareRecordDO();
scoreRuleShareRecordDO.setMemberId(createReqVO.getMemberId());
scoreRuleShareRecordDO.setRuleId(createReqVO.getRuleId());
scoreRuleShareRecordDO.setCode(scoreRuleGenCodeUtils.generateShareRecordCode());
// 插入
scoreRuleShareRecordMapper.insert(scoreRuleShareRecordDO);
// 返回
return scoreRuleShareRecordDO.getId();
}
@Override
public PageResult<ScoreRuleShareRecordDetailVO> getRuleShareRecordDetail(ScoreRuleShareRecordDetailReqVO reqVO) {
int size = reqVO.getRows();
int start = (reqVO.getPage() - 1) * size;
List<ScoreRuleShareRecordDetailVO> list = scoreRuleShareRecordMapper.getRuleShareRecordDetail(start, size, reqVO.getId());
if (list.isEmpty()) {
return PageResult.empty();
}
list.stream().forEach(item -> {
item.setTypeZh(DictFrameworkUtils.getDictDataFromCache("score_rule_type", item.getType().toString()).getLabel());
item.setTypeEn(DictFrameworkUtils.getDictDataFromCache("score_rule_type", item.getType().toString()).getLabelEn());
});
int total = scoreRuleShareRecordMapper.countScoreRuleShareRecordDetail(reqVO.getId());
return new PageResult<>(list, total, size, reqVO.getPage(), (total + size - 1) / size);
}
@Override
public PageResult<ScoreRuleShareRecordPageVO> getRuleShareRecordPage(ScoreRuleShareRecordQueryVO query) {
int size = query.getRows();
int start = (query.getPage() - 1) * size;
List<ScoreRuleShareRecordPageVO> list = scoreRuleShareRecordMapper.getScoreRuleShareRecordList(start, size, query);
if (list.isEmpty()) {
return PageResult.empty();
}
list.stream().forEach(item -> {
item.setTypeZh(DictFrameworkUtils.getDictDataFromCache("score_rule_type", item.getType().toString()).getLabel());
item.setTypeEn(DictFrameworkUtils.getDictDataFromCache("score_rule_type", item.getType().toString()).getLabelEn());
});
int total = scoreRuleShareRecordMapper.countScoreRuleShareRecord(query);
return new PageResult<>(list, total, size, query.getPage(), (total + size - 1) / size);
}
}
......@@ -15,12 +15,14 @@ import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleLi
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListReqVO;
import cn.iocoder.yudao.module.member.convert.scoreRule.ScoreRuleConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.dal.mysql.scoreRule.ScoreRuleMapper;
import cn.iocoder.yudao.module.member.dal.redis.scoreRule.ScoreRuleRedisDao;
import cn.iocoder.yudao.module.member.enums.ScoreRuleStatusEnum;
import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
import cn.iocoder.yudao.module.member.enums.TransportTypeEnum;
import cn.iocoder.yudao.module.member.enums.YesOrNoTypeEnum;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.member.util.ScoreRuleGenCodeUtils;
import cn.iocoder.yudao.module.member.vo.scoreRule.*;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
......@@ -33,6 +35,7 @@ import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
......@@ -52,7 +55,10 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
@Service
@Validated
public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, ScoreRuleDO> implements ScoreRuleService {
private static final String PROD_REGISTER_URL = "https://app2.groupage.cn/#/pages/register/register?code=";
private static final String UAT_REGISTER_URL = "https://apptest.groupage.cn/#/pages/register/register?code=";
@Value("${spring.profiles.active}")
private String env;
@Resource
private ScoreRuleMapper scoreRuleMapper;
@Resource
......@@ -63,6 +69,8 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
private AdminUserApi adminUserApi;
@Resource
private ScoreRuleGenCodeUtils scoreRuleGenCodeUtils;
@Resource
private MemberUserService memberUserService;
@Override
public Long createScoreRule(ScoreRuleCreateReqVO createReqVO) {
......@@ -515,6 +523,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if (scoreRuleDO.getType() == ScoreRuleTypeEnum.RECOMMEND.getValue()) {
ScoreRulerRecommendExtraVO scoreRulerRecommendExtraVO = JsonUtils.parseObject(scoreRuleDO.getExtra(), ScoreRulerRecommendExtraVO.class);
appScoreRuleListBackVO.setExtraRecommend(scoreRulerRecommendExtraVO);
MemberUserDO memberUserDO = memberUserService.getUser(reqVO.getMemberId());
if (memberUserDO != null && !"pro".equals(env)) {
appScoreRuleListBackVO.setRecommendUrl(UAT_REGISTER_URL + memberUserDO.getCode());
} else if (memberUserDO != null) {
appScoreRuleListBackVO.setRecommendUrl(PROD_REGISTER_URL + memberUserDO.getCode());
}
} else if (scoreRuleDO.getType() == ScoreRuleTypeEnum.SHARE.getValue()) {
ScoreRuleShareExtraVO scoreRuleShareExtraVO = JsonUtils.parseObject(scoreRuleDO.getExtra(), ScoreRuleShareExtraVO.class);
appScoreRuleListBackVO.setExtraShare(scoreRuleShareExtraVO);
......
......@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.util;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO;
import cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord.ScoreRuleShareRecordMapper;
import cn.iocoder.yudao.module.member.dal.mysql.scoreRule.ScoreRuleMapper;
import com.alibaba.excel.util.DateUtils;
import org.redisson.api.RLock;
......@@ -28,6 +29,8 @@ public class ScoreRuleGenCodeUtils {
private RedissonClient redissonClient;
@Resource
private ScoreRuleMapper scoreRuleMapper;
@Resource
private ScoreRuleShareRecordMapper scoreRuleShareRecordMapper;
/**
* 生成积分规则编号
......@@ -65,6 +68,42 @@ public class ScoreRuleGenCodeUtils {
code.append(String.format("%05d", codeNum));
return code.toString();
}
/**
* 生成分享记录编号
*/
public String generateShareRecordCode() {
// 编号规则:S+年份+月份+5位数,S240100005
String key = "shareRecord:max:number";
StringBuilder code = new StringBuilder();
code.append("S");
code.append(DateUtils.format(new Date(), "yyMM"));
Long codeNum;
if (redisHelper.hasKey(key)) {
codeNum = redisHelper.incrBy(key, 1);
} else {
RLock lock = redissonClient.getLock("next:shareRecord:code:lock");
try {
boolean lockSuccess = lock.tryLock(2, 2, TimeUnit.SECONDS);
if (!lockSuccess) {
throw exception(GET_LOCK_FAILED);
}
String currentMaxShareRecordCode = scoreRuleShareRecordMapper.getCurrentMaxShareRecordCode();
if (currentMaxShareRecordCode == null){
codeNum = 1L;
} else {
codeNum = Long.parseLong(currentMaxShareRecordCode.substring(3)) + 1;
}
redisHelper.set(key, String.valueOf(codeNum),10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw exception(GET_LOCK_FAILED);
} finally {
lock.unlock();
}
}
// 获得5位序列号,不足位前面补0
code.append(String.format("%05d", codeNum));
return code.toString();
}
public void historyScoreRuleCodeFlush() {
long start = 1L;
redisHelper.delete("scoreRule:max:number");
......
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import lombok.Data;
/**
* 分享记录 Base VO,提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class ScoreRuleShareRecordBaseVO {
}
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel("管理后台 - 分享记录创建 Request VO")
public class ScoreRuleShareRecordCreateReqVO extends ScoreRuleShareRecordBaseVO {
@ApiModelProperty(value = "会员id", required = true)
@NotNull(message = "会员id不能为空")
private Long memberId;
@ApiModelProperty(value = "积分规则id", required = true)
@NotNull(message = "积分规则id不能为空")
private Long ruleId;
}
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("管理后台 - 分享记录详情查询 VO")
public class ScoreRuleShareRecordDetailReqVO extends PageVO {
@ApiModelProperty(value = "分享记录id")
@NotNull(message = "分享记录id不能为空")
private Long id;
}
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 分享记录 Response VO
* @author 系统管理员
*/
@Data
@ApiModel("管理后台 - 分享记录详情 Response VO")
public class ScoreRuleShareRecordDetailVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ApiModelProperty(value = "分享编号", required = true)
private String code;
@ApiModelProperty(value = "操作人")
private String memberName;
@ApiModelProperty(value = "分类(3推荐,4分享)")
private Integer type;
@ApiModelProperty(value = "分类中文")
private String typeZh;
@ApiModelProperty(value = "分类英文")
private String typeEn;
@ApiModelProperty(value = "积分规则标题中文")
private String titleZh;
@ApiModelProperty(value = "积分规则标题英文")
private String titleEn;
@ApiModelProperty(value = "单次积分")
private Integer score;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "操作时间")
private Date createTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "点击时间")
private Date triggerTime;
}
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 分享记录 Response VO
* @author 系统管理员
*/
@Data
@ApiModel("管理后台 - 分享记录分页 Response VO")
public class ScoreRuleShareRecordPageVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ApiModelProperty(value = "分享编号", required = true)
private String code;
@ApiModelProperty(value = "操作人")
private String memberName;
@ApiModelProperty(value = "分类(3推荐,4分享)")
private Integer type;
@ApiModelProperty(value = "分类中文")
private String typeZh;
@ApiModelProperty(value = "分类英文")
private String typeEn;
@ApiModelProperty(value = "积分规则标题中文")
private String titleZh;
@ApiModelProperty(value = "积分规则标题英文")
private String titleEn;
@ApiModelProperty(value = "有效次数")
private Integer triggerCount;
@ApiModelProperty(value = "总积分")
private Integer totalScore;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "操作时间")
private Date createTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "最后点击时间")
private Date lastTriggerTime;
}
package cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
@ApiModel("管理后台 - 分享记录查询 VO")
public class ScoreRuleShareRecordQueryVO extends PageVO {
@ApiModelProperty(value = "操作人")
private String memberName;
@ApiModelProperty(value = "分类(3推荐,4分享)")
private Integer type;
@ApiModelProperty(value = "积分规则标题")
private String title;
@ApiModelProperty(value = "分享编号")
private String code;
@ApiModelProperty(value = "总积分查询条件操作符(1大于,2等于,3小于)")
private Integer relationSymbol;
@ApiModelProperty(value = "总积分")
private Integer totalScore;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "操作开始时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "操作结束时间")
private Date endCreateTime;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.member.dal.mysql.ScoreRuleShareRecord.ScoreRuleShareRecordMapper">
<select id="getScoreRuleShareRecordList"
resultType="cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordPageVO">
SELECT
srsr.id,
srsr.code,
srsr.create_time AS createTime,
srsr.total_score AS totalScore,
srsr.last_trigger_time AS lastTriggerTime,
mu.nickname AS memberName,
sr.type,
sr.title_zh AS titleZh,
sr.title_en AS titleEn,
(srsr.total_score / sr.get_score_once) AS triggerCount
FROM
score_rule_share_record srsr
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
WHERE 1 = 1 and srsr.deleted = 0
<include refid="shareRecordCondition"/>
order by srsr.create_time desc
limit #{start}, #{size}
</select>
<select id="countScoreRuleShareRecord" resultType="java.lang.Integer">
SELECT
count(*)
FROM
score_rule_share_record srsr
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where 1 = 1 and srsr.deleted = 0
<include refid="shareRecordCondition"/>
</select>
<select id="getRuleShareRecordDetail"
resultType="cn.iocoder.yudao.module.member.vo.ScoreRuleShareRecord.ScoreRuleShareRecordDetailVO">
SELECT
srsr.id,
srsr.code,
srsr.create_time AS createTime,
msul.score_count AS score,
msul.create_time AS triggerTime,
mu.nickname AS memberName,
sr.type,
sr.title_zh AS titleZh,
sr.title_en AS titleEn
FROM
member_user_score_log msul
LEFT JOIN score_rule_share_record srsr ON msul.member_id = srsr.member_id AND msul.rule_id = srsr.rule_id
LEFT JOIN member_user mu ON srsr.member_id = mu.id
LEFT JOIN score_rule sr ON srsr.rule_id = sr.id
where srsr.deleted = 0 AND srsr.id = #{id}
order by srsr.create_time desc
limit #{start}, #{size}
</select>
<select id="countScoreRuleShareRecordDetail" resultType="java.lang.Integer">
SELECT
count(*)
FROM
member_user_score_log msul
LEFT JOIN score_rule_share_record srsr ON msul.member_id = srsr.member_id AND msul.rule_id = srsr.rule_id
where srsr.deleted = 0 AND srsr.id = #{id}
</select>
<select id="getCurrentMaxShareRecordCode" resultType="java.lang.String">
SELECT code FROM score_rule_share_record ORDER BY code desc LIMIT 1
</select>
<sql id="shareRecordCondition">
<if test="query.memberName != null and query.memberName != ''">
AND mu.nickname = #{query.memberName}
</if>
<if test="query.type != null">
AND sr.type = #{query.type}
</if>
<if test="query.title != null and query.title != ''">
AND ( sr.title_zh LIKE concat('%', #{query.title}, '%') OR sr.title_en LIKE concat('%', #{query.title}, '%') )
</if>
<if test="query.code != null and query.code != ''">
AND srsr.code = #{query.code}
</if>
<if test="query.beginCreateTime != null and query.endCreateTime != null">
AND ( srsr.create_time BETWEEN #{query.beginCreateTime} AND #{query.endCreateTime} )
</if>
<if test="query.relationSymbol != null and query.totalScore != null">
<!--1:大于 2:等于 3:小于-->
<if test="query.relationSymbol == 1">
AND srsr.total_score &gt; #{query.totalScore}
</if>
<if test="query.relationSymbol == 2">
AND srsr.total_score = #{query.totalScore}
</if>
<if test="query.relationSymbol == 3">
AND srsr.total_score &lt; #{query.totalScore}
</if>
</if>
</sql>
</mapper>
......@@ -1891,6 +1891,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
private void updateConsignorAndConsignee(OrderConsignorDO orderConsignorDO, OrderConsigneeDO
orderConsigneeDO, OrderDO orderDO, List<String> bugList) {
orderDO.setHasConsignee(Objects.nonNull(orderConsigneeDO));
boolean flag = false;
CustomerDO consignorDO = null;
CustomerDO consigneeDO = null;
......@@ -2112,7 +2113,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (order.getDrawee() == 1) {//发货人付款
......
......@@ -948,6 +948,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
public int checkOrderSalesman(OrderDO order, Long offerId, CustomerDO consignorDO, CustomerDO consigneeDO, OrderConsignorDO orderConsignorDO, OrderConsigneeDO orderConsigneeDO) {
order.setHasConsignee(Objects.nonNull(orderConsigneeDO)); // 订单是否填写了收货人
int customerType = 1; //1-业绩归属发货人,2-业绩归属收货人
if (Objects.isNull(orderConsigneeDO)) {//订单收货人
orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, order.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
......@@ -970,7 +971,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (order.getDrawee() == 1) {//发货人付款
......@@ -1849,8 +1850,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (vo.getIsCargoControl() && vo.getHasConsignee() != noConsignee) {
ApplyInfoVO infoVO = new ApplyInfoVO();
infoVO.setName("控货订单发货人控货无收货人");
infoVO.setOrgValue(vo.getHasConsignee() ? "是" : "否");
infoVO.setNewValue(noConsignee ? "是" : "否");
infoVO.setOrgValue(vo.getHasConsignee() ? "有" : "无");
infoVO.setNewValue(noConsignee ? "无" : "有");
vo.setHasConsignee(noConsignee);
applyInfoList.add(infoVO);
// 发货人控货无收货人属性设置变动,需要变动客户业绩
......@@ -2558,7 +2559,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
}
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !vo.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !vo.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
} else {
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(vo.getOrderId(), null, null);
......@@ -6263,6 +6264,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
consigneeDO.setCreateTime(now);
consigneeDO.setUpdateTime(now);
orderConsigneeService.save(consigneeDO);
newOrder.setHasConsignee(true);
}else {
newOrder.setHasConsignee(false);
}
if (newOrder.getIsCargoControl()) {
// 控货信息
......@@ -6431,7 +6435,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
newOrder.setIsException(null);
newOrder.setExceptionReason(null);
newOrder.setExternalWarehouseJson(null);
newOrder.setHasConsignee(null);
newOrder.setHasExitAndEntry(null);
newOrder.setHasSendRucangSms(null);
newOrder.setHasSendWarehouseInNotice(null);
......
......@@ -489,6 +489,11 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
queryWrapper.orderByDesc("e.id");
return orderExceptionMapper.getOrderExceptionExcelList(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
......@@ -2593,6 +2598,10 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
queryWrapper.orderByDesc("b.id");
......@@ -2712,6 +2721,11 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
StatisticsOrderVO vo = orderExceptionMapper.statisticsExceptionOrder(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
if (Objects.nonNull(vo)) {
vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
......
......@@ -634,6 +634,28 @@ public class OrderQueryVO {
@ApiModelProperty(value = "0 控货中;1 已放完货;2 部分控货 3 放货中(此状态值为组合状态,当已放完货,但未全部复核完毕时为此状态,仅供查询条件传参使用)")
private List<Integer> cargoControlStatusList;
@ApiModelProperty(value = "动态查询审核类型(字典 order_approval_type) 0 为正常")
private List<Integer> dynamicAuditTypeList;
@ApiModelProperty(value = "动态查询订单异常状态(字典 order_abnormal_state)")
private List<Integer> dynamicAbnormalStateList;
@ApiModelProperty(value = "动态查询订单入仓状态(字典 order_warehouse_in_status)")
private List<Integer> dynamicInWarehouseStateList;
@ApiModelProperty(value = "动态查询订单出货状态(字典 order_shipment_state)")
private List<Integer> dynamicShipmentStateList;
@ApiModelProperty(value = "动态查询空运可出货状态:0 默认值 1 待出 2 可出 3 备货中 4 已备货 10 可出、备货中、已备货 11 待出、可出、备货中、已备货 12 可出、备货中")
private List<Integer> dynamicAirShipmentList;
@ApiModelProperty(value = "动态查询运输方式")
private List<Integer> dynamicTransportIdList;
@ApiModelProperty(value = "动态查询状态字段")
private List<Integer> dynamicStatusList;
@ApiModelProperty(value = "内部转换状态字段")
private List<Integer> asStatusList;
......@@ -643,14 +665,6 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否有收货人")
private Boolean hasConsignee;
public void setHasConsignee(Boolean hasConsignee) {
if (Objects.nonNull(hasConsignee)) {
// 这里数据的条件正好相反,数据库是同步的客户信息设置,是否允许无收货人,true为允许无收货人
this.hasConsignee = !hasConsignee;
}
}
public void setStatus(Integer status) {
this.status = status;
this.asStatus = status;
......@@ -662,7 +676,7 @@ public class OrderQueryVO {
public void setAsStatusList(List<Integer> asStatusList) {
this.asStatusList = asStatusList;
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
this.dynamicStatusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -672,7 +686,7 @@ public class OrderQueryVO {
if (StringUtils.isNotBlank(statusString)) {
this.asStatusList = Arrays.stream(statusString.split(StrUtil.COMMA)).map(Integer::parseInt).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
this.dynamicStatusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -683,7 +697,7 @@ public class OrderQueryVO {
this.statusList = statusList;
this.asStatusList = statusList;
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
this.dynamicStatusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -696,7 +710,7 @@ public class OrderQueryVO {
combinedState(this.asStatus, this.transportId);
}
if (Objects.nonNull(transportId) && CollectionUtil.isNotEmpty(this.asStatusList)) {
this.statusList = new ArrayList<>();
this.dynamicStatusList = new ArrayList<>();
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
......@@ -772,108 +786,190 @@ public class OrderQueryVO {
private void combinedStateList(Integer asStatus, Integer transportId) {
switch (asStatus) {
case 12325:
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicShipmentStateList)){
this.dynamicShipmentStateList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(12)) {
this.dynamicStatusList.add(12);
}
if (!this.dynamicShipmentStateList.contains(325)) {
this.dynamicShipmentStateList.add(325);
}
this.statusList.add(12);
this.shipmentStateList.add(325);
break;
case 10501:
// 空运待出
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
if (Objects.isNull(this.dynamicAirShipmentList)){
this.dynamicAirShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicAuditTypeList)){
this.dynamicAuditTypeList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicAbnormalStateList)){
this.dynamicAbnormalStateList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(5)) {
this.dynamicStatusList.add(5);
}
if (!this.dynamicAirShipmentList.contains(1)) {
this.dynamicAirShipmentList.add(1);
}
if (Objects.isNull(this.auditTypeList)){
this.auditTypeList = new ArrayList<>();
if (!this.dynamicAuditTypeList.contains(0)) {
this.dynamicAuditTypeList.add(0);
}
if (Objects.isNull(this.abnormalStateList)){
this.abnormalStateList = new ArrayList<>();
if (!this.dynamicAbnormalStateList.contains(0)) {
this.dynamicAbnormalStateList.add(0);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运待出查询,只查空运的订单
}
this.statusList.add(5);
this.airShipmentList.add(1);
this.auditTypeList.add(0);
this.abnormalStateList.add(0);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10502:
// 空运可出
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
if (Objects.isNull(this.dynamicAirShipmentList)){
this.dynamicAirShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(5)) {
this.dynamicStatusList.add(5);
}
if (!this.dynamicAirShipmentList.contains(12)) {
this.dynamicAirShipmentList.add(12);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运可出查询,只查空运的订单
}
this.statusList.add(5);
this.airShipmentList.add(12);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10503:
// 空运已备货
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
if (Objects.isNull(this.dynamicAirShipmentList)){
this.dynamicAirShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(5)) {
this.dynamicStatusList.add(5);
}
if (!this.dynamicAirShipmentList.contains(4)) {
this.dynamicAirShipmentList.add(4);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运已备货查询,只查空运的订单
}
this.statusList.add(5);
this.airShipmentList.add(4);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10504:
// 待排单
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
if (Objects.isNull(this.dynamicAirShipmentList)){
this.dynamicAirShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.auditTypeList)){
this.auditTypeList = new ArrayList<>();
if (Objects.isNull(this.dynamicAuditTypeList)){
this.dynamicAuditTypeList = new ArrayList<>();
}
if (Objects.isNull(this.abnormalStateList)){
this.abnormalStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicAbnormalStateList)){
this.dynamicAbnormalStateList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(5)) {
this.dynamicStatusList.add(5);
}
if (!this.dynamicAuditTypeList.contains(0)) {
this.dynamicAuditTypeList.add(0);
}
if (!this.dynamicAbnormalStateList.contains(0)) {
this.dynamicAbnormalStateList.add(0);
}
this.statusList.add(5);
this.auditTypeList.add(0);
this.abnormalStateList.add(0);
if (Objects.nonNull(transportId) && transportId == 3) {
// 空运无需判断备货状态 可出、备货中、已备货
this.airShipmentList.add(10);
if (!this.dynamicAirShipmentList.contains(10)) {
this.dynamicAirShipmentList.add(10);
}
}else {
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
this.airShipmentList.add(20);
if (!this.dynamicAirShipmentList.contains(20)) {
this.dynamicAirShipmentList.add(20);
}
}
break;
case 132411:
// 空运已出货
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicShipmentStateList)){
this.dynamicShipmentStateList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(32)) {
this.dynamicStatusList.add(32);
}
if (!this.dynamicShipmentStateList.contains(411)) {
this.dynamicShipmentStateList.add(411);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运已出货查询,只查空运的订单
}
this.statusList.add(32);
this.shipmentStateList.add(411);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132412:
// 空运已出仓
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicShipmentStateList)){
this.dynamicShipmentStateList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(32)) {
this.dynamicStatusList.add(32);
}
if (!this.dynamicShipmentStateList.contains(412)) {
this.dynamicShipmentStateList.add(412);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运已出仓查询,只查空运的订单
}
this.statusList.add(32);
this.shipmentStateList.add(412);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132409:
// 空运已理货
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicShipmentStateList)){
this.dynamicShipmentStateList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(32)) {
this.dynamicStatusList.add(32);
}
if (!this.dynamicShipmentStateList.contains(409)) {
this.dynamicShipmentStateList.add(409);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运已理货查询,只查空运的订单
}
this.statusList.add(32);
this.shipmentStateList.add(409);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 118428:
// 空运已到港
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
if (Objects.isNull(this.dynamicShipmentStateList)){
this.dynamicShipmentStateList = new ArrayList<>();
}
if (Objects.isNull(this.dynamicTransportIdList)) {
this.dynamicTransportIdList = new ArrayList<>();
}
if (!this.dynamicStatusList.contains(32)) {
this.dynamicStatusList.add(32);
}
if (!this.dynamicShipmentStateList.contains(428)) {
this.dynamicShipmentStateList.add(428);
}
if (!this.dynamicTransportIdList.contains(3)) {
this.dynamicTransportIdList.add(3); // 空运已到港查询,只查空运的订单
}
this.statusList.add(32);
this.shipmentStateList.add(428);
// this.transportId = 3; // 空运待出查询,只查空运的订单
break;
default:
this.statusList.add(asStatus);
if (!this.dynamicStatusList.contains(asStatus)) {
this.dynamicStatusList.add(asStatus);
}
}
}
......
......@@ -112,4 +112,10 @@ public class OrderExceptionQueryVO {
@ApiModelProperty(value = "目的城市")
private List<Long> objectiveIds;
@ApiModelProperty(value = "增值服务")
private List<Long> types;
@ApiModelProperty(value = "商品类型")
private List<Long> goodsTypes;
}
......@@ -115,75 +115,98 @@
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0
<if test="query.pdaStartWareIds != null and query.pdaStartWareIds != '' ">
AND FIND_IN_SET(ew_start.`id`, #{query.pdaStartWareIds})
</if>
<if test="query.pdaDestWareIds != null and query.pdaDestWareIds != '' ">
AND FIND_IN_SET(ew_dest.`id`, #{query.pdaDestWareIds})
</if>
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<if test="query.pickState != null">
AND o.`pick_state` = #{query.pickState}
</if>
<if test="query.pickStateList != null and query.pickStateList.size()>0">
<if test="query.pickStateList != null and query.pickStateList.size()==1 ">
AND o.`pick_state` =
<foreach item='pickState' index="index" collection='query.pickStateList' >
#{pickState}
</foreach>
</if>
<if test="query.pickStateList != null and query.pickStateList.size()>1 ">
AND o.`pick_state` in
<foreach item='pickState' index="index" collection='query.pickStateList' open='(' separator=',' close=')'>
#{pickState}
</foreach>
</if>
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<include refid="orderQuery"/>
</select>
<if test="query.statusList != null and query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
<select id="getOrderExceptionStatisticsList"
resultType="cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionStatisticsExcelVo">
SELECT
o.rucang_time AS warehouse_date,
o.order_no as warehouse_no,
o.status as order_status,
m.prod_title_zh as goods_name,
e.order_exception_type as exception_status,
r.phone AS `consignor_phone`,
c.phone AS `consignee_phone`
FROM
ecw_order_exception e
LEFT JOIN ecw_order o ON e.order_id = o.order_id
LEFT JOIN ecw_order_item m ON e.order_item_id = m.order_item_id
LEFT JOIN ecw_order_consignee c ON o.order_id = c.order_id
LEFT JOIN ecw_order_consignor r ON o.order_id = r.order_id
WHERE
e.order_exception_status !=2 and o.deleted=0
<include refid="myOrderQuery">
</include>
</select>
<sql id="dynamicQuery">
<if test="query.dynamicStatusList != null and query.dynamicStatusList.size()>0">
AND (1 != 1
<if test="query.dynamicStatusList.size()==1 ">
or o.`status` =
<foreach item='status' index="index" collection='query.dynamicStatusList' >
#{status}
</foreach>
</if>
<if test="query.dynamicStatusList.size()>1 ">
or o.`status` in
<foreach item='status' index="index" collection='query.dynamicStatusList' open='(' separator=',' close=')'>
#{status}
</foreach>
</if>
<if test="query.dynamicShipmentStateList != null and query.dynamicShipmentStateList.size()>0">
<if test="query.dynamicShipmentStateList.size()==1 ">
or o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.dynamicShipmentStateList' >
#{shipmentState}
</foreach>
</if>
<if test="query.dynamicShipmentStateList.size()>1 ">
or o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.dynamicShipmentStateList' open='(' separator=',' close=')'>
#{shipmentState}
</foreach>
</if>
</if>
<if test="query.dynamicTransportIdList != null and query.dynamicTransportIdList.size() > 0">
or o.`transport_id` in
<foreach item='transportId' index='index' collection='query.dynamicTransportIdList' open='(' separator=',' close=')'>
#{transportId}
</foreach>
</if>
</if>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>0">
<if test="query.abnormalStateList != null and query.abnormalStateList.size()==1 ">
<foreach item='abnormalState' index="index" collection='query.abnormalStateList' >
<if test="query.dynamicAirShipmentList != null and query.dynamicAirShipmentList.size() > 0">
<foreach item='airShipment' index="index" collection='query.dynamicAirShipmentList'>
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
AND o.`abnormal_state` = #{abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>1 ">
AND (1!=1
<foreach item='abnormalState' index="index" collection='query.abnormalStateList'>
<if test="query.dynamicAbnormalStateList != null and query.dynamicAbnormalStateList.size()>0">
<foreach item='abnormalState' index="index" collection='query.dynamicAbnormalStateList'>
<choose>
<when test="abnormalState != '0'">
<choose>
......@@ -200,348 +223,126 @@
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.abnormalState != null">
<choose>
<when test="query.abnormalState != 0">
<if test="query.dynamicAuditTypeList != null and query.dynamicAuditTypeList.size()>0">
<foreach item='auditType' index="index" collection='query.dynamicAuditTypeList'>
<choose>
<when test="query.abnormalState != -1">
AND o.`abnormal_state` = #{query.abnormalState}
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
or o.`audit_type` = #{auditType}
</when>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` != 0
or o.`audit_type` = 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</if>
<if test="query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
AND o.`in_warehouse_state` =
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' >
#{inWarehouseState}
</foreach>
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>1 ">
AND o.`in_warehouse_state` in
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' open='(' separator=',' close=')'>
#{inWarehouseState}
</foreach>
</if>
)
</if>
<if test="query.shipmentState != null">
AND o.`shipment_State` = #{query.shipmentState}
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>0">
<if test="query.shipmentStateList != null and query.shipmentStateList.size()==1 ">
AND o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' >
#{shipmentState}
</foreach>
</if>
</sql>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>1 ">
AND o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' open='(' separator=',' close=')'>
#{shipmentState}
</foreach>
</if>
<sql id="orderQuerySql">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.auditType != null">
<choose>
<when test="query.auditType != 0">
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="query.auditType != -1">
AND o.`audit_type` = #{query.auditType}
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</if>
<if test="query.auditTypeList != null and query.auditTypeList.size()>0">
<if test="query.auditTypeList != null and query.auditTypeList.size()==1 ">
<foreach item='auditType' index="index" collection='query.auditTypeList' >
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
AND o.`audit_type` = #{auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.auditTypeList != null and query.auditTypeList.size()>1 ">
<if test="query.airShipmentList.size() > 1">
AND (1!=1
<foreach item='auditType' index="index" collection='query.auditTypeList'>
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
or o.`audit_type` = #{auditType}
</when>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<otherwise>
or o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.salesmanId != null and query.creator != null ">
AND (o.`salesman_id` = #{query.salesmanId} or o.`customer_id` in(select cus.id from ecw_customer cus where cus.is_customer_service_confirmed = 1 and cus.customer_service = #{query.salesmanId} ) or o.`creator` = #{query.creator})
</if>
<if test="query.customsType != null">
AND o.`customs_type` = #{query.customsType}
</if>
<if test="query.productRecord != null">
AND o.`product_record` = #{query.productRecord}
</if>
<if test="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<if test="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
where oi.deleted = 0 and
((oi.warehouse_in_info is null and oi.express_no like concat('%',concat(#{query.number},'%')))
or (oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like concat("%",concat(#{query.number},"%"))))))
</if>
<if test="query.notNumber != null and query.notNumber != '' ">
AND o.`number` not like concat("%",concat(#{query.notNumber},"%"))
and
o.order_id not in
(select distinct oi.order_id from ecw_order_item oi
where oi.deleted = 0 and
((oi.warehouse_in_info is null and oi.express_no like concat("%",concat(#{query.notNumber},"%")))
or
(oi.warehouse_in_info is not null and oi.warehouse_in_info ->> '$.expressNo' like
concat("%",concat(#{query.notNumber},"%")))))
</if>
<if test="query.marks != null and query.marks != '' ">
AND o.`marks` like concat("%",concat(#{query.marks},"%"))
</if>
<if test="query.departureId != null ">
AND de.`departure_id` = #{query.departureId}
</if>
<if test="query.objectiveId != null ">
AND ob.`objective_id` = #{query.objectiveId}
</if>
<if test="query.consignorId != null ">
AND nor.`customer_id` = #{query.consignorId}
</if>
<if test="query.consigneeId != null ">
AND nee.`customer_id` = #{query.consigneeId}
</if>
<if test="query.isCargoControl != null ">
AND o.`is_cargo_control` = #{query.isCargoControl}
</if>
<if test="query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat("%",concat(#{query.orderNo},"%"))
</if>
<if test="query.orderIdList != null and query.orderIdList.size() != 0">
AND o.`order_id` in
<foreach item='orderId' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>
#{orderId}
</foreach>
</if>
<if test="query.tidanNo != null and query.tidanNo != '' ">
AND o.`tidan_no` like concat("%",concat(#{query.tidanNo},"%"))
</if>
<if test="query.userId != null">
AND o.`user_id` = #{query.userId}
</if>
<if test="query.customerId != null">
AND o.`customer_id` = #{query.customerId}
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
AND o.`rucang_time` between #{query.beginRucangTime} and #{query.endRucangTime}
</if>
<if test="query.beginQingguanTime != null and query.endQingguanTime != null ">
AND o.`qingguan_time` between #{query.beginQingguanTime} and #{query.endQingguanTime}
</if>
<if test="query.beginDaogangTime != null and query.endDaogangTime != null ">
AND o.`daogang_time` between #{query.beginDaogangTime} and #{query.endDaogangTime}
</if>
<if test="query.beginPreLoadTime != null and query.endPreLoadTime != null ">
AND o.`pre_load_time` between #{query.beginPreLoadTime} and #{query.endPreLoadTime}
</if>
<if test="query.beginOutboundTime != null and query.endOutboundTime != null ">
AND o.`status` > 5 AND o.container_number in(select distinct b.self_no from ecw_box_air_checkout bc join ecw_box b ON bc.shipment_id = b.id
where b.deleted = 0 and bc.deleted = 0 and bc.`checkout_time` between #{query.beginOutboundTime} and #{query.endOutboundTime})
</if>
<if test="query.beginLoadTime != null and query.endLoadTime != null ">
AND o.`load_time` between #{query.beginLoadTime} and #{query.endLoadTime}
</if>
<if test="query.beginUnloadTime != null and query.endUnloadTime != null ">
AND o.`unload_time` between #{query.beginUnloadTime} and #{query.endUnloadTime}
</if>
<if test="query.beginTakeTime != null and query.endTakeTime != null ">
AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if>
<if test="query.beginSplitTime != null and query.endSplitTime != null ">
AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}
</if>
<if test="query.beginCreateTime != null and query.endCreateTime != null ">
AND o.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if>
<if test="query.lePickRatio != null ">
AND o.pick_ratio <![CDATA[ <= ]]> #{query.lePickRatio}
</if>
<if test="query.gePickRatio != null ">
AND o.pick_ratio <![CDATA[ >= ]]> #{query.gePickRatio}
</if>
<if test="query.eqPickRatio != null ">
AND o.pick_ratio = #{query.eqPickRatio}
</if>
<if test="query.leReleaseRatio != null ">
AND o.release_ratio <![CDATA[ <= ]]> #{query.leReleaseRatio}
</if>
<if test="query.geReleaseRatio != null ">
AND o.release_ratio <![CDATA[ >= ]]> #{query.geReleaseRatio}
</if>
<if test="query.eqReleaseRatio != null ">
AND o.release_ratio = #{query.eqReleaseRatio}
</if>
<if test="query.searchKey != null and query.searchKey != '' ">
AND concat(IFNULL(o.`order_no`,''),IFNULL(o.`parent_number`,''),IFNULL(o.`initial_parent_order_no`,''),
IFNULL(o.`old_numbers`,''),IFNULL(o.`marks`,''),IFNULL(nee.`name`,''),IFNULL(nee.`phone`,'')) like
concat("%",concat(#{query.searchKey},"%"))
</if>
<if test="query.numberKey != null and query.numberKey != '' ">
AND concat(IFNULL(o.`order_no`,''), IFNULL(o.`old_numbers`,''), IFNULL(o.`parent_number`,''), IFNULL(o.`initial_parent_order_no`,'')
,IFNULL(o.`marks`,''),IFNULL(o.`tidan_no`,''),IFNULL(o.`container_number`,'')) like concat("%",concat(#{query.numberKey},"%"))
</if>
<if test="query.prodKey != null and query.prodKey != '' ">
and (o.order_id in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 and
concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),
IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,''))
like concat("%",concat(#{query.prodKey},"%"))
))
</if>
<if test="query.notProdKey != null and query.notProdKey != '' ">
and (o.order_id not in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 and
concat(IFNULL(oi.`prod_title_zh`,''),IFNULL(oi.`prod_title_en`,''),IFNULL(pt.`title_zh`,''),IFNULL(pt.`title_en`,''),
IFNULL(pb.`title_zh`,''),IFNULL(pb.`title_en`,''))
like concat("%",concat(#{query.notProdKey},"%"))
))
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.eqProdKey != null and query.eqProdKey != '' ">
and (o.order_id in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 and (oi.`prod_title_zh` = #{query.eqProdKey} or oi.`prod_title_en` = #{query.eqProdKey}
or pt.`title_zh` = #{query.eqProdKey} or pt.`title_en` = #{query.eqProdKey}
or pb.`title_zh` = #{query.eqProdKey} or pb.`title_en` = #{query.eqProdKey})
))
<if test="query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test="query.notEqProdKey != null and query.notEqProdKey != '' ">
and (o.order_id not in(
select oi.order_id
from ecw_order_item oi
left join ecw_product p
on oi.prod_id = p.id
left join ecw_product_type pt
on pt.id = oi.prod_type
left join ecw_product_brank pb
on pb.id = oi.brand
where oi.deleted = 0 and (oi.`prod_title_zh` = #{query.notEqProdKey} or oi.`prod_title_en` = #{query.notEqProdKey}
or pt.`title_zh` = #{query.notEqProdKey} or pt.`title_en` = #{query.notEqProdKey}
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
<if test="query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
<if test="query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
<if test="query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test="query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
</select>
<select id="getOrderExceptionStatisticsList"
resultType="cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionStatisticsExcelVo">
SELECT
o.rucang_time AS warehouse_date,
o.order_no as warehouse_no,
o.status as order_status,
m.prod_title_zh as goods_name,
e.order_exception_type as exception_status,
r.phone AS `consignor_phone`,
c.phone AS `consignee_phone`
FROM
ecw_order_exception e
LEFT JOIN ecw_order o ON e.order_id = o.order_id
LEFT JOIN ecw_order_item m ON e.order_item_id = m.order_item_id
LEFT JOIN ecw_order_consignee c ON o.order_id = c.order_id
LEFT JOIN ecw_order_consignor r ON o.order_id = r.order_id
WHERE
e.order_exception_status !=2 and o.deleted=0
<include refid="myOrderQuery">
</include>
</select>
<sql id="orderQuerySql">
<if test="query.hasConsignee != null ">
AND has_consignee = #{query.hasConsignee}
</if>
......@@ -568,14 +369,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -673,7 +474,6 @@
#{shipmentState}
</foreach>
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>1 ">
AND o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' open='(' separator=',' close=')'>
......@@ -752,7 +552,9 @@
<if test="query.productRecord != null">
AND o.`product_record` = #{query.productRecord}
</if>
<if test="query.isExternalWarehouse != null">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if>
<if test="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
......@@ -1042,15 +844,105 @@
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
</if>
</sql>
<sql id="myOrderQuerySql">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
</if>
<if test="query.airShipmentList.size() > 1">
AND (1!=1
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
</choose>
</foreach>
)
</if>
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test="query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test="query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<if test="query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test="query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
</sql>
<sql id="myOrderQuerySql">
<if test="query.hasConsignee != null ">
AND has_consignee = #{query.hasConsignee}
</if>
......@@ -1079,14 +971,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList'>
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -1257,6 +1149,9 @@
<if test="query.customerId != null">
AND o.`customer_id` = #{query.customerId}
</if>
<if test="query.isExternalWarehouse != null">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
AND o.`rucang_time` between #{query.beginRucangTime} and #{query.endRucangTime}
</if>
......@@ -1430,12 +1325,7 @@
</foreach>
))
</if>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
</sql>
<select id="getHeavyOrderExcelList"
......@@ -1621,8 +1511,6 @@
o.audit_result,
o.guan_lian_order_status,
o.transport_id,
-- (select ifnull(sum(ccp.pick_num),0) from ecw_order_cargo_control_pick ccp where ccp.order_id = o.order_id and
-- ccp.status in(1,2,3,4) ) as release_num,
o.release_num,
o.release_ratio,
o.is_cargo_control,
......@@ -1835,80 +1723,175 @@
<if test="query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
</if>
<include refid="myOrderQuery"/>
GROUP BY o.order_id
order by o.order_id desc
limit #{start}, #{size}
</select>
<select id="orderCount" resultType="java.lang.Long">
select count(1)
from ecw_order o
left join ecw_order_departure de on de.order_id = o.order_id
left join ecw_order_objective ob on ob.order_id = o.order_id
left join ecw_order_consignor nor on nor.order_id = o.order_id and nor.deleted = 0
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test="query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
</if>
<include refid="orderQuery"/>
</select>
<select id="myOrderCount" resultType="java.lang.Long">
select count(1)
from ecw_order o
left join ecw_order_departure de on de.order_id = o.order_id
left join ecw_order_objective ob on ob.order_id = o.order_id
left join ecw_order_consignor nor on nor.order_id = o.order_id and nor.deleted = 0
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test="query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
</if>
<include refid="myOrderQuery"/>
</select>
<sql id="myOrderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
</if>
<if test="query.airShipmentList.size() > 1">
AND (1!=1
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
</choose>
</foreach>
)
</if>
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test="query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test="query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<include refid="myOrderQuery"/>
GROUP BY o.order_id
order by o.order_id desc
limit #{start}, #{size}
</select>
<select id="orderCount" resultType="java.lang.Long">
select count(1)
from ecw_order o
left join ecw_order_departure de on de.order_id = o.order_id
left join ecw_order_objective ob on ob.order_id = o.order_id
left join ecw_order_consignor nor on nor.order_id = o.order_id and nor.deleted = 0
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test="query.deptId != null ">
AND o.dept_id = #{query.deptId}
<if test="query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
<if test="query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<include refid="orderQuery"/>
</select>
<select id="myOrderCount" resultType="java.lang.Long">
select count(1)
from ecw_order o
left join ecw_order_departure de on de.order_id = o.order_id
left join ecw_order_objective ob on ob.order_id = o.order_id
left join ecw_order_consignor nor on nor.order_id = o.order_id and nor.deleted = 0
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test="query.deptId != null ">
AND o.dept_id = #{query.deptId}
<if test="query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item="deptId" collection="query.deptIdList" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
<if test="query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<include refid="myOrderQuery"/>
</select>
<sql id="myOrderQuery">
<if test="query.hasConsignee != null ">
AND has_consignee = #{query.hasConsignee}
</if>
......@@ -1984,14 +1967,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -2387,6 +2370,9 @@
<if test="query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat("%",concat(#{query.orderNo},"%"))
</if>
<if test="query.isExternalWarehouse != null">
AND o.`is_external_warehouse` = #{query.isExternalWarehouse}
</if>
<if test="query.orderIdList != null and query.orderIdList.size() != 0">
AND o.`order_id` in
<foreach item='orderId' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>
......@@ -2596,12 +2582,24 @@
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
</if>
<if test="query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or
nee.`customer_id` = #{query.customerDetailId})
</if>
<if test="query.userType == 2 ">
AND ((o.user_id is not null AND o.user_id > 0 AND o.`status` != 0) or o.user_id is null or o.user_id = 0)
</if>
</sql>
<sql id="orderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
......@@ -2636,28 +2634,28 @@
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or o.`status` = 5 AND o.air_shipment = 2
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or o.`status` = 5 AND o.air_shipment = 3
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or o.`status` = 5 AND o.air_shipment = 4
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or o.`status` = 5 AND o.air_shipment in(2,3,4)
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
</choose>
</foreach>
......@@ -2691,18 +2689,6 @@
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<if test="query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or
nee.`customer_id` = #{query.customerDetailId})
</if>
<if test="query.userType == 2 ">
AND ((o.user_id is not null AND o.user_id > 0 AND o.`status` != 0) or o.user_id is null or o.user_id = 0)
</if>
</sql>
<sql id="orderQuery">
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
......@@ -2785,7 +2771,7 @@
</foreach>
</if>
<if test="and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -3545,11 +3531,23 @@
</foreach>
))
</if>
<if test="query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or
nee.`customer_id` = #{query.customerDetailId})
</if>
<if test="query.userType == 2 ">
AND ((o.user_id is not null AND o.user_id > 0 AND o.`status` != 0) or o.user_id is null or o.user_id = 0)
</if>
</sql>
<sql id="issuedOrderQuery">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
......@@ -3584,28 +3582,28 @@
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or o.`status` = 5 AND o.air_shipment = 2
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or o.`status` = 5 AND o.air_shipment = 3
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or o.`status` = 5 AND o.air_shipment = 4
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or o.`status` = 5 AND o.air_shipment in(2,3,4)
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
</choose>
</foreach>
......@@ -3639,16 +3637,6 @@
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<if test="query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or
nee.`customer_id` = #{query.customerDetailId})
</if>
<if test="query.userType == 2 ">
AND ((o.user_id is not null AND o.user_id > 0 AND o.`status` != 0) or o.user_id is null or o.user_id = 0)
</if>
</sql>
<sql id="issuedOrderQuery">
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
......@@ -3724,14 +3712,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -4408,36 +4396,6 @@
</foreach>
))
</if>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test="query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test="query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<if test="query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test="query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<if test="query.customerDetailId != null">
AND (o.`customer_id` = #{query.customerDetailId} or nor.`customer_id` = #{query.customerDetailId} or
nee.`customer_id` = #{query.customerDetailId})
......@@ -5225,6 +5183,101 @@
<include refid="appOrderQurey"/>
</select>
<sql id="appOrderQurey">
<include refid="dynamicQuery"/>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 1">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
</if>
<if test="query.airShipmentList.size() > 1">
AND (1!=1
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or (o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 2">
or (o.`status` = 5 AND o.air_shipment = 2)
</when>
<when test="airShipment == 3">
or (o.`status` = 5 AND o.air_shipment = 3)
</when>
<when test="airShipment == 4">
or (o.`status` = 5 AND o.air_shipment = 4)
</when>
<when test="airShipment == 10">
or (o.`status` = 5 AND o.air_shipment in(2,3,4))
</when>
<when test="airShipment == 11">
or (o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 12">
or (o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0)
</when>
<when test="airShipment == 20">
or (o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0)
</when>
</choose>
</foreach>
)
</if>
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</if>
<if test="query.airShipment != null and query.airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</if>
<if test="query.airShipment != null and query.airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</if>
<if test="query.airShipment != null and query.airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</if>
<if test="query.airShipment != null and query.airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.airShipment != null and query.airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
......@@ -5303,14 +5356,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -5920,9 +5973,6 @@
</foreach>
))
</if>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
......@@ -5966,9 +6016,6 @@
<if test="query.marks != null and query.marks != '' ">
AND o.`marks` like concat("%",concat(#{query.marks},"%"))
</if>
<if test="query.isNeat == true ">
AND o.sum_num = o.cost->>'$.totalNum'
</if>
<if test="query.containerNumber != null and query.containerNumber != '' ">
AND o.`container_number` = #{query.containerNumber}
</if>
......@@ -6070,14 +6117,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
<if test=" query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......@@ -6551,14 +6598,14 @@
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList.size()==1 ">
<if test="query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
<if test="query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
......
......@@ -210,6 +210,7 @@
LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id
LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id
left join ecw_order_objective eo on a.order_id = eo.order_id
LEFT JOIN system_user su on a.salesman_id = su.id
left join (select it.order_id AS order_id,
SUM(
IFNULL(
......
......@@ -331,7 +331,7 @@ public class OrderController {
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.orderPage(query, page);
return success(pageResult);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment