瀏覽代碼

1.转移逻辑修改
2.品牌导入唯一简码校验去除
3.取货码页面(非收银端)修改

zcb 4 年之前
父節點
當前提交
3b3443a982
共有 20 個文件被更改,包括 413 次插入131 次删除
  1. 25 3
      kmall-admin/src/main/java/com/kmall/admin/controller/ExportExcelController.java
  2. 23 23
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  3. 28 1
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreTransferInventoryOrderController.java
  4. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/kmall2oms/KtoOmsController.java
  5. 0 3
      kmall-admin/src/main/java/com/kmall/admin/controller/oms2kmall/Oms2KmallController.java
  6. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java
  7. 1 1
      kmall-admin/src/main/java/com/kmall/admin/entity/StoreTransferInventoryOrderEntity.java
  8. 4 0
      kmall-admin/src/main/java/com/kmall/admin/service/StoreTransferInventoryOrderService.java
  9. 25 25
      kmall-admin/src/main/java/com/kmall/admin/service/impl/BrandServiceImpl.java
  10. 23 23
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  11. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreTransferInventoryOrderServiceImpl.java
  12. 9 9
      kmall-admin/src/main/java/com/kmall/admin/service/impl/oms2kmall/Oms2KmallServiceImpl.java
  13. 24 0
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  14. 76 21
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  15. 11 9
      kmall-admin/src/main/webapp/WEB-INF/page/pcd/hbk6zzez.html
  16. 5 3
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storetransferinventoryorder.html
  17. 2 2
      kmall-admin/src/main/webapp/js/sale/sale.js
  18. 1 0
      kmall-admin/src/main/webapp/js/shop/offilineOrderList.js
  19. 78 4
      kmall-admin/src/main/webapp/js/shop/storetransferinventoryorder.js
  20. 3 3
      kmall-manager/src/main/resources/conf/oms-merch.properties

+ 25 - 3
kmall-admin/src/main/java/com/kmall/admin/controller/ExportExcelController.java

@@ -3,8 +3,10 @@ package com.kmall.admin.controller;
 import com.kmall.admin.dto.ExportExcelDto;
 import com.kmall.admin.dto.TaxDetailDto;
 import com.kmall.admin.entity.OrderEntity;
+import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.OrderService;
 import com.kmall.admin.service.SalesDataUploadService;
+import com.kmall.admin.service.StoreService;
 import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.DateUtils;
@@ -40,6 +42,8 @@ public class ExportExcelController {
     private OrderService orderService;
     @Autowired
     private SalesDataUploadService salesDataUploadService;
+    @Autowired
+    private StoreService storeService;
 
 
 
@@ -49,6 +53,24 @@ public class ExportExcelController {
 
         // 账单日期
         String billDate = (String) params.get("billDate");
+        String storeName = "";
+        String storeId = "";
+
+        if(params.get("storeName") != null){
+            storeName = (String) params.get("storeName");
+
+            // 查询门店名称的门店id
+            Map<String,Object> param = new HashMap<>();
+            param.put("storeName",storeName);
+            List<StoreEntity> storeEntities = storeService.queryList(param);
+            if(storeEntities.size() > 1){
+                return R.error("该门店名称不唯一,请选择一个唯一的名称。门店名称:"+storeName);
+            }else if(storeEntities.size() == 1){
+                storeId = storeEntities.get(0).getId() + "";
+            }else{
+                return R.error("查询不到该名店。门店名称:"+storeName);
+            }
+        }
         params = ParamUtils.setTimeMap(params);
 
         try {
@@ -76,7 +98,7 @@ public class ExportExcelController {
         ExcelExport ee = new ExcelExport("CW保税 新零售销售额统计_"+format.format(new Date()));
 
         // ==================================第一个sheet-销售总额===============================================
-        ExportExcelDto exportExcelDto = orderService.querySumAmount(billDate,"");
+        ExportExcelDto exportExcelDto = orderService.querySumAmount(billDate,storeId);
 
 
         Map<String,String> firstSheetFirstRowValue = new HashMap<>();
@@ -108,7 +130,7 @@ public class ExportExcelController {
         // ==================================第二个sheet-销售订单金额===========================================
         String[] saleHeader = new String[]{"订单编号", "操作店员", "购买类型", "订单业务类型", "订单状态",
                 "付款状态",  "实际支付", "订单总价","下单时间", "付款时间", "退T-1日前订单金额", "T-1日前订单生成时间"};
-        Map<String,List<OrderEntity>> orderEntityListMap = orderService.querySaleOrderList(billDate,"");
+        Map<String,List<OrderEntity>> orderEntityListMap = orderService.querySaleOrderList(billDate,storeId);
         // 当期的订单
         List<OrderEntity> orderEntityList = orderEntityListMap.get("current");
         List<Map<String, Object>> list = new LinkedList<>();
@@ -174,7 +196,7 @@ public class ExportExcelController {
         String[] taxDetailHeader = new String[]{"订单编号", "门店编号", "门店名称", "商品编码", "完税总价格",
                 "进口增值税率(%)", "进口从价消费税率(%)", "应征增值税", "应征消费税", "总税额",
                 "税单接收时间","退T-1日前应征增值税","退T-1日前应征消费税","退T-1日前总税额","T-1日前生成时间"};
-        Map<String,List<TaxDetailDto>> TaxDetailEntityListMap = orderService.queryTaxDetailList(billDate,"");
+        Map<String,List<TaxDetailDto>> TaxDetailEntityListMap = orderService.queryTaxDetailList(billDate,storeId);
         List<Map<String,Object>> taxList = new LinkedList<>();
         // 获取当前税率
         List<TaxDetailDto> current = TaxDetailEntityListMap.get("current");

+ 23 - 23
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1357,29 +1357,29 @@ public class OrderController {
         if (systemFormatList != null && systemFormatList.size() > 0) {
             for (SystemFormatDto systemFormat : systemFormatList) {
 
-                // 如果有退款,获取销售时间的年月和退款时间的年月
-                if (StringUtils.isNotEmpty(systemFormat.getOutRefundNo())){
-                    Date saleDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getTimeStampDetails());
-                    Date refundDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getRefundTime());
-                    Calendar saleC = Calendar.getInstance();
-                    saleC.setTime(saleDate);
-                    Calendar refundC = Calendar.getInstance();
-                    refundC.setTime(refundDate);
-                    int saleYear = saleC.get(Calendar.YEAR);// 销售的年
-                    int refundYear = refundC.get(Calendar.YEAR);// 退款的年
-                    int saleMonth = saleC.get(Calendar.MONTH);
-                    int refundMonth = refundC.get(Calendar.MONTH);
-
-                    // 如果是同一年并且销售时间是比退款时间少的话
-                    if (saleMonth<refundMonth && saleYear==refundYear){
-                        systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
-                    }
-                    if (saleYear!= refundYear){
-                        systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
-                    }
-
-
-                }
+//                // 如果有退款,获取销售时间的年月和退款时间的年月
+//                if (StringUtils.isNotEmpty(systemFormat.getOutRefundNo())){
+//                    Date saleDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getTimeStampDetails());
+//                    Date refundDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(systemFormat.getRefundTime());
+//                    Calendar saleC = Calendar.getInstance();
+//                    saleC.setTime(saleDate);
+//                    Calendar refundC = Calendar.getInstance();
+//                    refundC.setTime(refundDate);
+//                    int saleYear = saleC.get(Calendar.YEAR);// 销售的年
+//                    int refundYear = refundC.get(Calendar.YEAR);// 退款的年
+//                    int saleMonth = saleC.get(Calendar.MONTH);
+//                    int refundMonth = refundC.get(Calendar.MONTH);
+//
+//                    // 如果是同一年并且销售时间是比退款时间少的话
+//                    if (saleMonth<refundMonth && saleYear==refundYear){
+//                        systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
+//                    }
+//                    if (saleYear!= refundYear){
+//                        systemFormat.setOrderStatus(Dict.orderStatus.item_301.getItem());
+//                    }
+//
+//
+//                }
 
 
                 LinkedHashMap<String, Object> map = new LinkedHashMap<>(32);

+ 28 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/StoreTransferInventoryOrderController.java

@@ -26,7 +26,7 @@ import java.util.Map;
  * @email admin@qhdswl.com
  * @date 2021-03-08 15:43:04
  */
-@Controller
+@RestController
 @RequestMapping("storetransferinventoryorder")
 public class StoreTransferInventoryOrderController {
     @Autowired
@@ -142,4 +142,31 @@ public class StoreTransferInventoryOrderController {
 
         return R.ok().put("list", list);
     }
+
+    @RequestMapping("/transferOutReduce/{transferOrderId}")
+    public R transferOutReduce(@PathVariable("transferOrderId") String transferOrderId){
+        try {
+            storeTransferInventoryOrderService.transferOutReduce(transferOrderId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error(e.getMessage());
+        }
+        return R.ok("转出扣减成功!");
+    }
+
+
+    @RequestMapping("/transferInIncrease/{transferOrderId}")
+    public R transferInIncrease(@PathVariable("transferOrderId") String transferOrderId){
+
+
+        try {
+            storeTransferInventoryOrderService.transferInIncrease(transferOrderId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error(e.getMessage());
+        }
+        return R.ok("转入新增成功!");
+
+    }
+
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/kmall2oms/KtoOmsController.java

@@ -129,7 +129,7 @@ public class KtoOmsController {
         sParaTemp.put("sign", sign);
         //构建Request
         String  url = omsMerchProperties.getSendTransferUrl();
-        url = "http://183.3.221.143:8680/al/shop/bdd/cb/transgoods";
+//        url = "http://183.3.221.143:8680/al/shop/bdd/cb/transgoods";
         return com.kmall.admin.utils.oms.OkHttpUtils.buildRequest(url, JSON.toJSONString(sParaTemp));
     }
 

+ 0 - 3
kmall-admin/src/main/java/com/kmall/admin/controller/oms2kmall/Oms2KmallController.java

@@ -54,10 +54,7 @@ public class Oms2KmallController {
             e.printStackTrace();
             return R.error(e.getMessage());
         }
-
         return oms2KmallService.transGoodsNotice(wayBillResponse);
-
-
     }
 
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java

@@ -32,4 +32,6 @@ public interface BrandDao extends BaseDao<BrandEntity> {
     List<BrandEntity> queryExportList(Map<String, Object> params);
 
     BrandEntity queryByUniqueIdentifier(@Param("uniqueIdentifier") String uniqueIdentifier);
+
+    BrandEntity queryByName(@Param("brandName") String brandName);
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/entity/StoreTransferInventoryOrderEntity.java

@@ -43,7 +43,7 @@ public class StoreTransferInventoryOrderEntity implements Serializable {
      */
     private String outStoreName;
     /**
-     * 状态 0:未转移 1:转移成功 2:转移失败
+     * 状态 0:未转移 1:转移成功 2:转移失败 3:转移中 4:审核成功未转出 5:审核成功未转入
      */
     private Integer status;
     /**

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/service/StoreTransferInventoryOrderService.java

@@ -73,4 +73,8 @@ public interface StoreTransferInventoryOrderService {
     int deleteBatch(Integer[]ids);
 
     R uploadExcel(List<StoreTransferInventoryOrderImportDto> dtoList);
+
+    void transferInIncrease(String transferOrderId);
+
+    void transferOutReduce(String transferOrderId);
 }

+ 25 - 25
kmall-admin/src/main/java/com/kmall/admin/service/impl/BrandServiceImpl.java

@@ -58,37 +58,37 @@ public class BrandServiceImpl implements BrandService {
     @Override
     public int save(BrandEntity brand) {
 
-        // 品牌唯一标识符正则校验
-        String uniqueIdentifier = brand.getUniqueIdentifier();
-        String regex = "(^[0-9a-zA-Z_&]{1,10}$)";
-        if(!Pattern.matches(regex,uniqueIdentifier)){
-            throw new RuntimeException("请输入正确的品牌唯一简码,有问题的简码:"+uniqueIdentifier);
-        }
-
-        // 如果是正确的,根据唯一简码查询该简码是否存在
-        BrandEntity brandEntity = brandDao.queryByUniqueIdentifier(uniqueIdentifier);
-        if(brandEntity != null ){
-            throw new RuntimeException("该唯一简码已存在,请检查唯一简码,唯一简码:"+uniqueIdentifier);
-        }
+//        // 品牌唯一标识符正则校验
+//        String uniqueIdentifier = brand.getUniqueIdentifier();
+//        String regex = "(^[0-9a-zA-Z_&]{1,10}$)";
+//        if(!Pattern.matches(regex,uniqueIdentifier)){
+//            throw new RuntimeException("请输入正确的品牌唯一简码,有问题的简码:"+uniqueIdentifier);
+//        }
+//
+//        // 如果是正确的,根据唯一简码查询该简码是否存在
+//        BrandEntity brandEntity = brandDao.queryByUniqueIdentifier(uniqueIdentifier);
+//        if(brandEntity != null ){
+//            throw new RuntimeException("该唯一简码已存在,请检查唯一简码,唯一简码:"+uniqueIdentifier);
+//        }
 
         return brandDao.save(brand);
     }
 
     @Override
     public int update(BrandEntity brand) {
-
-        // 品牌唯一标识符正则校验
-        String uniqueIdentifier = brand.getUniqueIdentifier();
-        String regex = "(^[0-9a-zA-Z_&]{1,10}$)";
-        if(!Pattern.matches(regex,uniqueIdentifier)){
-            throw new RuntimeException("请输入正确的品牌唯一简码,有问题的简码:"+uniqueIdentifier);
-        }
-
-        // 如果是正确的,根据唯一简码查询该简码是否存在
-        BrandEntity brandEntity = brandDao.queryByUniqueIdentifier(uniqueIdentifier);
-        if(brandEntity != null && brand.getId().compareTo(brandEntity.getId()) != 0){
-            throw new RuntimeException("该唯一简码已存在,请检查唯一简码,唯一简码:"+uniqueIdentifier);
-        }
+//
+//        // 品牌唯一标识符正则校验
+//        String uniqueIdentifier = brand.getUniqueIdentifier();
+//        String regex = "(^[0-9a-zA-Z_&]{1,10}$)";
+//        if(!Pattern.matches(regex,uniqueIdentifier)){
+//            throw new RuntimeException("请输入正确的品牌唯一简码,有问题的简码:"+uniqueIdentifier);
+//        }
+//
+//        // 如果是正确的,根据唯一简码查询该简码是否存在
+//        BrandEntity brandEntity = brandDao.queryByUniqueIdentifier(uniqueIdentifier);
+//        if(brandEntity != null && brand.getId().compareTo(brandEntity.getId()) != 0){
+//            throw new RuntimeException("该唯一简码已存在,请检查唯一简码,唯一简码:"+uniqueIdentifier);
+//        }
 
         return brandDao.update(brand);
     }

+ 23 - 23
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -2130,29 +2130,29 @@ public class OrderServiceImpl implements OrderService {
             // 设置支付单开始时间
             processRecordEntity.setPaymentStartTime(new Date());
             // 判断是微信的支付码还是支付宝的支付码
-//            if (parCode.startsWith("28")) {
-//                // 支付宝支付
-//                try {
-//                    AliPay(user, parCode, order, processRecordEntity, orderWXPayRecordCurrent, store);
-//                } catch (Exception e) {
-//                    e.printStackTrace();
-//                    throw e;
-//                }
-//            } else {
-//                // 微信支付
-//                try {
-//                    wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
-//                } catch (Exception e) {
-//                    e.printStackTrace();
-//                    throw e;
-//                }
-//            }
+            if (parCode.startsWith("28")) {
+                // 支付宝支付
+                try {
+                    AliPay(user, parCode, order, processRecordEntity, orderWXPayRecordCurrent, store);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    throw e;
+                }
+            } else {
+                // 微信支付
+                try {
+                    wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    throw e;
+                }
+            }
 
-            OrderEntity orderEntity = queryObject(order.getId());
-//             TODO 到时候要注释掉,测试用而已
-            orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
-            orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
-            orderDao.update(orderEntity);
+//            OrderEntity orderEntity = queryObject(order.getId());
+////             TODO 到时候要注释掉,测试用而已
+//            orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
+//            orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
+//            orderDao.update(orderEntity);
             resultObj.put("shopName", store.getStoreName()); // 根据门店编号查询
             resultObj.put("userName", user.getUsername());
 
@@ -2520,7 +2520,7 @@ public class OrderServiceImpl implements OrderService {
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
-                if (times >= 20) {
+                if (times >= 120) {
                     throw new RuntimeException("超过20s未支付,订单下单失败");
                 }
                 times++;

+ 72 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreTransferInventoryOrderServiceImpl.java

@@ -6,6 +6,7 @@ import com.kmall.admin.entity.StoreTransferInventoryOrderDetailEntity;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.StoreTransferInventoryOrderDetailService;
 import com.kmall.admin.utils.ShiroUtils;
+import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -122,6 +123,77 @@ public class StoreTransferInventoryOrderServiceImpl implements StoreTransferInve
         return R.ok();
     }
 
+    /**
+     * 确认门店转入增加库存
+     * @param transferOrderId
+     */
+    @Override
+    @Transactional
+    public void transferInIncrease(String transferOrderId) {
+        StoreTransferInventoryOrderEntity inventoryOrderEntity = checkTransferOrder(transferOrderId);
+
+        // 判断状态是否是转出成功 也就是status = 5
+        if(5 != inventoryOrderEntity.getStatus()){
+            throw new RuntimeException("该转移单状态有误,不允许确认增加转入门店库存!");
+        }
+
+        // 查询转移明细
+        List<StoreTransferInventoryOrderDetailEntity> detailEntityList =
+                storeTransferInventoryOrderDetailService.queryByTransferId(Integer.valueOf(transferOrderId));
+        // 获取转出门店
+        String outStoreSn = inventoryOrderEntity.getOutStoreSn();
+
+        // 转入
+        productStoreRelaService.handleTransfer(Dict.transferType.in.getItem(),outStoreSn,detailEntityList);
+
+        inventoryOrderEntity.setStatus(1);
+        this.update(inventoryOrderEntity);
+
+
+    }
+
+
+
+    /**
+     * 确认门店转出减少库存
+     * @param transferOrderId
+     */
+    @Override
+    @Transactional
+    public void transferOutReduce(String transferOrderId) {
+        StoreTransferInventoryOrderEntity inventoryOrderEntity = checkTransferOrder(transferOrderId);
+
+        // 判断状态是否是审核成功未转出 也就是status = 4
+        if(4 != inventoryOrderEntity.getStatus()){
+            throw new RuntimeException("该转移单状态有误,不允许确认减少转出门店库存!");
+        }
+
+        // 查询转移明细
+        List<StoreTransferInventoryOrderDetailEntity> detailEntityList =
+                storeTransferInventoryOrderDetailService.queryByTransferId(Integer.valueOf(transferOrderId));
+        // 获取转出门店
+        String inStoreSn = inventoryOrderEntity.getInStoreSn();
+        // 再转出
+        productStoreRelaService.handleTransfer(Dict.transferType.out.getItem(),inStoreSn,detailEntityList);
+        inventoryOrderEntity.setStatus(5);
+        this.update(inventoryOrderEntity);
+    }
+
+    /**
+     * 检查该转移单是否审核通过
+     * @param transferOrderId
+     */
+    private StoreTransferInventoryOrderEntity checkTransferOrder(String transferOrderId) {
+        StoreTransferInventoryOrderEntity inventoryOrderEntity = storeTransferInventoryOrderDao.queryObject(transferOrderId);
+        if(inventoryOrderEntity == null){
+            throw new RuntimeException("没有查询到该转移单!转移单号:"+ transferOrderId);
+        }
+//        if(inventoryOrderEntity.getStatus() != 1){
+//            throw new RuntimeException("该转移单未完成,无法进行操作。转移单号:"+ transferOrderId);
+//        }
+        return inventoryOrderEntity;
+    }
+
     private void checkExcelData(List<StoreTransferInventoryOrderImportDto> dtoList) {
         for (StoreTransferInventoryOrderImportDto dto : dtoList) {
             String inStoreSn = dto.getInStoreSn();

+ 9 - 9
kmall-admin/src/main/java/com/kmall/admin/service/impl/oms2kmall/Oms2KmallServiceImpl.java

@@ -45,7 +45,7 @@ public class Oms2KmallServiceImpl implements Oms2KmallService {
 
     @Transactional
     public R transGoodsNotice(TransferResponse wayBillResponse){
-        LOGGER.info("转移单审核通过:"+wayBillResponse);
+        LOGGER.info("转移单审核结果:"+wayBillResponse);
         try {
             // 解析数据,回去转移订单号
             Integer merchTransDocSn = wayBillResponse.getMerchTransDocSn();
@@ -56,14 +56,14 @@ public class Oms2KmallServiceImpl implements Oms2KmallService {
                 LOGGER.error("该转移单已经处理过,转移单编号:"+merchTransDocSn);
                 return R.error("该转移单已经处理过,转移单编号:"+merchTransDocSn);
             }
-            // 查询转移订单明细,开始转移门店的库存
-            List<StoreTransferInventoryOrderDetailEntity> list = storeTransferInventoryOrderDetailService.queryByTransferId(merchTransDocSn);
-            // 先转出
-            productStoreRelaService.handleTransfer(Dict.transferType.in.getItem(),wayBillResponse.getRollOutShopId(),list);
-            // 再转入
-            productStoreRelaService.handleTransfer(Dict.transferType.out.getItem(),wayBillResponse.getRollInShopId(),list);
-
-            storeTransferInventoryOrder.setStatus(1);
+//            // 查询转移订单明细,开始转移门店的库存
+//            List<StoreTransferInventoryOrderDetailEntity> list = storeTransferInventoryOrderDetailService.queryByTransferId(merchTransDocSn);
+//            // 先转出
+//            productStoreRelaService.handleTransfer(Dict.transferType.in.getItem(),wayBillResponse.getRollOutShopId(),list);
+//            // 再转入
+//            productStoreRelaService.handleTransfer(Dict.transferType.out.getItem(),wayBillResponse.getRollInShopId(),list);
+
+            storeTransferInventoryOrder.setStatus(4);
             storeTransferInventoryOrderService.update(storeTransferInventoryOrder);
 
 

+ 24 - 0
kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml

@@ -334,4 +334,28 @@
 		where unique_identifier = #{uniqueIdentifier}
     </select>
 
+    <select id="queryByName" resultType="com.kmall.admin.entity.BrandEntity">
+        select
+			`id`,
+			`name`,
+			`unique_identifier`,
+			`store_id`,
+			`merch_sn`,
+			`list_pic_url`,
+			`simple_desc`,
+			`pic_url`,
+			`sort_order`,
+			`is_show`,
+			`floor_price`,
+			`app_list_pic_url`,
+			`is_new`,
+			`new_pic_url`,
+			`new_sort_order`,
+			category_id,
+			category_level
+		from mall_brand
+		where name = #{brandName}
+    </select>
+
+
 </mapper>

+ 76 - 21
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -2053,7 +2053,7 @@
         g.goods_id,
         o.order_sn as receiptNo,
         u.username as cashRegisterNo,
-        o.pay_time as timeStampDetails,
+        o.create_time as timeStampDetails,
         u.username as staffID,
         u.username as staffName,
         gs.hs_code as hsCode,
@@ -2074,10 +2074,8 @@
         gs.goods_rate as taxRate,
         '专柜单品' as productCategory,
         sup.child_supplier_name as supplierName,
-        o.order_status as orderStatus,
-        g.tax_price as taxPrice,
-        mor.out_refund_no as outRefundNo,
-        mor.create_time as refundTime
+        '300' as orderStatus,
+        g.tax_price as taxPrice
         FROM
         mall_order o
         LEFT JOIN mall_order_goods g ON o.id = g.order_id
@@ -2089,7 +2087,6 @@
         left join mall_product_store_rela sr on sr.goods_id=gs.id
         left join mall_brand b on b.id=sr.brand_id
         left join mall_supplier sup on gs.supplier_id = sup.id
-        left join mall_order_refund mor on mor.out_refund_no = o.order_sn
         WHERE 1=1
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
@@ -2099,7 +2096,7 @@
                 AND o.order_status = #{orderStatus}
             </when>
             <otherwise>
-                AND o.order_status in ('300','401')
+                AND o.order_status in ('401','300')
             </otherwise>
         </choose>
         <if test="isOnfiilineOrder != null">
@@ -2115,6 +2112,76 @@
             AND s.store_name LIKE concat('%',#{storeName},'%')
         </if>
 
+
+
+        union
+
+        SELECT distinct
+        o.id,
+        g.goods_id,
+        o.order_sn as receiptNo,
+        u.username as cashRegisterNo,
+        mor.create_time as timeStampDetails,
+        u.username as staffID,
+        u.username as staffName,
+        gs.hs_code as hsCode,
+        gs.hs_code_name as hsCodeName,
+        gs.goods_sn as ematouCode,
+        gs.plu as plu,
+        gs.mychem_id as mychemID,
+        gs.english_name as productNameEN,
+        gs.name as productNameCN,
+        gs.prod_barcode as barcode,
+        gs.ciq_prod_model as packSize,
+        uc.name as productSpecification,
+        b.name as brand,
+        gs.daily_price as edlp,
+        sr.bottom_line_price as costPrice,
+        g.number as unitSold,
+        g.actual_payment_amount as totalSalesInclTax,
+        gs.goods_rate as taxRate,
+        '专柜单品' as productCategory,
+        sup.child_supplier_name as supplierName,
+        o.order_status as orderStatus,
+        g.tax_price as taxPrice
+        FROM
+        mall_order o
+        LEFT JOIN mall_order_goods g ON o.id = g.order_id
+        left join mall_store s on o.store_id = s.id
+        LEFT JOIN mall_goods gs ON g.goods_id = gs.id
+        left join mall_sale_record record on record.order_sn = o.order_sn
+        LEFT JOIN sys_user u ON record.saller_id = u.user_id
+        left join sys_cus_unit_code uc on uc.code = gs.unit_code
+        left join mall_product_store_rela sr on sr.goods_id=gs.id
+        left join mall_brand b on b.id=sr.brand_id
+        left join mall_supplier sup on gs.supplier_id = sup.id
+        left join mall_order_refund mor on mor.out_refund_no = o.order_sn
+        WHERE 1=1
+        <if test="orderSn != null and orderSn.trim() != ''">
+            AND o.order_sn LIKE concat('%',#{orderSn},'%')
+        </if>
+        <choose>
+            <when test="orderStatus != null and orderStatus.trim() != ''">
+                AND o.order_status = #{orderStatus}
+            </when>
+            <otherwise>
+                AND o.order_status = '401'
+            </otherwise>
+        </choose>
+        <if test="isOnfiilineOrder != null">
+            AND o.is_onffline_order = #{isOnfiilineOrder}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            AND mor.create_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND mor.create_time <![CDATA[ <  ]]> #{endTime}
+        </if>
+        <if test="storeName != null and storeName != ''">
+            AND s.store_name LIKE concat('%',#{storeName},'%')
+        </if>
+
+
     </select>
 
     <update id="updateOrderInfo" parameterType="map">
@@ -2211,9 +2278,9 @@
         where
             DATE_FORMAT(create_time,'%Y-%m-%d') != #{billDate}
         and order_id in (
-            select distinct order_id from mall_order_refund where DATE_FORMAT(create_time,'%Y-%m-%d') = #{billDate}
+            select distinct mor.order_id from mall_order_refund mor , mall_order o where mor.out_refund_no = o.order_sn and  DATE_FORMAT(mor.create_time,'%Y-%m-%d') = #{billDate}
         <if test="storeId != ''">
-            and store_id = #{storeId}
+            and o.store_id = #{storeId}
         </if>
         )
     </select>
@@ -2252,9 +2319,6 @@
         <if test="storeId != ''">
             and o.store_id = #{storeId}
         </if>
-        <if test="storeName != null and storeName != ''">
-            AND s.store_name LIKE concat('%',#{storeName},'%')
-        </if>
         order by o.order_status
     </select>
 
@@ -2294,9 +2358,6 @@
         <if test="storeId != ''">
             and o.store_id = #{storeId}
         </if>
-        <if test="storeName != null and storeName != ''">
-            AND s.store_name LIKE concat('%',#{storeName},'%')
-        </if>
         order by o.order_status
     </select>
 
@@ -2310,9 +2371,6 @@
         <if test="storeId != ''">
             and o.store_id = #{storeId}
         </if>
-        <if test="storeName != null and storeName != ''">
-            AND s.store_name LIKE concat('%',#{storeName},'%')
-        </if>
     </select>
 
     <select id="queryRefundPreviousTaxDetailList" resultType="com.kmall.admin.dto.TaxDetailDto">
@@ -2325,9 +2383,6 @@
         <if test="storeId != ''">
             and o.store_id = #{storeId}
         </if>
-        <if test="storeName != null and storeName != ''">
-            AND s.store_name LIKE concat('%',#{storeName},'%')
-        </if>
     </select>
 
     <select id="queryAll201Order" resultType="com.kmall.admin.entity.OrderEntity">

+ 11 - 9
kmall-admin/src/main/webapp/WEB-INF/page/pcd/hbk6zzez.html

@@ -17,14 +17,7 @@
                 </div>
             </div>
 
-            <div class="col-md-3">
-                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,待取货</h2><br/>
-                <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
-                    <div class="col-xs-6 col-sm-6" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 2" style="margin-bottom: 12px;padding-left: 10px;">
-                        <i-button data-toggle="modal" style="background-color:#808080;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 17px; font-weight: 600;color: white;" v-if="item.pickUpCodeStatus == 2" >{{item.pickUpCodeSn}}</i-button>
-                    </div>
-                </div>
-            </div>
+
 
             <div class="col-md-4">
                 <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,可取货</h2><br/>
@@ -34,6 +27,15 @@
                     </div>
                 </div>
             </div>
+            <div class="col-md-3">
+                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,已取货</h2><br/>
+                <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
+                    <div class="col-xs-6 col-sm-6" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 5" style="margin-bottom: 12px;padding-left: 10px;">
+                        <i-button data-toggle="modal" style="background-color:#ffc800;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 17px; font-weight: 600;color: white;" v-if="item.pickUpCodeStatus == 5" >{{item.pickUpCodeSn}}</i-button>
+                    </div>
+                </div>
+            </div>
+
             <div class="col-md-2">
                 <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关失败</h2><br/>
                 <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
@@ -48,4 +50,4 @@
 
 <script src="${rc.contextPath}/js/pcd/hbk6zzez.js?_${date.systemTime}"></script>
 </body>
-</html>
+</html>

+ 5 - 3
kmall-admin/src/main/webapp/WEB-INF/page/shop/storetransferinventoryorder.html

@@ -22,10 +22,12 @@
                 <i-button @click="reloadSearch">重置</i-button>
             </div>
             <div class="buttons-group">
-                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
+<!--                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>-->
+<!--                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>-->
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                 <i-button type="info" @click="transfer"><i class="fa fa-plus"></i>&nbsp;库存转移</i-button>
+                <i-button type="info" @click="transferOutReduce"><i class="fa fa-plus"></i>&nbsp;确认转出门店扣减</i-button>
+                <i-button type="info" @click="transferInIncrease"><i class="fa fa-plus"></i>&nbsp;确认转入门店新增</i-button>
                 <i-col style="display: inline-grid;">
                     <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-format-error="uploadExcelFormatError"
                             :format="['xls','xlsx']"
@@ -91,4 +93,4 @@
 
 <script src="${rc.contextPath}/js/shop/storetransferinventoryorder.js?_${date.systemTime}"></script>
 </body>
-</html>
+</html>

+ 2 - 2
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -1254,8 +1254,8 @@ function openWebSocket() {
         //注意ws、wss使用不同的端口。我使用自签名的证书测试,
         //无法使用wss,浏览器打开WebSocket时报错
         //ws对应http、wss对应https。
-        webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
-        // webSocket = new WebSocket("ws://8.135.102.238:8080//ws/server/"+storeId);
+        // webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
+        webSocket = new WebSocket("ws://8.135.102.238:8080//ws/server/"+storeId);
         // webSocket = new WebSocket("ws://127.0.0.1:8080//ws/server/"+163);
         // webSocket = new WebSocket("wss://cb.k1net.cn/ws/server/"+storeId);
         if (webSocket.readyState === webSocket.CONNECTING) {

+ 1 - 0
kmall-admin/src/main/webapp/js/shop/offilineOrderList.js

@@ -564,6 +564,7 @@ let vm = new Vue({
             });
             var params = {};
             params.billDate = vm.q.billDate;
+            params.storeName = vm.q.storeName;
             exportFile('#rrapp', '../exportExcel/exportSalesExcel', params);
             setTimeout(msg, 1000);
 

+ 78 - 4
kmall-admin/src/main/webapp/js/shop/storetransferinventoryorder.js

@@ -21,6 +21,10 @@ $(function () {
 					ret = "转移失败";
 				} else if (value === 3) {
 					ret = "转移中";
+				} else if (value === 4) {
+					ret = "审核成功未转出";
+				} else if (value === 5) {
+					ret = "审核成功未转入";
 				}
 				return ret;
 			}},
@@ -213,10 +217,80 @@ let vm = new Vue({
 				onCancel: () => {
 				}
 			});
+		},
+		transferOutReduce: function (event) {
+			let id = getSelectedRow();
+			if (id == null){
+				return;
+			}
+			let that = this;
+
+			this.$Modal.confirm({
+				title: '提示',
+				content: '确定要对选中的记录进行转移吗?',
+				onOk: () => {
+					that.$Modal.info({
+						title: "处理中",
+						content: "正在处理中,请勿关闭页面..."
+					});
+
+					$.ajax({
+						type: "POST",
+						url: "../storetransferinventoryorder/transferOutReduce/" + id,
+						contentType: "application/json",
+						data: "{}",
+						success: function (r) {
+							// that.$Modal.remove()
+							if (r.code == 0) {
+								alert('操作成功', function (index) {
+									$("#jqGrid").trigger("reloadGrid");
+								});
+							} else {
+								alert(r.msg);
+							}
+						}
+					});
+				},
+				onCancel: () => {
+				}
+			});
+		},
+		transferInIncrease: function (event) {
+			let id = getSelectedRow();
+			if (id == null){
+				return;
+			}
+			let that = this;
 
-			// confirm('确定要对选中的记录进行转移吗?', function () {
-			//
-			// });
+			this.$Modal.confirm({
+				title: '提示',
+				content: '确定要对选中的记录进行转移吗?',
+				onOk: () => {
+					that.$Modal.info({
+						title: "处理中",
+						content: "正在处理中,请勿关闭页面..."
+					});
+
+					$.ajax({
+						type: "POST",
+						url: "../storetransferinventoryorder/transferInIncrease/" + id,
+						contentType: "application/json",
+						data: "{}",
+						success: function (r) {
+							// that.$Modal.remove()
+							if (r.code == 0) {
+								alert('操作成功', function (index) {
+									$("#jqGrid").trigger("reloadGrid");
+								});
+							} else {
+								alert(r.msg);
+							}
+						}
+					});
+				},
+				onCancel: () => {
+				}
+			});
 		},
 		getInfo: function(id){
 			$.get("../storetransferinventoryorder/info/"+id, function (r) {
@@ -249,4 +323,4 @@ let vm = new Vue({
             handleResetForm(this, name);
         }
 	}
-});
+});

+ 3 - 3
kmall-manager/src/main/resources/conf/oms-merch.properties

@@ -9,9 +9,9 @@ merch.merchShortName=ZW
 #cw\u5546\u6237\u7F16\u53F7
 merch.thirdSn=CW001
 #\u67E5\u8BE2\u8BA2\u5355\u5730\u5740
-merch.queryOrderUrl=http://ws.ds-bay.com/al/shop/order/query
-merch.queryInveResponseUrl=http://ws.ds-bay.com/al/queryInveResponse
-merch.sendTransferUrl=http://ws.ds-bay.com/al/shop/bdd/cb/transgoods
+merch.queryOrderUrl=http://120.76.26.84:8680/al/shop/order/query
+merch.queryInveResponseUrl=http://120.76.26.84:8680/al/queryInveResponse
+merch.sendTransferUrl=http://120.76.26.84:8680/al/shop/bdd/cb/transgoods
 #ccnet\u751F\u4EA7\u73AF\u5883\u67E5\u8BE2\u652F\u4ED8\u5355\u3001\u7535\u5B50\u8BA2\u5355\u3001\u8FD0\u5355\u5931\u8D25\u8BA2\u5355\u63A5\u53E3
 merch.wxOrderResendUrl=http://8.135.102.238:8680/wx/wxOrderResendQueryAll