浏览代码

add 所有衣服入厂后,订单更新

xuhaifeng 2 月之前
父节点
当前提交
f837b9d2a2
共有 32 个文件被更改,包括 113 次插入708 次删除
  1. 0 9
      admin-ui/src/api/order/cloth.js
  2. 1 1
      admin-ui/src/utils/request.js
  3. 1 1
      admin-ui/src/views/index.vue
  4. 4 54
      yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothController.java
  5. 20 4
      yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothItemController.java
  6. 0 1
      yiqi-admin/src/main/java/com/yiqi/admin/controller/recharge/RechargePasswordCardController.java
  7. 1 1
      yiqi-admin/src/main/java/com/yiqi/task/ClothOrderStatusChangeTask.java
  8. 1 0
      yiqi-common/src/main/java/com/yiqi/common/enums/ClothOrderStatusType.java
  9. 9 1
      yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothItemService.java
  10. 1 7
      yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothService.java
  11. 0 13
      yiqi-common/src/main/java/com/yiqi/order/service/IOrderGoodsService.java
  12. 0 4
      yiqi-common/src/main/java/com/yiqi/order/service/IOrderRechargeService.java
  13. 1 1
      yiqi-core/src/main/java/com/yiqi/core/service/impl/ClothHangerDetailServiceImpl.java
  14. 13 6
      yiqi-core/src/main/java/com/yiqi/core/service/impl/GoodsInfoServiceImpl.java
  15. 2 1
      yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementFactoryStatisticsServiceImpl.java
  16. 2 1
      yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementManageBillServiceImpl.java
  17. 0 22
      yiqi-core/src/main/java/com/yiqi/order/mapper/OrderClothMapper.java
  18. 0 25
      yiqi-core/src/main/java/com/yiqi/order/mapper/OrderGoodsMapper.java
  19. 0 5
      yiqi-core/src/main/java/com/yiqi/order/mapper/OrderRechargeMapper.java
  20. 1 1
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothAdjunctServiceImpl.java
  21. 7 10
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothItemServiceImpl.java
  22. 44 222
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java
  23. 0 61
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderGoodsServiceImpl.java
  24. 1 19
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderPurchaseGoodsServiceImpl.java
  25. 0 30
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderRechargeServiceImpl.java
  26. 1 1
      yiqi-core/src/main/java/com/yiqi/order/service/impl/PayServiceImpl.java
  27. 1 1
      yiqi-core/src/main/resources/mapper/core/SettlementStoreStatisticsMapper.xml
  28. 1 1
      yiqi-core/src/main/resources/mapper/order/OrderClothItemMapper.xml
  29. 0 80
      yiqi-core/src/main/resources/mapper/order/OrderClothMapper.xml
  30. 0 97
      yiqi-core/src/main/resources/mapper/order/OrderGoodsMapper.xml
  31. 0 27
      yiqi-core/src/main/resources/mapper/order/OrderRechargeMapper.xml
  32. 1 1
      yiqi-core/src/main/resources/mapper/recharge/RechargePasswordCardMapper.xml

+ 0 - 9
admin-ui/src/api/order/cloth.js

@@ -198,15 +198,6 @@ export function listCountNoConsumeByClothOrder(data) {
   })
 }
 
-// 财务统计-日报
-export function listFinancialStatisticsByClothOrderDay(data) {
-  return request({
-    url: '/mapi/order/cloth/listFinancialStatisticsByClothOrderDay',
-    method: 'post',
-    data: data
-  })
-}
-
 // 财务统计-月报
 export function listFinancialStatisticsByClothOrderMonth(data) {
   return request({

+ 1 - 1
admin-ui/src/utils/request.js

@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 30000
+  timeout: 90000
 })
 
 // request拦截器

+ 1 - 1
admin-ui/src/views/index.vue

@@ -202,7 +202,7 @@
               <el-table-column label="充值笔数" align="center" prop="chargeCount" />
               <el-table-column label="充值金额" align="center" prop="chargeAmount">
                 <template slot-scope="scope">
-                  ¥{{ scope.row.dailyChargeAmount }}
+                  ¥{{ scope.row.chargeAmount }}
                 </template>
               </el-table-column>
             </el-table>

+ 4 - 54
yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothController.java

@@ -317,11 +317,8 @@ public class OrderClothController extends BaseController {
         if (ClothTakeWay.DELIVERY.getCode().equals(orderCloth.getSendClothWay())) {
             throw new ServiceException("该订单客户已选择送货上门,无法取衣");
         }
-        if (!ClothOrderStatusType.WASHING.getCode().equals(orderCloth.getOrderStatus())
-                && !ClothOrderStatusType.HAS_WASH.getCode().equals(orderCloth.getOrderStatus())) {
-            throw new ServiceException("当前订单状态为"
-                    + EnumUtils.getEnumByType(orderCloth.getOrderStatus(), ClothOrderStatusType.class)
-                    + ",无法进行取衣操作");
+        if (!orderCloth.getPayStatus().equals(PayStatus.HAS_PAY.getCode())) {
+            throw new ServiceException("订单未支付,无法取衣");
         }
         orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
                 .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())
@@ -330,14 +327,8 @@ public class OrderClothController extends BaseController {
         List<OrderClothItem> orderClothItems = orderClothItemService.list(new QueryWrapper<OrderClothItem>()
                 .lambda().eq(OrderClothItem::getOrderId, orderId).in(OrderClothItem::getWashCode, washCodes.split(",")));
         orderClothItemFlowRecordService.addRecordBatch(orderClothItems, ClothOrderFlowStatus.hasTake.getCode());
-
-        if (orderClothItemService.count(new QueryWrapper<OrderClothItem>().lambda()
-                .eq(OrderClothItem::getOrderId, orderId)
-                .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())) == 0) {//衣服已经全部取走,需要修改订单状态
-            orderClothService.update(new UpdateWrapper<OrderCloth>().lambda()
-                    .set(OrderCloth::getOrderStatus, ClothOrderStatusType.FINISH.getCode())
-                    .eq(OrderCloth::getId, orderId));
-        }
+        //判断订单是否全部取完
+        orderClothService.checkAllOrderStatus(orderCloth.getId(), ClothOrderStatusType.WAITING_FOR_HANG.getCode());
         return R.ok();
     }
 
@@ -947,32 +938,6 @@ public class OrderClothController extends BaseController {
         return R.ok(orderClothCountConsumeQueryVO);
     }
 
-    /**
-     * 门店财务统计-经营日报-衣服订单
-     */
-    @PreAuthorize("@ss.hasPermi('order:manageDay:list')")
-    @PostMapping(value = "/listFinancialStatisticsByClothOrderDay")
-    @ApiOperation(value = "财务统计-经营日报-衣服订单")
-    public R<OrderFinancialQueryVO> listFinancialStatisticsByClothOrderDay(@RequestBody OrderFinancialDayQueryDTO orderFinancialDayQueryDTO) {
-        if (orderFinancialDayQueryDTO.getBeginCreateTime() != null && orderFinancialDayQueryDTO.getEndCreateTime() != null) {
-            if (DateUtils.addMonths(DateUtils.strToDate(orderFinancialDayQueryDTO.getBeginCreateTime()), 1)
-                    .compareTo(DateUtils.strToDate(orderFinancialDayQueryDTO.getEndCreateTime())) < 0) {
-                throw new ServiceException("查询最大范围1个月的数据");
-            }
-        }
-        return R.ok(orderClothService.listFinancialStatisticsByClothOrderDay(orderFinancialDayQueryDTO));
-    }
-
-    /**
-     * 门店财务统计-经营月报-衣服订单
-     */
-    @PreAuthorize("@ss.hasPermi('order:manageMonth:list')")
-    @PostMapping(value = "/listFinancialStatisticsByClothOrderMonth")
-    @ApiOperation(value = "财务统计-经营月报-衣服订单")
-    public R<OrderFinancialQueryVO> listFinancialStatisticsByClothOrderMonth(@RequestBody OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO) {
-        return R.ok(orderClothService.listFinancialStatisticsByClothOrderMonth(orderFinancialMonthQueryDTO));
-    }
-
     /**
      * 门店财务统计-支付宝微信统计
      */
@@ -1013,21 +978,6 @@ public class OrderClothController extends BaseController {
         return R.ok(page);
     }
 
-    /**
-     * 门店财务统计-工厂洗衣明细统计-衣服订单
-     */
-    @PreAuthorize("@ss.hasPermi('order:manageFactory:list')")
-    @PostMapping(value = "/listFinancialStatisticsByClothOrderFactory")
-    @ApiOperation(value = "财务统计-工厂洗衣明细统计-衣服订单")
-    public R<OrderClothFactoryClothQueryVO> listPayFinancialStatisticsByClothOrderFactory(@RequestBody OrderFinancialFactoryClothQueryDTO orderFinancialFactoryClothQueryDTO) {
-        if (orderFinancialFactoryClothQueryDTO.getBeginCreateTime() != null && orderFinancialFactoryClothQueryDTO.getEndCreateTime() != null) {
-            if (DateUtils.addMonths(orderFinancialFactoryClothQueryDTO.getBeginCreateTime(), 3)
-                    .compareTo(orderFinancialFactoryClothQueryDTO.getEndCreateTime()) < 0) {
-                throw new ServiceException("查询最大范围3个月的数据");
-            }
-        }
-        return R.ok(orderClothService.listPayFinancialStatisticsByClothOrderFactory(orderFinancialFactoryClothQueryDTO));
-    }
 
     /**
      * 工厂财务统计-经营日报-今日统计

+ 20 - 4
yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothItemController.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.yiqi.common.enums.ClothOrderStatusType;
 import com.yiqi.common.exception.ServiceException;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yiqi.app.domain.AppUser;
@@ -87,7 +88,7 @@ public class OrderClothItemController extends BaseController {
     @PostMapping(value = "saveOrderClothPics")
     @ApiOperation("保存衣服图片")
     public R saveOrderClothPics(@RequestParam @ApiParam("衣服图片集合,『,』分割")
-                                        String pics, @RequestParam @ApiParam("订单衣服ID") Long id) throws Exception {
+                                String pics, @RequestParam @ApiParam("订单衣服ID") Long id) throws Exception {
         OrderClothItem orderClothItem = orderClothItemService.getOne(new QueryWrapper<OrderClothItem>().lambda()
                 .eq(OrderClothItem::getId, id)
                 .eq(OrderClothItem::getOrgId, SecurityUtils.getLoginUser().getOrgId())
@@ -124,8 +125,15 @@ public class OrderClothItemController extends BaseController {
     @PostMapping(value = "outFactory")
     public R outFactory(@RequestBody @Valid OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception {
         if (orderClothItemOutFactoryDTO.getClothType().equals("1")) {
-            orderClothItemService.outFactory(orderClothItemOutFactoryDTO);
+            //衣服出厂
+            List<OrderClothItem> orderClothItems = orderClothItemService.outFactory(orderClothItemOutFactoryDTO);
+            //衣服状态修改,判断是否全部出厂
+            Set<Long> ids = orderClothItems.stream().map(OrderClothItem::getOrderId).collect(Collectors.toSet());
+            for (Long orderId : ids) {
+                orderClothService.checkAllOrderStatus(orderId, ClothOrderStatusType.WASHING.getCode());
+            }
         } else {
+            //附件出厂
             orderClothAdjunctService.outFactory(orderClothItemOutFactoryDTO);
         }
         return R.ok();
@@ -321,8 +329,16 @@ public class OrderClothItemController extends BaseController {
             orderClothItemVO.setOrderClothAdjuncts(Arrays.asList(orderClothAdjunct));
             orderClothItemVO.setFlowStatus(orderClothAdjunct.getFlowStatus());
         }
-        //判断所有衣服的状态,更新订单状态
-        orderClothService.checkAllOrderStatus(orderClothItem.getOrderId());
+        //只要有一件衣服已经入厂,订单就要更新成已入厂状态
+        if (orderClothItem.getRefundId() == null) {
+            OrderCloth orderCloth = orderClothService.getById(orderClothItem.getOrderId());
+            if (Integer.parseInt(orderCloth.getOrderStatus()) < Integer.parseInt(ClothOrderStatusType.WASHING.getCode())) {
+                orderCloth.setId(orderClothItem.getOrderId());
+                orderCloth.setOrderStatus(ClothOrderStatusType.WASHING.getCode());
+                orderCloth.buildUpdateData();
+                orderClothService.updateById(orderCloth);
+            }
+        }
         orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
                 .eq(SysOrg::getId, orderClothItemVO.getOrgId())
                 .eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());

+ 0 - 1
yiqi-admin/src/main/java/com/yiqi/admin/controller/recharge/RechargePasswordCardController.java

@@ -69,7 +69,6 @@ public class RechargePasswordCardController extends BaseController {
     /**
      * 查询密码充值卡管理列表
      */
-    @PreAuthorize("@ss.hasPermi('recharge:card:list')")
     @GetMapping("/list")
     @ApiOperation(value = "查询密码充值卡管理列表")
     public TableDataInfo list(RechargePasswordCardQueryDTO rechargePasswordCardQueryDTO) {

+ 1 - 1
yiqi-admin/src/main/java/com/yiqi/task/ClothOrderStatusChangeTask.java

@@ -48,6 +48,6 @@ public class ClothOrderStatusChangeTask {
      */
     public void run() {
         log.info("*****订单状态变更逻辑开始执行*****");
-        orderClothService.checkAllOrderStatus(null);
+        orderClothService.checkAllOrderStatus(null, null);
     }
 }

+ 1 - 0
yiqi-common/src/main/java/com/yiqi/common/enums/ClothOrderStatusType.java

@@ -20,6 +20,7 @@ public enum ClothOrderStatusType implements CodeEnum{
     , SENDING("10", "送衣中")
     , WAITING_FOR_COMMENT("11", "待评价")
     , FINISH("12", "已完成")
+    , REFUND_SUCCESS("15", "已退款")
     , CANCEL("-1", "已取消");
 
     private final String code;

+ 9 - 1
yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothItemService.java

@@ -30,7 +30,15 @@ public interface IOrderClothItemService extends IService<OrderClothItem> {
 
     public List<OrderClothItemVO> buildOrderClothItemDetail(List<OrderClothItem> orderClothItems);
 
-    public void outFactory(OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception;
+    /**
+     * 衣服出厂
+     *
+     * @param orderClothItemOutFactoryDTO
+     * @return
+     * @throws Exception
+     */
+    public List<OrderClothItem> outFactory(OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception;
+
 
     /**
      * 查询洗衣订单衣服明细

+ 1 - 7
yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothService.java

@@ -142,14 +142,8 @@ public interface IOrderClothService extends IService<OrderCloth> {
      */
     public List<OrderClothAppointmentVO> getAppointmentClothOrderList(OrderAppointmentDTO2 orderAppointmentDTO2);
 
-    public OrderFinancialQueryVO listFinancialStatisticsByClothOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO);
-
-    public OrderFinancialQueryVO listFinancialStatisticsByClothOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO);
-
-    OrderClothFactoryClothQueryVO listPayFinancialStatisticsByClothOrderFactory(OrderFinancialFactoryClothQueryDTO orderFinancialFactoryClothQueryDTO);
-
     /**
      * 检测订单状态 (对所有订单进行判断)
      */
-    void checkAllOrderStatus(Long orderClothId);
+    void checkAllOrderStatus(Long orderClothId, String orderStatus);
 }

+ 0 - 13
yiqi-common/src/main/java/com/yiqi/order/service/IOrderGoodsService.java

@@ -178,17 +178,4 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
      */
     public OrderDeliveryPathVO getDeliveryPath(Long orderId) throws Exception;
 
-    List<OrderGoodsFinancialVO>  listFinancialStatisticsByGoodsOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO);
-
-    int  countFinancialStatisticsByGoodsOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO);
-
-    void  listFinancialStatisticsByGoodsOrderToday(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today);
-
-    void  listFinancialStatisticsByGoodsOrderMTD(OrderFinancialQueryVO orderFinancialQueryVO);
-
-    List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO);
-
-    Integer countFinancialStatisticsByGoodsOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO);
-
-    //</editor-folder>
 }

+ 0 - 4
yiqi-common/src/main/java/com/yiqi/order/service/IOrderRechargeService.java

@@ -180,9 +180,5 @@ public interface IOrderRechargeService extends IService<OrderRecharge> {
      */
     public String handleCancelRecharge(String orderNo);
 
-    void  listFinancialStatisticsByRechargeOrderToday(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today);
-
-    void  listFinancialStatisticsByRechargeOrderMTD(OrderFinancialQueryVO orderFinancialQueryVO);
-
 
 }

+ 1 - 1
yiqi-core/src/main/java/com/yiqi/core/service/impl/ClothHangerDetailServiceImpl.java

@@ -170,7 +170,7 @@ public class ClothHangerDetailServiceImpl extends ServiceImpl<ClothHangerDetailM
 
         // 当衣服全部上挂后 是否需要自动更新订单状态= 7 待取衣
         //判断所有衣服的状态,更新订单状态
-        orderClothService.checkAllOrderStatus(orderClothItem.getOrderId());
+        orderClothService.checkAllOrderStatus(orderClothItem.getOrderId(), ClothOrderStatusType.HAS_WASH.getCode());
         orderClothItemFlowRecordService.addRecord(orderClothItem, orderClothItem.getFlowStatus());
         return 1;
     }

+ 13 - 6
yiqi-core/src/main/java/com/yiqi/core/service/impl/GoodsInfoServiceImpl.java

@@ -130,10 +130,10 @@ public class GoodsInfoServiceImpl extends ServiceImpl<GoodsInfoMapper, GoodsInfo
         //如果是单规格
         if (goods.getSkuType() == 0) {
             GoodsSku goodsSku = new GoodsSku();
-            if(StringUtils.isNotBlank(goods.getGoodsCode())){
+            if (StringUtils.isNotBlank(goods.getGoodsCode())) {
                 goodsSku.setSkuCode(goods.getGoodsCode());
-            }else{
-                goodsSku.setSkuCode(goods.getId()+ RandomUtil.randomNumbers(6));
+            } else {
+                goodsSku.setSkuCode(goods.getId() + RandomUtil.randomNumbers(6));
             }
             goodsSku.setSalePrice(goods.getSingleSkuPrice());
             goodsSku.setCostPrice(goods.getSingleSkuCostPrice());
@@ -163,8 +163,8 @@ public class GoodsInfoServiceImpl extends ServiceImpl<GoodsInfoMapper, GoodsInfo
                 goodsSku.setSourceType(SourceType.MANAGER.getCode());
                 goodsSku.setStatus("0");
                 goodsSku.setDelFlag("0");
-                if(StringUtils.isBlank(goodsSku.getSkuCode())){
-                    goodsSku.setSkuCode(goods.getId()+ RandomUtil.randomNumbers(6));
+                if (StringUtils.isBlank(goodsSku.getSkuCode())) {
+                    goodsSku.setSkuCode(goods.getId() + RandomUtil.randomNumbers(6));
                 }
                 goodsSku.buildCreateData();
                 goodsSkuMapper.insert(goodsSku);
@@ -323,7 +323,14 @@ public class GoodsInfoServiceImpl extends ServiceImpl<GoodsInfoMapper, GoodsInfo
      */
     @Override
     public int deleteGoodsByIds(Long[] ids) {
-        return baseMapper.deleteGoodsByIds(ids);
+        for (Long id : ids) {
+            GoodsInfo goodsInfo = new GoodsInfo();
+            goodsInfo.setId(id);
+            goodsInfo.setDelFlag("2");
+            goodsInfo.buildUpdateData();
+            baseMapper.updateById(goodsInfo);
+        }
+        return 1;
     }
 
     /**

+ 2 - 1
yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementFactoryStatisticsServiceImpl.java

@@ -130,7 +130,8 @@ public class SettlementFactoryStatisticsServiceImpl implements ISettlementFactor
                 .eq(storeId != null, "org_id", storeId)
                 .ge("flow_status", 1)
                 .ge("in_factory_time", DateUtils.addDays(start, -2))
-                .le("in_factory_time", DateUtils.addDays(end, 2));
+                .le("in_factory_time", DateUtils.addDays(end, 2))
+                .ge("create_time", DateUtils.addDays(start, -5));
 
         List<OrderClothItem> clothItems = orderClothItemService.list(queryWrapper);
         if (CollUtil.isEmpty(clothItems)) {

+ 2 - 1
yiqi-core/src/main/java/com/yiqi/core/service/impl/SettlementManageBillServiceImpl.java

@@ -157,7 +157,8 @@ public class SettlementManageBillServiceImpl extends ServiceImpl<SettlementManag
                 ClothOrderStatusType.WAITING_TO_SEND.getCode(),
                 ClothOrderStatusType.WAITING_FOR_HANG.getCode(),
                 ClothOrderStatusType.SENDING.getCode(),
-                ClothOrderStatusType.FINISH.getCode()
+                ClothOrderStatusType.FINISH.getCode(),
+                ClothOrderStatusType.REFUND_SUCCESS.getCode()
         );
         List<OrderCloth> orderClothList = orderClothService.list(new QueryWrapper<OrderCloth>().lambda()
                 .in(OrderCloth::getOrderStatus, orderStatuss)

+ 0 - 22
yiqi-core/src/main/java/com/yiqi/order/mapper/OrderClothMapper.java

@@ -82,26 +82,4 @@ public interface OrderClothMapper extends BaseMapper<OrderCloth> {
      */
     public List<OrderClothAppointmentVO> getAppointmentClothOrderList(OrderAppointmentDTO2 orderAppointmentDTO2);
 
-    public List<OrderClothFinancialVO>  listFinancialStatisticsByClothOrderDay(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                                               @Param("orgId") Long orgId,
-                                                                               @Param("sourceType") String sourceType);
-
-    public Integer countFinancialStatisticsByClothOrderDay(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                           @Param("orgId") Long orgId,
-                                                           @Param("sourceType") String sourceType);
-
-    public List<OrderClothFinancialVO> listFinancialStatisticsByClothOrderToday(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                                                @Param("orgId") Long orgId,
-                                                                                @Param("sourceType") String sourceType);
-
-    public List<OrderClothFinancialVO> listFinancialStatisticsByClothOrderMTD(@Param("orgId") Long orgId,
-                                                                              @Param("sourceType") String sourceType);
-
-    List<OrderClothFinancialVO> listFinancialStatisticsByClothOrderMonth(@Param("orderFinancialMonthQueryDTO") OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO,
-                                                                         @Param("orgId") Long orgId,
-                                                                         @Param("sourceType") String sourceType);
-
-    Integer countFinancialStatisticsByClothOrderMonth(@Param("orderFinancialMonthQueryDTO") OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO,
-                                                      @Param("orgId") Long orgId,
-                                                      @Param("sourceType") String sourceType);
 }

+ 0 - 25
yiqi-core/src/main/java/com/yiqi/order/mapper/OrderGoodsMapper.java

@@ -58,29 +58,4 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
      */
     public List<AppGoodsOrderInfoQueryVO> getGoodsOrderListByApp(AppGoodsOrderInfoQueryDTO appGoodsOrderInfoQueryDTO);
 
-    public List<OrderGoodsFinancialVO>  listFinancialStatisticsByGoodsOrderDay(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                                               @Param("orgId") Long orgId,
-                                                                               @Param("sourceType") String sourceType);
-
-    int  countFinancialStatisticsByGoodsOrderDay(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                 @Param("orgId") Long orgId,
-                                                 @Param("sourceType") String sourceType);
-
-
-    public List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderToday(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                                                @Param("orgId") Long orgId,
-                                                                                @Param("sourceType") String sourceType);
-
-
-    public List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderMTD(@Param("orgId") Long orgId, @Param("sourceType") String sourceType);
-
-
-    List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderMonth(@Param("orderFinancialMonthQueryDTO") OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO,
-                                                                         @Param("orgId") Long orgId,
-                                                                         @Param("sourceType") String sourceType);
-
-    Integer countFinancialStatisticsByGoodsOrderMonth(@Param("orderFinancialMonthQueryDTO") OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO,
-                                                      @Param("orgId") Long orgId,
-                                                      @Param("sourceType") String sourceType);
-    //</editor-folder>
 }

+ 0 - 5
yiqi-core/src/main/java/com/yiqi/order/mapper/OrderRechargeMapper.java

@@ -105,9 +105,4 @@ public interface OrderRechargeMapper extends BaseMapper<OrderRecharge> {
      */
     public List<OrderRechargeRecordVO> getRechargeRecordByUserId (Long useId);
 
-    public List<OrderRechargeFinancialVO> listFinancialStatisticsByRechargeOrderToday(@Param("orderFinancialDayQueryDTO") OrderFinancialDayQueryDTO orderFinancialDayQueryDTO,
-                                                                                      @Param("orgId") Long orgId,
-                                                                                      @Param("sourceType") String sourceType);
-
-    public List<OrderRechargeFinancialVO> listFinancialStatisticsByRechargeOrderMTD(@Param("orgId") Long orgId, @Param("sourceType") String sourceType);
 }

+ 1 - 1
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothAdjunctServiceImpl.java

@@ -123,7 +123,7 @@ public class OrderClothAdjunctServiceImpl extends ServiceImpl<OrderClothAdjunctM
             String errorMsg = "";
             for (OrderClothAdjunct orderClothItem : orderClothItems) {
                 errorMsg += (StringUtils.isEmpty(errorMsg)
-                        ? ("衣服编号" + orderClothItem.getAdjunctNo()) : ("," + orderClothItem.getAdjunctNo()));
+                        ? ("附件编号" + orderClothItem.getAdjunctNo()) : ("," + orderClothItem.getAdjunctNo()));
             }
             errorMsg += "洗衣状态不正确,请重新选择";
             throw new ServiceException(errorMsg);

+ 7 - 10
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothItemServiceImpl.java

@@ -144,35 +144,32 @@ public class OrderClothItemServiceImpl extends ServiceImpl<OrderClothItemMapper,
     }
 
     @Override
-    public void outFactory(OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception {
+    public List<OrderClothItem> outFactory(OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception {
         /**
          * 先进行验证,如果这批ID里,有状态不符合的,查出来
          */
         List<OrderClothItem> orderClothItems = list(new QueryWrapper<OrderClothItem>().lambda()
-                .in(OrderClothItem::getId, orderClothItemOutFactoryDTO.getIds())
-                .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId())
-                .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode()));
-        if (orderClothItems.size() > 0) {
+                .in(OrderClothItem::getId, orderClothItemOutFactoryDTO.getIds()));
+        List<OrderClothItem> errorOrderClothItems = orderClothItems.stream().filter(orderClothItem -> !orderClothItem.getFlowStatus().equals(ClothOrderFlowStatus.checkCloth.getCode())).collect(Collectors.toList());
+        if (errorOrderClothItems.size() > 0) {
             String errorMsg = "";
-            for (OrderClothItem orderClothItem : orderClothItems) {
+            for (OrderClothItem orderClothItem : errorOrderClothItems) {
                 errorMsg += (StringUtils.isEmpty(errorMsg)
                         ? ("衣服编号" + orderClothItem.getWashCode()) : ("," + orderClothItem.getWashCode()));
             }
             errorMsg += "洗衣状态不正确,请重新选择";
             throw new ServiceException(errorMsg);
         }
-
         update(new UpdateWrapper<OrderClothItem>().lambda().set(OrderClothItem::getFlowStatus
                         , ClothOrderFlowStatus.outFactory.getCode())
                 .set(OrderClothItem::getOutFactoryTime, DateUtils.getNowDate())
                 .set(OrderClothItem::getOutFactoryById, AuthHolder.userId())
                 .set(OrderClothItem::getOutFactoryBy, AuthHolder.nickName())
                 .in(OrderClothItem::getId, orderClothItemOutFactoryDTO.getIds())
-                .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId())
                 .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode()));
-
         orderClothItemFlowRecordService.addRecordBatch(orderClothItemService.list(new QueryWrapper<OrderClothItem>().lambda()
                 .in(OrderClothItem::getId, orderClothItemOutFactoryDTO.getIds())), ClothOrderFlowStatus.outFactory.getCode());
+        return orderClothItems;
     }
 
     /**
@@ -353,7 +350,7 @@ public class OrderClothItemServiceImpl extends ServiceImpl<OrderClothItemMapper,
         Boolean result = true;
         List<OrderClothItem> orderClothItems = baseMapper.checkClothItemStatus(clothOrderId, flawStatus);
         for (OrderClothItem orderClothItem : orderClothItems) {
-            if (Integer.valueOf(orderClothItem.getFlowStatus()) < Integer.valueOf(flawStatus)) {
+            if (Integer.valueOf(orderClothItem.getFlowStatus()) < Integer.valueOf(flawStatus) || Integer.valueOf(orderClothItem.getFlowStatus()) > 5) {
                 result = false;
             }
         }

+ 44 - 222
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java

@@ -170,8 +170,8 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         if (ClothOrderPayTimeType.take_cloth_pay.getCode().equals(orderCloth.getPayTimeType())) {//收衣付款
             orderCloth.setOrderStatus(ClothOrderStatusType.WAIT_FACTORY.getCode());
         } else {
-            //取衣付款
-            orderCloth.setOrderStatus(ClothOrderStatusType.WAITING_TO_SEND.getCode());
+            //取衣付款,不影响订单状态
+//            orderCloth.setOrderStatus(ClothOrderStatusType.WAITING_FOR_HANG.getCode());
         }
         orderCloth.setRefundAmount(BigDecimal.ZERO);
         orderCloth.setPayStatus(PayStatus.HAS_PAY.getCode());
@@ -220,8 +220,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         if (orderCloth.getRefundStatus() == OrderRefundStatus.REFUND_SUCCESS.getCode()) {//退款状态不正确,直接跳过
             return R.ok();
         }
-
-        orderCloth.setOrderStatus(ClothOrderStatusType.CANCEL.getCode());
+        orderCloth.setOrderStatus(ClothOrderStatusType.REFUND_SUCCESS.getCode());
         orderCloth.setRefundTime(DateUtils.getNowDate());
         orderCloth.setRefundStatus(OrderRefundStatus.REFUND_SUCCESS.getCode());
         updateById(orderCloth);
@@ -254,7 +253,6 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         if (orderCloth == null) {
             throw new ServiceException("未查询到订单");
         }
-
         orderCloth.setRefundStatus(OrderRefundStatus.ERROR.getCode());
         updateById(orderCloth);
         return R.ok();
@@ -344,6 +342,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             orderCloth.setAppUserId(orderClothDTO.getAppUserId());
             //新建为到店收衣方式
             orderCloth.setTakeClothWay(TakeOrSendClothWay.TOSTORE.getCode());
+            orderCloth.setSendClothWay(TakeOrSendClothWay.TOSTORE.getCode());
             //门店新建的订单
             orderCloth.setOrderType(ClothOrderType.normal.getCode());
             buildAppUserInfoOrder(orderCloth);
@@ -420,14 +419,23 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         if (Integer.parseInt(orderCloth.getRefundStatus()) > 0) {
             throw new ServiceException("请勿重复申请");
         }
-        if (Integer.parseInt(orderCloth.getOrderStatus()) >= 6) {
-            throw new ServiceException("订单已入厂状态不允许退款");
+        if (Integer.parseInt(orderCloth.getOrderStatus()) >= Integer.parseInt(ClothOrderStatusType.WASHING.getCode())) {
+            throw new ServiceException("订单已入厂,不允许退款");
+        }
+        //如果有某个衣服已经是已入厂的情况,也不允许退款
+        //todo
+        //如果用户是且未支付情况下,则直接撤销成功,不生成退款订单,否则要生成退款单
+        if (orderCloth.getPayStatus().equals(PayStatus.WAITING_TO_PAY.getCode())) {
+            orderCloth.setOrderStatus(ClothOrderStatusType.CANCEL.getCode());
+            orderCloth.buildUpdateData();
+            updateById(orderCloth);
+            return;
         }
         OrderClothRefund orderClothRefund = new OrderClothRefund();
         BeanUtils.copyProperties(orderCloth, orderClothRefund);
         orderClothRefund.setId(null);
         orderClothRefund.setRefundNo(orderNoUtils.getClothOrderNo());
-        orderClothRefund.setRefundAmount(orderCloth.getRefundAmount());
+        orderClothRefund.setRefundAmount(orderCloth.getPayAmount());
         orderClothRefund.setRefundApplyTime(DateUtils.getNowDate());
         orderClothRefund.setRefundReason(remark);
         orderClothRefund.setRefundStatus(OrderRefundStatus.REFUND_APPLYING.getCode());
@@ -448,10 +456,12 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             orderClothItemService.updateById(orderClothItem);
         });
 
-        //执行退款逻辑
+        //如果是现金支付,执行退款逻辑
         if (orderCloth.getPayType().equals(PayType.CASH.getCode())) {
             refundSuccess(orderClothRefund.getRefundNo(), orderCloth.getOrderNo());
+            return;
         }
+
         if (orderCloth.getPayType().equals(PayType.BALANCE.getCode())) {
             //充值卡支付退单
             Boolean res = rechargePasswordCardService.orderRefundByBalance(orderClothRefund.getOrderNo(), orderClothRefund.getRefundAmount());
@@ -813,10 +823,10 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             orderClothItem.setIsCustomPrice(orderClothItemDTO.getIsCustomPrice());
             orderClothItem.setSpecialPrice(buildOrderClothItemSpecialPrice(orderClothItemDTO, clothSpeedMap.get(orderClothItemDTO.getClothSpeedId())));
             orderClothItem.setTotalPrice(orderClothItem.getPrice().add(orderClothItem.getSpecialPrice()));
-            if (SysBoolType.YES.getCode().equals(orderClothItem.getIsHedging())) {
-                orderClothItem.setTotalPrice(orderClothItem.getTotalPrice().add(orderClothItem.getHedgingPrice()
-                        .multiply(new BigDecimal(sysConfigService.selectConfigByKey(SysConfigKey.OrderClothHedgingRate.getCode())))));
-            }
+//            if (SysBoolType.YES.getCode().equals(orderClothItem.getIsHedging())) {
+//                orderClothItem.setTotalPrice(orderClothItem.getTotalPrice().add(orderClothItem.getHedgingPrice()
+//                        .multiply(new BigDecimal(sysConfigService.selectConfigByKey(SysConfigKey.OrderClothHedgingRate.getCode())))));
+//            }
             orderClothItem.setPayPrice(orderClothItem.getTotalPrice());
             orderClothItem.setRemark(orderClothItemDTO.getRemark());
             orderClothItem.buildCreateData();
@@ -1140,197 +1150,28 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         return orderClothAppointmentVOList;
     }
 
-    /**
-     * 财务统计-经营日报-衣服订单
-     *
-     * @param orderFinancialDayQueryDTO
-     * @return
-     */
     @Override
-    public OrderFinancialQueryVO listFinancialStatisticsByClothOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO) {
-        OrderFinancialQueryVO orderFinancialQueryVO = new OrderFinancialQueryVO();
-        OrderFinancialDayQueryDTO today = new OrderFinancialDayQueryDTO();
-        today.setBeginCreateTime(DateUtils.getDate());
-        today.setEndCreateTime(DateUtils.getDate());
-        // 统计今日洗衣数据
-        this.handleTodayDataByClothOrder(orderFinancialQueryVO, today);
-        // 统计今日商品数据
-        this.handleTodayDataByGoodsOrder(orderFinancialQueryVO, today);
-        // 统计今日充值数据
-        this.handleTodayDataByRechargeOrder(orderFinancialQueryVO, today);
-        // 查询列表数据
-        this.handleListDataByDay(orderFinancialQueryVO, orderFinancialDayQueryDTO);
-        return orderFinancialQueryVO;
-    }
-
-    private void handleTodayDataByClothOrder(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today) {
-        // 查询今日洗衣订单
-        List<OrderClothFinancialVO> todayData = baseMapper.listFinancialStatisticsByClothOrderToday(today,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-        this.buildClothData(orderFinancialQueryVO, todayData);
-    }
-
-    private void buildClothData(OrderFinancialQueryVO orderFinancialQueryVO, List<OrderClothFinancialVO> data) {
-        if (CollUtil.isEmpty(data)) {
-            orderFinancialQueryVO.setTodayOrderAmount(BigDecimal.ZERO);
-            orderFinancialQueryVO.setTodayOnlinePayAmount(BigDecimal.ZERO);
-            orderFinancialQueryVO.setTodayCardAmount(BigDecimal.ZERO);
-            orderFinancialQueryVO.setTodayCashAmount(BigDecimal.ZERO);
-            orderFinancialQueryVO.setTodayCouponAmount(BigDecimal.ZERO);
-            orderFinancialQueryVO.setTodayOrderClothCount(0);
-            return;
-        }
-        // 今日订单金额
-        orderFinancialQueryVO.setTodayOrderAmount(data.stream()
-                .map(OrderClothFinancialVO::getOrderAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-        // 今日券消费
-        orderFinancialQueryVO.setTodayCouponAmount(data.stream()
-                .map(OrderClothFinancialVO::getCouponDeductAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-        // 今日现金消费
-        orderFinancialQueryVO.setTodayCashAmount(data.stream()
-                .filter(vo -> PayType.CASH.getCode().equals(vo.getPayType()))
-                .map(OrderClothFinancialVO::getPayAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-        // 今日会员卡消费
-        orderFinancialQueryVO.setTodayCardAmount(data.stream()
-                .filter(vo -> PayType.BALANCE.getCode().equals(vo.getPayType()))
-                .map(OrderClothFinancialVO::getPayAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-        // 今日支付宝/微信消费
-        orderFinancialQueryVO.setTodayOnlinePayAmount(data.stream()
-                .filter(vo -> PayType.WECHAT.getCode().equals(vo.getPayType()) || PayType.ALIPAY.getCode().equals(vo.getPayType()))
-                .map(OrderClothFinancialVO::getPayAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-        // 今日收衣件数
-        orderFinancialQueryVO.setTodayOrderClothCount(data.stream()
-                .map(OrderClothFinancialVO::getOrderClothCount)
-                .filter(Objects::nonNull)
-                .reduce(0, Integer::sum));
-    }
-
-    private void handleTodayDataByRechargeOrder(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today) {
-        orderRechargeService.listFinancialStatisticsByRechargeOrderToday(orderFinancialQueryVO, today);
-    }
-
-    private void handleTodayDataByGoodsOrder(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today) {
-        // 查询今日商品订单
-        orderGoodsService.listFinancialStatisticsByGoodsOrderToday(orderFinancialQueryVO, today);
-    }
-
-    private void handleListDataByDay(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO orderFinancialDayQueryDTO) {
-        // 查询洗衣列表数据
-        List<OrderClothFinancialVO> clothFinancialVOS = baseMapper.listFinancialStatisticsByClothOrderDay(orderFinancialDayQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-        orderFinancialQueryVO.setOrderClothFinancialVOList(clothFinancialVOS);
-        orderFinancialQueryVO.setClothTotal(baseMapper.countFinancialStatisticsByClothOrderDay(orderFinancialDayQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType()));
-
-        // 查询商品列表数据
-        List<OrderGoodsFinancialVO> goodsFinancialVOS = orderGoodsService.listFinancialStatisticsByGoodsOrderDay(orderFinancialDayQueryDTO);
-        orderFinancialQueryVO.setGoodsOrderFinancialVOList(goodsFinancialVOS);
-        orderFinancialQueryVO.setGoodsTotal(orderGoodsService.countFinancialStatisticsByGoodsOrderDay(orderFinancialDayQueryDTO));
-    }
-
-    /**
-     * 财务统计-经营月报-衣服订单
-     *
-     * @param orderFinancialMonthQueryDTO
-     * @return
-     */
-    @Override
-    public OrderFinancialQueryVO listFinancialStatisticsByClothOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO) {
-        OrderFinancialQueryVO orderFinancialQueryVO = new OrderFinancialQueryVO();
-        // 统计本月洗衣数据
-        this.handleMtdDataByClothOrder(orderFinancialQueryVO);
-        // 统计本月商品数据
-        this.handleMtdDataByGoodsOrder(orderFinancialQueryVO);
-        // 统计本月充值数据
-        this.handleMtdDataByRechargeOrder(orderFinancialQueryVO);
-        // 查询列表数据
-        this.handleListDataByMonth(orderFinancialQueryVO, orderFinancialMonthQueryDTO);
-
-        return orderFinancialQueryVO;
-    }
-
-    /**
-     * 财务统计-工厂洗衣明细统计-衣服订单
-     */
-    @Override
-    public OrderClothFactoryClothQueryVO listPayFinancialStatisticsByClothOrderFactory(OrderFinancialFactoryClothQueryDTO orderFinancialFactoryClothQueryDTO) {
-        OrderClothFactoryClothQueryVO orderClothFactoryClothQueryVO = new OrderClothFactoryClothQueryVO();
-        Long orgId = SecurityUtils.getLoginUser().getOrgId();
-        String sourceType = SecurityUtils.getLoginUser().getSourceType();
-        // 设置查询条件
-        LambdaQueryWrapper<OrderClothItem> queryWrapper = new QueryWrapper<OrderClothItem>().lambda()
-                .eq(OrderClothItem::getOrgId, orgId)
-                .eq(OrderClothItem::getSourceType, sourceType)
-                .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.refund.getCode())
-                .orderByDesc(BaseEntity::getCreateTime);
-        if (orderFinancialFactoryClothQueryDTO.getBeginCreateTime() != null && orderFinancialFactoryClothQueryDTO.getEndCreateTime() != null) {
-            queryWrapper.ge(BaseEntity::getCreateTime, orderFinancialFactoryClothQueryDTO.getBeginCreateTime());
-            queryWrapper.lt(BaseEntity::getCreateTime, DateUtils.addDays(orderFinancialFactoryClothQueryDTO.getEndCreateTime(), 1));
-        }
-        if (orderFinancialFactoryClothQueryDTO.getFactoryId() != null) {
-            queryWrapper.eq(OrderClothItem::getFactoryId, orderFinancialFactoryClothQueryDTO.getFactoryId());
-        }
-        queryWrapper.orderByDesc(BaseEntity::getCreateTime);
-        // 设置统计明细 全量数据,不用加limit
-        List<OrderClothItem> orderClothItemAll = orderClothItemService.list(queryWrapper);
-        if (CollUtil.isNotEmpty(orderClothItemAll)) {
-            // 设置 总计消费金额
-            orderClothFactoryClothQueryVO.setTotalPayMoney(orderClothItemAll.stream()
-                    .map(OrderClothItem::getTotalPrice)
-                    .filter(Objects::nonNull)
-                    .reduce(BigDecimal.ZERO, BigDecimal::add));
-            // 设置 总件数
-            orderClothFactoryClothQueryVO.setTotalOrderClothCount(orderClothItemAll.size());
-            orderClothFactoryClothQueryVO.setTotal(orderClothItemAll.size());
-        }
-        // 设置列表分页
-        queryWrapper.last("limit " + orderFinancialFactoryClothQueryDTO.getStartRow() + "," + orderFinancialFactoryClothQueryDTO.getPageSize());
-        List<OrderClothItem> orderClothItems = orderClothItemService.list(queryWrapper);
-        if (CollUtil.isEmpty(orderClothItems)) {
-            return orderClothFactoryClothQueryVO;
-        }
-        List<OrderClothFactoryClothItemVO> orderClothFactoryClothItemVOList = new ArrayList<>();
-        for (OrderClothItem orderClothItem : orderClothItems) {
-            // 设置门店的工厂费率
-            OrderClothFactoryClothItemVO vo = new OrderClothFactoryClothItemVO();
-            BeanUtils.copyProperties(orderClothItem, vo);
-            orderClothFactoryClothItemVOList.add(vo);
-        }
-        orderClothFactoryClothQueryVO.setOrderClothFactoryClothItemVOList(orderClothFactoryClothItemVOList);
-        return orderClothFactoryClothQueryVO;
-    }
-
-    @Override
-    public void checkAllOrderStatus(Long orderClothId) {
+    public void checkAllOrderStatus(Long orderClothId, String orderStatus) {
         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));
+        queryWrapper.ge(BaseEntity::getCreateTime, DateUtils.addDays(new Date(), -10));
         // 1. 查询洗衣订单
         List<String> orderStatuss = CollUtil.newArrayList(
                 ClothOrderStatusType.WAIT_FACTORY.getCode(),
                 ClothOrderStatusType.WASHING.getCode(),
-                ClothOrderStatusType.HAS_WASH.getCode()
+                ClothOrderStatusType.HAS_WASH.getCode(),
+                ClothOrderStatusType.WAITING_FOR_HANG.getCode()
         );
         queryWrapper.in(OrderCloth::getOrderStatus, orderStatuss);
         List<OrderCloth> orderCloths = baseMapper.selectList(queryWrapper);
         for (OrderCloth orderCloth : orderCloths) {
-            if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WAIT_FACTORY.getCode())) {
+            if (orderStatus == null) {
+                orderStatus = orderCloth.getOrderStatus();
+            }
+            if (orderStatus.equals(ClothOrderStatusType.WAIT_FACTORY.getCode())) {
                 //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
                 Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.inFactory.getCode());
                 if (res) {
@@ -1341,7 +1182,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
                     baseMapper.updateById(orderClothUpdate);
                 }
             }
-            if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.WASHING.getCode())) {
+            if (orderStatus.equals(ClothOrderStatusType.WASHING.getCode())) {
                 //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
                 Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.outFactory.getCode());
                 if (res) {
@@ -1352,7 +1193,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
                     baseMapper.updateById(orderClothUpdate);
                 }
             }
-            if (orderCloth.getOrderStatus().equals(ClothOrderStatusType.HAS_WASH.getCode())) {
+            if (orderStatus.equals(ClothOrderStatusType.HAS_WASH.getCode())) {
                 //待入厂,判断所有的衣服和附件是否都已经入厂,如果都入厂,则改变状态
                 Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.hangering.getCode());
                 if (res) {
@@ -1363,37 +1204,18 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
                     baseMapper.updateById(orderClothUpdate);
                 }
             }
+            if (orderStatus.equals(ClothOrderStatusType.WAITING_FOR_HANG.getCode())) {
+                //已到店,如果所有衣服已取完,则变成已完成
+                Boolean res = orderClothItemService.checkClothItemStatus(orderCloth.getId(), ClothOrderFlowStatus.hasTake.getCode());
+                if (res) {
+                    OrderCloth orderClothUpdate = new OrderCloth();
+                    orderClothUpdate.setId(orderCloth.getId());
+                    orderClothUpdate.setOrderStatus(ClothOrderStatusType.FINISH.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);
-    }
-
-    private void handleMtdDataByGoodsOrder(OrderFinancialQueryVO orderFinancialQueryVO) {
-        // 查询今日商品订单
-        orderGoodsService.listFinancialStatisticsByGoodsOrderMTD(orderFinancialQueryVO);
-    }
-
-    private void handleMtdDataByRechargeOrder(OrderFinancialQueryVO orderFinancialQueryVO) {
-        orderRechargeService.listFinancialStatisticsByRechargeOrderMTD(orderFinancialQueryVO);
-    }
-
-    private void handleListDataByMonth(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO) {
-        // 查询洗衣列表数据
-        List<OrderClothFinancialVO> clothFinancialVOS = baseMapper.listFinancialStatisticsByClothOrderMonth(orderFinancialMonthQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-        orderFinancialQueryVO.setOrderClothFinancialVOList(clothFinancialVOS);
-        orderFinancialQueryVO.setClothTotal(baseMapper.countFinancialStatisticsByClothOrderMonth(orderFinancialMonthQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType()));
-
-        // 查询商品列表数据
-        List<OrderGoodsFinancialVO> goodsFinancialVOS = orderGoodsService.listFinancialStatisticsByGoodsOrderMonth(orderFinancialMonthQueryDTO);
-        orderFinancialQueryVO.setGoodsOrderFinancialVOList(goodsFinancialVOS);
-        orderFinancialQueryVO.setGoodsTotal(orderGoodsService.countFinancialStatisticsByGoodsOrderMonth(orderFinancialMonthQueryDTO));
-    }
-
 }

+ 0 - 61
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderGoodsServiceImpl.java

@@ -1065,65 +1065,4 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         return thirdDeliveryService.getDeliveryPath(OrderThirdDeliveryPathDTO.buildDeliveryPathByGoodsOrder(orderGoods, appUserInfo.getWxOpenId()));
     }
 
-    @Override
-    public List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO) {
-        return baseMapper.listFinancialStatisticsByGoodsOrderDay(orderFinancialDayQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType()
-        );
-    }
-
-    @Override
-    public int countFinancialStatisticsByGoodsOrderDay(OrderFinancialDayQueryDTO orderFinancialDayQueryDTO) {
-        return baseMapper.countFinancialStatisticsByGoodsOrderDay(orderFinancialDayQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType()
-        );
-    }
-
-    @Override
-    public void listFinancialStatisticsByGoodsOrderToday(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today) {
-        // 查询今日商品订单
-        List<OrderGoodsFinancialVO> todayData = baseMapper.listFinancialStatisticsByGoodsOrderToday(today,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-        if (CollUtil.isEmpty(todayData)) {
-            orderFinancialQueryVO.setTodayOrderGoodsCount(0);
-        }
-        // 今日商品件数
-        orderFinancialQueryVO.setTodayOrderGoodsCount(todayData.stream()
-                .map(OrderGoodsFinancialVO::getOrderGoodsCount)
-                .filter(Objects::nonNull)
-                .reduce(0, Integer::sum));
-    }
-
-    @Override
-    public void listFinancialStatisticsByGoodsOrderMTD(OrderFinancialQueryVO orderFinancialQueryVO) {
-        // 查询本月商品订单
-        List<OrderGoodsFinancialVO> todayData = baseMapper.listFinancialStatisticsByGoodsOrderMTD(SecurityUtils.getLoginUser().getOrgId(), SecurityUtils.getLoginUser().getSourceType());
-        if (CollUtil.isEmpty(todayData)) {
-            orderFinancialQueryVO.setTodayOrderGoodsCount(0);
-        }
-        // 本月商品件数
-        orderFinancialQueryVO.setTodayOrderGoodsCount(todayData.stream()
-                .map(OrderGoodsFinancialVO::getOrderGoodsCount)
-                .filter(Objects::nonNull)
-                .reduce(0, Integer::sum));
-    }
-
-    @Override
-    public List<OrderGoodsFinancialVO> listFinancialStatisticsByGoodsOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO) {
-        return baseMapper.listFinancialStatisticsByGoodsOrderMonth(orderFinancialMonthQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-    }
-
-    @Override
-    public Integer countFinancialStatisticsByGoodsOrderMonth(OrderFinancialMonthQueryDTO orderFinancialMonthQueryDTO) {
-        return baseMapper.countFinancialStatisticsByGoodsOrderMonth(orderFinancialMonthQueryDTO,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType()
-        );
-    }
-    //</editor-folder>
 }

+ 1 - 19
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderPurchaseGoodsServiceImpl.java

@@ -360,27 +360,9 @@ public class OrderPurchaseGoodsServiceImpl extends ServiceImpl<OrderPurchaseGood
      * 检查操作权限- 出货校验
      */
     private Boolean checkActionByOutOrder(OrderPurchaseGoods orderPurchaseGoods) {
-        // 门店操作
-        if (SourceType.STORE.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            log.warn("门店没有出货权限");
-            return Boolean.FALSE;
-        }
-        // 工厂操作
-        if (SourceType.FACTORY.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            if (SourceType.FACTORY.getCode().equals(orderPurchaseGoods.getParentSourceType())
-                    && SecurityUtils.getLoginUser().getOrgId().equals(orderPurchaseGoods.getOrgId())) {
-                return Boolean.TRUE;
-            }
-        }
         // 总部操作
         if (SourceType.MANAGER.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            if (SourceType.MANAGER.getCode().equals(orderPurchaseGoods.getParentSourceType())) {
-                return Boolean.TRUE;
-            }
-            if (SourceType.FACTORY.getCode().equals(orderPurchaseGoods.getParentSourceType())
-                    && SourceType.HQ_FACTORY.getCode().equals(String.valueOf(orderPurchaseGoods.getParentOrgId()))) {
-                return Boolean.TRUE;
-            }
+            return Boolean.TRUE;
         }
         return Boolean.FALSE;
     }

+ 0 - 30
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderRechargeServiceImpl.java

@@ -1357,34 +1357,4 @@ public class OrderRechargeServiceImpl extends ServiceImpl<OrderRechargeMapper, O
         return "支付失败,取消订单";
     }
 
-    @Override
-    public void listFinancialStatisticsByRechargeOrderToday(OrderFinancialQueryVO orderFinancialQueryVO, OrderFinancialDayQueryDTO today) {
-        // 查询今日充值订单
-        List<OrderRechargeFinancialVO> todayData = baseMapper.listFinancialStatisticsByRechargeOrderToday(today,
-                SecurityUtils.getLoginUser().getOrgId(),
-                SecurityUtils.getLoginUser().getSourceType());
-        if (CollUtil.isEmpty(todayData)) {
-            orderFinancialQueryVO.setTodayChargeAmount(BigDecimal.ZERO);
-        }
-        // 今日充值金额
-        orderFinancialQueryVO.setTodayChargeAmount(todayData.stream()
-                .map(OrderRechargeFinancialVO::getPayAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-    }
-
-    @Override
-    public void listFinancialStatisticsByRechargeOrderMTD(OrderFinancialQueryVO orderFinancialQueryVO) {
-        // 查询本月充值订单
-        List<OrderRechargeFinancialVO> todayData = baseMapper.listFinancialStatisticsByRechargeOrderMTD(SecurityUtils.getLoginUser().getOrgId(), SecurityUtils.getLoginUser().getSourceType());
-        if (CollUtil.isEmpty(todayData)) {
-            orderFinancialQueryVO.setTodayChargeAmount(BigDecimal.ZERO);
-        }
-        // 本月充值金额
-        orderFinancialQueryVO.setTodayChargeAmount(todayData.stream()
-                .map(OrderRechargeFinancialVO::getPayAmount)
-                .filter(Objects::nonNull)
-                .reduce(BigDecimal.ZERO, BigDecimal::add));
-    }
-
 }

+ 1 - 1
yiqi-core/src/main/java/com/yiqi/order/service/impl/PayServiceImpl.java

@@ -265,7 +265,7 @@ public class PayServiceImpl implements IPayService {
             }
             default: {
                 throw new ServiceException("当前订单支付方式为" + EnumUtils.getEnumByType(payRefundDTO.getPayType()
-                        , PayType.class).getInfo() + "不支持第三方APP退款");
+                        , PayType.class).getInfo() + "不支持的退款方式");
             }
         }
 

+ 1 - 1
yiqi-core/src/main/resources/mapper/core/SettlementStoreStatisticsMapper.xml

@@ -384,7 +384,7 @@
         <if test="endDay!=null">
              and day &lt;= #{endDay}
         </if>
-        <if test="storeId != null and storeId != 0">
+        <if test="storeId != null">
             and store_id = #{storeId}
         </if>
     </select>

+ 1 - 1
yiqi-core/src/main/resources/mapper/order/OrderClothItemMapper.xml

@@ -652,7 +652,7 @@
         order by item.id desc
     </select>
     <select id="checkClothItemStatus" resultType="com.yiqi.order.domain.OrderClothItem">
-        select order_id, flow_status, order_no from order_cloth_item where order_id = #{orderId} and flow_status != #{flowStatus}
+        select order_id, flow_status, order_no from order_cloth_item where order_id = #{clothOrderId} and flow_status != #{flawStatus}
     </select>
 
     <update id="updateAllClothItemStatusByOrderId">

+ 0 - 80
yiqi-core/src/main/resources/mapper/order/OrderClothMapper.xml

@@ -289,86 +289,6 @@
             limit #{pageSizeExport}
         </if>
     </select>
-    <select id="listFinancialStatisticsByClothOrderDay"
-            resultType="com.yiqi.order.domain.vo.OrderClothFinancialVO">
-        <include refid="orderClothFinancialVo"/>
-        <where>
-             a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-                and a.org_id = #{orgId} and a.source_type = '02'
-        <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-            and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-        </if>
-        <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-            and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-        </if>
-        </where>
-        order by a.create_time desc
-        limit #{orderFinancialDayQueryDTO.startRow},#{orderFinancialDayQueryDTO.pageSize}
-    </select>
-    <select id="listFinancialStatisticsByClothOrderToday"
-            resultType="com.yiqi.order.domain.vo.OrderClothFinancialVO">
-        <include refid="orderClothFinancialVo"/>
-        <where>
-            a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-        order by a.create_time desc
-    </select>
-    <select id="countFinancialStatisticsByClothOrderDay" resultType="java.lang.Integer">
-        select count(*)
-        from order_cloth a
-        <where>
-            a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-    </select>
-    <select id="listFinancialStatisticsByClothOrderMTD"
-            resultType="com.yiqi.order.domain.vo.OrderClothFinancialVO">
-        <include refid="orderClothFinancialVo"/>
-        <where>
-            a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            and a.create_time BETWEEN DATE_FORMAT(NOW(), '%Y-%m-01') AND LAST_DAY(NOW())
-    </where>
-        order by a.create_time desc
-    </select>
-    <select id="listFinancialStatisticsByClothOrderMonth"
-            resultType="com.yiqi.order.domain.vo.OrderClothFinancialVO">
-        <include refid="orderClothFinancialVo"/>
-        <where>
-        a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-        and a.org_id = #{orgId} and a.source_type = '02'
-        <if test="orderFinancialMonthQueryDTO.monthTime != null and orderFinancialMonthQueryDTO.monthTime != ''"><!-- 开始时间检索 -->
-            and DATE_FORMAT(a.create_time,'%Y-%m') = #{orderFinancialMonthQueryDTO.monthTime}
-        </if>
-        </where>
-        order by a.create_time desc
-        limit #{orderFinancialMonthQueryDTO.startRow},#{orderFinancialMonthQueryDTO.pageSize}
-    </select>
-    <select id="countFinancialStatisticsByClothOrderMonth" resultType="java.lang.Integer">
-        select count(*)
-        from order_cloth a
-        <where>
-            a.order_status IN ('6','7','8','9','10','11') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialMonthQueryDTO.monthTime != null and orderFinancialMonthQueryDTO.monthTime != ''"><!-- 开始时间检索 -->
-                and DATE_FORMAT(a.create_time,'%Y-%m') = #{orderFinancialMonthQueryDTO.monthTime}
-            </if>
-        </where>
-        order by a.create_time desc
-    </select>
 
     <insert id="insertOrderCloth" parameterType="OrderCloth" useGeneratedKeys="true"
             keyProperty="id">

+ 0 - 97
yiqi-core/src/main/resources/mapper/order/OrderGoodsMapper.xml

@@ -184,102 +184,5 @@
         </where>
 
     </select>
-    <select id="listFinancialStatisticsByGoodsOrderToday"
-            resultType="com.yiqi.order.domain.vo.OrderGoodsFinancialVO">
-        select a.order_no as orderNo , b.buy_num  as orderGoodsCount
-        from order_goods a
-        left join order_goods_sku b on a.order_no = b.order_no
-        <where>
-            a.order_status IN ('2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-        order by a.create_time desc
-    </select>
-    <select id="listFinancialStatisticsByGoodsOrderDay"
-            resultType="com.yiqi.order.domain.vo.OrderGoodsFinancialVO">
-        select
-        a.order_no as orderNo, a.total_price as totalPrice, a.pay_amount as payAmount, a.coupon_deduct_amount + a.cash_deduct_amount  as couponAmount,
-        a.create_time as createTime, b.real_name as userName, b.phone_number as phoneNumber,
-        a.create_by as employeeName, a.create_by_id as employeeId, a.order_status as orderStatus, a.pay_type as payType
-        from order_goods a
-        left join app_user b on a.app_user_id = b.id
-        <where>
-        a.order_status IN ('0','1','2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-        order by a.create_time desc
-        limit #{orderFinancialDayQueryDTO.startRow},#{orderFinancialDayQueryDTO.pageSize}
-    </select>
-    <select id="countFinancialStatisticsByGoodsOrderDay" resultType="java.lang.Integer">
-        select
-            count(*)
-        from order_goods a
-        <where>
-            a.order_status IN ('0','1','2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-    </select>
-    <select id="listFinancialStatisticsByGoodsOrderMTD"
-            resultType="com.yiqi.order.domain.vo.OrderGoodsFinancialVO">
-        select a.order_no as orderNo , b.buy_num  as orderGoodsCount
-        from order_goods a
-        left join order_goods_sku b on a.order_no = b.order_no
-        <where>
-            a.order_status IN ('2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            and a.create_time BETWEEN DATE_FORMAT(NOW(), '%Y-%m-01') AND LAST_DAY(NOW())
-        </where>
-        order by a.create_time desc
-    </select>
-    <select id="listFinancialStatisticsByGoodsOrderMonth"
-            resultType="com.yiqi.order.domain.vo.OrderGoodsFinancialVO">
-        select
-        a.order_no as orderNo, a.total_price as totalPrice, a.pay_amount as payAmount, a.coupon_deduct_amount + a.cash_deduct_amount  as couponAmount,
-        a.create_time as createTime, b.real_name as userName, b.phone_number as phoneNumber,
-        a.create_by as employeeName, a.create_by_id as employeeId, a.order_status as orderStatus, a.pay_type as payType
-        from order_goods a
-        left join app_user b on a.app_user_id = b.id
-        <where>
-            a.order_status IN ('0','1','2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialMonthQueryDTO.monthTime != null and orderFinancialMonthQueryDTO.monthTime != ''"><!-- 开始时间检索 -->
-                and DATE_FORMAT(a.create_time,'%Y-%m') = #{orderFinancialMonthQueryDTO.monthTime}
-            </if>
-        </where>
-        order by a.create_time desc
-        limit #{orderFinancialMonthQueryDTO.startRow},#{orderFinancialMonthQueryDTO.pageSize}
-    </select>
-    <select id="countFinancialStatisticsByGoodsOrderMonth" resultType="java.lang.Integer">
-        select count(*)
-        from order_goods a
-        left join app_user b on a.app_user_id = b.id
-        <where>
-            a.order_status IN ('0','1','2','3','5') and a.refund_status = '0' and a.del_flag='0'
-            and a.org_id = #{orgId} and a.source_type = '02'
-            <if test="orderFinancialMonthQueryDTO.monthTime != null and orderFinancialMonthQueryDTO.monthTime != ''">
-                and DATE_FORMAT(a.create_time,'%Y-%m') = #{orderFinancialMonthQueryDTO.monthTime}
-            </if>
-        </where>
-        order by a.create_time desc
-    </select>
-
 
 </mapper>

+ 0 - 27
yiqi-core/src/main/resources/mapper/order/OrderRechargeMapper.xml

@@ -209,33 +209,6 @@
             </if>
         </where>
     </select>
-    <select id="listFinancialStatisticsByRechargeOrderToday"
-            resultType="com.yiqi.order.domain.vo.OrderRechargeFinancialVO">
-        select a.order_no as orderNo , a.pay_amount as payAmount
-        from order_recharge a
-        <where>
-            a.order_status IN ('2','3') and a.refund_status = '0' and a.del_flag='0'
-            and a.store_id = #{orgId}
-            <if test="orderFinancialDayQueryDTO.beginCreateTime != null and orderFinancialDayQueryDTO.beginCreateTime != ''"><!-- 开始时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &gt;= date_format(#{orderFinancialDayQueryDTO.beginCreateTime},'%y%m%d')
-            </if>
-            <if test="orderFinancialDayQueryDTO.endCreateTime != null and orderFinancialDayQueryDTO.endCreateTime != ''"><!-- 结束时间检索 -->
-                and date_format(a.create_time,'%y%m%d') &lt;= date_format(#{orderFinancialDayQueryDTO.endCreateTime},'%y%m%d')
-            </if>
-        </where>
-        order by a.create_time desc
-    </select>
-    <select id="listFinancialStatisticsByRechargeOrderMTD"
-            resultType="com.yiqi.order.domain.vo.OrderRechargeFinancialVO">
-        select a.order_no as orderNo , a.pay_amount as payAmount
-        from order_recharge a
-        <where>
-            a.order_status IN ('2','3') and a.refund_status = '0' and a.del_flag='0'
-            and a.store_id = #{orgId}
-            and a.create_time BETWEEN DATE_FORMAT(NOW(), '%Y-%m-01') AND LAST_DAY(NOW())
-        </where>
-        order by a.create_time desc
-    </select>
 
     <insert id="insertOrderRecharge" parameterType="OrderRecharge" useGeneratedKeys="true"
             keyProperty="id">

+ 1 - 1
yiqi-core/src/main/resources/mapper/recharge/RechargePasswordCardMapper.xml

@@ -208,7 +208,7 @@
     <select id="getCardBillMstrInfoById" resultType="com.yiqi.recharge.domain.vo.RechargeCardBillMstrQueryVO">
         select aubm.id, aubm.title, aubm.content, aubm.order_id as orderId, aubm.order_no as orderNo,
         aubm.order_type as orderType, aubm.pay_type as payType,
-        aubm.app_user_id  as appUserId, aubm. bill_type as billType, aubm.pay_total_amount  as payTotalAmount, aubm.cash_pay_amount  as cashPayAmount,
+        aubm.app_user_id  as appUserId, aubm. bill_type as billType, aubm.pay_total_amount  as payTotalAmount,
         aubm.recharge_pay_amount  as rechargePayAmount, aubm.give_pay_amount  as givePayAmount, aubm.welfare_pay_amount  as welfarePayAmount, aubm.receive_point  as receivePoint,
         aubm.use_point  as usePoint, aubm.is_refund  as isRefund, aubm.create_time  as createTime, aubm.recharge_card_id  as rechargeCardId,
         aubm.create_time as createTime,