Browse Source

Merge branch 'feature/管理端bug修复1211' of qng/kmall-haikong into master

bug修复
钱能归 3 years ago
parent
commit
5edff613cb

+ 4 - 2
kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDto.java

@@ -129,10 +129,11 @@ public class GoodsDto implements Serializable {
     private String hsCodeName;
 
     private String plu;
-
+    //品牌唯一简码
     private String uniqueIdentifier;
-
+    //一级分类
     private String firstLevel;
+    //二级分类
     private String secondLevel;
     //第一法定单位数量
     private String legalUnit1Qty;
@@ -153,6 +154,7 @@ public class GoodsDto implements Serializable {
     private String defectiveProductsGrade;
     //商品重量
     private String netWeight;
+    //增值税率
     private String valueAddedTaxRate;
 
     public String getCounterPrice() {

+ 36 - 120
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -804,34 +804,29 @@ public class GoodsServiceImpl implements GoodsService {
                 builder.put("thirdPartyMerchCode", "第三方商户代码");
                 builder.put("goodsBizType", "货品业务类型");
                 builder.put("name", "商品名称");
+                builder.put("prodBarcode", "产品条码");
+                builder.put("sku", "sku");
                 builder.put("isOnSaleStr", "上架");
                 builder.put("goodsUnit", "商品单位");
-                builder.put("isHotStr", "热销");
-                builder.put("prodBarcode", "产品条码");
-//                builder.put("marketPrice", "市场价");
-//                builder.put("retailPrice", "零售价");
-                builder.put("supplierName", "供应商");
-                builder.put("goodsNumber", "商品总库存");
+                builder.put("isHotStr", "是否热销");
+                builder.put("goodsRate", "商品税率");
+                builder.put("brand", "产品品牌");
+                builder.put("uniqueIdentifier", "品牌唯一简码");
+                builder.put("unitName", "计量单位");
+                builder.put("oriCntName", "原产国");
+                builder.put("valueAddedTaxRate", "增值税率");
+                builder.put("goodsNumber", "库存数");
+                builder.put("firstLevel", "一级分类");
+                builder.put("secondLevel", "二级分类");
+                builder.put("warehouseSn", "仓库编码");
+                builder.put("consignorSn", "货主编码");
+                builder.put("warehousSysGoodId", "仓储系统商品ID");
+                builder.put("inventoryType", "库存类型");
+                builder.put("legalUnit1Qty", "第一法定单位数量");
+                builder.put("legalUnit2Qty", "第二法定单位数量");
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
                     throw new RRException(r.get("msg").toString());
-                } else {
-                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                        // 海关信息,普通货物可不添加
-                        builder.put("goodsRate", "商品税率");
-                        builder.put("sku", "SKU");
-//                        builder.put("brand", "产品品牌");
-                        builder.put("unitName", "计量单位");
-                        builder.put("oriCntName", "原产国");
-                        //builder.put("cusGoodsCode", "海关商品编码");
-                        //builder.put("ciqProdModel", "国检规格型号");
-                        //builder.put("cusDeclEle", "海关申报要素");
-                        //builder.put("cusRecCode", "海关备案编号");
-                    }
-                    r = ValidatorUtil.isEmpty(builder.build(), valideDate);
-                    if (Integer.valueOf(r.get("code").toString()) != 0) {
-                        throw new RRException(r.get("msg").toString());
-                    }
                 }
                 //业务类型校验
                 if(!Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType())){
@@ -895,10 +890,10 @@ public class GoodsServiceImpl implements GoodsService {
                         goodsEntity.setSupplierId(supplierEntity.getId());
                     }
                 }
-                //商品配置校验
-                /*
-                 先在redis在查询该品牌是否存在,如果存在获取品牌id,如果不存在,先新增该品牌,在将品牌存入到redis中,在获取品牌id
-                 */
+                 GoodsEntity goodsNew = goodsDao.queryObjectBySnNew(goodsDto.getGoodsSn());
+                 if(goodsNew!=null){
+                     throw new RRException("该商品数据已存在,请勿重复导入:"+goodsNew.getGoodsSn());
+                 }
                 // 获取品牌唯一简码
                 checkBrand(goodsDto, goodsEntity);
                 // 获取二级分类id
@@ -957,7 +952,7 @@ public class GoodsServiceImpl implements GoodsService {
                 goodsEntity.setConsignorSn(goodsDto.getConsignorSn());
                 goodsEntity.setInventoryType(goodsDto.getInventoryType());
                 goodsEntity.setDefectiveProductsGrade(goodsDto.getDefectiveProductsGrade());
-                goodsEntity.setNetWeight(new BigDecimal(goodsDto.getNetWeight()));
+                //goodsEntity.setNetWeight(new BigDecimal(goodsDto.getNetWeight()));
                 goodsEntity.setLegalUnit1Qty(new BigDecimal(goodsDto.getLegalUnit1Qty()));
                 goodsEntity.setLegalUnit2Qty(new BigDecimal(goodsDto.getLegalUnit2Qty()));
                 if(null!=goodsDto.getImpConsumTaxRate()){
@@ -1139,105 +1134,26 @@ public class GoodsServiceImpl implements GoodsService {
     }
 
     private void checkCategory(GoodsDto goodsDto, GoodsEntity goodsEntity) {
-        String secondLevel = goodsDto.getSecondLevel(); // 二级分类名称
-        Map<String, String> categoryCache = JedisUtil.getMap(secondLevel);
-        if(categoryCache != null){
-            String categoryId = categoryCache.get("categoryId");
-            String level = categoryCache.get("level");
+        // 二级分类名称
+        String secondLevel = goodsDto.getSecondLevel().trim();
+        String firstLevelName = goodsDto.getFirstLevel().trim();
+        CategoryEntity categoryNew = categoryDao.queryByName(secondLevel);
+        if(categoryNew != null){
+            String categoryId = categoryNew.getId().toString();
+            String level = categoryNew.getLevel();
             if(categoryId == null){
-                CategoryEntity category = categoryDao.queryByName(secondLevel);
-                if (category == null) {
-
-                    // 将该id存入带缓存中
-                    Map<String,String> categoryCacheData = new HashMap<>();
-                    categoryCacheData.put("level",Dict.Level.item_L2.getItem());
-
-                    // 查询数据库中是否有一级分类
-                    String firstLevel = goodsDto.getFirstLevel();
-                    CategoryEntity firstCategory = categoryDao.queryByName(firstLevel);
-                    // if(firstCategory == null){
-                    //     // 一级分类不存在
-                    //     // 新增一级分类
-                    //     CategoryEntity firstCategoryEntity = initCategory(firstLevel, 0, Dict.Level.item_L1);
-                    //     categoryDao.save(firstCategoryEntity);
-                    //     // 新增二级分类
-                    //     CategoryEntity secondCategoryEntity = initCategory(secondLevel, firstCategoryEntity.getId(), Dict.Level.item_L2);
-                    //     categoryDao.save(secondCategoryEntity);
-                    //     categoryId = secondCategoryEntity.getId()+"";
-                    // }else{
-                    //     // 新增二级分类
-                    //     CategoryEntity saveCategoryEntity = initCategory(secondLevel, firstCategory.getId(), Dict.Level.item_L2);
-                    //     categoryDao.save(saveCategoryEntity);
-                    //     categoryId = saveCategoryEntity.getId()+"";
-                    //
-                    // }
-//                    categoryCacheData.put("categoryId",categoryId);
-//                    JedisUtil.setMap(secondLevel,categoryCacheData,0);
-//                    goodsEntity.setCategoryId(Integer.parseInt(categoryId));
-                    throw new RuntimeException("该分类不是二级分类,请检查,对应条码是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
-                }else if(category != null && Dict.Level.item_L2.getItem().equals(category.getLevel())){
-                    // 缓存中没有,数据库中有,直接存入数据库中查询到的数据
-                    goodsEntity.setCategoryId(category.getId());
-                    // 将该id存入带缓存中
-                    Map<String,String> categoryCacheData = new HashMap<>();
-                    categoryCacheData.put("level",Dict.Level.item_L2.getItem());
-                    categoryCacheData.put("categoryId",category.getId()+"");
-                    JedisUtil.setMap(secondLevel,categoryCacheData,0);
-
-                }else{
-                    throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
-                }
+                   throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
             }else if(Dict.Level.item_L2.getItem().equals(level)){
+                CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
+                if(firstCategory==null) {
+                    throw new RuntimeException("该分类不是一级分类,请检查,对应sku是:" + goodsDto.getSku() + ",分类名称为:" + firstLevelName);
+                }
+                goodsEntity.setAttributeCategory(firstCategory.getId());
                 // 二级分类id在缓存中有,直接存入商品
                 goodsEntity.setCategoryId(Integer.parseInt(categoryId));
-            }else {
-                throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
             }
         }else {
-            String categoryId = "";
-            CategoryEntity category = categoryDao.queryByName(secondLevel);
-            if (category == null) {
-                // 将该id存入带缓存中
-                Map<String,String> categoryCacheData = new HashMap<>();
-                categoryCacheData.put("level",Dict.Level.item_L2.getItem());
-
-                // 查询数据库中是否有一级分类
-                String firstLevel = goodsDto.getFirstLevel();
-                CategoryEntity firstCategory = categoryDao.queryByName(firstLevel);
-                // if(firstCategory == null){
-                //     // 一级分类不存在
-                //     // 新增一级分类
-                //     CategoryEntity firstCategoryEntity = initCategory(firstLevel, 0, Dict.Level.item_L1);
-                //     categoryDao.save(firstCategoryEntity);
-                //     // 新增二级分类
-                //     CategoryEntity secondCategoryEntity = initCategory(secondLevel, firstCategoryEntity.getId(), Dict.Level.item_L2);
-                //     categoryDao.save(secondCategoryEntity);
-                //     categoryId = secondCategoryEntity.getId()+"";
-                // }else{
-                //     // 新增二级分类
-                //     CategoryEntity saveCategoryEntity = initCategory(secondLevel, firstCategory.getId(), Dict.Level.item_L2);
-                //     categoryDao.save(saveCategoryEntity);
-                //     categoryId = saveCategoryEntity.getId()+"";
-                //
-                // }
-//                categoryCacheData.put("categoryId",categoryId);
-//                JedisUtil.setMap(secondLevel,categoryCacheData,0);
-//                goodsEntity.setCategoryId(Integer.parseInt(categoryId));
-                throw new RuntimeException("该分类不是二级分类,请检查,对应条码是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
-
-
-            }else if(category != null && Dict.Level.item_L2.getItem().equals(category.getLevel())){
-                // 缓存中没有,数据库中有,直接存入数据库中查询到的数据
-                goodsEntity.setCategoryId(category.getId());
-                // 将该id存入带缓存中
-                Map<String,String> categoryCacheData = new HashMap<>();
-                categoryCacheData.put("level",Dict.Level.item_L2.getItem());
-                categoryCacheData.put("categoryId",category.getId()+"");
-                JedisUtil.setMap(secondLevel,categoryCacheData,0);
-
-            }else{
                 throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ goodsDto.getSku()+",分类名称为:"+ goodsDto.getSecondLevel());
-            }
         }
     }
 

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

@@ -294,6 +294,12 @@ public class OrderServiceImpl implements OrderService {
     private WxCusDeclareBiz wxCusDeclareBiz;
 
     /**
+     * 取货码信息表
+     */
+    @Autowired
+    private PickUpCodeDao pickUpCodeDao;
+
+    /**
      * 支付宝海关申报
      */
     @Autowired
@@ -2691,7 +2697,7 @@ public class OrderServiceImpl implements OrderService {
             Integer afterScoreStrInteger = (Integer) param.get("afterScore");
             int deductionScore = org.springframework.util.StringUtils.isEmpty((String) param.get("deductionScore")) ? 0 : Integer.parseInt((String) param.get("deductionScore"));
             String memberPhone = String.valueOf(param.get("memberPhone"));
-            BigDecimal scoreDeductionPrice = new BigDecimal(org.springframework.util.StringUtils.isEmpty((String) param.get("scoreDeductionPrice")) ? "0" : (String) param.get("scoreDeductionPrice"));
+            BigDecimal scoreDeductionPrice = new BigDecimal(org.springframework.util.StringUtils.isEmpty(param.get("scoreDeductionPrice").toString()) ? "0" : param.get("scoreDeductionPrice").toString());
             consumptionRecords.setBeforeScore(beforeScoreInteger);
             consumptionRecords.setAfterScore(afterScoreStrInteger);
             consumptionRecords.setOrderTotalPrice(order.getActual_price());
@@ -3539,7 +3545,7 @@ public class OrderServiceImpl implements OrderService {
             LOGGER.info("=======> [vipIntegralGoBack-----调用会员系统积分全量回退接口数据]" + responseMsg);
 
             //解析数据
-            if ("true".equals(res.get("success"))) {
+            if ("true".equals(res.get("success").toString())) {
                 LOGGER.info("=======> [vipIntegralGoBack-----调用会员系统积分全量回退接口数据]" + responseMsg);
             } else {
                 LOGGER.error("=======> [vipIntegralGoBack-----调用会员系统积分全量回退接口异常数据]" + responseMsg);
@@ -4730,12 +4736,12 @@ public class OrderServiceImpl implements OrderService {
         ) {
             return R.error(500,"无法重发订单,请检查订单状态");
         }
-        OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordDao.queryObjectByOrderSn(orderEntity.getOrderSn());
-        if(null==orderProcessRecordEntity.getIsCustomsSend()){
+        String orderCode = pickUpCodeDao.queryPickUpCodeStatus(orderEntity.getOrderSn());
+        if(null==orderCode||"6".equals(orderCode)){
             return R.error(500,"订单尚未发送至下游系统,无法重发订单");
         }else{
-            if(Dict.orderCustomsStatus.item_1.getItem().equals(orderProcessRecordEntity.getIsCustomsSend())||
-                    Dict.orderCustomsStatus.item_2.getItem().equals(orderProcessRecordEntity.getIsCustomsSend())){
+            if(Dict.orderCustomsStatus.item_2.getItem().equals(orderCode)||
+                    Dict.orderCustomsStatus.item_4.getItem().equals(orderCode)){
                 return R.error(500,"订单处于清关放行状态或查验状态,无需重发订单");
             }
         }

+ 31 - 117
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dao.mk.dist.MkDistSellAllocationDao;
+import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.dto.StoreGoodsDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
@@ -902,6 +903,25 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
 
             for (int i = 0; i < storeGoodsDtoList.size(); i++) {
                 StoreGoodsDto storeGoodsDto = storeGoodsDtoList.get(i);
+
+                Map<String, Object> valideDate = MapBeanUtil.fromObject(storeGoodsDto);
+                ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+                builder.put("storeName", "门店名称");
+                builder.put("goodsSn", "sku");
+                builder.put("stockNum", "库存");
+                builder.put("categoryName", "一级分类");
+                builder.put("attributeCategory", "二级分类");
+                builder.put("brandName", "品牌");
+                builder.put("uniqueIdentifier", "品牌唯一简码");
+                builder.put("retailPrice", "零售价(税后)");
+                builder.put("marketPrice", "市场价");
+                builder.put("bottomLinePrice", "底线价");
+                builder.put("exitRegionNumber", "出区数");
+                R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+                if (Integer.valueOf(r.get("code").toString()) != 0) {
+                    throw new RRException(r.get("msg").toString());
+                }
+
                 ProductStoreRelaEntity storeRelaEntity = new ProductStoreRelaEntity();
                 StoreEntity store = storeDao.queryObjectByName(storeGoodsDto.getStoreName().trim());
                 storeRelaEntity.setExitRegionNumber(storeGoodsDto.getExitRegionNumber());
@@ -914,133 +934,24 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                 }
 
                 // 获取分类id
-                String firstLevelName = storeGoodsDto.getCategoryName();
-                String secondLevelName = storeGoodsDto.getAttributeCategory();
+                String firstLevelName = storeGoodsDto.getCategoryName().trim();
+                String secondLevelName = storeGoodsDto.getAttributeCategory().trim();
                 CategoryEntity categoryNew = categoryDao.queryByName(secondLevelName);
                 if(categoryNew != null){
                     String categoryId = categoryNew.getId().toString();
                     String level = categoryNew.getLevel();
-
-                    String firstLevelCategoryId = "";
-                    String secondLevelCategoryId = "";
-
                     if(categoryId == null){
-                        CategoryEntity category = categoryDao.queryByName(secondLevelName);
-                        if (category == null) {
-
-                            // 查询数据库中是否有一级分类
-//                            CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
-//                            if(firstCategory == null){
-//                                // 一级分类不存在
-//                                // 新增一级分类
-//                                CategoryEntity firstCategoryEntity = initCategory(firstLevelName, 0, Dict.Level.item_L1);
-//                                categoryDao.save(firstCategoryEntity);
-//                                // 新增二级分类
-//                                CategoryEntity secondCategoryEntity = initCategory(secondLevelName, firstCategoryEntity.getId(), Dict.Level.item_L2);
-//                                categoryDao.save(secondCategoryEntity);
-//                                categoryId = secondCategoryEntity.getId()+"";
-//
-//                                firstLevelCategoryId = firstCategoryEntity.getId() + "";
-//                                secondLevelCategoryId = secondCategoryEntity.getId()+"";
-//                            }else{
-//                                // 新增二级分类
-//                                CategoryEntity saveCategoryEntity = initCategory(secondLevelName, firstCategory.getId(), Dict.Level.item_L2);
-//                                categoryDao.save(saveCategoryEntity);
-//                                firstLevelCategoryId = firstCategory.getId() + "";
-//                                secondLevelCategoryId = saveCategoryEntity.getId()+"";
-//
-//                            }
-//                            // 存储一级分类
-//                            set2Redis(firstLevelName, firstLevelCategoryId, Dict.Level.item_L1);
-//                            // 存储二级分类
-//                            set2Redis(secondLevelName, secondLevelCategoryId, Dict.Level.item_L2);
-//
-//                            // 设置一级、二级分类id
-//
-//                            storeRelaEntity.setAttributeCategory(Integer.parseInt(firstLevelCategoryId));
-//                            storeRelaEntity.setCategoryId(Integer.parseInt(secondLevelCategoryId));
-                            throw new RuntimeException("该分类不是一级或二级分类,请检查,对应条码是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
-
-                        }else if(category != null && Dict.Level.item_L2.getItem().equals(category.getLevel())){
-                            // 缓存中没有,数据库中有,直接存入数据库中查询到的数据
-                            storeRelaEntity.setCategoryId(category.getId());
-                            // 将该id存入带缓存中
-                            CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
-                            // 存储一级分类
-                            set2Redis(firstLevelName, firstCategory.getId()+"", Dict.Level.item_L1);
-                            // 存储二级分类
-                            set2Redis(secondLevelName, category.getId() + "", Dict.Level.item_L2);
-
-                            // 设置一级、二级分类id
-                            storeRelaEntity.setAttributeCategory(firstCategory.getId());
-                            storeRelaEntity.setCategoryId(category.getId());
-
-                        }else{
-                            throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
-                        }
+                        throw new RuntimeException("该分类不是二级分类,请检查,对应条码是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
                     }else if(Dict.Level.item_L2.getItem().equals(level)){
-
                         CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
+                        if(firstCategory==null) {
+                            throw new RuntimeException("该分类不是一级分类,请检查,对应条码是:" + storeGoodsDto.getGoodsSn() + ",分类名称为:" + firstLevelName);
+                        }
                         storeRelaEntity.setAttributeCategory(firstCategory.getId());
                         storeRelaEntity.setCategoryId(Integer.parseInt(categoryId));
-                    }else {
-                        throw new RuntimeException("该分类不是一级或二级分类,请检查,对应sku是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
                     }
                 }else {
-                    String firstLevelCategoryId = "";
-                    String secondLevelCategoryId = "";
-                    CategoryEntity category = categoryDao.queryByName(secondLevelName);
-                    if (category == null) {
-
-
-                        // 查询数据库中是否有一级分类
-//                        CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
-//                        if(firstCategory == null){
-//                            // 一级分类不存在
-//                            // 新增一级分类
-//                            CategoryEntity firstCategoryEntity = initCategory(firstLevelName, 0, Dict.Level.item_L1);
-//                            categoryDao.save(firstCategoryEntity);
-//                            // 新增二级分类
-//                            CategoryEntity secondCategoryEntity = initCategory(secondLevelName, firstCategoryEntity.getId(), Dict.Level.item_L2);
-//                            categoryDao.save(secondCategoryEntity);
-//                            firstLevelCategoryId = firstCategoryEntity.getId() + "";
-//                            secondLevelCategoryId = secondCategoryEntity.getId()+"";
-//                        }else{
-//                            // 新增二级分类
-//                            CategoryEntity saveCategoryEntity = initCategory(secondLevelName, firstCategory.getId(), Dict.Level.item_L2);
-//                            categoryDao.save(saveCategoryEntity);
-//                            firstLevelCategoryId = firstCategory.getId() + "";
-//                            secondLevelCategoryId = saveCategoryEntity.getId()+"";
-//
-//                        }
-//                        // 存储一级分类
-//                        set2Redis(firstLevelName, firstLevelCategoryId, Dict.Level.item_L1);
-//                        // 存储二级分类
-//                        set2Redis(secondLevelName, secondLevelCategoryId, Dict.Level.item_L2);
-//
-//                        // 设置一级、二级分类id
-//                        storeRelaEntity.setAttributeCategory(Integer.parseInt(firstLevelCategoryId));
-//                        storeRelaEntity.setCategoryId(Integer.parseInt(secondLevelCategoryId));
-                        throw new RuntimeException("该分类不是一级或二级分类,请检查,对应sku是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
-
-
-                    }else if(category != null && Dict.Level.item_L2.getItem().equals(category.getLevel())){
-                        // 缓存中没有,数据库中有,直接存入数据库中查询到的数据
-                        // 将该id存入带缓存中
-                        CategoryEntity firstCategory = categoryDao.queryByName(firstLevelName);
-                        // 存储一级分类
-                        set2Redis(firstLevelName, firstCategory.getId()+"", Dict.Level.item_L1);
-                        // 存储二级分类
-                        set2Redis(secondLevelName, category.getId() + "", Dict.Level.item_L2);
-
-                        // 设置一级、二级分类id
-                        storeRelaEntity.setAttributeCategory(firstCategory.getId());
-                        storeRelaEntity.setCategoryId(category.getId());
-
-
-                    }else{
-                        throw new RuntimeException("该分类不是二级分类,请检查,对应sku是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
-                    }
+                        throw new RuntimeException("该分类不是二级分类,请检查,对应条码是:"+ storeGoodsDto.getGoodsSn()+",分类名称为:"+ storeGoodsDto.getAttributeCategory());
                 }
 
                 checkBrand(storeGoodsDto, storeRelaEntity);
@@ -1048,7 +959,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                 storeRelaEntity.setRetailPrice(new BigDecimal(storeGoodsDto.getRetailPrice()));
                 storeRelaEntity.setBottomLinePrice(storeGoodsDto.getBottomLinePrice());
                 storeRelaEntity.setStockNum(Integer.valueOf(storeGoodsDto.getStockNum()));
-
+                String strCheck = productStoreRelaDao.queryproductStoreByName(storeRelaEntity.getSku(),storeRelaEntity.getStoreId());
+                if(strCheck!=null&&!"".equals(strCheck)){
+                    throw new RuntimeException("该商品在当前账号所属门店已存在,请勿重复导入!"+storeRelaEntity.getGoodsSn());
+                }
                 ProductStoreRelaEntity productStoreRelaEntity = productStoreRelaDao.queryByGoodsIdAndStoreId(storeRelaEntity.getStoreId(), storeRelaEntity.getGoodsId());
                 if (Objects.isNull(productStoreRelaEntity)) {
                     ((ProductStoreRelaService) AopContext.currentProxy()).save(storeRelaEntity);

+ 1 - 1
kmall-admin/src/main/resources/XmlTemplate/GoodsDtoList.xml

@@ -35,7 +35,7 @@
                 <mapping row="1" col="25">GoodsDto.warehousSysGoodId</mapping>
                 <mapping row="1" col="26">GoodsDto.inventoryType</mapping>
                 <mapping row="1" col="27">GoodsDto.defectiveProductsGrade</mapping>
-                <mapping row="1" col="28">GoodsDto.netWeight</mapping>
+<!--                <mapping row="1" col="28">GoodsDto.netWeight</mapping>-->
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

+ 0 - 1
kmall-admin/src/main/resources/XmlTemplate/StoreGoodsDtoList.xml

@@ -12,7 +12,6 @@
                 <mapping row="1" col="4">StoreGoodsDto.attributeCategory</mapping>
                 <mapping row="1" col="5">StoreGoodsDto.brandName</mapping>
                 <mapping row="1" col="6">StoreGoodsDto.uniqueIdentifier</mapping>
-<!--                <mapping row="1" col="6">StoreGoodsDto.freightName</mapping>-->
                 <mapping row="1" col="7">StoreGoodsDto.retailPrice</mapping>
                 <mapping row="1" col="8">StoreGoodsDto.marketPrice</mapping>
                 <mapping row="1" col="9">StoreGoodsDto.bottomLinePrice</mapping>

+ 22 - 17
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -153,7 +153,7 @@
         LEFT JOIN mall_store s ON s.id = psr1.store_id
         LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
         LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
-        where a.id = #{id} and psr1.store_id = #{storeId}
+        where a.is_delete=0 and a.id = #{id} and psr1.store_id = #{storeId}
     </select>
 
     <select id="queryGoodsByGoodsSnAndStoreId" resultMap="goodsMap">
@@ -207,7 +207,7 @@
         LEFT JOIN mall_store s ON s.id = psr1.store_id
         LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
         LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
-        where a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
+        where a.is_delete=0 and a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
     </select>
 
     <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -218,7 +218,7 @@
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
+        where a.is_delete=0 and a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
     </select>
 
 
@@ -230,7 +230,7 @@
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId}
+        where a.is_delete=0 and a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId}
         and r.stock_num > 0
         limit 1
     </select>
@@ -260,12 +260,12 @@
         FROM
             mall_goods a
         LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
-        left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id and a.is_on_sale = 1
+        left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id and a.is_on_sale = 1 and a.is_delete=0
         where a.prod_barcode = #{prodBarcode} and m.store_id = #{storeId}
         <if test="sku != null and sku != ''">
             and a.sku=#{sku}
         </if>
-        and m.stock_num > 0 order by m.stock_num desc
+        and m.stock_num > 0 and a.is_delete = 0 order by m.stock_num desc
         limit 1
     </select>
 
@@ -281,7 +281,7 @@
         LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
         left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id
         where a.prod_barcode = #{prodBarcode} and m.store_id = #{storeId}
-        and m.stock_num > 0 and a.is_on_sale = 1 order by m.stock_num desc
+        and m.stock_num > 0 and a.is_on_sale = 1 and a.is_delete = 0 order by m.stock_num desc
 
     </select>
 
@@ -293,7 +293,7 @@
         FROM
             mall_goods a
         LEFT JOIN mall_goods_group g ON g.goods_id = a.id
-        AND g.open_status != 3
+        AND g.open_status != 3 and a.is_delete=0
         where a.goods_sn = #{goodsSn}
     </select>
 
@@ -302,7 +302,7 @@
             a.*
         FROM
             mall_goods a
-        where a.sku = #{goodsSn}
+        where a.is_delete=0 and a.is_on_sale=1 and a.sku = #{goodsSn}
     </select>
 
     <select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -516,6 +516,7 @@
 			`brand`,
 			`brand_id`,
 			`category_id`,
+			 attribute_category,
 			`goods_number`,
 			`keywords`,
 			`goods_brief`,
@@ -587,6 +588,7 @@
 			#{brand},
 			#{brandId},
 			#{categoryId},
+			#{attributeCategory},
 			#{goodsNumber},
 			#{keywords},
 			#{goodsBrief},
@@ -662,6 +664,7 @@
             <if test="brand != null">`brand` = #{brand},</if>
             <if test="brandId != null">`brand_id` = #{brandId},</if>
             <if test="categoryId != null">`category_id` = #{categoryId},</if>
+            <if test="attributeCategory != null">`attribute_category` = #{attributeCategory},</if>
             <if test="goodsNumber != null">`goods_number` = #{goodsNumber},</if>
             <if test="keywords != null">`keywords` = #{keywords},</if>
             <if test="goodsBrief != null">`goods_brief` = #{goodsBrief},</if>
@@ -747,6 +750,7 @@
             INNER JOIN mall_supplier s
         WHERE
             g.category_id = c.id
+            and g.is_delete=0
             and g.supplier_id = s.id
             AND (g.goods_sn=#{keyword} OR g.prod_barcode=#{keyword})
     </select>
@@ -814,7 +818,7 @@
             g.prod_barcode as barCode
         from
             mall_goods g
-        left join mall_product_store_rela rela on g.id = rela.goods_id
+        left join mall_product_store_rela rela on g.id = rela.goods_id and g.is_delete = 0
         <where>
             <if test="sku != null and sku != ''">
                and g.sku = #{sku}
@@ -833,13 +837,13 @@
     <select id="queryByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
         select *
         from mall_goods
-        where prod_barcode = #{barCode}
+        where is_delete = 0 and prod_barcode = #{barCode}
     </select>
 
     <select id="queryBySku" resultType="com.kmall.admin.entity.GoodsEntity">
         select *
         from mall_goods
-        where sku = #{sku}
+        where is_delete = 0 and sku = #{sku}
     </select>
 
     <select id="queryListByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -850,7 +854,7 @@
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1
+        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1 and a.is_delete = 0
         and r.stock_num > 0 order by r.stock_num desc
     </select>
 
@@ -877,7 +881,7 @@
     <select id="queryListBySku" resultType="com.kmall.admin.entity.GoodsEntity">
          select *
         from mall_goods
-        where sku = #{sku}
+        where is_delete = 0 and sku = #{sku}
     </select>
     <select id="queryNonSyncOmsGoodsRateSkuList" resultType="com.kmall.admin.entity.GoodsEntity">
         select *
@@ -892,7 +896,7 @@
     </select>
 
     <select id="queryByBarcodeAndSku" resultType="com.kmall.admin.entity.GoodsEntity">
-        select * from mall_goods where
+        select * from mall_goods where is_delete = 0 and
         goods_sn = #{goodsSn} and prod_barcode = #{prodBarcode}
     </select>
 
@@ -905,7 +909,7 @@
             m.store_id as storeId
         FROM
             mall_goods a
-        left join mall_product_store_rela m on m.goods_id = a.id
+        left join mall_product_store_rela m on m.goods_id = a.id and a.is_delete = 0
         <where>
             a.cus_rec_code in
             <foreach collection="hdCodeSet" item="item" open="(" close=")" separator=",">
@@ -1172,7 +1176,7 @@
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
-        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1
+        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1 and a.is_delete = 0
         and r.stock_num > 0 order by r.stock_num desc
     </select>
 
@@ -1186,6 +1190,7 @@
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
         inner join mall_store s on r.store_id=s.id
         where
+        a.is_delete = 0 and
         a.is_on_sale = 1
         and
         <foreach collection="list" item="item" open="(" separator=" or " close=")">

+ 1 - 2
kmall-admin/src/main/resources/mybatis/mapper/HaiKongResendMsgDao.xml

@@ -11,9 +11,7 @@
 			interface_type,
 			request_msg,
 			response_msg,
-			resend_num,
 			resend_time,
-			last_resend_time,
 			is_valid
 		)
 		values
@@ -23,6 +21,7 @@
 			#{interfaceType},
 			#{requestMsg},
 			#{responseMsg},
+			sysdate(),
 			#{isValid}
 		)
 	</insert>

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

@@ -3,7 +3,7 @@ $(function () {
         url: '../goods/list',
         datatype: "json",
         colModel: [
-            // {label: 'ID', name: 'id', index: 'id', width: 60, key: true},
+            {label: 'ID', name: 'id', index: 'id', width: 60, key: true},
             {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
             {label: '第三方商户编号', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 160, align: 'center'},
             // {label: '海关商品编码', name: 'cusGoodsCode', index: 'cus_goods_code', width: 180, align: 'center'},

+ 1 - 1
kmall-admin/src/main/webapp/js/vip/mall2pointsrules.js

@@ -20,7 +20,7 @@ $(function () {
 			},
 			// {label: '积分金额', name: 'pointsRulesMoney', index: 'points_rules_money', width: 80},
 			// {label: '对应积分数', name: 'pointsRulesNum', index: 'points_rules_num', width: 80},
-			{label: '对应积分', name: 'ratio', index: 'ratio', width: 80},
+			{label: '对应积分生成比例', name: 'ratio', index: 'ratio', width: 80},
 			{
 				label: '规则适用开始时间', name: 'pointsBeginTime', index: 'points_begin_time',align:"center", width: 200, formatter: function (value) {
 					return transDate(value, 'yyyy-MM-dd');

BIN
kmall-admin/src/main/webapp/statics/file/goods_export_yyyy_mm_dd_v1.0.0.xls


BIN
kmall-admin/src/main/webapp/statics/file/mall2RulesDetil_1.0.xlsx