Explorar el Código

金牛订单导出

ct hace 3 días
padre
commit
58eab322c9

+ 3 - 3
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -194,9 +194,9 @@ public class FsStoreOrderController extends BaseController
     @GetMapping("/orderExport")
     public AjaxResult orderExport(FsStoreOrderParam param) {
         Integer exportType1 = exportTaskService.isExportType1(SecurityUtils.getUserId());
-        if (exportType1>0){
-            return AjaxResult.error("你已经有正在导出的任务");
-        }
+//        if (exportType1>0){
+//            return AjaxResult.error("你已经有正在导出的任务");
+//        }
         if (fsStoreOrderService.isEntityNull(param)){
             return AjaxResult.error("请筛选数据导出");
         }

+ 17 - 2
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -677,7 +677,14 @@ public interface FsStoreOrderMapper
             "            <if test=\"maps.userPhone != null  and maps.userPhone != ''\"> and so.user_phone = #{maps.userPhone}</if>\n" +
             "            <if test=\"maps.totalNum != null  and maps.totalNum != ''\"> and so.total_num = #{maps.totalNum}</if>\n" +
             "            <if test=\"maps.totalPrice != null \"> and so.total_price = #{maps.totalPrice}</if>\n" +
-            "            <if test=\"maps.status != null \"> and so.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.status != null and maps.status != 6\"> and so.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.status == 6\">\n" +
+            "                and so.`status`= 2\n" +
+            "                and (\n" +
+            "                so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)\n" +
+            "                )\n" +
+            "                and  (so.extend_order_id is null or  so.extend_order_id like '')\n" +
+            "            </if>" +
             "            <if test=\"maps.refundStatus != null  and maps.refundStatus != ''\"> and so.refund_status = #{maps.refundStatus}</if>\n" +
             "            <if test=\"maps.refundExplain != null  and maps.refundExplain != ''\"> and so.refund_explain = #{maps.refundExplain}</if>\n" +
             "            <if test=\"maps.deliverySn != null  and maps.deliverySn != ''\"> and so.delivery_sn = #{maps.deliverySn}</if>\n" +
@@ -978,7 +985,15 @@ public interface FsStoreOrderMapper
             "            <if test=\"maps.userPhone != null  and maps.userPhone != ''\"> and so.user_phone = #{maps.userPhone}</if>\n" +
             "            <if test=\"maps.totalNum != null  and maps.totalNum != ''\"> and so.total_num = #{maps.totalNum}</if>\n" +
             "            <if test=\"maps.totalPrice != null \"> and so.total_price = #{maps.totalPrice}</if>\n" +
-            "            <if test=\"maps.status != null \"> and so.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.status != null and maps.status != 6\"> and so.status = #{maps.status}</if>\n" +
+            "            <if test=\"maps.status == 6\">\n" +
+            "                and so.`status`= 2\n" +
+            "                and (\n" +
+            "                so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)\n" +
+            "                )\n" +
+            "                and  (so.extend_order_id is null or  so.extend_order_id like '')\n" +
+            "            </if>" +
+
             "            <if test=\"maps.refundStatus != null  and maps.refundStatus != ''\"> and so.refund_status = #{maps.refundStatus}</if>\n" +
             "            <if test=\"maps.refundExplain != null  and maps.refundExplain != ''\"> and so.refund_explain = #{maps.refundExplain}</if>\n" +
             "            <if test=\"maps.deliverySn != null  and maps.deliverySn != ''\"> and so.delivery_sn = #{maps.deliverySn}</if>\n" +

+ 7 - 3
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -340,10 +340,14 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             Integer status = fsStoreOrder.getStatus();
             if (status == null){
                 status = oldOrder.getStatus();
+            } else if (status.equals(FsStoreOrderStatusEnum.STATUS_6.getValue())){
+                status = oldOrder.getStatus();
             }
-            if (Objects.equals(FsStoreOrderStatusEnum.STATUS_1.getValue(), status) || Objects.equals(FsStoreOrderStatusEnum.STATUS_6.getValue(), status)) {
-                fsStoreOrder.setUserAddress(StringUtils.isNotBlank(userAddress)?null:userAddress);
-                fsStoreOrder.setUserPhone(StringUtils.isNotBlank(userPhone)?null:userPhone);
+            if (Objects.equals(FsStoreOrderStatusEnum.STATUS_1.getValue(), status) ||
+                    (Objects.equals(FsStoreOrderStatusEnum.STATUS_2.getValue(), status) && StringUtils.isBlank(oldOrder.getExtendOrderId()))
+                ) {
+                fsStoreOrder.setUserAddress(StringUtils.isBlank(userAddress)?null:userAddress);
+                fsStoreOrder.setUserPhone(StringUtils.isBlank(userPhone)?null:userPhone);
             } else {
                 return R.error("该订单状态不支持修改收货地址/电话");
             }