Эх сурвалжийг харах

add 优化取衣收衣和预约相关逻辑

xuhaifeng 2 сар өмнө
parent
commit
d2ba67c9a0
21 өөрчлөгдсөн 599 нэмэгдсэн , 372 устгасан
  1. 3 3
      admin-ui/src/api/order/cloth.js
  2. 13 0
      admin-ui/src/components/Page/index.vue
  3. 22 7
      admin-ui/src/components/payStatusPopup/index.vue
  4. 19 21
      admin-ui/src/views/order/cloth/component/cashCloth.vue
  5. 55 55
      admin-ui/src/views/order/cloth/components/PayStatusPopup.vue
  6. 95 26
      admin-ui/src/views/order/cloth/orderList.vue
  7. 34 5
      admin-ui/src/views/order/cloth/searchCloth.vue
  8. 1 0
      admin-ui/src/views/recharge/card/index.vue
  9. 48 17
      admin-ui/src/views/statistics/overtimeOrders.vue
  10. 52 16
      admin-ui/src/views/statistics/queryReception.vue
  11. 32 16
      admin-ui/src/views/workbench/workAppointmentOrder/index.vue
  12. 46 156
      yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothItemController.java
  13. 34 1
      yiqi-common/src/main/java/com/yiqi/order/domain/dto/OrderClothItemQueryDTO.java
  14. 6 0
      yiqi-common/src/main/java/com/yiqi/order/domain/vo/OrderClothAppointmentVO.java
  15. 7 0
      yiqi-common/src/main/java/com/yiqi/order/domain/vo/OrderClothItemVO.java
  16. 16 0
      yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothItemService.java
  17. 16 0
      yiqi-core/src/main/java/com/yiqi/order/mapper/OrderClothItemMapper.java
  18. 10 0
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothItemServiceImpl.java
  19. 19 35
      yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java
  20. 66 6
      yiqi-core/src/main/resources/mapper/order/OrderClothItemMapper.xml
  21. 5 8
      yiqi-core/src/main/resources/mapper/order/OrderClothMapper.xml

+ 3 - 3
admin-ui/src/api/order/cloth.js

@@ -276,7 +276,7 @@ export function countFinancialStatisticsByFactoryOperateDetail(data) {
 // 获取订单信息
 export function getOrderInfo(data) {
   return request({
-    url: '/order/cloth/info',
+    url: '/mapi/order/cloth/info',
     method: 'get',
     params: data
   })
@@ -285,7 +285,7 @@ export function getOrderInfo(data) {
 // 订单支付
 export function clothOrderPay(data) {
   return request({
-    url: '/order/cloth/pay',
+    url: '/mapi/order/cloth/clothOrderPay',
     method: 'post',
     data
   })
@@ -294,7 +294,7 @@ export function clothOrderPay(data) {
 // 获取支付结果
 export function getOrderPayResult(data) {
   return request({
-    url: '/order/cloth/payResult',
+    url: '/mapi/order/cloth/payResult',
     method: 'get',
     params: data
   })

+ 13 - 0
admin-ui/src/components/Page/index.vue

@@ -100,6 +100,19 @@ export default {
             if (isLoading === undefined) {
                 isLoading = true
             }
+          console.log("requestParams", this.requestParams)
+            console.log("page", {
+              pageNum: this.pagination.current,
+              pageSize: this.pagination.size
+            })
+            console.log(merge(
+              {},
+              {
+                pageNum: this.pagination.current,
+                pageSize: this.pagination.size
+              },
+              this.requestParams
+            ))
             this.isLoading = isLoading
             request({
                 url: this.uri,

+ 22 - 7
admin-ui/src/components/payStatusPopup/index.vue

@@ -21,7 +21,7 @@
             <!-- 未支付 -->
             <div v-if="type === 2">
                 <div class="icon">
-                    
+
                     <i class="el-icon-warning warning"></i>
                 </div>
                 <div class="message">请支付后取衣</div>
@@ -167,28 +167,43 @@ export default {
         open(type, info, appUserInfo = null) {
             this.orderInfo = info
             this.type = type
+          this.showPaySuccessBtn = false
+          console.log(this.type)
+            if (type == 0) {
+              //微信支付宝支付
+              this.payType = 0
+              this.authCode = info.authCode
+              this.showPaySuccessBtn = false
+              if (appUserInfo) {
+                this.appUserInfo = appUserInfo
+              }
+              console.log('aasss', this.appUserInfo)
+              this.pay()
+            }
             if (type == 1) {
                 if (info.id && !this.hidePointer) {
                     this.getClothItemInfo(info)
                 }
             }
             if (type == 2) {
+              //现金支付
                 this.appUserInfo = {}
                 this.authCode = ''
                 this.showPaySuccessBtn = false
                 if (this.hideUser) {
-                    this.payType = 2
+                  this.payType = 2
                 } else {
-                    this.payType = 3
+                  this.payType = 2
                     this.getUserInfo(info.appUserId)
                 }
+              this.pay()
+
             }
             if (type == 3) {
-                this.payType = info.payType
-                this.authCode = info.authCode
+              //会员支付
+                this.payType = 3
                 this.showPaySuccessBtn = false
-                console.log(appUserInfo)
-                if (appUserInfo.id) {
+                if (appUserInfo) {
                     this.appUserInfo = appUserInfo
                 }
                 console.log('aasss', this.appUserInfo)

+ 19 - 21
admin-ui/src/views/order/cloth/component/cashCloth.vue

@@ -1,9 +1,9 @@
 <template>
     <div class="cash-cloth-container">
         <div v-loading="dialogLoading" :element-loading-text="loadingText">
-            <el-form 
-                ref="payForm" 
-                :model="orderForm" 
+            <el-form
+                ref="payForm"
+                :model="orderForm"
                 :rules="rules"
                 label-width="100px"
             >
@@ -49,7 +49,7 @@
                                 </div>
                                 <div class="info-item">
                                     <span class="label">可用余额:</span>
-                                    <span class="value balance">¥{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance }}</span>
+                                    <span class="value balance">¥{{ appUserInfo.rechargeBalance + appUserInfo.giveBalance + appUserInfo.welfareBalance  }}</span>
                                 </div>
                             </div>
                         </el-card>
@@ -264,7 +264,7 @@
 
         <!-- 修改支付状态弹窗的位置和样式 -->
         <div class="payment-status-container">
-            <pay-status-popup 
+            <pay-status-popup
                 ref="payStatusPopup"
                 :hide-pointer="false"
                 :hide-user="false"
@@ -341,7 +341,7 @@ export default {
                     }
                 ],
                 cashDeductAmount: [
-                    { 
+                    {
                         validator: (rule, value, callback) => {
                             if (value && value > this.calculateTotalPrice()) {
                                 callback(new Error('抵扣金额不能大于订单金额'));
@@ -742,20 +742,20 @@ export default {
                     params.orderClothItemDTOS.forEach(item => {
                         item.clothItemName = item.name;
                     });
-                    
+
                     params.orderCouponDTOS = this.selectCoupons.concat();
                     params.isSpecial = params.isSpecial ? 'Y' : 'N';
                     params.payTimeType = payTimeType;
-                    
+
                     if (payTimeType === 1) {
                         params.payType = 0;
                     }
-                    
+
                     if (this.calculateTotalDiscountByActivity(this.activity, 'A3')) {
                         params.activityId = this.activity.id;
                         params.activityDiscountAmount = this.calculateTotalDiscountByActivity(this.activity, 'A4');
                     }
-                    
+
                     params.sendClothWay = this.orderForm.sendClothWay;
 
                     // 修改 loading 配置,只覆盖表单区域
@@ -771,19 +771,17 @@ export default {
                         .then(res => {
                             loading.close();
                             // 直接打开支付状态弹窗,不需要延时
+                          //0=微信,1=支付宝,2=现金,3=余额
                             if (this.orderForm.payType === '0') {
-                                this.$refs.payStatusPopup.open(3, res.data, this.appUserInfo);
+                                this.$refs.payStatusPopup.open(0, res.data, this.appUserInfo);
                             } else if (this.orderForm.payType === '2') {
-                                this.$refs.payStatusPopup.open(1, res.data);
+                                this.$refs.payStatusPopup.open(2, res.data);
                             } else if (this.orderForm.payType === '3') {
-                                if (this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance >= params.payAmount) {
-                                    this.$refs.payStatusPopup.open(1, res.data);
-                                } else {
-                                    this.$refs.payStatusPopup.open(4, { payMsg: '余额不足' });
-                                }
+                              this.$refs.payStatusPopup.open(3, res.data);
                             }
                         })
                         .catch(e => {
+                            console.log("下单异常",e);
                             loading.close();
                             this.$refs.payStatusPopup.open(4, { payMsg: e.data.msg || '支付失败' });
                         });
@@ -1111,12 +1109,12 @@ export default {
     font-weight: 600;
     height: 48px;
   }
-  
+
   /* 斑马纹 */
   .el-table__row--striped {
     background-color: #FAFAFA;
   }
-  
+
   /* 悬停效果 */
   .el-table__row:hover {
     background-color: #F5F7FA;
@@ -1128,10 +1126,10 @@ export default {
   &--primary {
     font-weight: 500;
   }
-  
+
   &--text {
     padding: 4px 8px;
-    
+
     &:hover {
       background: rgba(64,158,255,0.1);
       border-radius: 4px;

+ 55 - 55
admin-ui/src/views/order/cloth/components/PayStatusPopup.vue

@@ -3,21 +3,21 @@
  */
 <template>
     <div class="pay-status-popup">
-        <el-dialog 
-            :visible.sync="show" 
-            width="30%" 
-            :close-on-click-modal="false" 
-            :close-on-press-escape="false" 
+        <el-dialog
+            :visible.sync="show"
+            width="30%"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
             :show-close="false"
             custom-class="pay-dialog">
-            
+
             <!-- 支付成功状态 -->
             <template v-if="status === PAY_STATUS.SUCCESS">
                 <div class="status-icon">
                     <i class="el-icon-success success"></i>
                 </div>
                 <div class="status-message">支付成功</div>
-                
+
                 <!-- 打印选项 -->
                 <div class="action-buttons" v-if="!hidePointer">
                     <el-button type="primary" @click="handlePrint(PRINT_TYPE.RECEIPT)">
@@ -39,7 +39,7 @@
                     <i class="el-icon-warning warning"></i>
                 </div>
                 <div class="status-message">请支付后取衣</div>
-                
+
                 <!-- 支付金额 -->
                 <div class="payment-info">
                     <div class="info-label">需支付金额</div>
@@ -53,8 +53,8 @@
                 <div class="payment-method">
                     <div class="info-label">支付方式</div>
                     <el-radio-group v-model="payType" @change="handlePayTypeChange">
-                        <el-radio-button 
-                            v-if="!hideUser" 
+                        <el-radio-button
+                            v-if="!hideUser"
                             :label="PAY_TYPE.BALANCE">
                             余额支付
                         </el-radio-button>
@@ -65,10 +65,10 @@
 
                 <!-- 余额支付信息 -->
                 <div v-if="payType === PAY_TYPE.BALANCE && !hideUser" class="balance-info">
-                    <el-descriptions 
-                        border 
-                        direction="vertical" 
-                        :column="3" 
+                    <el-descriptions
+                        border
+                        direction="vertical"
+                        :column="3"
                         :label-style="{ width: '140px' }">
                         <el-descriptions-item label="用户">
                             {{ appUserInfo.realName }}
@@ -97,8 +97,8 @@
 
                 <!-- 操作按钮 -->
                 <div class="action-buttons">
-                    <el-button 
-                        type="primary" 
+                    <el-button
+                        type="primary"
                         :loading="paying"
                         @click="handlePay">
                         确认支付
@@ -126,7 +126,7 @@
                     <i class="el-icon-error error"></i>
                 </div>
                 <div class="status-message error-message">{{ errorMessage }}</div>
-                
+
                 <!-- 重试支付方式选择 -->
                 <div v-if="!hideUser" class="payment-method">
                     <div class="info-label">重选支付方式</div>
@@ -139,9 +139,9 @@
 
                 <!-- 操作按钮 -->
                 <div class="action-buttons">
-                    <el-button 
+                    <el-button
                         v-if="!hideUser"
-                        type="primary" 
+                        type="primary"
                         @click="handleRetry">
                         重试支付
                     </el-button>
@@ -172,7 +172,7 @@ import { PAY_STATUS, PAY_TYPE, PRINT_TYPE } from '../constants/payStatus'
 
 export default {
     name: 'PayStatusPopup',
-    
+
     props: {
         hidePointer: {
             type: Boolean,
@@ -213,7 +213,7 @@ export default {
         // 计算总余额
         calculateTotalBalance() {
             if (!this.appUserInfo) return 0
-            return this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance
+            return this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance + this.appUserInfo.welfareBalance
         },
 
         // 计算支付后余额
@@ -250,7 +250,7 @@ export default {
             this.errorMessage = ''
             this.showPaySuccessBtn = false
             this.paying = false
-            
+
             // 根据状态处理
             switch (status) {
                 case PAY_STATUS.SUCCESS:
@@ -258,20 +258,20 @@ export default {
                         this.fetchPrintData(orderInfo)
                     }
                     break
-                    
+
                 case PAY_STATUS.UNPAID:
                     this.initPayment(orderInfo, userInfo)
                     break
-                    
+
                 case PAY_STATUS.PAYING:
                     this.handlePayProcess(orderInfo, userInfo)
                     break
-                    
+
                 case PAY_STATUS.FAILED:
                     this.errorMessage = orderInfo.payMsg
                     break
             }
-            
+
             this.show = true
         },
 
@@ -281,7 +281,7 @@ export default {
         initPayment(orderInfo, userInfo) {
             this.authCode = ''
             this.appUserInfo = {}
-            
+
             if (this.hideUser) {
                 this.payType = PAY_TYPE.CASH
             } else {
@@ -331,7 +331,7 @@ export default {
         handlePayTypeChange(value) {
             this.payType = value
             this.authCode = ''
-            
+
             if (value === PAY_TYPE.SCAN) {
                 this.$nextTick(() => {
                     this.$refs.scanInput?.focus()
@@ -345,7 +345,7 @@ export default {
         async handlePay() {
             // 验证支付条件
             if (!this.validatePayment()) return
-            
+
             this.paying = true
             try {
                 const res = await clothOrderPay({
@@ -374,14 +374,14 @@ export default {
                 this.$message.warning('请先扫描付款码')
                 return false
             }
-            
+
             if (this.payType === PAY_TYPE.BALANCE) {
                 if (this.calculateTotalBalance < this.orderInfo.payAmount) {
                     this.$message.warning('余额不足')
                     return false
                 }
             }
-            
+
             return true
         },
 
@@ -394,13 +394,13 @@ export default {
                     this.status = PAY_STATUS.WAITING
                     this.startPayResultQuery()
                     break
-                    
+
                 case 101:
                 case 0: // 支付失败
                     this.status = PAY_STATUS.FAILED
                     this.errorMessage = result.payMsg
                     break
-                    
+
                 case 200: // 支付成功
                     this.status = PAY_STATUS.SUCCESS
                     this.$emit('paySuccess')
@@ -436,7 +436,7 @@ export default {
 
                 if (res) {
                     this.handlePayResult(res.data)
-                    
+
                     // 继续查询
                     if (res.data.payResult === 100) {
                         this.resultQueryCount++
@@ -502,17 +502,17 @@ export default {
 
                 LODOP.SET_PRINT_PAGESIZE(3, 580, 40, "")
                 LODOP.SET_PRINTER_INDEX(printerName)
-                
+
                 // 设置打印内容
                 let printContent = this.generateReceiptContent()
                 LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", printContent)
-                
+
                 // 直接打印
                 if (!LODOP.PRINT()) {
                     this.$message.error('打印失败')
                     return false
                 }
-                
+
                 return true
             } catch (err) {
                 console.error('打印小票出错:', err)
@@ -579,39 +579,39 @@ export default {
                         <div>${printData.shopAddress || ''}</div>
                         <div>电话:${printData.shopPhone || ''}</div>
                     </div>
-                    
+
                     <div class="divider"></div>
-                    
+
                     <div class="order-info">
                         <div>订单号:${printData.orderNo}</div>
                         <div>下单时间:${this.$parseTime(printData.createTime)}</div>
                         <div>客户:${printData.customerName}</div>
                         <div>电话:${printData.customerPhone}</div>
                     </div>
-                    
+
                     <div class="divider"></div>
-                    
+
                     <div class="cloth-list">
                         ${this.generateClothListHtml()}
                     </div>
-                    
+
                     <div class="divider"></div>
-                    
+
                     <div class="total-info">
                         <div>衣物总数:${printData.orderClothDetails?.length || 0}件</div>
                         <div>合计金额:¥${printData.totalAmount || 0}</div>
                         <div>实付金额:¥${printData.payAmount || 0}</div>
                     </div>
-                    
+
                     <div class="divider"></div>
-                    
+
                     <div>
                         <div>预计取衣时间:${this.$parseTime(printData.expectedPickTime)}</div>
                         <div>注意事项:</div>
                         <div>1. 请妥善保管此小票,取衣时请出示</div>
                         <div>2. 超过30天未取的衣物,本店不负责保管</div>
                     </div>
-                    
+
                     <div class="qrcode">
                         <!-- 这里可以添加二维码图片 -->
                     </div>
@@ -626,7 +626,7 @@ export default {
          */
         generateClothListHtml() {
             const { orderClothDetails = [] } = this.printData
-            
+
             return orderClothDetails.map((item, index) => `
                 <div class="cloth-item">
                     <div class="cloth-name">${index + 1}. ${item.clothName}</div>
@@ -661,17 +661,17 @@ export default {
 
                 LODOP.SET_PRINT_PAGESIZE(1, 800, 400, "")
                 LODOP.SET_PRINTER_INDEX(printerName)
-                
+
                 // 设置条码打印内容
                 const barcodeContent = this.generateBarcodeContent()
                 LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", barcodeContent)
-                
+
                 // 直接打印
                 if (!LODOP.PRINT()) {
                     this.$message.error('打印失败')
                     return false
                 }
-                
+
                 return true
             } catch (err) {
                 console.error('打印条码出错:', err)
@@ -713,7 +713,7 @@ export default {
                         <div>${printData.customerName} ${printData.customerPhone}</div>
                         <div>${this.$parseTime(printData.createTime)}</div>
                     </div>
-                    
+
                     <!-- 这里可以添加条码图片 -->
                 </div>
             `
@@ -809,7 +809,7 @@ export default {
     .payment-method,
     .scan-input {
         padding: 0 40px 20px;
-        
+
         .info-label {
             font-size: 14px;
             color: #606266;
@@ -822,7 +822,7 @@ export default {
             font-size: 16px;
             color: #f56c6c;
         }
-        
+
         .value {
             font-size: 24px;
             font-weight: bold;
@@ -838,11 +838,11 @@ export default {
         text-align: center;
         padding: 20px;
         border-top: 1px solid #EBEEF5;
-        
+
         .el-button {
             min-width: 120px;
             margin: 0 10px;
         }
     }
 }
-</style> 
+</style>

+ 95 - 26
admin-ui/src/views/order/cloth/orderList.vue

@@ -166,20 +166,52 @@
                 </el-col>
                 <el-col :span="24" style="margin-top: 10px">
                     <el-table :data="orderClothDetails" fit highlight-current-row border stripe>
-                        <el-table-column label="衣物条码" align="center" prop="washCode" width="180" fixed="left" />
-                        <el-table-column label="衣服名称" align="center" prop="clothItemName" width="200">
+                        <el-table-column label="衣物条码" align="center" prop="washCode" width="130" fixed="left" />
+                        <el-table-column label="衣服名称" align="center" prop="clothItemName" width="150">
                             <template slot-scope="scope">
                                 <span> {{ calculateClothName(scope.row) }}</span>
                             </template>
                         </el-table-column>
-
-                        <el-table-column label="颜色" align="center" width="150">
+                        <el-table-column label="衣物照片" align="center" width="120">
+                            <template slot-scope="scope">
+                                <div class="cloth-photos" v-if="scope.row.pics">
+                                    <el-image 
+                                        v-for="(pic, index) in scope.row.pics.split(',')" 
+                                        :key="index"
+                                        :src="pic"
+                                        :preview-src-list="scope.row.pics.split(',')"
+                                        fit="cover"
+                                        class="cloth-photo"
+                                        @click="handlePreview(scope.row.pics.split(','))"
+                                    >
+                                        <div slot="error" class="image-slot">
+                                            <i class="el-icon-picture-outline"></i>
+                                        </div>
+                                    </el-image>
+                                </div>
+                                <span v-else>暂无照片</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="颜色" align="center" width="100">
                             <template slot-scope="scope">
                                 <span v-for="(item, index) in scope.row.orderClothColors">
                                     {{ index == 0 ? item.clothColorName : ',' + item.clothColorName }}
                                 </span>
                             </template>
                         </el-table-column>
+                        <el-table-column label="状态" align="center" prop="flowStatus" width="100">
+                            <template slot-scope="scope">
+                                <dict-tag :options="dict.type.order_cloth_flow_status" :value="scope.row.flowStatus" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="附件" align="center" width="150">
+                            <template slot-scope="scope">
+                                <el-tag size="small" v-for="item in scope.row.orderClothAdjuncts" style="margin-right: 10px; margin-bottom: 2.5px; margin-top: 2.5px">
+                                    {{ item.adjunctName + '*' + item.num }}
+                                </el-tag>
+                                <el-tag v-if="!scope.row.orderClothAdjuncts">暂无</el-tag>
+                            </template>
+                        </el-table-column>
                         <el-table-column label="瑕疵" align="center" width="150">
                             <template slot-scope="scope">
                                 <span v-for="(item, index) in scope.row.orderClothFlaws">
@@ -196,26 +228,17 @@
                                 <el-tag v-if="!scope.row.orderClothCrafts">暂无</el-tag>
                             </template>
                         </el-table-column>
-
-                        <el-table-column label="附件" align="center">
-                            <template slot-scope="scope">
-                                <el-tag size="small" v-for="item in scope.row.orderClothAdjuncts" style="margin-right: 10px; margin-bottom: 2.5px; margin-top: 2.5px">
-                                    {{ item.adjunctName + '*' + item.num }}
-                                </el-tag>
-                                <el-tag v-if="!scope.row.orderClothAdjuncts">暂无</el-tag>
-                            </template>
-                        </el-table-column>
-                        <el-table-column label="洗衣速度" align="center" prop="clothSpeedName" width="150" />
-                        <el-table-column label="挂衣号" align="center">
-                            <template slot-scope="scope">
-                                <span v-if="scope.row.clothHanger">
-                                    {{ scope.row.clothHanger.name + '#' + scope.row.clothHangerCode }}
-                                </span>
-                            </template>
-                        </el-table-column>
-                        <el-table-column label="状态" align="center" prop="flowStatus" width="80">
+                        <el-table-column label="洗衣速度" align="center" prop="clothSpeedName" width="120" />
+    
+                        <el-table-column label="备注" align="center" min-width="150">
                             <template slot-scope="scope">
-                                <dict-tag :options="dict.type.order_cloth_flow_status" :value="scope.row.flowStatus" />
+                                <el-tooltip 
+                                    :content="scope.row.remark" 
+                                    placement="top" 
+                                    :disabled="!scope.row.remark || scope.row.remark.length <= 20"
+                                >
+                                    <span class="remark-text">{{ scope.row.remark || '暂无备注' }}</span>
+                                </el-tooltip>
                             </template>
                         </el-table-column>
                     </el-table>
@@ -390,12 +413,12 @@ export default {
             this.title = '添加洗衣订单衣服明细'
         },
         /** 详情按钮 */
-        handleDetail(scope) {
+        handleDetail(row) {
             console.log('handleDetail')
             this.reset()
             this.orderClothDetails = []
-            this.orderDetail = scope.row
-            listOrderClothItem({ pageSize: 99999, pageNum: 1, orderNo: scope.row.orderNo }).then((res) => {
+            this.orderDetail = row
+            listOrderClothItem({ pageSize: 99999, pageNum: 1, orderNo: row.orderNo }).then((res) => {
                 this.orderClothDetails = res.rows
                 this.title = '订单详情'
                 this.open = true
@@ -590,6 +613,9 @@ export default {
             } else if (command === 'close') {
                 this.handleClose(row)
             }
+        },
+        handlePreview(images) {
+            // 图片预览功能由 el-image 组件的 preview-src-list 属性自动处理
         }
     }
 }
@@ -713,6 +739,49 @@ export default {
             font-size: 14px;
         }
     }
+
+    .cloth-photos {
+        display: flex;
+        gap: 8px;
+        justify-content: center;
+        flex-wrap: wrap;
+        padding: 5px;
+
+        .cloth-photo {
+            width: 60px;
+            height: 60px;
+            border-radius: 4px;
+            cursor: pointer;
+            transition: all 0.3s;
+            border: 1px solid #ebeef5;
+
+            &:hover {
+                transform: scale(1.05);
+                box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
+            }
+
+            .image-slot {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                width: 100%;
+                height: 100%;
+                background: #f5f7fa;
+                color: #909399;
+                font-size: 20px;
+            }
+        }
+    }
+
+    .remark-text {
+        display: inline-block;
+        max-width: 200px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        color: #606266;
+        font-size: 13px;
+    }
 }
 
 .pointer_content {

+ 34 - 5
admin-ui/src/views/order/cloth/searchCloth.vue

@@ -4,9 +4,13 @@
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
             <el-form-item prop="flowStatus">
                 <el-select v-model="queryParams.flowStatus" placeholder="请选择衣服状态" clearable>
-                    <el-option key="0" label="清洗中" value="0" />
-                    <el-option key="1" label="已上挂" value="1" />
-                    <el-option key="2" label="已取衣" value="2" />
+                    <el-option key="0" label="待入厂" value="0" />
+                  <el-option key="1" label="清洗中" value="1" />
+                    <el-option key="2" label="已检查" value="2" />
+                  <el-option key="3" label="已出厂" value="3" />
+                  <el-option key="4" label="已上挂" value="4" />
+                    <el-option key="5" label="已取衣" value="5" />
+                  <el-option key="-1" label="已取消" value="-1" />
                 </el-select>
             </el-form-item>
             <el-form-item>
@@ -44,6 +48,26 @@
             <el-table-column label="订单编号" align="center" prop="orderNo" min-width="100" fixed="left" />
             <el-table-column label="衣物条码" align="center" prop="washCode" />
             <el-table-column label="衣服名称" align="center" prop="clothItemName" />
+          <el-table-column label="衣物照片" align="center" width="120">
+            <template slot-scope="scope">
+              <div class="cloth-photos" v-if="scope.row.pics">
+                <el-image
+                  v-for="(pic, index) in scope.row.pics.split(',')"
+                  :key="index"
+                  :src="pic"
+                  :preview-src-list="scope.row.pics.split(',')"
+                  fit="cover"
+                  class="cloth-photo"
+                  @click="handlePreview(scope.row.pics.split(','))"
+                >
+                  <div slot="error" class="image-slot">
+                    <i class="el-icon-picture-outline"></i>
+                  </div>
+                </el-image>
+              </div>
+              <span v-else>暂无照片</span>
+            </template>
+          </el-table-column>
             <el-table-column label="是否重洗" align="center" prop="repeatCount">
                 <template slot-scope="scope">
                     <span v-if="scope.row.repeatCount && scope.row.repeatCount > 0" style="color: red"> 重洗 {{ scope.row.repeatCount }} 次 </span>
@@ -72,11 +96,16 @@
                     <span v-else>暂无</span>
                 </template>
             </el-table-column>
-            <el-table-column label="状态" align="center" prop="flowStatus" width="80">
+            <el-table-column label="衣服状态" align="center" prop="flowStatus" width="80">
                 <template slot-scope="scope">
                     <dict-tag :options="dict.type.order_cloth_flow_status" :value="scope.row.flowStatus" />
                 </template>
             </el-table-column>
+          <el-table-column label="订单状态" align="center" prop="flowStatus" width="80">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.cloth_order_status" :value="scope.row.orderStatus" />
+            </template>
+          </el-table-column>
             <el-table-column label="下单时间" align="center" prop="createTime" />
             <el-table-column label="取衣时间" align="center" prop="sendClothTime">
                 <template slot-scope="scope">
@@ -227,7 +256,7 @@ import { getLodop } from '@/utils/lodopUtils'
 
 export default {
     name: 'ClothItem',
-    dicts: ['sys_yes_no', 'order_cloth_flow_status', 'order_cloth_flow_action'],
+    dicts: ['sys_yes_no', 'order_cloth_flow_status', 'cloth_order_status' ,'order_cloth_flow_action'],
     data() {
         return {
             uploadAction: `${process.env.VUE_APP_BASE_API}` + '/common/uploadOSS',

+ 1 - 0
admin-ui/src/views/recharge/card/index.vue

@@ -386,6 +386,7 @@ export default {
         givePointAmount: null,
         rechargeBalance: null,
         giveBalance: null,
+        welfareBalance: null,
         pointBalance: null,
         rechargeStatus: '0',
         rechargeTime: null,

+ 48 - 17
admin-ui/src/views/statistics/overtimeOrders.vue

@@ -36,23 +36,58 @@
     </el-tabs>
 
     <Page uri="/mapi/order/clothItem/list" :request-params="queryParams" ref="pagination">
-      <el-table-column label="订单编号" align="center" prop="orderNo" min-width="200" fixed="left" />
-      <el-table-column label="衣物条码" align="center" prop="washCode" width="200" />
-      <el-table-column label="衣服名称" align="center" prop="clothItemName" width="200" />
-      <el-table-column label="颜色" align="center" width="200">
+
+      <el-table-column label="订单编号" align="center" prop="orderNo" min-width="150" fixed="left" />
+      <el-table-column label="衣物条码" align="center" prop="washCode" width="150" />
+      <el-table-column label="衣服名称" align="center" prop="clothItemName" width="150" />
+      <el-table-column label="衣物照片" align="center" width="120">
+        <template slot-scope="scope">
+          <div class="cloth-photos" v-if="scope.row.pics">
+            <el-image
+              v-for="(pic, index) in scope.row.pics.split(',')"
+              :key="index"
+              :src="pic"
+              :preview-src-list="scope.row.pics.split(',')"
+              fit="cover"
+              class="cloth-photo"
+              @click="handlePreview(scope.row.pics.split(','))"
+            >
+              <div slot="error" class="image-slot">
+                <i class="el-icon-picture-outline"></i>
+              </div>
+            </el-image>
+          </div>
+          <span v-else>暂无照片</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否重洗" align="center" prop="repeatCount" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.repeatCount && scope.row.repeatCount > 0" style="color: red"> 重洗 {{ scope.row.repeatCount }} 次 </span>
+          <span v-else> 否 </span>
+        </template>
+      </el-table-column>
+      <el-table-column label="客户信息" align="center" prop="appUserName" width="150">
+        <template slot-scope="scope">
+          <span>{{ scope.row.appUserName ? scope.row.appUserName : '--' }} </span>
+          <br />
+          <span>{{ scope.row.appUserPhoneNumber ? scope.row.appUserPhoneNumber : '' }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="颜色" align="center" width="150">
         <template slot-scope="scope">
           <template v-for="(item, index) in scope.row.orderClothColors">
             {{ index == 0 ? item.clothColorName : ',' + item.clothColorName }}
           </template>
         </template>
       </el-table-column>
-      <el-table-column label="预计取衣时间" align="center" prop="planSendClothTime" min-width="200" />
-      <el-table-column label="状态" align="center" prop="flowStatus" width="80">
+      <el-table-column label="预计取衣时间" align="center" prop="planSendClothTime" min-width="150" />
+      <el-table-column label="状态" align="center" prop="flowStatus" width="100">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.order_cloth_flow_status" :value="scope.row.flowStatus" />
         </template>
       </el-table-column>
-      <el-table-column label="挂衣号" align="center" width="200">
+      <el-table-column label="挂衣号" align="center" width="120">
         <template slot-scope="scope">
           <span v-if="scope.row.clothHanger">
             {{ scope.row.clothHanger.name + '#' + scope.row.clothHangerCode }}
@@ -60,15 +95,12 @@
           <span v-else> -- </span>
         </template>
       </el-table-column>
-      <el-table-column label="超时天数" align="center" prop="timeoutDayNum" width="100">
+      <el-table-column label="超时" align="center" prop="timeoutDayNum" width="100">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.timeoutDayNum" type="danger">{{ scope.row.timeoutDayNum }}天</el-tag>
           <span v-else>未超时</span>
         </template>
       </el-table-column>
-      <el-table-column label="客户姓名" align="center" prop="appUserName" width="150" />
-      <el-table-column label="客户手机号" align="center" prop="appUserPhoneNumber" width="150" />
-
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100">
         <template slot-scope="scope">
           <el-button type="text" icon="el-icon-view" @click="handleUpdate(scope.row)">详情</el-button>
@@ -181,6 +213,7 @@ export default {
       clothItemList: [],
       // 查询参数
       queryParams: {
+        timeoutStatus: 2,
         clothItemName: null,
         washCode: null,
         clothHangerId: null,
@@ -190,7 +223,7 @@ export default {
       createTimeRange: [],
       takeClothTimeRange: [],
       reception_info: {},
-      flowStatus: 5,
+      timeoutStatus: 2,
 
       // 弹出层标题
       title: '',
@@ -228,7 +261,7 @@ export default {
         delete this.queryParams.endTakeClothTime
       }
 
-      this.queryParams.flowStatus = this.flowStatus
+      this.queryParams.timeoutStatus = this.timeoutStatus
 
       this.$nextTick(() => {
         this.$refs.pagination.handleSearch(true)
@@ -241,16 +274,14 @@ export default {
     },
     handleClick(tab, event) {
       if (tab.index == 0) {
-        this.flowStatus = 5
+        this.timeoutStatus = 2
       } else {
-        this.flowStatus = 6
+        this.timeoutStatus = 3
       }
-
       this.handleQuery()
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1
       this.getList()
     },
     /** 重置按钮操作 */

+ 52 - 16
admin-ui/src/views/statistics/queryReception.vue

@@ -45,24 +45,57 @@
     </el-tabs>
 
     <Page uri="/mapi/order/clothItem/list" :request-params="queryParams" ref="pagination">
+      <el-table-column label="订单编号" align="center" prop="orderNo" min-width="150" fixed="left" />
+      <el-table-column label="衣物条码" align="center" prop="washCode" width="150" />
+      <el-table-column label="衣服名称" align="center" prop="clothItemName" width="150" />
+      <el-table-column label="衣物照片" align="center" width="120">
+        <template slot-scope="scope">
+          <div class="cloth-photos" v-if="scope.row.pics">
+            <el-image
+              v-for="(pic, index) in scope.row.pics.split(',')"
+              :key="index"
+              :src="pic"
+              :preview-src-list="scope.row.pics.split(',')"
+              fit="cover"
+              class="cloth-photo"
+              @click="handlePreview(scope.row.pics.split(','))"
+            >
+              <div slot="error" class="image-slot">
+                <i class="el-icon-picture-outline"></i>
+              </div>
+            </el-image>
+          </div>
+          <span v-else>暂无照片</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否重洗" align="center" prop="repeatCount" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.repeatCount && scope.row.repeatCount > 0" style="color: red"> 重洗 {{ scope.row.repeatCount }} 次 </span>
+          <span v-else> 否 </span>
+        </template>
+      </el-table-column>
+      <el-table-column label="客户信息" align="center" prop="appUserName" width="150">
+        <template slot-scope="scope">
+          <span>{{ scope.row.appUserName ? scope.row.appUserName : '--' }} </span>
+          <br />
+          <span>{{ scope.row.appUserPhoneNumber ? scope.row.appUserPhoneNumber : '' }}</span>
+        </template>
+      </el-table-column>
 
-      <el-table-column label="订单编号" align="center" prop="orderNo" min-width="200" fixed="left" />
-      <el-table-column label="衣物条码" align="center" prop="washCode" width="200" />
-      <el-table-column label="衣服名称" align="center" prop="clothItemName" width="200" />
-      <el-table-column label="颜色" align="center" width="200">
+      <el-table-column label="颜色" align="center" width="150">
         <template slot-scope="scope">
           <template v-for="(item, index) in scope.row.orderClothColors">
             {{ index == 0 ? item.clothColorName : ',' + item.clothColorName }}
           </template>
         </template>
       </el-table-column>
-      <el-table-column label="收衣时间" align="center" prop="createTime" min-width="200" />
-      <el-table-column label="状态" align="center" prop="flowStatus" width="80">
+      <el-table-column label="收衣时间" align="center" prop="createTime" min-width="150" />
+      <el-table-column label="状态" align="center" prop="flowStatus" width="100">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.order_cloth_flow_status" :value="scope.row.flowStatus" />
         </template>
       </el-table-column>
-      <el-table-column label="挂衣号" align="center" width="200">
+      <el-table-column label="挂衣号" align="center" width="120">
         <template slot-scope="scope">
           <span v-if="scope.row.clothHanger">
             {{ scope.row.clothHanger.name + '#' + scope.row.clothHangerCode }}
@@ -70,16 +103,13 @@
           <span v-else> -- </span>
         </template>
       </el-table-column>
-      <el-table-column label="超时" align="center" prop="timeoutDayNum" width="80">
+      <el-table-column label="超时" align="center" prop="timeoutDayNum" width="100">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.timeoutDayNum" type="danger">{{ scope.row.timeoutDayNum }}天</el-tag>
           <span v-else>未超时</span>
         </template>
       </el-table-column>
-      <el-table-column label="客户姓名" align="center" prop="appUserName" width="150" />
-      <el-table-column label="客户手机号" align="center" prop="appUserPhoneNumber" width="150" />
-
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="100">
         <template slot-scope="scope">
           <el-button type="text" icon="el-icon-view" @click="handleUpdate(scope.row)">详情</el-button>
         </template>
@@ -199,7 +229,8 @@ export default {
       },
       createTimeRange: [],
       reception_info: {},
-      flowStatus: 7,
+      flowStatus: null,
+      timeoutStatus: null,
 
       // 弹出层标题
       title: '',
@@ -229,6 +260,7 @@ export default {
       }
 
       this.queryParams.flowStatus = this.flowStatus
+      this.queryParams.timeoutStatus = this.timeoutStatus
 
       this.$nextTick(() => {
         this.$refs.pagination.handleSearch(true)
@@ -242,26 +274,30 @@ export default {
     handleClick(tab, event) {
       switch (tab.index) {
         case '0':
-          this.flowStatus = 7
+          this.flowStatus = ''
+          this.timeoutStatus = ''
           break
         case '1':
           this.flowStatus = 0
+          this.timeoutStatus = ''
           break
         case '2':
           this.flowStatus = 1
+          this.timeoutStatus = ''
           break
         case '3':
-          this.flowStatus = 3
+          this.timeoutStatus = 0
+          this.flowStatus = ''
           break
         default:
           this.flowStatus = 4
+          this.timeoutStatus = ''
       }
 
       this.handleQuery()
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1
       this.getList()
     },
     /** 重置按钮操作 */

+ 32 - 16
admin-ui/src/views/workbench/workAppointmentOrder/index.vue

@@ -27,15 +27,15 @@
     </el-row>
 
     <el-tabs type="border-card" v-model="virtualListStatus" @tab-click="changeOrderStatus">
-      <el-tab-pane label="待接单" :name="1"></el-tab-pane>
-      <el-tab-pane label="取衣中" :name="2"></el-tab-pane>
-      <el-tab-pane label="待支付" :name="3"></el-tab-pane>
-      <el-tab-pane label="待入厂" :name="4"></el-tab-pane>
-      <el-tab-pane label="清洗中" :name="5"></el-tab-pane>
-      <el-tab-pane label="待上挂" :name="6"></el-tab-pane>
-      <el-tab-pane label="待送衣" :name="7"></el-tab-pane>
-      <el-tab-pane label="送衣中" :name="8"></el-tab-pane>
-      <el-tab-pane label="已完成" :name="99"></el-tab-pane>
+      <el-tab-pane label="待接单" :name="'0'" ></el-tab-pane>
+      <el-tab-pane label="取衣中" :name="'1'"></el-tab-pane>
+      <el-tab-pane label="待支付" :name="'4'"></el-tab-pane>
+      <el-tab-pane label="待入厂" :name="'5'"></el-tab-pane>
+      <el-tab-pane label="清洗中" :name="'6'"></el-tab-pane>
+      <el-tab-pane label="待上挂" :name="'8'"></el-tab-pane>
+      <el-tab-pane label="待送衣" :name="'9'"></el-tab-pane>
+      <el-tab-pane label="送衣中" :name="'10'"></el-tab-pane>
+      <el-tab-pane label="已完成" :name="'12'"></el-tab-pane>
 
       <el-table v-loading="loading" fit highlight-current-row border stripe :data="clothList">
         <el-table-column label="预约单号" align="center" prop="orderNo" width="200px" />
@@ -51,19 +51,34 @@
           </template>
         </el-table-column>
         <el-table-column label="件数" align="center" prop="appointmentCount" width="80px" />
-        <el-table-column label="客户信息" align="center" prop="contactName" width="120px">
+        <el-table-column label="客户姓名" align="center" prop="contactName" width="120px">
           <template slot-scope="scope">
             <div>{{ scope.row.contactName }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="客户电话" align="center" prop="contactName" width="120px">
+          <template slot-scope="scope">
             <div>{{ scope.row.contactPhone }}</div>
           </template>
         </el-table-column>
-        <el-table-column label="地址明细" align="center" prop="address" width="220px" show-overflow-tooltip></el-table-column>
-        <el-table-column label="取衣方式" align="center" width="100px">
+        <el-table-column label="订单金额" align="center" width="120">
+          <template slot-scope="scope">
+            <span class="value">{{ scope.row.payAmount > 0 ? scope.row.payAmount : '未定价' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="订单状态" align="center" width="150">
+          <template slot-scope="scope">
+            <div class="status-group">
+              <dict-tag :options="dict.type.cloth_order_status" :value="scope.row.orderStatus" />
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="取衣方式" align="center" width="120px">
           <template slot-scope="scope">
             <dict-tag :options="dict.type.cloth_take_type" :value="scope.row.takeClothWay" />
           </template>
         </el-table-column>
-        <el-table-column label="配送方式" align="center" width="100px">
+        <el-table-column label="配送方式" align="center" width="120px">
           <template slot-scope="scope">
             <dict-tag :options="dict.type.order_cloth_delivery_way" :value="scope.row.deliveryWay" />
           </template>
@@ -84,7 +99,8 @@
             </span>
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
+        <el-table-column label="地址明细" align="center" prop="address" min-width="220px" show-overflow-tooltip></el-table-column>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
           <template slot-scope="scope">
             <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                        v-if="scope.row.orderStatus == '0' || scope.row.orderStatus == '9'">派单
@@ -365,7 +381,7 @@ export default {
     }
     return {
       orderStatus: '1',
-      virtualListStatus: 1,
+      virtualListStatus: '0',
       // 遮罩层
       loading: true,
       // 选中数组
@@ -419,7 +435,7 @@ export default {
         contactName: null,
         contactPhone: null,
         orderStatus: null,
-        virtualListStatus: null
+        virtualListStatus: '0'
       },
       // 表单参数
       form: {},

+ 46 - 156
yiqi-admin/src/main/java/com/yiqi/admin/controller/order/OrderClothItemController.java

@@ -660,119 +660,27 @@ public class OrderClothItemController extends BaseController {
     @PreAuthorize("@ss.hasPermi('order:clothItem:list')")
     @GetMapping(value = "list")
     @ApiOperation(value = "查询洗衣订单衣服明细列表")
-    public R list(OrderClothItemQueryDTO orderClothItemQueryDTO) {
-        LambdaQueryWrapper<OrderClothItem> queryWrapper = new QueryWrapper<OrderClothItem>().lambda();
-        if (SourceType.STORE.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            queryWrapper.eq(OrderClothItem::getOrgId, SecurityUtils.getLoginUser().getOrgId());
-        } else if (SourceType.FACTORY.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            queryWrapper.eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
-        } else if (orderClothItemQueryDTO.getOrgId() != null) {
-            queryWrapper.eq(OrderClothItem::getOrgId, orderClothItemQueryDTO.getOrgId());
-        }
-        if (StringUtils.isNotEmpty(orderClothItemQueryDTO.getWashCode())) {
-            queryWrapper.like(OrderClothItem::getWashCode, orderClothItemQueryDTO.getWashCode());
-        }
-        if (StringUtils.isNotEmpty(orderClothItemQueryDTO.getFlowStatus())) {
-            switch (orderClothItemQueryDTO.getFlowStatus()) {
-                case "0": {
-                    queryWrapper.and(orderClothItemLambdaQueryWrapper
-                            -> orderClothItemLambdaQueryWrapper
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode()).or()
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.inFactory.getCode()).or()
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode()).or()
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.outFactory.getCode()).or()
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.reWash.getCode()).or()
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.deleteInFactory.getCode()));
-                    break;
-                }
-                case "1": {
-                    queryWrapper.eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hangering.getCode());
-                    break;
-                }
-                case "2": {
-                    queryWrapper.eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode());
-                    break;
-                }
-                case "3"://超时
-                {
-                    queryWrapper
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.refund.getCode())
-                            .lt(OrderClothItem::getPlanSendClothTime, DateUtils.getNowDate());
-                    break;
-                }
-                case "4": {
-                    queryWrapper
-                            .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hangering.getCode())
-                            .lt(OrderClothItem::getPlanSendClothTime, DateUtils.getNowDate());
-                    break;
-                }
-                case "5"://超时3天
-                {
-                    queryWrapper
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.refund.getCode())
-                            .lt(OrderClothItem::getPlanSendClothTime, DateUtils.addDays(DateUtils.getNowDate(), -3))
-                            .ge(OrderClothItem::getPlanSendClothTime, DateUtils.addDays(DateUtils.getNowDate(), -5));
-                    break;
-                }
-                case "6"://超时5天
-                {
-                    queryWrapper
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.refund.getCode())
-                            .lt(OrderClothItem::getPlanSendClothTime, DateUtils.addDays(DateUtils.getNowDate(), -5));
-                    break;
-                }
-                case "7": {
-                    queryWrapper
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.hasTake.getCode())
-                            .ne(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.refund.getCode());
-                    break;
-                }
-                default: {
-                    throw new ServiceException("衣服状态查询不正确");
-                }
+    public TableDataInfo list(OrderClothItemQueryDTO orderClothItemQueryDTO) {
+        //1=超时,2=超时3天,3=超时5天
+        startPage();
+        if(StringUtils.isNotEmpty(orderClothItemQueryDTO.getTimeoutStatus())){
+            if(orderClothItemQueryDTO.getTimeoutStatus().equals("1")){
+                orderClothItemQueryDTO.setTimeoutStartTime(DateUtils.getNowDate());
             }
-
-        }
-        if (orderClothItemQueryDTO.getBeginCreateTime() != null) {
-            queryWrapper.ge(BaseEntity::getCreateTime, orderClothItemQueryDTO.getBeginCreateTime());
-        }
-        if (orderClothItemQueryDTO.getEndCreateTime() != null) {
-            queryWrapper.lt(BaseEntity::getCreateTime, DateUtils.addDays(orderClothItemQueryDTO.getEndCreateTime(), 1));
-        }
-        if (StringUtils.isNotEmpty(orderClothItemQueryDTO.getOrderNo())) {
-            queryWrapper.eq(OrderClothItem::getOrderNo, orderClothItemQueryDTO.getOrderNo());
-        }
-        if (StringUtils.isNotEmpty(orderClothItemQueryDTO.getAppUserPhoneNumber())) {
-            LambdaQueryWrapper<AppUser> appUserLambdaQueryWrapper = new QueryWrapper<AppUser>().lambda();
-            appUserLambdaQueryWrapper.eq(AppUser::getPhoneNumber, orderClothItemQueryDTO.getAppUserPhoneNumber());
-            AppUser appUser = appUserService.getOne(new QueryWrapper<AppUser>().lambda().eq(AppUser::getPhoneNumber, orderClothItemQueryDTO.getAppUserPhoneNumber()));
-            if (appUser == null) {
-                Page<OrderClothItemVO> orderClothItemVOPage = new Page<>();
-                orderClothItemVOPage.setRecords(new ArrayList<>());
-                orderClothItemVOPage.setTotal(0);
-                return R.ok(orderClothItemVOPage);
+            if(orderClothItemQueryDTO.getTimeoutStatus().equals("2")){
+                orderClothItemQueryDTO.setTimeoutStartTime(DateUtils.addDays(DateUtils.getNowDate(), -3));
+                orderClothItemQueryDTO.setTimeoutEndTime(DateUtils.addDays(DateUtils.getNowDate(), -5));
+            }
+            if(orderClothItemQueryDTO.getTimeoutStatus().equals("3")){
+                orderClothItemQueryDTO.setTimeoutStartTime(DateUtils.addDays(DateUtils.getNowDate(), -5));
             }
-            queryWrapper.eq(OrderClothItem::getAppUserId, appUser.getId());
-        }
-        if (StringUtils.isNotEmpty(orderClothItemQueryDTO.getClothName())) {
-            queryWrapper.like(OrderClothItem::getClothItemName, orderClothItemQueryDTO.getClothName());
         }
-//        }
-        queryWrapper.orderByDesc(BaseEntity::getCreateTime);
-        Page<OrderClothItem> page = orderClothItemService.page(
-                new Page<>(orderClothItemQueryDTO.getPageNum()
-                        , orderClothItemQueryDTO.getPageSize())
-                , queryWrapper);
-        if (page.getRecords().size() == 0) {
-            Page<OrderClothItemVO> orderClothItemVOPage = new Page<>();
-            orderClothItemVOPage.setRecords(new ArrayList<>());
-            orderClothItemVOPage.setTotal(page.getTotal());
-            return R.ok(orderClothItemVOPage);
+        List<OrderClothItemVO> orderClothItemVOList = orderClothItemService.queryClothItem(orderClothItemQueryDTO);
+
+        if (orderClothItemVOList.size() == 0) {
+            return getDataTable(orderClothItemVOList, new PageInfo(orderClothItemVOList).getTotal());
         }
-        Set<Long> orderClothItemIds = page.getRecords().stream().map(OrderClothItem::getId).collect(Collectors.toSet());
+        Set<Long> orderClothItemIds = orderClothItemVOList.stream().map(OrderClothItemVO::getId).collect(Collectors.toSet());
         Map<Long, List<OrderClothAdjunct>> orderClothAdjunctMap = orderClothAdjunctService.list(
                         new QueryWrapper<OrderClothAdjunct>().lambda().in(OrderClothAdjunct::getOrderClothId, orderClothItemIds))
                 .stream().collect(Collectors.groupingBy(OrderClothAdjunct::getOrderClothId));
@@ -788,74 +696,56 @@ public class OrderClothItemController extends BaseController {
         Map<Long, List<OrderClothType>> orderClothTypeMap = orderClothTypeService.list(
                         new QueryWrapper<OrderClothType>().lambda().in(OrderClothType::getOrderClothId, orderClothItemIds))
                 .stream().collect(Collectors.groupingBy(OrderClothType::getOrderClothId));
-        Map<Long, AppUser> appUserMap = appUserService.list(new QueryWrapper<AppUser>().lambda().in(AppUser::getId, page.getRecords().stream()
-                .map(OrderClothItem::getAppUserId).collect(Collectors.toSet()))).stream().collect(Collectors.toMap(AppUser::getId, AppUser -> AppUser));
+        Map<Long, AppUser> appUserMap = appUserService.list(new QueryWrapper<AppUser>().lambda().in(AppUser::getId, orderClothItemVOList.stream()
+                .map(OrderClothItemVO::getAppUserId).collect(Collectors.toSet()))).stream().collect(Collectors.toMap(AppUser::getId, AppUser -> AppUser));
         Map<Long, ClothHanger> clothHangerMap = new HashMap<>();
-        if (page.getRecords().stream()
+        if (orderClothItemVOList.stream()
                 .filter(orderClothItem -> orderClothItem.getClothHangerId() != null)
-                .map(OrderClothItem::getClothHangerId)
+                .map(OrderClothItemVO::getClothHangerId)
                 .collect(Collectors.toSet()).size() > 0) {
             clothHangerMap = clothHangerService.list(new QueryWrapper<ClothHanger>().lambda()
-                            .in(ClothHanger::getId, page.getRecords().stream()
+                            .in(ClothHanger::getId, orderClothItemVOList.stream()
                                     .filter(orderClothItem -> orderClothItem.getClothHangerId() != null)
-                                    .map(OrderClothItem::getClothHangerId)
+                                    .map(OrderClothItemVO::getClothHangerId)
                                     .collect(Collectors.toSet()))).stream()
                     .collect(Collectors.toMap(ClothHanger::getId, ClothHanger -> ClothHanger));
         }
+        Map<Long, SysOrg> storeOrgMap = new HashMap<>();
+        Map<Long, SysOrg> factoryOrgMap = new HashMap<>();
+        if (orderClothItemVOList.stream().filter(orderCloth -> SourceType.STORE.getCode()
+                .equals(orderCloth.getSourceType())).collect(Collectors.toList()).size() > 0) {
+            storeOrgMap = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSourceType
+                            , SourceType.STORE.getCode()).in(SysOrg::getId, orderClothItemVOList.stream()
+                            .map(OrderClothItemVO::getOrgId).collect(Collectors.toSet()))).stream()
+                    .collect(Collectors.toMap(SysOrg::getId, SysOrg -> SysOrg));
+        }
         List<OrderClothItemVO> orderClothItemVOS = new ArrayList<>();
-        for (OrderClothItem record : page.getRecords()) {
-            OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
-            BeanUtils.copyProperties(record, orderClothItemVO);
-            orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctMap.get(record.getId()));
-            orderClothItemVO.setOrderClothColors(orderClothColorMap.get(record.getId()));
-            orderClothItemVO.setOrderClothCrafts(orderClothCraftMap.get(record.getId()));
-            orderClothItemVO.setOrderClothFlaws(orderClothFlawMap.get(record.getId()));
-            orderClothItemVO.setOrderClothTypes(orderClothTypeMap.get(record.getId()));
-            AppUser appUser = appUserMap.get(record.getAppUserId());
+        for (OrderClothItemVO orderClothItemVO : orderClothItemVOList) {
+            orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctMap.get(orderClothItemVO.getId()));
+            orderClothItemVO.setOrderClothColors(orderClothColorMap.get(orderClothItemVO.getId()));
+            orderClothItemVO.setOrderClothCrafts(orderClothCraftMap.get(orderClothItemVO.getId()));
+            orderClothItemVO.setOrderClothFlaws(orderClothFlawMap.get(orderClothItemVO.getId()));
+            orderClothItemVO.setOrderClothTypes(orderClothTypeMap.get(orderClothItemVO.getId()));
+            AppUser appUser = appUserMap.get(orderClothItemVO.getAppUserId());
             orderClothItemVO.setAppUserName(appUser != null ? appUser.getRealName() : "--");
             orderClothItemVO.setAppUserPhoneNumber(appUser != null ? appUser.getPhoneNumber() : "--");
             if (clothHangerMap.containsKey(orderClothItemVO.getClothHangerId())) {
                 orderClothItemVO.setClothHanger(clothHangerMap.get(orderClothItemVO.getClothHangerId()));
             }
-            if (record.getPlanSendClothTime().getTime() < DateUtils.getNowDate().getTime()) {
+            if (orderClothItemVO.getPlanSendClothTime().getTime() < DateUtils.getNowDate().getTime()) {
                 orderClothItemVO.setTimeoutDayNum((DateUtils.getNowDate().getTime()
-                        - record.getPlanSendClothTime().getTime()) / (24 * 3600 * 1000) + 1);
+                        - orderClothItemVO.getPlanSendClothTime().getTime()) / (24 * 3600 * 1000) + 1);
             }
-            orderClothItemVOS.add(orderClothItemVO);
-        }
-
-        //如果为总部或工厂查询,需要带上组织信息返回
-        if (SourceType.MANAGER.getCode().equals(SecurityUtils.getLoginUser().getSourceType()) ||
-                SourceType.FACTORY.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
-            Map<Long, SysOrg> storeOrgMap = new HashMap<>();
-            Map<Long, SysOrg> factoryOrgMap = new HashMap<>();
-            if (page.getRecords().stream().filter(orderCloth -> SourceType.STORE.getCode()
-                    .equals(orderCloth.getSourceType())).collect(Collectors.toList()).size() > 0) {
-                storeOrgMap = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSourceType
-                                , SourceType.STORE.getCode()).in(SysOrg::getId, page.getRecords().stream()
-                                .map(OrderClothItem::getOrgId).collect(Collectors.toSet()))).stream()
-                        .collect(Collectors.toMap(SysOrg::getId, SysOrg -> SysOrg));
-            }
-            if (page.getRecords().stream().filter(orderCloth -> SourceType.FACTORY.getCode()
-                    .equals(orderCloth.getSourceType())).collect(Collectors.toList()).size() > 0) {
-                factoryOrgMap = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSourceType
-                                , SourceType.FACTORY.getCode()).in(SysOrg::getId, page.getRecords().stream()
-                                .map(OrderClothItem::getOrgId).collect(Collectors.toSet()))).stream()
-                        .collect(Collectors.toMap(SysOrg::getId, SysOrg -> SysOrg));
-            }
-            for (OrderClothItemVO orderClothItemVO : orderClothItemVOS) {
+            //如果为总部或工厂查询,需要带上组织信息返回
+            if (SourceType.MANAGER.getCode().equals(SecurityUtils.getLoginUser().getSourceType()) ||
+                    SourceType.FACTORY.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
                 if (SourceType.STORE.getCode().equals(orderClothItemVO.getSourceType())) {
                     orderClothItemVO.setSysOrg(storeOrgMap.get(orderClothItemVO.getOrgId()));
-                } else if (SourceType.FACTORY.getCode().equals(orderClothItemVO.getSourceType())) {
-                    orderClothItemVO.setSysOrg(factoryOrgMap.get(orderClothItemVO.getOrgId()));
                 }
             }
+            orderClothItemVOS.add(orderClothItemVO);
         }
-
-        Page<OrderClothItemVO> orderClothItemVOPage = new Page<>();
-        orderClothItemVOPage.setRecords(orderClothItemVOS);
-        orderClothItemVOPage.setTotal(page.getTotal());
-        return R.page(orderClothItemVOPage);
+        return getDataTable(orderClothItemVOS, new PageInfo(orderClothItemVOList).getTotal());
     }
 
     /**

+ 34 - 1
yiqi-common/src/main/java/com/yiqi/order/domain/dto/OrderClothItemQueryDTO.java

@@ -6,14 +6,47 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 @Data
-public class OrderClothItemQueryDTO extends PageVO {
+public class OrderClothItemQueryDTO implements Serializable {
 
     @ApiModelProperty("衣服状态(0=清洗中,1=上挂,2=已完成,3=超时,4=未取,5=超时3天,6=超时5天)")
     private String flowStatus;
 
+    /**
+     * 订单状态(0=待支付,1=待取衣,2=待取衣,3=已完成,4=已
+     *
+     * **/
+    private String orderStatus;
+
+    /**
+     * 超时状态 (1 超时  2 超时3天 3:超时5天)
+     */
+    private String timeoutStatus;
+
+    /**
+     * 门店ID
+     */
+    private Long storeId;
+
+    /**
+     * 工厂ID
+     */
+    private Long factoryId;
+
+    /**
+     * 取衣超时天数
+     */
+    private Date timeoutStartTime;
+
+    /**
+     * 取衣超时天数
+     */
+    private Date timeoutEndTime;
+
     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     @ApiModelProperty("开始时间")
     private Date beginCreateTime;

+ 6 - 0
yiqi-common/src/main/java/com/yiqi/order/domain/vo/OrderClothAppointmentVO.java

@@ -8,6 +8,7 @@ import com.yiqi.order.domain.OrderClothAddress;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @Data
@@ -119,6 +120,11 @@ public class OrderClothAppointmentVO {
     private String sendClothWay;
 
 
+    @Excel(name = "支付金额")
+    @ApiModelProperty("支付金额")
+    private BigDecimal payAmount;
+
+
     @ApiModelProperty("组织ID")
     private Long orgId;
 

+ 7 - 0
yiqi-common/src/main/java/com/yiqi/order/domain/vo/OrderClothItemVO.java

@@ -53,6 +53,13 @@ public class OrderClothItemVO extends BaseEntity {
     @ApiModelProperty("订单编号")
     private String orderNo;
 
+    /**
+     * 订单状态
+     */
+    @Excel(name = "订单状态")
+    @ApiModelProperty("订单状态")
+    private String orderStatus;
+
     /**
      * 门店/工厂ID
      */

+ 16 - 0
yiqi-common/src/main/java/com/yiqi/order/service/IOrderClothItemService.java

@@ -103,4 +103,20 @@ public interface IOrderClothItemService extends IService<OrderClothItem> {
     List<FactoryStatisticsDetailQueryVO> listFinancialStatisticsByFactoryOperateDetail(FactoryStatisticsDetailQueryDTO factoryStatisticsDetailQueryDTO);
 
     int countFinancialStatisticsByFactoryOperateDetail(FactoryStatisticsDetailQueryDTO factoryStatisticsDetailQueryDTO);
+
+    /**
+     * 查询洗衣订单 clothesItem
+     *
+     * @param orderClothItemQueryDTO
+     * @return
+     */
+    List<OrderClothItemVO> queryClothItem(OrderClothItemQueryDTO orderClothItemQueryDTO);
+
+    /**
+     * 修改所有 clothesItem 状态
+     *
+     * @param clothOrderId
+     * @param flawStatus
+     */
+    void updateAllClothItemStatusByOrderId(Long clothOrderId, String flawStatus);
 }

+ 16 - 0
yiqi-core/src/main/java/com/yiqi/order/mapper/OrderClothItemMapper.java

@@ -7,6 +7,7 @@ import com.yiqi.order.domain.dto.FactoryStatisticsDetailQueryDTO;
 import com.yiqi.order.domain.dto.FactoryStatisticsQueryDTO;
 import com.yiqi.order.domain.OrderClothItem;
 import com.yiqi.order.domain.dto.FactoryOrderFinancialDayQueryDTO;
+import com.yiqi.order.domain.dto.OrderClothItemQueryDTO;
 import com.yiqi.order.domain.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -101,4 +102,19 @@ public interface OrderClothItemMapper extends BaseMapper<OrderClothItem> {
     int countFinancialStatisticsByFactoryOperateDetail(@Param("factoryStatisticsDetailQueryDTO") FactoryStatisticsDetailQueryDTO factoryStatisticsDetailQueryDTO,
                                                        @Param("factoryId") Long orgId);
 
+    /**
+     * 查询订单 clothes item
+     *
+     * @param orderClothItemQueryDTO
+     * @return
+     */
+    List<OrderClothItemVO> queryClothItem(OrderClothItemQueryDTO orderClothItemQueryDTO);
+
+    /**
+     * 修改订单 clothes item
+     *
+     * @param orderClothItem
+     * @return
+     */
+    int updateAllClothItemStatusByOrderId(@Param("clothOrderId") Long clothOrderId, @Param("flawStatus") String flawStatus);
 }

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

@@ -339,5 +339,15 @@ public class OrderClothItemServiceImpl extends ServiceImpl<OrderClothItemMapper,
         return baseMapper.countFinancialStatisticsByFactoryOperateDetail(factoryStatisticsDetailQueryDTO, SecurityUtils.getLoginUser().getOrgId());
     }
 
+    @Override
+    public List<OrderClothItemVO> queryClothItem(OrderClothItemQueryDTO orderClothItemQueryDTO) {
+        return baseMapper.queryClothItem(orderClothItemQueryDTO);
+    }
+
+    @Override
+    public void updateAllClothItemStatusByOrderId(Long clothOrderId, String flawStatus) {
+        baseMapper.updateAllClothItemStatusByOrderId(clothOrderId, flawStatus);
+    }
+
 
 }

+ 19 - 35
yiqi-core/src/main/java/com/yiqi/order/service/impl/OrderClothServiceImpl.java

@@ -164,6 +164,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         return paySuccess(orderCloth);
     }
 
+    @Transactional(rollbackFor = Exception.class)
     public R paySuccess(OrderCloth orderCloth) {
         //查询订单
         if (ClothOrderPayTimeType.take_cloth_pay.getCode().equals(orderCloth.getPayTimeType())) {//收衣付款
@@ -175,6 +176,13 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
         orderCloth.setPayStatus(PayStatus.HAS_PAY.getCode());
         orderCloth.setPayTime(DateUtils.getNowDate());
         updateById(orderCloth);
+        //更新衣服状态
+        if (ClothOrderPayTimeType.take_cloth_pay.getCode().equals(orderCloth.getPayTimeType())) {
+            //收衣付款,更新衣服状态为待入厂
+            orderClothItemService.updateAllClothItemStatusByOrderId(orderCloth.getId(), ClothOrderFlowStatus.waitingForWash.getCode());
+        } else {
+            //取衣付款
+        }
         return R.ok();
     }
 
@@ -356,7 +364,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
 
         //取衣时再付款,直接配置订单状态为清洗中
         if (ClothOrderPayTimeType.send_cloth_pay.getCode().equals(orderClothDTO.getPayTimeType())) {
-            orderCloth.setOrderStatus(ClothOrderStatusType.WASHING.getCode());
+            orderCloth.setOrderStatus(ClothOrderStatusType.WAIT_FACTORY.getCode());
         } else {
             orderCloth.setOrderStatus(ClothOrderStatusType.WAITING_FOR_PAY.getCode());
         }
@@ -621,7 +629,7 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
     private void buildOrderTotalPrice(OrderCloth orderCloth, List<OrderClothItem> orderClothItems) {
         BigDecimal totalPrice = BigDecimal.ZERO;
         for (OrderClothItem orderClothItem : orderClothItems) {
-            totalPrice = totalPrice.add(orderClothItem.getTotalPrice());
+            totalPrice = CurrencyUtil.add(totalPrice, orderClothItem.getTotalPrice());
         }
 
         int freeDeliveryNum = 0;//免费的配送次数
@@ -723,7 +731,12 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
             orderClothItem.setClothBrandId(orderClothItemDTO.getClothBrandId());
             orderClothItem.setClothBrandName(orderClothItemDTO.getClothBrandName());
             orderClothItem.setClothSpeedId(orderClothItemDTO.getClothSpeedId());
-            orderClothItem.setFlowStatus(ClothOrderFlowStatus.waitingForWash.getCode());
+            //如果是取衣款,则直接赋值待入厂,否则不赋值,支付成功后设置
+            if (ClothOrderPayTimeType.send_cloth_pay.getCode().equals(orderCloth.getPayTimeType())) {
+                orderClothItem.setFlowStatus(ClothOrderFlowStatus.waitingForWash.getCode());
+            } else {
+                orderClothItem.setFlowStatus(null);
+            }
             orderClothItem.setClothSpeedName(clothSpeedMap.get(orderClothItemDTO.getClothSpeedId()).getName());
             orderClothItem.setClothMultiple(clothSpeedMap.get(orderClothItemDTO.getClothSpeedId()).getMultiple());
             orderClothItem.setClothWashDayNum(clothSpeedMap.get(orderClothItemDTO.getClothSpeedId()).getDayNum());
@@ -1047,49 +1060,20 @@ public class OrderClothServiceImpl extends ServiceImpl<OrderClothMapper, OrderCl
          */
         switch (orderAppointmentDTO2.getVirtualListStatus()) {
             case 1:
-                // 待接单
-                orderStatus = new Integer[]{0};
-                break;
-            case 2:
                 // 取衣中
                 orderStatus = new Integer[]{1, 2, 3};
                 break;
-            case 3:
-                // 待支付
-                orderStatus = new Integer[]{4};
-                break;
-            case 4:
-                // 待入厂
-                orderStatus = new Integer[]{5};
-                break;
-            case 5:
+            case 6:
                 // 清洗中
                 orderStatus = new Integer[]{6, 7};
                 break;
-            case 6:
-                // 待上挂
-                orderStatus = new Integer[]{8};
-                break;
-            case 7:
-                // 待送衣
-                orderStatus = new Integer[]{9};
-                orderAppointmentDTO2.setTakeClothWay("1");
-                break;
-            case 8:
-                // 送衣中
-                orderStatus = new Integer[]{10};
-                orderAppointmentDTO2.setSendClothWay("1");
-                break;
-            case 99:
+            case 12:
                 // 已完成
                 orderStatus = new Integer[]{11, 12};
                 orderAppointmentDTO2.setSendClothWay("1");
                 break;
-            case 100:
-                orderStatus = new Integer[]{100};
-                break;
             default:
-                orderStatus = new Integer[]{0};
+                orderStatus = new Integer[]{orderAppointmentDTO2.getVirtualListStatus()};
                 break;
         }
         orderAppointmentDTO2.setQueryOrderStatus(Arrays.asList(orderStatus));

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

@@ -424,6 +424,7 @@
         where id = #{orderClothItemId}
 </update>
 
+
     <delete id="deleteOrderClothItemById" parameterType="Long">
             delete from order_cloth_item where id = #{id}
         </delete>
@@ -441,16 +442,16 @@
         ,not_take_count.count as not_take_count from
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status in ('0','1','2','3','4','100','101'))  as all_count,
+        and flow_status is not null)  as all_count,
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status in ('0','1','2','3','100','101'))  as washing_count,
+        and flow_status in ('0','1','2','3','12'))  as washing_count,
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status='04')  as hanger_count,
+        and flow_status='4')  as hanger_count,
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status in ('0','1','2','3','4','100','101')
+        and flow_status in ('0','1','2','3','4','11','12')
         and plan_send_cloth_time&lt;now()) as timeout_count,
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
@@ -464,11 +465,11 @@
         five_day_timeout_count.count as five_day_timeout_count from
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status in ('0','1','2','3','4','100','101')
+        and flow_status in ('0','1','2','3','4','11','12')
         and plan_send_cloth_time&lt;#{threeTimeoutDay} and plan_send_cloth_time&gt;=#{fiveTimeoutDay}) as three_day_timeout_count,
         (select count(1) as count from order_cloth_item
         where org_id=#{orgId} and source_type=#{sourceType}
-        and flow_status in ('0','1','2','3','4','100','101')
+        and flow_status in ('0','1','2','3','4','11','12')
         and plan_send_cloth_time&lt;#{fiveTimeoutDay}) as five_day_timeout_count
     </select>
     <select id="listFinancialStatisticsByFactoryWithToday"
@@ -559,4 +560,63 @@
             and oci.org_id = #{factoryStatisticsDetailQueryDTO.orgId}
         </if>
     </select>
+
+    <select id="queryClothItem" resultType="com.yiqi.order.domain.vo.OrderClothItemVO"
+            parameterType="com.yiqi.order.domain.dto.OrderClothItemQueryDTO">
+        select item.*, cl.order_status, cl.pay_status, cl.contact_name, cl.contact_phone  from order_cloth_item item left join order_cloth cl on item.order_id = cl.id
+        where 1 = 1
+        <if test="orderNo != null and orderNo != ''">
+            and cl.order_no = #{orderNo}
+        </if>
+        <if test="hangerCode != null and hangerCode != ''">
+            and item.hanger_code = #{hangerCode}
+        </if>
+        <if test="storeId != null">
+            and cl.org_id = #{storeId}
+        </if>
+        <if test="factoryId != null">
+            and cl.factory_id = #{factoryId}
+        </if>
+        <if test="appUserName != null and appUserName != ''">
+            and cl.app_user_name = #{appUserName}
+        </if>
+        <if test="appUserPhoneNumber != null and appUserPhoneNumber != ''">
+            and cl.app_user_phone_number = #{appUserPhoneNumber}
+        </if>
+        <if test="washCode != null and washCode != ''">
+            and item.wash_code = #{washCode}
+        </if>
+        <if test="clothName != null and clothName != ''">
+            and item.cloth_item_name like concat('%',#{clothName},'%')
+        </if>
+        <if test="beginCreateTime !=null">
+            and cl.create_time  between #{beginCreateTime} and #{endCreateTime}
+        </if>
+        <if test="beginTakeClothTime !=null">
+            and cl.take_cloth_time  between #{beginTakeClothTime} and #{endTakeClothTime}
+        </if>
+        <if test="flowStatus != null">
+            and item.flow_status = #{flowStatus}
+        </if>
+        <if test="orderStatus != null">
+            and cl.order_status = #{orderStatus}
+        </if>
+          <if test="timeoutStartTime !=null">
+              and item.plan_send_cloth_time &lt;= #{timeoutStartTime} and item.flow_status in ('0','1','2','3','4','11','12')
+          </if>
+        <if test="timeoutEndTime !=null">
+            and item.plan_send_cloth_time >= #{timeoutEndTime} and item.flow_status in ('0','1','2','3','4','11','12')
+        </if>
+        <!-- 考虑性能最多只能查询半年一年的数据
+#         and cl.create_time >= date_sub(now(), interval 180 day)
+#         and cl.order_status >= 5
+        -->
+        order by item.id desc
+    </select>
+
+    <update id="updateAllClothItemStatusByOrderId">
+        update order_cloth_item
+        set flow_status = #{flowStatus}
+        where order_id = #{clothOrderId}
+    </update>
 </mapper>

+ 5 - 8
yiqi-core/src/main/resources/mapper/order/OrderClothMapper.xml

@@ -236,23 +236,20 @@
     </select>
 
     <select id="getAppointmentClothOrderList" resultType="com.yiqi.order.domain.vo.OrderClothAppointmentVO">
-        select o.order_no as orderNo, o.appointment_time as appointmentTime, o.appointment_count as appointmentCount, o.pay_status as payStatus,
-        o.take_cloth_app_user_id as takeClothAppUserId, o.order_status AS orderStatus,
-        a.user_address as address, o.take_cloth_way as takeClothWay, o.send_cloth_way AS sendClothWay,
-        o.is_disassembly_and_assembly as isDisassemblyAndAssembly, o.is_large_item as isLargeItem, b.real_name as takeClothAppUserName,
+        select o.*,
+        a.user_address as address,  b.real_name as takeClothAppUserName,
         a.user_name as contactName, a.user_phone as contactPhone, b.phone_number as takeClothAppUserPhone
-        ,o.org_id as orgId,o.source_type as sourceType,org.name as orgName,a.delivery_way as deliveryWay
+        ,a.delivery_way as deliveryWay
         from order_cloth o
         left join app_user b on o.take_cloth_app_user_id = b.id
         left join order_delivery a on a.order_sn=o.order_no
         <if test="takeClothWay != null  and takeClothWay == '1'.toString()">
-            and a.cloth_order_type=0
+            and a.cloth_order_type = 0
         </if>
         <if test="sendClothWay != null  and sendClothWay == '1'.toString()">
             and a.cloth_order_type=1
         </if>
-        left join sys_org as org on org.id=o.org_id and org.source_type=o.source_type and org.id is not null
-        where o.del_flag='0' and o.is_appointment = 'Y' and o.order_status != '100'
+        where o.del_flag='0' and o.is_appointment = 'Y' and o.order_status >= 0
         <if test="orderType != null  and orderType != ''">
             and o.order_type=#{orderType}
         </if>