|
@@ -1313,6 +1313,59 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
|
|
|
return orderClothFactoryClothQueryVO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void checkAllOrderStatus(Long orderClothId) {
|
|
|
+ LambdaQueryWrapper<OrderCloth> queryWrapper = new QueryWrapper<OrderCloth>().lambda()
|
|
|
+ .eq(OrderCloth::getDelFlag, DeleteStatus.OK.getCode())
|
|
|
+ .eq(orderClothId != null, OrderCloth::getId, orderClothId)
|
|
|
+ .ne(OrderCloth::getRefundStatus, OrderRefundStatus.REFUND_SUCCESS.getCode());
|
|
|
+ //查询一个月内的数据
|
|
|
+ queryWrapper.ge(BaseEntity::getCreateTime, DateUtils.addDays(new Date(), -20));
|
|
|
+ // 1. 查询洗衣订单
|
|
|
+ List<String> orderStatuss = CollUtil.newArrayList(
|
|
|
+ ClothOrderStatusType.WAIT_FACTORY.getCode(),
|
|
|
+ ClothOrderStatusType.WASHING.getCode(),
|
|
|
+ ClothOrderStatusType.HAS_WASH.getCode()
|
|
|
+ );
|
|
|
+ queryWrapper.in(OrderCloth::getOrderStatus, orderStatuss);
|
|
|
+ List<OrderCloth> orderCloths = baseMapper.selectList(queryWrapper);
|
|
|
+ for (OrderCloth orderCloth : orderCloths) {
|
|
|
+ if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAIT_FACTORY.getCode())) {
|
|
|
+ //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
|
|
|
+ Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.inFactory.getCode());
|
|
|
+ if (res) {
|
|
|
+ OrderCloth orderClothUpdate = new OrderCloth();
|
|
|
+ orderClothUpdate.setId(orderCloth.getId());
|
|
|
+ orderClothUpdate.setOrderStatus(ClothOrderStatusType.WASHING.getCode());
|
|
|
+ orderClothUpdate.setUpdateTime(new Date());
|
|
|
+ baseMapper.updateById(orderClothUpdate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WASHING.getCode())) {
|
|
|
+ //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
|
|
|
+ Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.outFactory.getCode());
|
|
|
+ if (res) {
|
|
|
+ OrderCloth orderClothUpdate = new OrderCloth();
|
|
|
+ orderClothUpdate.setId(orderCloth.getId());
|
|
|
+ orderClothUpdate.setOrderStatus(ClothOrderStatusType.HAS_WASH.getCode());
|
|
|
+ orderClothUpdate.setUpdateTime(new Date());
|
|
|
+ baseMapper.updateById(orderClothUpdate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_WASH.getCode())) {
|
|
|
+ //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
|
|
|
+ Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.hangering.getCode());
|
|
|
+ if (res) {
|
|
|
+ OrderCloth orderClothUpdate = new OrderCloth();
|
|
|
+ orderClothUpdate.setId(orderCloth.getId());
|
|
|
+ orderClothUpdate.setOrderStatus(ClothOrderStatusType.WAITING_FOR_HANG.getCode());
|
|
|
+ orderClothUpdate.setUpdateTime(new Date());
|
|
|
+ baseMapper.updateById(orderClothUpdate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void handleMtdDataByClothOrder(OrderFinancialQueryVO orderFinancialQueryVO) {
|
|
|
List<OrderClothFinancialVO> MtdData = baseMapper.listFinancialStatisticsByClothOrderMTD(SecurityUtils.getLoginUser().getOrgId(), SecurityUtils.getLoginUser().getSourceType());
|
|
|
this.buildClothData(orderFinancialQueryVO, MtdData);
|