1
0
Переглянути джерело

小程序管理后台:新增第三方商户管理,修改门店商品逻辑,导出数据逻辑,前端查询逻辑

hyq 6 роки тому
батько
коміт
835f67070a
50 змінених файлів з 1563 додано та 231 видалено
  1. 22 4
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  2. 60 2
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  3. 2 2
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  4. 134 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java
  5. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java
  6. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java
  7. 1 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java
  8. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OfflineCartDao.java
  9. 19 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java
  10. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/AttributeEntity.java
  11. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java
  12. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/CategoryEntity.java
  13. 19 0
      kmall-admin/src/main/java/com/kmall/admin/entity/FreightEntity.java
  14. 51 22
      kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java
  15. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  16. 181 0
      kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java
  17. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/ThirdMerchantBizService.java
  18. 29 20
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  19. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OfflineCartServiceImpl.java
  20. 60 21
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  21. 24 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreServiceImpl.java
  22. 71 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ThirdMerchantBizServiceImpl.java
  23. 2 2
      kmall-admin/src/main/resources/XmlTemplate/GeneralGoodsDtoList.xml
  24. 7 7
      kmall-admin/src/main/resources/XmlTemplate/GoodsDtoList.xml
  25. 7 1
      kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml
  26. 30 14
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  27. 24 13
      kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml
  28. 31 11
      kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml
  29. 19 9
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  30. 19 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  31. 167 0
      kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml
  32. 20 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  33. 67 47
      kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html
  34. BIN
      kmall-admin/src/main/webapp/WEB-INF/page/shop/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls
  35. BIN
      kmall-admin/src/main/webapp/WEB-INF/page/shop/file/goods_export_yyyy_mm_dd_v1.0.0.xls
  36. 12 7
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  37. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html
  38. 10 4
      kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html
  39. 5 6
      kmall-admin/src/main/webapp/WEB-INF/page/shop/store.html
  40. 2 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html
  41. 69 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html
  42. 2 0
      kmall-admin/src/main/webapp/js/shop/attribute.js
  43. 4 1
      kmall-admin/src/main/webapp/js/shop/brand.js
  44. 13 12
      kmall-admin/src/main/webapp/js/shop/category.js
  45. 2 0
      kmall-admin/src/main/webapp/js/shop/freight.js
  46. 12 3
      kmall-admin/src/main/webapp/js/shop/goods.js
  47. 19 4
      kmall-admin/src/main/webapp/js/shop/order.js
  48. 14 1
      kmall-admin/src/main/webapp/js/shop/store.js
  49. 21 13
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  50. 166 0
      kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js

+ 22 - 4
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -3,18 +3,18 @@ package com.kmall.admin.controller;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.GoodsGalleryEntity;
+import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.GoodsGalleryService;
 import com.kmall.admin.service.GoodsService;
 import com.kmall.admin.service.OfflineCartService;
+import com.kmall.admin.service.StoreService;
 import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.constant.JxlsXmlTemplateName;
 import com.kmall.common.entity.SysUserEntity;
-import com.kmall.common.utils.PageUtils;
-import com.kmall.common.utils.Query;
-import com.kmall.common.utils.R;
-import com.kmall.common.utils.ShiroUtils;
+import com.kmall.common.utils.*;
 import com.kmall.common.utils.excel.ExcelUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -40,6 +40,8 @@ public class GoodsController {
     private OfflineCartService offlineCartService;
     @Autowired
     private ExcelUtil excelUtil;
+    @Autowired
+    private StoreService storeService;
 
     /**
      * 查看列表
@@ -49,6 +51,14 @@ public class GoodsController {
     public R list(@RequestParam Map<String, Object> params) {
 
         ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
         //查询列表数据
         Query query = new Query(params);
 
@@ -116,6 +126,14 @@ public class GoodsController {
     @RequestMapping("/queryAll")
     public R queryAll(@RequestParam Map<String, Object> params) {
         ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
         params.put("isDelete", Integer.parseInt(Dict.isDelete.item_0.getItem()));
         params.put("isOnSale", Integer.parseInt(Dict.isOnSale.item_1.getItem()));
         List<GoodsEntity> list = goodsService.queryList(params);

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

@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -71,6 +73,26 @@ public class OrderController {
         //查询列表数据
         Query query = new Query(params);
         query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            query.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            query.put("endTime", endTime + " 59:59:59");
+        }
         List<OrderEntity> orderList = orderService.queryList(query);
         int total = orderService.queryTotal(query);
 
@@ -78,7 +100,6 @@ public class OrderController {
 
         return R.ok().put("page", pageUtil);
     }
-
     /**
      * 信息
      */
@@ -686,11 +707,33 @@ public class OrderController {
         ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         //查询列表数据
         params.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+
+        String startTime = (String) params.get("startTime");
+        String endTime = (String) params.get("endTime");
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(startTime)) {
+            try {
+                startTime = new String(startTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            startTime = getDate(startTime);
+            params.put("startTime", startTime + " 00:00:00");
+        }
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(endTime)) {
+            try {
+                endTime = new String(endTime.getBytes("iso-8859-1"), "utf-8");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            endTime = getDate(endTime);
+            params.put("endTime", endTime + " 59:59:59");
+        }
+
         List<OrderEntity> orderList = orderService.queryExportList(params);
 
         ExcelExport ee = new ExcelExport("订单信息");
 
-        String[] header = new String[]{"订单编号","商户订单编号", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间"};
+        String[] header = new String[]{"订单编号","商户订单编号", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间", "支付流水号"};
 
         List<Map<String, Object>> list = new ArrayList<>();
         if (orderList != null && orderList.size() != 0) {
@@ -720,6 +763,7 @@ public class OrderController {
                 map.put("Address", orderEntity.getAddress());
 
                 map.put("OrderStartTime", orderEntity.getOrderProcessRecord()==null?"":DateUtils.format(orderEntity.getOrderProcessRecord().getAddOrderStartTime(),"yyyy-MM-dd HH:mm:ss"));
+                map.put("PayId", orderEntity.getPayTransactionId());
 
                 list.add(map);
             }
@@ -730,4 +774,18 @@ public class OrderController {
         return R.ok();
     }
 
+    private String getDate(String datdString){
+        datdString = datdString.replace("GMT", "").replaceAll("\\(.*\\)", "");
+        //将字符串转化为date类型,格式2016-10-12
+        SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z", Locale.ENGLISH);
+        Date dateTrans = null;
+        try {
+            dateTrans = format.parse(datdString);
+            return new SimpleDateFormat("yyyy-MM-dd").format(dateTrans);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return datdString;
+    }
+
 }

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java

@@ -104,7 +104,7 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
         builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");
@@ -134,7 +134,7 @@ public class StoreController {
         builder.put("storeName", "门店名称");
         builder.put("storeNumber", "门店编号");
         builder.put("thirdPartyMerchCode", "第三方商户编号");
-        builder.put("thirdPartyMerchName", "第三方商户名称");
+//        builder.put("thirdPartyMerchName", "第三方商户名称");
         builder.put("exprAgreementType", "第三方商户快递协议类型");
         builder.put("latitude", "纬度");
         builder.put("longitude", "经度");

+ 134 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java

@@ -0,0 +1,134 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.admin.service.StoreService;
+import com.kmall.admin.service.ThirdMerchantBizService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 第三方商户表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+@Controller
+@RequestMapping("thirdmerchantbiz")
+public class ThirdMerchantBizController {
+    @Autowired
+    private ThirdMerchantBizService thirdMerchantBizService;
+    @Autowired
+    private StoreService storeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("thirdmerchantbiz:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ThirdMerchantBizEntity> thirdMerchantBizList = thirdMerchantBizService.queryList(query);
+        int total = thirdMerchantBizService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(thirdMerchantBizList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{thirdMerchSn}")
+    @RequiresPermissions("thirdmerchantbiz:info")
+    @ResponseBody
+    public R info(@PathVariable("thirdMerchSn") Integer thirdMerchSn) {
+        ThirdMerchantBizEntity thirdMerchantBiz = thirdMerchantBizService.queryObject(thirdMerchSn);
+
+        return R.ok().put("thirdMerchantBiz", thirdMerchantBiz);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("thirdmerchantbiz:save")
+    @ResponseBody
+    public R save(@RequestBody ThirdMerchantBizEntity thirdMerchantBiz) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user != null) {
+            thirdMerchantBiz.setCreaterSn(user.getUserId().toString());
+            thirdMerchantBiz.setModerSn(user.getUserId().toString());
+        }else {
+            throw new RRException("登陆用户失效,请重新登陆!");
+        }
+        thirdMerchantBizService.save(thirdMerchantBiz);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("thirdmerchantbiz:update")
+    @ResponseBody
+    public R update(@RequestBody ThirdMerchantBizEntity thirdMerchantBiz) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user != null) {
+            thirdMerchantBiz.setCreaterSn(user.getUserId().toString());
+            thirdMerchantBiz.setModerSn(user.getUserId().toString());
+        }else {
+            throw new RRException("登陆用户失效,请重新登陆!");
+        }
+        thirdMerchantBizService.update(thirdMerchantBiz);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("thirdmerchantbiz:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]thirdMerchSns) {
+        thirdMerchantBizService.deleteBatch(thirdMerchSns);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        if (Dict.roleType.item_2.getItem().equals(ShiroUtils.getUserEntity().getRoleType())) {
+            StoreEntity storeEntity = storeService.queryObject(ShiroUtils.getUserEntity().getStoreId());
+            if(StringUtils.isNotEmpty(storeEntity.getThirdPartyMerchCode())) {
+                params.put("thirdPartyMerchCode", storeEntity.getThirdPartyMerchCode());
+            }else{
+                throw new RRException("请维护门店信息中的第三方商户编号信息!再进行商品查看");
+            }
+        }
+        List<ThirdMerchantBizEntity> list = thirdMerchantBizService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -15,4 +15,5 @@ import java.util.List;
  */
 public interface BrandDao extends BaseDao<BrandEntity> {
     BrandEntity queryObjectByName(@Param("brandName")String brandName,@Param("merchSn")String merchSn);
+    List<BrandEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 }

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java

@@ -15,5 +15,6 @@ import java.util.List;
  */
 public interface CategoryDao extends BaseDao<CategoryEntity> {
     CategoryEntity queryObjectByName(@Param("cateGoryName") String cateGoryName,@Param("merchSn")String merchSn);
+    List<CategoryEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 
 }

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java

@@ -21,4 +21,5 @@ public interface FreightDao extends BaseDao<FreightEntity> {
     List<FreightEntity> queryEntity(Map<String, Object> map);
 
     FreightEntity queryObjectByName(@Param("defaultFreight")String defaultFreight,@Param("merchSn")String merchSn);
+    List<FreightEntity> queryObjectByStoreId(@Param("storeId") Long storeId);
 }

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

@@ -3,6 +3,7 @@ package com.kmall.admin.dao;
 import com.kmall.admin.entity.OfflineCartEntity;
 import com.kmall.common.dao.BaseDao;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
 
 import java.util.List;
 import java.util.Map;
@@ -14,6 +15,7 @@ import java.util.Map;
  * @email admin@qhdswl.com
  * @date 2018-11-29 15:14:59
  */
+@Component
 public interface OfflineCartDao extends BaseDao<OfflineCartEntity> {
 
     OfflineCartEntity queryObjectByGoodsIdAndType(@Param("goodsId") Integer goodsId, @Param("userId")Long userId);

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java

@@ -0,0 +1,19 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 第三方商户表Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public interface ThirdMerchantBizDao extends BaseDao<ThirdMerchantBizEntity> {
+    List<ThirdMerchantBizEntity> findByMerchSn(String merchSn);
+    ThirdMerchantBizEntity getThirdMerchangByCode(@Param("thirdMerchantCode")String thirdMerchantCode);
+}

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/AttributeEntity.java

@@ -37,6 +37,25 @@ public class AttributeEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java

@@ -44,6 +44,25 @@ public class BrandEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/CategoryEntity.java

@@ -50,6 +50,25 @@ public class CategoryEntity extends Tree<CategoryEntity> {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/FreightEntity.java

@@ -45,8 +45,27 @@ public class FreightEntity implements Serializable {
 
     private String merchSn;
 
+    private String storeName;
+    private String merchName;
+
     private List<FreightItemEntity> freightItemEntityList;
 
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
     public Integer getStoreId() {
         return storeId;
     }

+ 51 - 22
kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java

@@ -64,7 +64,7 @@ public class GoodsEntity implements Serializable {
     //商品税率
     private BigDecimal goodsRate;
     //零售价格
-    private BigDecimal retailPrice;
+//    private BigDecimal retailPrice;
     //销售量
     private Integer sellVolume;
     //主sku product_id
@@ -86,8 +86,12 @@ public class GoodsEntity implements Serializable {
     //热销
     private Integer isHot;
     //市场价
-    private BigDecimal marketPrice;
+//    private BigDecimal marketPrice;
 
+    //零售价格
+    private BigDecimal storeRetailPrice;
+    //市场价
+    private BigDecimal storeMarketPrice;
     /**
      * 产品条码
      */
@@ -175,6 +179,31 @@ public class GoodsEntity implements Serializable {
     //商户编号
     private String merchSn;
     private String merchName;
+    private String thirdPartyMerchCode;
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    public BigDecimal getStoreRetailPrice() {
+        return storeRetailPrice;
+    }
+
+    public void setStoreRetailPrice(BigDecimal storeRetailPrice) {
+        this.storeRetailPrice = storeRetailPrice;
+    }
+
+    public BigDecimal getStoreMarketPrice() {
+        return storeMarketPrice;
+    }
+
+    public void setStoreMarketPrice(BigDecimal storeMarketPrice) {
+        this.storeMarketPrice = storeMarketPrice;
+    }
 
     public String getMerchName() {
         return merchName;
@@ -641,19 +670,19 @@ public class GoodsEntity implements Serializable {
         this.goodsRate = goodsRate;
     }
 
-    /**
-     * 设置:零售价格
-     */
-    public void setRetailPrice(BigDecimal retailPrice) {
-        this.retailPrice = retailPrice;
-    }
-
-    /**
-     * 获取:零售价格
-     */
-    public BigDecimal getRetailPrice() {
-        return retailPrice;
-    }
+//    /**
+//     * 设置:零售价格
+//     */
+//    public void setRetailPrice(BigDecimal retailPrice) {
+//        this.retailPrice = retailPrice;
+//    }
+//
+//    /**
+//     * 获取:零售价格
+//     */
+//    public BigDecimal getRetailPrice() {
+//        return retailPrice;
+//    }
 
     /**
      * 设置:销售量
@@ -781,13 +810,13 @@ public class GoodsEntity implements Serializable {
         return isHot;
     }
 
-    public BigDecimal getMarketPrice() {
-        return marketPrice;
-    }
-
-    public void setMarketPrice(BigDecimal marketPrice) {
-        this.marketPrice = marketPrice;
-    }
+//    public BigDecimal getMarketPrice() {
+//        return marketPrice;
+//    }
+//
+//    public void setMarketPrice(BigDecimal marketPrice) {
+//        this.marketPrice = marketPrice;
+//    }
 
     public List<GoodsAttributeEntity> getAttributeEntityList() {
         return attributeEntityList;

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java

@@ -141,6 +141,16 @@ public class OrderEntity implements Serializable {
     //零售价格
     private BigDecimal retailPrice;
 
+    private String payTransactionId;
+
+    public String getPayTransactionId() {
+        return payTransactionId;
+    }
+
+    public void setPayTransactionId(String payTransactionId) {
+        this.payTransactionId = payTransactionId;
+    }
+
     public String getGoodsName() {
         return goodsName;
     }

+ 181 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java

@@ -0,0 +1,181 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 第三方商户表实体
+ * 表名 third_merchant_biz
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public class ThirdMerchantBizEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 第三方商户编号,主键编号
+     */
+    private Integer thirdMerchSn;
+
+    private String merchSn;
+    /**
+     * 第三方商户代码
+     */
+    private String thirdPartyMerchCode;
+    /**
+     * 第三方商户名称
+     */
+    private String thirdPartyMerchName;
+    /**
+     * 是否有效,0:有效,1:无效
+     */
+    private String isValid;
+    /**
+     * 创建人序号
+     */
+    private String createrSn;
+    /**
+     * 创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date createTime;
+    /**
+     * 
+     */
+    private String moderSn;
+    /**
+     * 修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 设置:第三方商户编号,主键编号
+     */
+    public void setThirdMerchSn(Integer thirdMerchSn) {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    /**
+     * 获取:第三方商户编号,主键编号
+     */
+    public Integer getThirdMerchSn() {
+        return thirdMerchSn;
+    }
+    /**
+     * 设置:第三方商户代码
+     */
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    /**
+     * 获取:第三方商户代码
+     */
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+    /**
+     * 设置:第三方商户名称
+     */
+    public void setThirdPartyMerchName(String thirdPartyMerchName) {
+        this.thirdPartyMerchName = thirdPartyMerchName;
+    }
+
+    /**
+     * 获取:第三方商户名称
+     */
+    public String getThirdPartyMerchName() {
+        return thirdPartyMerchName;
+    }
+    /**
+     * 设置:是否有效,0:有效,1:无效
+     */
+    public void setIsValid(String isValid) {
+        this.isValid = isValid;
+    }
+
+    /**
+     * 获取:是否有效,0:有效,1:无效
+     */
+    public String getIsValid() {
+        return isValid;
+    }
+    /**
+     * 设置:创建人序号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人序号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

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

@@ -0,0 +1,72 @@
+package com.kmall.admin.service;
+
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 第三方商户表Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+public interface ThirdMerchantBizService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param thirdMerchSn 主键
+     * @return 实体
+     */
+    ThirdMerchantBizEntity queryObject(Integer thirdMerchSn);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<ThirdMerchantBizEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param thirdMerchantBiz 实体
+     * @return 保存条数
+     */
+    int save(ThirdMerchantBizEntity thirdMerchantBiz);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param thirdMerchantBiz 实体
+     * @return 更新条数
+     */
+    int update(ThirdMerchantBizEntity thirdMerchantBiz);
+
+    /**
+     * 根据主键删除
+     *
+     * @param thirdMerchSn
+     * @return 删除条数
+     */
+    int delete(Integer thirdMerchSn);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param thirdMerchSns
+     * @return 删除条数
+     */
+    int deleteBatch(Integer[] thirdMerchSns);
+}

+ 29 - 20
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -101,6 +101,7 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
         builder.put("attributeCategory", "商品分类");
         builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
@@ -125,7 +126,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -242,6 +243,7 @@ public class GoodsServiceImpl implements GoodsService {
         Map<String, Object> valideDate = MapBeanUtil.fromObject(goods);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("merchSn", "商户编号");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
         builder.put("attributeCategory", "商品分类");
         builder.put("categoryId", "商品二级分类");
         builder.put("goodsSn", "商品编码");
@@ -267,7 +269,7 @@ public class GoodsServiceImpl implements GoodsService {
                 // 海关信息,普通货物可不添加
                 builder.put("sku", "SKU");
                 builder.put("goodsRate", "商品税率");
-                builder.put("retailPrice", "零售价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("brand", "产品品牌");
                 builder.put("unitCode", "计量单位代码");
                 builder.put("cusGoodsCode", "海关商品编码");
@@ -323,7 +325,7 @@ public class GoodsServiceImpl implements GoodsService {
         if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
             for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
                 //修改该商品的所属商户信息,如在该商户门店中有该上架的商品信息,则提示该商品不能修改
-                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                /*if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
                         && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
                     if (goods.getRetailPrice() != null) {
                         productStoreRela.setRetailPrice(goods.getRetailPrice());
@@ -345,6 +347,13 @@ public class GoodsServiceImpl implements GoodsService {
                     } else {
                         throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
                     }
+                }*/
+                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                        && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
+                }else {
+                    if (goods.getIsOnSale() != Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
+                    }
                 }
             }
         }
@@ -354,8 +363,8 @@ public class GoodsServiceImpl implements GoodsService {
         List<CartEntity> cartList = cartDao.queryList(cartMap);
         if (cartList != null && cartList.size() > 0) {
             for (CartEntity cartEntity : cartList) {
-                cartEntity.setRetailPrice(goods.getRetailPrice());
-                cartEntity.setMarketPrice(goods.getMarketPrice());
+//                cartEntity.setRetailPrice(goods.getRetailPrice());
+//                cartEntity.setMarketPrice(goods.getMarketPrice());
                 cartEntity.setSku(goods.getSku());
                 cartEntity.setGoodsName(goods.getName());
                 cartEntity.setGoodsSn(goods.getGoodsSn());
@@ -568,8 +577,8 @@ public class GoodsServiceImpl implements GoodsService {
                 builder.put("goodsUnit", "商品单位");
                 builder.put("isHotStr", "热销");
                 builder.put("prodBarcode", "产品条码");
-                builder.put("marketPrice", "市场价");
-                builder.put("retailPrice", "零售价");
+//                builder.put("marketPrice", "市场价");
+//                builder.put("retailPrice", "零售价");
                 builder.put("supplierName", "供应商");
                 R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
                 if (Integer.valueOf(r.get("code").toString()) != 0) {
@@ -703,8 +712,8 @@ public class GoodsServiceImpl implements GoodsService {
                 }
                 goodsEntity.setIsOnSale(Integer.parseInt(goodsDto.getIsOnSaleStr()));
                 goodsEntity.setIsHot(Integer.parseInt(goodsDto.getIsHotStr()));
-                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
-                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
+//                goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
+//                goodsEntity.setMarketPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getMarketPrice())));
                 goodsEntity.setGoodsSn(goodsDto.getGoodsSn());
                 goodsEntity.setSku(goodsDto.getSku());
                 goodsEntity.setName(goodsDto.getName());
@@ -731,17 +740,17 @@ public class GoodsServiceImpl implements GoodsService {
                     }else{
                         goodsDao.save(goodsEntity);
                     }
-                    // 保税商品修改各个门店商品价格
-                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
-                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
-                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
-                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
-                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
-                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
-                                productStoreRelaDao.update(productStoreRela);
-                            }
-                        }
-                    }
+//                    // 保税商品修改各个门店商品价格
+//                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
+//                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
+//                        if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
+//                            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
+//                                productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
+//                                productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
+//                                productStoreRelaDao.update(productStoreRela);
+//                            }
+//                        }
+//                    }
                     // 修改产品
                     ProductEntity product = productDao.queryObjectBySn(goodsDto.getGoodsSn());
 

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/OfflineCartServiceImpl.java

@@ -84,8 +84,8 @@ public class OfflineCartServiceImpl implements OfflineCartService {
             cartEntity.setProdBarcode(goods.getProdBarcode());
             cartEntity.setSku(goods.getSku());
             cartEntity.setProductId(Integer.parseInt(goods.getProductId()));
-            cartEntity.setMarketPrice(goods.getMarketPrice());
-            cartEntity.setRetailPrice(goods.getRetailPrice());
+            cartEntity.setMarketPrice(goods.getStoreMarketPrice());
+            cartEntity.setRetailPrice(goods.getStoreRetailPrice());
             cartEntity.setNumber(1);
             cartEntity.setStockNum(Integer.parseInt(goods.getStockNum()));
             cartEntity.setListPicUrl(goods.getListPicUrl());

+ 60 - 21
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -37,6 +37,12 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
     private GoodsGalleryDao goodsGalleryDao;
     @Autowired
     private CartDao cartDao;
+    @Autowired
+    private BrandDao brandDao;
+    @Autowired
+    private FreightDao freightDao;
+    @Autowired
+    private CategoryDao categoryDao;
 
     @Override
     public ProductStoreRelaEntity queryObject(Integer id) {
@@ -75,13 +81,27 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
                 // 普通商品校验商品规格
                 builder.put("specification", "规格");
-                builder.put("retailPrice", "零售价");
-                builder.put("marketPrice", "市场价");
             }
+            builder.put("retailPrice", "零售价");
+            builder.put("marketPrice", "市场价");
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {
                 throw new RRException(r.get("msg").toString());
             }
+
+            //商品配置校验
+            List<CategoryEntity> categoryEntity = categoryDao.queryObjectByStoreId(productStoreRela.getStoreId());
+            if(categoryEntity == null || categoryEntity.size() == 0){
+                throw new RRException("该门店商品类型没有数据!请先在商品配置》商品类型中维护门店编号为【"+productStoreRela.getStoreId()+"】的商品类型信息,再来操作门店商品数据");
+            }
+            List<BrandEntity> brandEntity = brandDao.queryObjectByStoreId(productStoreRela.getStoreId());
+            if(brandEntity == null || brandEntity.size() == 0){
+                throw new RRException("该门店商品品牌没有数据!请先在商品配置》品牌制造商中维护门店编号为【"+productStoreRela.getStoreId()+"】的品牌信息,再来操作门店商品数据");
+            }
+            List<FreightEntity> freightEntity = freightDao.queryObjectByStoreId(productStoreRela.getStoreId());
+            if(freightEntity == null || freightEntity.size() == 0){
+                throw new RRException("该门店商品运费没有数据!请先在商品配置》运费模板中维护门店编号为【"+productStoreRela.getStoreId()+"】的商品运费信息,再来操作门店商品数据");
+            }
             if(!StringUtils.isNotEmpty(goodsEntity.getListPicUrl())){
                 throw new RRException("该商品列表图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品列表图信息,再来操作门店商品数据");
             }
@@ -94,6 +114,9 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             }
         }
 
+        if(!goodsEntity.getMerchSn().equalsIgnoreCase(productStoreRela.getMerchSn())) {
+            throw new RRException("该商品所属商户不属于该门店所属商户!");
+        }
         Map<String, Object> map = new HashMap();
         map.put("goodsId", goodsEntity.getId());
         map.put("storeId", productStoreRela.getStoreId());
@@ -104,13 +127,14 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
 
         SysUserEntity user = ShiroUtils.getUserEntity();
         ProductEntity product = productDao.queryObjectBySn(goodsEntity.getGoodsSn());
-        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            GoodsEntity goods = new GoodsEntity();
-            goods.setRetailPrice(productStoreRela.getRetailPrice());
-            goods.setMarketPrice(productStoreRela.getMarketPrice());
-            goods.setId(goodsEntity.getId());
-            goodsDao.update(goods);
 
+//        GoodsEntity goods = new GoodsEntity();
+//        goods.setRetailPrice(productStoreRela.getRetailPrice());
+//        goods.setMarketPrice(productStoreRela.getMarketPrice());
+//        goods.setId(goodsEntity.getId());
+//        goodsDao.update(goods);
+
+        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
             GoodsSpecificationEntity goodsSpecificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
             if(goodsSpecificationEntity != null){
                 goodsSpecificationDao.delete(goodsSpecificationEntity.getId());
@@ -121,16 +145,14 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             goodsSpecification.setValue(productStoreRela.getSpecification());
             goodsSpecification.setSpecificationId(1);
             goodsSpecificationDao.save(goodsSpecification);
-
             // 修改产品
             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
             productDao.update(product);
-
-        } else {
+        }/* else {
             productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
             productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());
-        }
+        }*/
 
         productStoreRela.setProductId(product.getId());
         productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
@@ -139,6 +161,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         productStoreRela.setCreateTime(new Date());
         productStoreRela.setModerSn(user.getUserId().toString());
         productStoreRela.setModTime(new Date());
+        productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
         return productStoreRelaDao.save(productStoreRela);
     }
 
@@ -163,14 +186,31 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
                 // 普通商品校验商品规格
                 builder.put("specification", "规格");
-                builder.put("retailPrice", "零售价");
-                builder.put("marketPrice", "市场价");
             }
+            builder.put("retailPrice", "零售价");
+            builder.put("marketPrice", "市场价");
             r = ValidatorUtil.isEmpty(builder.build(), valideDate);
             if (Integer.valueOf(r.get("code").toString()) != 0) {
                 throw new RRException(r.get("msg").toString());
             }
         }
+        //商品配置校验
+        List<CategoryEntity> categoryEntity = categoryDao.queryObjectByStoreId(productStoreRela.getStoreId());
+        if(categoryEntity == null || categoryEntity.size() == 0){
+            throw new RRException("该门店商品类型没有数据!请先在商品配置》商品类型中维护门店编号为【"+productStoreRela.getStoreId()+"】的商品类型信息,再来操作门店商品数据");
+        }
+        List<BrandEntity> brandEntity = brandDao.queryObjectByStoreId(productStoreRela.getStoreId());
+        if(brandEntity == null || brandEntity.size() == 0){
+            throw new RRException("该门店商品品牌没有数据!请先在商品配置》品牌制造商中维护门店编号为【"+productStoreRela.getStoreId()+"】的品牌信息,再来操作门店商品数据");
+        }
+        List<FreightEntity> freightEntity = freightDao.queryObjectByStoreId(productStoreRela.getStoreId());
+        if(freightEntity == null || freightEntity.size() == 0){
+            throw new RRException("该门店商品运费没有数据!请先在商品配置》运费模板中维护门店编号为【"+productStoreRela.getStoreId()+"】的商品运费信息,再来操作门店商品数据");
+        }
+
+        if(!goodsEntity.getMerchSn().equalsIgnoreCase(productStoreRela.getMerchSn())) {
+            throw new RRException("该商品所属商户不属于该门店所属商户!");
+        }
 
         Map<String, Object> map = new HashMap();
         map.put("goodsId", goodsEntity.getId());
@@ -182,12 +222,12 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         }
 
         SysUserEntity user = ShiroUtils.getUserEntity();
+//        GoodsEntity goods = new GoodsEntity();
+//        goods.setRetailPrice(productStoreRela.getRetailPrice());
+//        goods.setMarketPrice(productStoreRela.getMarketPrice());
+//        goods.setId(goodsEntity.getId());
+//        goodsDao.update(goods);
         if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            GoodsEntity goods = new GoodsEntity();
-            goods.setRetailPrice(productStoreRela.getRetailPrice());
-            goods.setMarketPrice(productStoreRela.getMarketPrice());
-            goods.setId(goodsEntity.getId());
-            goodsDao.update(goods);
             // 添加商品规格
             GoodsSpecificationEntity goodsSpecification = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
             goodsSpecification.setValue(productStoreRela.getSpecification());
@@ -198,8 +238,6 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
             productDao.update(product);
-        } else {
-            productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
         }
 
         Map cartMap = new HashMap();
@@ -219,6 +257,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
 
         productStoreRela.setModerSn(user.getUserId().toString());
         productStoreRela.setModTime(new Date());
+        productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
         return productStoreRelaDao.update(productStoreRela);
     }
 

+ 24 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/StoreServiceImpl.java

@@ -2,8 +2,10 @@ package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.MerchDao;
 import com.kmall.admin.dao.StoreDao;
+import com.kmall.admin.dao.ThirdMerchantBizDao;
 import com.kmall.admin.entity.MerchEntity;
 import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
 import com.kmall.admin.service.StoreService;
 import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
 import com.kmall.common.utils.RRException;
@@ -27,6 +29,8 @@ public class StoreServiceImpl implements StoreService {
     private StoreDao storeDao;
     @Autowired
     private MerchDao merchDao;
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
 
     @Override
     public StoreEntity queryObject(Integer id) {
@@ -57,6 +61,16 @@ public class StoreServiceImpl implements StoreService {
                 throw new RRException("商户编号不存在,请先维护用户商户编号信息再来操作");
             }
         }
+        if(StringUtils.isEmpty(store.getThirdPartyMerchCode())){
+            throw new RRException("第三方商户编号不能为空");
+        }else{
+            ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(store.getThirdPartyMerchCode());
+            if(thirdMerchantBizEntity != null){
+                store.setThirdPartyMerchName(thirdMerchantBizEntity.getThirdPartyMerchName());
+            }else{
+                throw new RRException("第三方商户编号【"+store.getThirdPartyMerchCode()+"】不存在,请先维护第三方商户信息再来操作");
+            }
+        }
         return storeDao.save(store);
     }
 
@@ -72,6 +86,16 @@ public class StoreServiceImpl implements StoreService {
                 throw new RRException("商户编号不存在,请先维护用户商户编号信息再来操作");
             }
         }
+        if(StringUtils.isEmpty(store.getThirdPartyMerchCode())){
+            throw new RRException("第三方商户编号不能为空");
+        }else{
+            ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(store.getThirdPartyMerchCode());
+            if(thirdMerchantBizEntity != null){
+                store.setThirdPartyMerchName(thirdMerchantBizEntity.getThirdPartyMerchName());
+            }else{
+                throw new RRException("第三方商户编号【"+store.getThirdPartyMerchCode()+"】不存在,请先维护第三方商户信息再来操作");
+            }
+        }
         return storeDao.update(store);
     }
 

+ 71 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/ThirdMerchantBizServiceImpl.java

@@ -0,0 +1,71 @@
+package com.kmall.admin.service.impl;
+
+import com.kmall.admin.dao.ThirdMerchantBizDao;
+import com.kmall.admin.entity.ThirdMerchantBizEntity;
+import com.kmall.admin.service.ThirdMerchantBizService;
+import com.kmall.common.utils.RRException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 第三方商户表Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-02-15 11:43:32
+ */
+@Service("thirdMerchantBizService")
+public class ThirdMerchantBizServiceImpl implements ThirdMerchantBizService {
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
+
+    @Override
+    public ThirdMerchantBizEntity queryObject(Integer thirdMerchSn) {
+        return thirdMerchantBizDao.queryObject(thirdMerchSn);
+    }
+
+    @Override
+    public List<ThirdMerchantBizEntity> queryList(Map<String, Object> map) {
+        return thirdMerchantBizDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return thirdMerchantBizDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(ThirdMerchantBizEntity thirdMerchantBiz) {
+        ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(thirdMerchantBiz.getThirdPartyMerchCode());
+        if(thirdMerchantBizEntity != null){
+            throw new RRException("第三方商户编号为【"+thirdMerchantBiz.getThirdPartyMerchCode()+"】的第三方商户信息已存在");
+        }
+        thirdMerchantBiz.setCreateTime(new Date());
+        thirdMerchantBiz.setModTime(new Date());
+        return thirdMerchantBizDao.save(thirdMerchantBiz);
+    }
+
+    @Override
+    public int update(ThirdMerchantBizEntity thirdMerchantBiz) {
+        ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(thirdMerchantBiz.getThirdPartyMerchCode());
+        if (thirdMerchantBizEntity != null && !thirdMerchantBizEntity.getThirdMerchSn().equals(thirdMerchantBiz.getThirdMerchSn())) {
+            throw new RRException("第三方商户编号为【"+thirdMerchantBiz.getThirdPartyMerchCode()+"】的第三方商户信息已存在");
+        }
+        thirdMerchantBiz.setModTime(new Date());
+        return thirdMerchantBizDao.update(thirdMerchantBiz);
+    }
+
+    @Override
+    public int delete(Integer thirdMerchSn) {
+        return thirdMerchantBizDao.delete(thirdMerchSn);
+    }
+
+    @Override
+    public int deleteBatch(Integer[]thirdMerchSns) {
+        return thirdMerchantBizDao.deleteBatch(thirdMerchSns);
+    }
+}

+ 2 - 2
kmall-admin/src/main/resources/XmlTemplate/GeneralGoodsDtoList.xml

@@ -17,8 +17,8 @@
                 <mapping row="1" col="9">GoodsDto.isOnSaleStr</mapping>
                 <mapping row="1" col="10">GoodsDto.goodsUnit</mapping>
                 <mapping row="1" col="11">GoodsDto.isHotStr</mapping>
-                <mapping row="1" col="12">GoodsDto.marketPrice</mapping>
-                <mapping row="1" col="13">GoodsDto.retailPrice</mapping>
+                <!--<mapping row="1" col="12">GoodsDto.marketPrice</mapping>-->
+                <!--<mapping row="1" col="13">GoodsDto.retailPrice</mapping>-->
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

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

@@ -21,13 +21,13 @@
                 <mapping row="1" col="13">GoodsDto.cusGoodsCode</mapping>
                 <mapping row="1" col="14">GoodsDto.ciqProdModel</mapping>
                 <mapping row="1" col="15">GoodsDto.goodsRate</mapping>
-                <mapping row="1" col="16">GoodsDto.marketPrice</mapping>
-                <mapping row="1" col="17">GoodsDto.retailPrice</mapping>
-                <mapping row="1" col="18">GoodsDto.brand</mapping>
-                <mapping row="1" col="19">GoodsDto.unitName</mapping>
-                <mapping row="1" col="20">GoodsDto.oriCntName</mapping>
-                <mapping row="1" col="21">GoodsDto.cusDeclEle</mapping>
-                <mapping row="1" col="22">GoodsDto.cusRecCode</mapping>
+                <!--<mapping row="1" col="16">GoodsDto.marketPrice</mapping>-->
+                <!--<mapping row="1" col="17">GoodsDto.retailPrice</mapping>-->
+                <mapping row="1" col="16">GoodsDto.brand</mapping>
+                <mapping row="1" col="17">GoodsDto.unitName</mapping>
+                <mapping row="1" col="18">GoodsDto.oriCntName</mapping>
+                <mapping row="1" col="19">GoodsDto.cusDeclEle</mapping>
+                <mapping row="1" col="20">GoodsDto.cusRecCode</mapping>
             </section>
             <loopbreakcondition>
                 <rowcheck offset="0">

+ 7 - 1
kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml

@@ -12,6 +12,8 @@
         <result property="inputType" column="input_type"/>
         <result property="value" column="value"/>
         <result property="sortOrder" column="sort_order"/>
+        <result property="storeName" column="storeName"/>
+        <result column="merchName" property="merchName" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.AttributeEntity">
@@ -38,9 +40,13 @@
         a.input_type,
         a.VALUE,
         a.sort_order,
-        c.NAME category_name
+        c.NAME category_name,
+        s.store_name storeName,
+        m.merch_name merchName
         FROM mall_attribute a
         LEFT JOIN mall_category c ON a.attribute_category_id = c.id
+        left join mall_store s on a.store_id = s.id
+        left join mall_merch m on a.merch_sn = m.merch_sn
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
             AND a.store_id = #{storeId}

+ 30 - 14
kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml

@@ -18,6 +18,8 @@
         <result property="isNew" column="is_new"/>
         <result property="newPicUrl" column="new_pic_url"/>
         <result property="newSortOrder" column="new_sort_order"/>
+        <result property="storeName" column="storeName"/>
+        <result column="merchName" property="merchName" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.BrandEntity">
@@ -55,37 +57,51 @@
         `app_list_pic_url`,
         `is_new`,
         `new_pic_url`,
-        `new_sort_order`
-        from mall_brand
+        `new_sort_order`,
+        s.store_name storeName,
+        m.merch_name merchName
+        from mall_brand b
+        left join mall_store s on b.store_id = s.id
+        left join mall_merch m on b.merch_sn = m.merch_sn
         where `name` = #{brandName}
         <if test="merchSn != null and merchSn.trim() != ''">
             AND merch_sn = #{merchSn}
         </if>
     </select>
 
+    <select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.BrandEntity">
+        select *
+        from mall_brand
+        where store_id = #{storeId}
+    </select>
+
     <select id="queryList" resultType="com.kmall.admin.entity.BrandEntity">
         select
-        `id`,
-        `name`,
-        `store_id`,
-        `merch_sn`,
+        b.id,
+        b.name,
+        b.store_id,
+        b.merch_sn,
         `list_pic_url`,
         `simple_desc`,
         `pic_url`,
-        `sort_order`,
-        `is_show`,
+        b.sort_order,
+        b.is_show,
         `floor_price`,
         `app_list_pic_url`,
-        `is_new`,
+        b.is_new,
         `new_pic_url`,
-        `new_sort_order`
-        from mall_brand
+        b.new_sort_order,
+        s.store_name storeName,
+        m.merch_name merchName
+        from mall_brand b
+        left join mall_store s on b.store_id = s.id
+        left join mall_merch m on b.merch_sn = m.merch_sn
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
-            AND store_id = #{storeId}
+            AND b.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
-            AND merch_sn = #{merchSn}
+            AND b.merch_sn = #{merchSn}
         </if>
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
@@ -95,7 +111,7 @@
                 order by ${sidx} ${order}
             </when>
             <otherwise>
-                order by id desc
+                order by b.id desc
             </otherwise>
         </choose>
         <if test="offset != null and limit != null">

+ 24 - 13
kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml

@@ -21,6 +21,8 @@
         <result property="level" column="level"/>
         <result property="type" column="type"/>
         <result property="frontName" column="front_name"/>
+		<result property="storeName" column="storeName"/>
+		<result column="merchName" property="merchName" />
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.CategoryEntity">
@@ -73,18 +75,23 @@
 		</if> and is_show = 1
 	</select>
 
+	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.CategoryEntity">
+		select *
+		from mall_category
+		where store_id = #{storeId}
+	</select>
+
 	<select id="queryList" resultType="com.kmall.admin.entity.CategoryEntity">
 		select
-    		`id`,
-    		`name`,
-			`store_id`,
-			`merch_sn`,
+    		b.id,
+    		b.name,
+			b.store_id,
+			b.merch_sn,
     		`keywords`,
     		`front_desc`,
     		`parent_id`,
-    		`sort_order`,
+    		b.sort_order,
     		`show_index`,
-    		`is_show`,
     		`banner_url`,
     		`icon_url`,
     		`img_url`,
@@ -92,23 +99,27 @@
     		`level`,
     		`type`,
     		`front_name`,
-			`is_show` as `show`
-		from mall_category
+			b.is_show as `show`,
+		s.store_name storeName,
+		m.merch_name merchName
+		from mall_category b
+		left join mall_store s on b.store_id = s.id
+		left join mall_merch m on b.merch_sn = m.merch_sn
 		WHERE 1=1
 		<if test="storeId != null and storeId != ''">
-			AND store_id = #{storeId}
+			AND b.store_id = #{storeId}
 		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
-			AND merch_sn = #{merchSn}
+			AND b.merch_sn = #{merchSn}
 		</if>
 		<if test="name != null and name.trim() != ''">
-			AND `name` LIKE concat('%',#{name},'%')
+			AND b.name LIKE concat('%',#{name},'%')
 		</if>
 		<if test="parentId != null and parentId != ''">
 			AND `parent_id` = #{parentId}
 		</if>
 		<if test="isShow != null and isShow != ''">
-			AND `is_show` = #{isShow}
+			AND b.is_show = #{isShow}
 		</if>
 		<if test="isL2 != null and isL2 != ''">
 			AND `parent_id` != #{isL2}
@@ -118,7 +129,7 @@
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by sort_order
+                order by b.sort_order
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 31 - 11
kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml

@@ -12,6 +12,8 @@
 		<result property="pricingManner" column="pricing_manner"/>
 		<result property="defaultFreight" column="default_freight"/>
 		<result property="isDefault" column="is_default"/>
+		<result property="storeName" column="storeName"/>
+		<result column="merchName" property="merchName" />
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.FreightEntity">
@@ -45,36 +47,54 @@
 		</if>
 	</select>
 
+	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.FreightEntity">
+		select
+		`id`,
+		`name`,
+		`store_id`,
+		`merch_sn`,
+		`template_type`,
+		`pricing_manner`,
+		`default_freight`,
+		`is_default`
+		from mall_freight
+		where store_id = #{storeId}
+	</select>
+
 	<select id="queryList" resultType="com.kmall.admin.entity.FreightEntity">
 		select
-    		`id`,
-    		`name`,
-			`store_id`,
-			`merch_sn`,
+    		b.id,
+    		b.name,
+			b.store_id,
+			b.merch_sn,
     		`template_type`,
     		`pricing_manner`,
 			`default_freight`,
-    		`is_default`
-		from mall_freight
+    		`is_default`,
+		s.store_name storeName,
+		m.merch_name merchName
+		from mall_freight b
+		left join mall_store s on b.store_id = s.id
+		left join mall_merch m on b.merch_sn = m.merch_sn
 		WHERE 1=1
 		<if test="storeId != null and storeId != ''">
-			AND store_id = #{storeId}
+			AND b.store_id = #{storeId}
 		</if>
 		<if test="merchSn != null and merchSn.trim() != ''">
-			AND merch_sn = #{merchSn}
+			AND b.merch_sn = #{merchSn}
 		</if>
 		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+			AND b.name LIKE concat('%',#{name},'%')
 		</if>
 		<if test="id != null and id != ''">
-			AND id LIKE concat('%',#{id},'%')
+			AND b.id LIKE concat('%',#{id},'%')
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
             </when>
 			<otherwise>
-                order by id desc
+                order by b.id desc
 			</otherwise>
         </choose>
 		<if test="offset != null and limit != null">

+ 19 - 9
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -27,7 +27,7 @@
         <result property="goodsUnit" column="goods_unit"/>
         <result property="primaryPicUrl" column="primary_pic_url"/>
         <result property="listPicUrl" column="list_pic_url"/>
-        <result property="retailPrice" column="retail_price"/>
+        <!--<result property="retailPrice" column="retail_price"/>-->
         <result property="sellVolume" column="sell_volume"/>
         <result property="primaryProductId" column="primary_product_id"/>
         <result property="unitPrice" column="unit_price"/>
@@ -37,7 +37,7 @@
         <result property="isAppExclusive" column="is_app_exclusive"/>
         <result property="isLimited" column="is_limited"/>
         <result property="isHot" column="is_hot"/>
-        <result property="marketPrice" column="market_price"/>
+        <!--<result property="marketPrice" column="market_price"/>-->
         <result property="goodsType" column="goodsType"/>
         <result property="sku" column="sku"/>
         <result property="goodsBizType" column="goods_biz_type"/>
@@ -60,6 +60,9 @@
         <result property="productId" column="productId"/>
         <result property="storeId" column="storeId"/>
         <result column="merch_name" property="merchName" />
+        <result column="storeMarketPrice" property="storeMarketPrice" />
+        <result column="storeRetailPrice" property="storeRetailPrice" />
+        <result column="third_party_merch_code" property="thirdPartyMerchCode" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
@@ -75,7 +78,7 @@
 
     <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
         SELECT
-            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price,r.retail_price,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
+            a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeRetailPrice,r.retail_price storeMarketPrice,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
         FROM
             mall_goods a
         LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
@@ -128,6 +131,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
@@ -161,6 +167,10 @@
         <if test="goodsBizType != null and goodsBizType != ''">
             AND mall_goods.goods_biz_type = #{goodsBizType}
         </if>
+        <!--<if test="storeId != null and storeId != ''">-->
+            <!--AND mall_goods.id not in (select goods_id from mall_product_store_rela where store_id = #{storeId})-->
+        <!--</if>-->
+
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -215,6 +225,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND mall_goods.merch_sn = #{merchSn}
         </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
         <if test="goodsSn != null and goodsSn != ''">
             AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
         </if>
@@ -247,6 +260,7 @@
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">
         insert into mall_goods(
             `merch_sn`,
+            third_party_merch_code,
 			`category_id`,
             `supplier_id`,
 			`goods_sn`,
@@ -279,7 +293,6 @@
 			`primary_pic_url`,
 			`list_pic_url`,
 			`goods_rate`,
-			`retail_price`,
 			`sell_volume`,
 			`primary_product_id`,
 			`unit_price`,
@@ -289,7 +302,6 @@
 			`is_app_exclusive`,
 			`is_limited`,
 			`is_hot`,
-			`market_price`,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -297,6 +309,7 @@
 			`tstm`)
 		values(
 			#{merchSn},
+            #{thirdPartyMerchCode},
 			#{categoryId},
             #{supplierId},
 			#{goodsSn},
@@ -329,7 +342,6 @@
 			#{primaryPicUrl},
 			#{listPicUrl},
 			#{goodsRate},
-			#{retailPrice},
 			#{sellVolume},
 			#{primaryProductId},
 			#{unitPrice},
@@ -339,7 +351,6 @@
 			#{isAppExclusive},
 			#{isLimited},
 			#{isHot},
-			#{marketPrice},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -351,6 +362,7 @@
         update mall_goods
         <set>
             <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+            <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
             <if test="categoryId != null">`category_id` = #{categoryId}, </if>
             <if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
             <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
@@ -383,7 +395,6 @@
             <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl}, </if>
             <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl}, </if>
             <if test="goodsRate != null">`goods_rate` = #{goodsRate}, </if>
-            <if test="retailPrice != null">`retail_price` = #{retailPrice}, </if>
             <if test="sellVolume != null">`sell_volume` = #{sellVolume}, </if>
             <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId}, </if>
             <if test="unitPrice != null">`unit_price` = #{unitPrice}, </if>
@@ -393,7 +404,6 @@
             <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive}, </if>
             <if test="isLimited != null">`is_limited` = #{isLimited}, </if>
             <if test="isHot != null">`is_hot` = #{isHot}, </if>
-            <if test="marketPrice != null">`market_price` = #{marketPrice}, </if>
             <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
             <if test="createTime != null">`create_time` = #{createTime}, </if>
             <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>

+ 19 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -60,6 +60,7 @@
         <result property="isOnfflineOrder" column="is_onffline_order"/>
         <result property="orderSnWx" column="order_sn_wx"/>
         <result property="isMergePay" column="is_merge_pay"/>
+        <result property="payTransactionId" column="pay_transaction_id"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
@@ -103,6 +104,12 @@
         LEFT JOIN mall_user u ON o.user_id = u.id
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
         WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
@@ -166,6 +173,12 @@
         LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
         Left join mall_order_goods g on o.id = g.order_id
         WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
@@ -214,6 +227,12 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_order o WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>

+ 167 - 0
kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml

@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.admin.dao.ThirdMerchantBizDao">
+
+    <resultMap type="com.kmall.admin.entity.ThirdMerchantBizEntity" id="thirdMerchantBizMap">
+        <result property="thirdMerchSn" column="third_merch_sn"/>
+		<result property="merchSn" column="merch_sn"/>
+        <result property="thirdPartyMerchCode" column="third_party_merch_code"/>
+        <result property="thirdPartyMerchName" column="third_party_merch_name"/>
+        <result property="isValid" column="is_valid"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+			`third_merch_sn`,
+            `merch_sn`,
+			`third_party_merch_code`,
+			`third_party_merch_name`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from third_merchant_biz
+		where third_merch_sn = #{id}
+	</select>
+
+	<select id="findByMerchSn" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+		`third_merch_sn`,
+		`merch_sn`,
+		`third_party_merch_code`,
+		`third_party_merch_name`,
+		`is_valid`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from third_merchant_biz
+		where merch_sn = #{value}
+	</select>
+
+	<select id="getThirdMerchangByCode" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+		`third_merch_sn`,
+		`merch_sn`,
+		`third_party_merch_code`,
+		`third_party_merch_name`,
+		`is_valid`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`
+		from third_merchant_biz
+		where third_party_merch_code = #{thirdMerchantCode}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+    		`third_merch_sn`,
+			`merch_sn`,
+    		`third_party_merch_code`,
+    		`third_party_merch_name`,
+    		`is_valid`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from third_merchant_biz
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+		<if test="merchSn != null and merchSn.trim() != ''">
+			and merch_sn = #{merchSn}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			and third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by third_merch_sn desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from third_merchant_biz
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+		<if test="merchSn != null and merchSn.trim() != ''">
+			and merch_sn = #{merchSn}
+		</if>
+		<if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+			and third_party_merch_code = #{thirdPartyMerchCode}
+		</if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.admin.entity.ThirdMerchantBizEntity" useGeneratedKeys="true" keyProperty="thirdMerchSn">
+		insert into third_merchant_biz(
+			`merch_sn`,
+			`third_party_merch_code`,
+			`third_party_merch_name`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{thirdPartyMerchCode},
+			#{thirdPartyMerchName},
+			#{isValid},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		update third_merchant_biz 
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn},</if>
+			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
+			<if test="thirdPartyMerchName != null">`third_party_merch_name` = #{thirdPartyMerchName}, </if>
+			<if test="isValid != null">`is_valid` = #{isValid}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where third_merch_sn = #{thirdMerchSn}
+	</update>
+	
+	<delete id="delete">
+		delete from third_merchant_biz where third_merch_sn = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from third_merchant_biz where third_merch_sn in 
+		<foreach item="thirdMerchSn" collection="array" open="(" separator="," close=")">
+			#{thirdMerchSn}
+		</foreach>
+	</delete>
+
+</mapper>

+ 20 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html

@@ -69,6 +69,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="描述" prop="simpleDesc">
                 <i-input type="textarea" v-model="brand.simpleDesc" placeholder="描述"/>
             </Form-item>
@@ -95,6 +100,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="排序" prop="sortOrder">
                 <Input-number :min="0" :step="1" v-model="brand.sortOrder" placeholder="排序" style="width: 188px;"/>
             </Form-item>
@@ -134,6 +144,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* app显示图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="新品牌" prop="isNew">
                 <Radio-group v-model="brand.isNew">
                     <Radio label="1">
@@ -167,6 +182,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 新品牌图片尺寸建议760*484像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <Form-item label="新品牌排序" prop="newSortOrder">
                 <Input-number :min="0" :step="1" v-model="brand.newSortOrder" placeholder="新品牌排序"
                               style="width: 188px;"/>

+ 67 - 47
kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html

@@ -86,33 +86,38 @@
                     </Radio>
                 </Radio-group>
             </Form-item>
+            <!--<Row>-->
+                <!--<i-col span="16">-->
+                    <!--<Form-item label="banner图片" prop="bannerUrl">-->
+                        <!--<i-input v-model="category.bannerUrl" placeholder="banner图片" readonly/>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"-->
+                                <!--max-size="2048"-->
+                                <!--:on-success="handleSuccessBannerUrl" :on-format-error="handleFormatError"-->
+                                <!--:show-upload-list="false"-->
+                                <!--:on-exceeded-size="handleMaxSize">-->
+                            <!--<i-button icon="ios-cloud-upload-outline">上传图片</i-button>-->
+                        <!--</Upload>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<i-button icon="eye" @click="eyeImageBannerUrl">预览图片</i-button>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+            <!--</Row>-->
+            <!--<Row>-->
+                <!--<i-col span="16" style="margin-top: -30px;">-->
+                    <!--<span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议320*105像素以内,大小2M以下</span>-->
+                <!--</i-col>-->
+            <!--</Row>-->
             <Row>
                 <i-col span="16">
-                    <Form-item label="banner图片" prop="bannerUrl">
-                        <i-input v-model="category.bannerUrl" placeholder="banner图片" readonly/>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
-                                :on-success="handleSuccessBannerUrl" :on-format-error="handleFormatError"
-                                :show-upload-list="false"
-                                :on-exceeded-size="handleMaxSize">
-                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
-                        </Upload>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <i-button icon="eye" @click="eyeImageBannerUrl">预览图片</i-button>
-                    </Form-item>
-                </i-col>
-            </Row>
-            <Row>
-                <i-col span="16">
-                    <Form-item label="icon链接" prop="iconUrl">
-                        <i-input v-model="category.iconUrl" placeholder="icon链接" readonly/>
+                    <Form-item label="首页icon" prop="iconUrl">
+                        <i-input v-model="category.iconUrl" placeholder="首页icon" readonly/>
                     </Form-item>
                 </i-col>
                 <i-col span="4">
@@ -133,32 +138,42 @@
                 </i-col>
             </Row>
             <Row>
-                <i-col span="16">
-                    <Form-item label="图片" prop="imgUrl">
-                        <i-input v-model="category.imgUrl" placeholder="图片" readonly/>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
-                                :on-success="handleSuccessImgUrl" :on-format-error="handleFormatError"
-                                :show-upload-list="false"
-                                :on-exceeded-size="handleMaxSize">
-                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
-                        </Upload>
-                    </Form-item>
-                </i-col>
-                <i-col span="4">
-                    <Form-item :label-width="1">
-                        <i-button icon="eye" @click="eyeImageImgUrl">预览图片</i-button>
-                    </Form-item>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议90*90像素以内,大小2M以下</span>
                 </i-col>
             </Row>
+            <!--<Row>-->
+                <!--<i-col span="16">-->
+                    <!--<Form-item label="图片" prop="imgUrl">-->
+                        <!--<i-input v-model="category.imgUrl" placeholder="图片" readonly/>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"-->
+                                <!--max-size="2048"-->
+                                <!--:on-success="handleSuccessImgUrl" :on-format-error="handleFormatError"-->
+                                <!--:show-upload-list="false"-->
+                                <!--:on-exceeded-size="handleMaxSize">-->
+                            <!--<i-button icon="ios-cloud-upload-outline">上传图片</i-button>-->
+                        <!--</Upload>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+                <!--<i-col span="4">-->
+                    <!--<Form-item :label-width="1">-->
+                        <!--<i-button icon="eye" @click="eyeImageImgUrl">预览图片</i-button>-->
+                    <!--</Form-item>-->
+                <!--</i-col>-->
+            <!--</Row>-->
+            <!--<Row>-->
+                <!--<i-col span="16" style="margin-top: -30px;">-->
+                    <!--<span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议320*105像素以内,大小2M以下</span>-->
+                <!--</i-col>-->
+            <!--</Row>-->
             <Row>
                 <i-col span="16">
-                    <Form-item label="手机banner" prop="wapBannerUrl">
-                        <i-input v-model="category.wapBannerUrl" placeholder="手机banner" readonly/>
+                    <Form-item label="分类banner" prop="wapBannerUrl">
+                        <i-input v-model="category.wapBannerUrl" placeholder="分类banner" readonly/>
                     </Form-item>
                 </i-col>
                 <i-col span="4">
@@ -178,6 +193,11 @@
                     </Form-item>
                 </i-col>
             </Row>
+            <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 一级分类图片尺寸建议720*246像素以内,二级分类图片尺寸建议250*250像素以内,大小2M以下</span>
+                </i-col>
+            </Row>
             <!--<Form-item label="类型" prop="type">-->
             <!--<Radio-group v-model="category.type">-->
             <!--<Radio label="0">-->

BIN
kmall-admin/src/main/webapp/WEB-INF/page/shop/file/general_goods_export_yyyy_mm_dd_v1.0.0.xls


BIN
kmall-admin/src/main/webapp/WEB-INF/page/shop/file/goods_export_yyyy_mm_dd_v1.0.0.xls


+ 12 - 7
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -140,11 +140,16 @@
                     </i-col>
                 </Row>
                 <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
-                    <Form-item label="商户" prop="merchSn">
+                <Form-item label="商户" prop="merchSn">
                         <i-select v-model="goods.merchSn" filterable placeholder="商户" @on-change="showMerchInfo" label-in-value>
                             <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
                         </i-select>
                     </Form-item>
+                <Form-item label="第三方商户" prop="merchSn">
+                    <i-select v-model="goods.thirdPartyMerchCode" placeholder="第三方商户" label-in-value>
+                        <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                    </i-select>
+                </Form-item>
                     <Form-item label="商品类型" prop="categoryId" style="height: 30px;">
                         <!--<i-input v-model="goods.categoryName" @on-click="categoryTree" icon="eye" readonly="readonly" placeholder="商品类型"/>-->
                         <i-select v-model="goods.attributeCategory" placeholder="商品分类" @on-change="changeCategories"
@@ -209,12 +214,12 @@
                             </i-option>
                         </i-select>
                     </Form-item>
-                    <Form-item label="市场价" prop="marketPrice">
-                        <Input-number :min="0.01" :step="0.01" v-model="goods.marketPrice" placeholder="市场价" style="width: 268px;"/>
-                    </Form-item>
-                    <Form-item label="零售价" prop="retailPrice">
-                        <Input-number :min="0.01" :step="0.01" v-model="goods.retailPrice" placeholder="零售价" style="width: 268px;"/>
-                    </Form-item>
+                    <!--<Form-item label="市场价" prop="marketPrice">-->
+                        <!--<Input-number :min="0.01" :step="0.01" v-model="goods.marketPrice" placeholder="市场价" style="width: 268px;"/>-->
+                    <!--</Form-item>-->
+                    <!--<Form-item label="零售价" prop="retailPrice">-->
+                        <!--<Input-number :min="0.01" :step="0.01" v-model="goods.retailPrice" placeholder="零售价" style="width: 268px;"/>-->
+                    <!--</Form-item>-->
                     <Form-item label="商品税率(0.00)" prop="goodsRate">
                         <Input-number :min="0.001" :step="0.001" v-model="goods.goodsRate" placeholder="商品税率" style="width: 268px;"/>
                     </Form-item>

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html

@@ -21,7 +21,7 @@
                         <i-option value="300">订单已发货</i-option>
                         <i-option value="301">用户确认收货</i-option>
                         <i-option value="401">退款</i-option>
-                        <i-option value="402">完成</i-option>
+                        <!--<i-option value="402">完成</i-option>-->
                     </i-select>
                 </i-col>
                 <!--<i-col span="4">

+ 10 - 4
kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html

@@ -9,13 +9,13 @@
     <div v-show="showDiv == 1">
         <Row :gutter="16">
             <div class="search-group">
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单号"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-input v-model="q.merchOrderSn" @on-enter="query" placeholder="商户订单号"/>
                 </i-col>
-                <i-col span="4">
+                <i-col span="3">
                     <i-select v-model="q.orderStatus" placeholder="订单状态">
                         <i-option value="0">待付款</i-option>
                         <i-option value="101">订单已取消</i-option>
@@ -24,7 +24,7 @@
                         <i-option value="300">订单已发货</i-option>
                         <i-option value="301">用户确认收货</i-option>
                         <i-option value="401">退款</i-option>
-                        <i-option value="402">完成</i-option>
+                        <!--<i-option value="402">完成</i-option>-->
                     </i-select>
                 </i-col>
                 <!--<i-col span="4">
@@ -33,6 +33,12 @@
                         <i-option value="2">团购订单</i-option>
                     </i-select>
                 </i-col>-->
+                <i-col span="3">
+                    <Date-picker v-model="q.startTime" placeholder="创建订单开始时间"/>
+                </i-col>
+                <i-col span="3">
+                    <Date-picker v-model="q.endTime" placeholder="创建订单结束时间"/>
+                </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>

+ 5 - 6
kmall-admin/src/main/webapp/WEB-INF/page/shop/store.html

@@ -38,7 +38,7 @@
         <p slot="title">{{title}}</p>
         <i-form ref="formValidate" :model="store" :rules="ruleValidate" :label-width="80">
             <Form-item label="商户编号" prop="merchSn">
-                <i-select v-model="store.merchSn" filterable placeholder="商户编号" label-in-value>
+                <i-select v-model="store.merchSn" filterable placeholder="商户编号" @on-change="showMerchInfo"  label-in-value>
                     <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
                 </i-select>
             </Form-item>
@@ -48,11 +48,10 @@
             <Form-item label="门店编号" prop="storeNumber">
                 <i-input v-model="store.storeNumber" placeholder="门店编号"/>
             </Form-item>
-            <Form-item label="第三方商户编号" prop="thirdPartyMerchCode">
-                <i-input v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号"/>
-            </Form-item>
-            <Form-item label="第三方商户名称" prop="thirdPartyMerchName">
-                <i-input v-model="store.thirdPartyMerchName" placeholder="第三方商户名称"/>
+            <Form-item label="第三方商户编号" prop="merchSn">
+                <i-select v-model="store.thirdPartyMerchCode" placeholder="第三方商户编号" label-in-value>
+                    <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                </i-select>
             </Form-item>
             <Form-item label="第三方商户快递协议类型" prop="exprAgreementType">
                 <Radio-group v-model="store.exprAgreementType">

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html

@@ -114,7 +114,7 @@
                 <Input-number :min="0" :step="1" v-model="productStoreRela.stockNum" placeholder="总库存"
                               style="width: 268px;"/>
             </Form-item>
-            <Form-item v-if="showInput" label="规格" prop="specification">
+            <Form-item v-if="showInputSpecification" label="规格" prop="specification">
                 <i-input v-model="productStoreRela.specification" placeholder="规格"/>
             </Form-item>
             <Form-item  v-if="showInput" label="零售价" prop="retailPrice">
@@ -122,7 +122,7 @@
                               style="width: 268px;"/>
             </Form-item>
             <Form-item  v-if="showInput" label="市场价" prop="marketPrice">
-                <Input-number :min="0.01" :step="0.01" v-model="productStoreRela.marketPrice" placeholder="零售价格"
+                <Input-number :min="0.01" :step="0.01" v-model="productStoreRela.marketPrice" placeholder="市场价"
                               style="width: 268px;"/>
             </Form-item>
         </i-form>

+ 69 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html

@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>第三方商户表</title>
+    #parse("sys/header.html")
+</head>
+<body>
+<div id="rrapp" v-cloak>
+	<div v-show="showList">
+        <Row :gutter="16">
+            <div class="search-group">
+                <i-col span="4">
+                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                </i-col>
+                <i-button @click="query">查询</i-button>
+                <i-button @click="reloadSearch">重置</i-button>
+            </div>
+            <div class="buttons-group">
+                #if($shiro.hasPermission("thirdmerchantbiz:save"))
+                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
+                #end
+                #if($shiro.hasPermission("thirdmerchantbiz:update"))
+                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
+                #end
+                #if($shiro.hasPermission("thirdmerchantbiz:delete"))
+                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
+                #end
+            </div>
+        </Row>
+	    <table id="jqGrid"></table>
+	    <div id="jqGridPager"></div>
+    </div>
+
+    <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+		<i-form ref="formValidate" :model="thirdMerchantBiz" :rules="ruleValidate" :label-width="80">
+            <Form-item label="商户" prop="merchSn">
+                <i-select v-model="thirdMerchantBiz.merchSn" filterable placeholder="商户" label-in-value>
+                    <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
+                </i-select>
+            </Form-item>
+            <Form-item label="第三方商户代码" prop="thirdPartyMerchCode">
+                <i-input v-model="thirdMerchantBiz.thirdPartyMerchCode" placeholder="第三方商户代码"/>
+            </Form-item>
+            <Form-item label="第三方商户名称" prop="thirdPartyMerchName">
+                <i-input v-model="thirdMerchantBiz.thirdPartyMerchName" placeholder="第三方商户名称"/>
+            </Form-item>
+            <Form-item label="是否有效" prop="isValid">
+                <Radio-group v-model="thirdMerchantBiz.isValid">
+                    <Radio label="1">
+                        <span>无效</span>
+                    </Radio>
+                    <Radio label="0">
+                        <span>有效</span>
+                    </Radio>
+                </Radio-group>
+            </Form-item>
+            <Form-item>
+                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
+            </Form-item>
+        </i-form>
+	</Card>
+</div>
+
+<script src="${rc.contextPath}/js/shop/thirdmerchantbiz.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 2 - 0
kmall-admin/src/main/webapp/js/shop/attribute.js

@@ -4,6 +4,8 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '所属分类', name: 'categoryName', index: 'attribute_category_id', width: 80},
             {label: '名称', name: 'name', index: 'name', width: 80},
             // {label: '类型', name: 'inputType', index: 'input_type', width: 80},

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

@@ -4,7 +4,10 @@ $(function () {
         datatype: "json",
         colModel: [{
             label: 'id', name: 'id', index: 'id', key: true, hidden: true
-        }, {
+        },
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
+            {
             label: '品牌名称', name: 'name', index: 'name', width: 80
         }, {
             label: '图片', name: 'listPicUrl', index: 'list_pic_url', width: 80, formatter: function (value) {

+ 13 - 12
kmall-admin/src/main/webapp/js/shop/category.js

@@ -45,7 +45,8 @@ TreeGrid.initColumn = function () {
             return '-';
         }},
         {title: '分类名称', field: 'name', align: 'center', valign: 'middle', width: '60px'},
-        {title: '商户编号', field: 'merchSn', align: 'center', valign: 'middle', width: '100px'},
+        {title: '所属商户', field: 'merchName',  width: '100px', align: 'center'},
+        {title: '所属门店', field: 'storeName', width: '80px', align: 'center'},
         {title: '描述', field: 'frontDesc', align: 'center', valign: 'middle', width: '150px'},
         {title: '首页排序', field: 'sortOrder', align: 'center', valign: 'middle', width: '50px'},
         {
@@ -74,21 +75,21 @@ var vm = new Vue({
             frontDesc: [
                 {required: true, message: '描述不能为空', trigger: 'blur'}
             ],
-            bannerUrl: [
-                {required: true, message: 'banner图片不能为空', trigger: 'blur'}
-            ],
+            // bannerUrl: [
+            //     {required: true, message: 'banner图片不能为空', trigger: 'blur'}
+            // ],
             iconUrl: [
-                {required: true, message: 'icon链接不能为空', trigger: 'blur'}
-            ],
-            imgUrl: [
-                {required: true, message: '图片不能为空', trigger: 'blur'}
+                {required: true, message: '首页icon不能为空', trigger: 'blur'}
             ],
+            // imgUrl: [
+            //     {required: true, message: '图片不能为空', trigger: 'blur'}
+            // ],
             wapBannerUrl: [
-                {required: true, message: '手机banner不能为空', trigger: 'blur'}
-            ],
-            frontName: [
-                {required: true, message: 'frontName不能为空', trigger: 'blur'}
+                {required: true, message: '分类banner不能为空', trigger: 'blur'}
             ]
+            // frontName: [
+            //     {required: true, message: 'frontName不能为空', trigger: 'blur'}
+            // ]
         },
         q: {
             name: ''

+ 2 - 0
kmall-admin/src/main/webapp/js/shop/freight.js

@@ -4,6 +4,8 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '模版名称', name: 'name', index: 'name'},
             {
                 label: '模版类型', name: 'templateType', index: 'template_type', width: 100,

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

@@ -5,6 +5,7 @@ $(function () {
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
             {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '第三方商户编号', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 60, align: 'center'},
             {label: '商品编码', name: 'goodsSn', index: 'goods_Sn', width: 60, align: 'center'},
             {label: 'SKU', name: 'sku', index: 'sku', width: 80, align: 'center'},
             {label: '商品类型', name: 'categoryName', index: 'category_id', width: 40, align: 'center'},
@@ -22,8 +23,8 @@ $(function () {
                     return '普通货物';
                 }
             },
-            {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
-            {label: '市场价', name: 'marketPrice', index: 'market_price', width: 80, align: 'center'},
+            // {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
+            // {label: '市场价', name: 'marketPrice', index: 'market_price', width: 80, align: 'center'},
             {
                 label: '上架', name: 'isOnSale', index: 'is_on_sale', width: 40, align: 'center',
                 formatter: function (value) {
@@ -142,7 +143,8 @@ var vm = new Vue({
         cusUnitCodeList: [],
         cusNationCodeList: [],
         merchList: [],
-        suppliers: []
+        suppliers: [],
+        thirdMerchantBizList: []
     },
     methods: {
         delSpeRow: function (index) {
@@ -216,6 +218,7 @@ var vm = new Vue({
             var opt = {};
             opt.value = vm.goods.categoryId;
             opt.flag = 1;
+            vm.thirdMerchantBizList = [];
             vm.getAttributes(opt);
             vm.getMacro();
             vm.getCusUnitCodeList();
@@ -268,6 +271,11 @@ var vm = new Vue({
                 vm.merchList = r.list;
             });
         },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         saveOrUpdate: function (event) {
             var url = vm.goods.id == null ? "../goods/save" : "../goods/update";
             vm.goods.goodsDesc = $('#goodsDesc').editable('getHTML');
@@ -609,6 +617,7 @@ var vm = new Vue({
             vm.getFreights(merchSn);
             vm.getBrand(merchSn);
             vm.getSuppliers(merchSn);
+            vm.getThirdMerchantBizList(merchSn);
         },
         getCategories: function (merchSn) {
             $.get("../category/getCategorySelect?isShow=1&merchSn=" + merchSn, function (r) {

+ 19 - 4
kmall-admin/src/main/webapp/js/shop/order.js

@@ -3,6 +3,8 @@ $(function () {
     let payStatus = getQueryString("payStatus");
     let orderStatus = getQueryString("orderStatus");
     let merchOrderSn = getQueryString("merchOrderSn");
+    let startTime = getQueryString("startTime");
+    let endTime = getQueryString("endTime");
     let url = '../order/list?1';
     if (shippingStatus) {
         url += '&shippingStatus=' + shippingStatus;
@@ -16,6 +18,12 @@ $(function () {
     if (merchOrderSn) {
         url += '&merchOrderSn=' + merchOrderSn;
     }
+    if (startTime) {
+        url += '&startTime=' + startTime;
+    }
+    if (endTime) {
+        url += '&endTime=' + endTime;
+    }
     $("#jqGrid").jqGrid({
         url: url,
         datatype: "json",
@@ -193,7 +201,9 @@ let vm = new Vue({
         q: {
             orderSn: '',
             orderStatus: '',
-            merchOrderSn: ''
+            merchOrderSn: '',
+            startTime: '',
+            endTime: ''
         },
         refundMoney: 0,
         shipping: {},
@@ -315,7 +325,9 @@ let vm = new Vue({
                 postData: {
                     'orderSn': vm.q.orderSn,
                     'orderStatus': vm.q.orderStatus,
-                    'merchOrderSn': vm.q.merchOrderSn
+                    'merchOrderSn': vm.q.merchOrderSn,
+                    'startTime': vm.q.startTime,
+                    'endTime': vm.q.endTime
                 },
                 page: page
             }).trigger("reloadGrid");
@@ -324,7 +336,9 @@ let vm = new Vue({
             vm.q = {
                 orderSn: '',
                 orderStatus: '',
-                merchOrderSn: ''
+                merchOrderSn: '',
+                startTime: '',
+                endTime: ''
             };
         },
         lookDetail: function (rowId) { //第三步:定义编辑操作
@@ -425,7 +439,8 @@ let vm = new Vue({
         },
         exportOrder: function() {
             var params = {};
-            params.orderSn = vm.q.orderSn, params.orderStatus = vm.q.orderStatus, params.merchOrderSn = vm.q.merchOrderSn;
+            params.orderSn = vm.q.orderSn, params.orderStatus = vm.q.orderStatus, params.merchOrderSn = vm.q.merchOrderSn
+                , params.startTime = vm.q.startTime, params.endTime = vm.q.endTime;
 
             exportFile('#rrapp', '../order/export', params);
             /*$.ajax({

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

@@ -75,7 +75,8 @@ let vm = new Vue({
             storeName: '',
             storeNumber: ''
         },
-        merchList: []
+        merchList: [],
+        thirdMerchantBizList: []
     },
     methods: {
         query: function () {
@@ -95,6 +96,8 @@ let vm = new Vue({
             }
             vm.showList = false;
             vm.title = "修改";
+            vm.merchList = [];
+            vm.thirdMerchantBizList = [];
 
             vm.getInfo(id);
             vm.getMerchList();
@@ -141,14 +144,24 @@ let vm = new Vue({
                 });
             });
         },
+        showMerchInfo:function(opt){
+            var merchSn = opt.value;
+            vm.getThirdMerchantBizList(merchSn);
+        },
         getMerchList: function() {
             $.get("../merch/queryAll", function (r) {
                 vm.merchList = r.list;
             });
         },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
         getInfo: function (id) {
             $.get("../store/info/" + id, function (r) {
                 vm.store = r.store;
+                vm.getThirdMerchantBizList(r.store.merchSn);
             });
         },
         reloadSearch: function () {

+ 21 - 13
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -5,8 +5,8 @@ $(function () {
         colModel: [
             {label: 'ID', name: 'id', index: 'id', hidden: true, key: true},
             {label: '商品商户编号', name: 'goods_merch_sn', index: 'goods_merch_sn', hidden: true},
-            {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
-            {label: '门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
+            {label: '所属商户', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 80, align: 'center'},
             {label: '商品类型', name: 'categoryName', index: 'categoryName', width: 80, align: 'center'},
             {
                 label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 70, align: 'center',
@@ -21,12 +21,12 @@ $(function () {
                     return '普通货物';
                 }
             },
-            {label: '商品编码', name: 'goodsSn', index: 'goodsSn', align: 'center'},
+            {label: '商品编码', name: 'goodsSn', index: 'goodsSn', width: 80, align: 'center'},
             {label: '名称', name: 'goodsName', index: 'goodsName', width: 160, align: 'left'},
             {label: '产品编码', name: 'productSn', index: 'productSn', width: 80, align: 'center'},
             {label: '库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
             {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80, align: 'center'},
-            // {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80},
+            {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80, align: 'center'},
             // {label: '库存价格', name: 'stockPrice', index: 'stockPrice', width: 80},
             {
                 label: '销售量',
@@ -130,20 +130,25 @@ var vm = new Vue({
         macros: [],//商品单位
         goodss: {},
         products: [],
-        showInput: false
+        showInput: false,
+        showInputSpecification: false
     },
     methods: {
         changeGoods: function (opt) {
             var goodsId = opt.value;
             if (null != goodsId && '' != goodsId) {
                 $.get("../goods/info/" + goodsId, function (r) {
+                    vm.showInput = true;
+                    // console.log(r.goods.goodsBizType);
                     if (r.goods.goodsBizType == 11) {
-                        vm.showInput = true;
-                        vm.productStoreRela.retailPrice = r.goods.retailPrice;
-                        vm.productStoreRela.marketPrice = r.goods.marketPrice;
-                    } else {
-                        vm.showInput = false;
+                        vm.showInputSpecification = true;
+                    }else{
+                        vm.showInputSpecification = false;
                     }
+                    // console.log(r.goods.retailPrice);
+                    // console.log(r.goods.marketPrice);
+                    // vm.productStoreRela.retailPrice = r.goods.retailPrice;
+                    // vm.productStoreRela.marketPrice = r.goods.marketPrice;
                 });
             }
         },
@@ -166,6 +171,7 @@ var vm = new Vue({
             vm.productStoreRela = { stockNum: '', retailPrice: '', marketPrice: '' };
             vm.getMacro();
             vm.showInput = false;
+            vm.showInputSpecification = false;
         },
         update: function (event) {
             var id = getSelectedRow();
@@ -177,9 +183,12 @@ var vm = new Vue({
             vm.uploadList = [];
             vm.getInfo(id);
             vm.getMacro();
-            vm.showInput = false;
             if (vm.productStoreRela.goodsBizType == 11) {
                 vm.showInput = true;
+                vm.showInputSpecification = true;
+            }else{
+                vm.showInput = false;
+                vm.showInputSpecification = false;
             }
         },
         /**
@@ -237,7 +246,6 @@ var vm = new Vue({
             });
         },
         getGoods: function (opt) {
-
             var storeId = opt.value;
             var merchSn = "";
             for (var i = 0; i < vm.stores.length; i ++ ) {
@@ -245,7 +253,7 @@ var vm = new Vue({
                     merchSn = vm.stores[i].merchSn;
             }
 
-            $.get("../goods/queryAll?merchSn=" + merchSn, function (r) {
+            $.get("../goods/queryAll?merchSn=" + merchSn + "&storeId=" +storeId, function (r) {
                 vm.goodss = r.list;
             });
         },

+ 166 - 0
kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js

@@ -0,0 +1,166 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: '../thirdmerchantbiz/list',
+        datatype: "json",
+        colModel: [
+			{label: 'thirdMerchSn', name: 'thirdMerchSn', index: 'third_merch_sn', key: true, hidden: true},
+            {label: '商户编号', name: 'merchSn', index: 'merch_sn', width: 80, align: 'center'},
+			{label: '第三方商户代码', name: 'thirdPartyMerchCode', index: 'third_party_merch_code', width: 80, align: 'center'},
+			{label: '第三方商户名称', name: 'thirdPartyMerchName', index: 'third_party_merch_name', width: 80, align: 'center'},
+			{label: '是否有效', name: 'isValid', index: 'is_valid', width: 80, align: 'center',
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '有效';
+                    } else if (value == '1') {
+                        return '无效';
+                    }
+                    return '';
+                }},
+			{label: '创建时间', name: 'createTime', index: 'create_time', width: 80, align: 'center',
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }},
+			{label: '修改时间', name: 'modTime', index: 'mod_time', width: 80, align: 'center',
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }}],
+		viewrecords: true,
+        height: 385,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
+        }
+    });
+});
+
+let vm = new Vue({
+	el: '#rrapp',
+	data: {
+        showList: true,
+        title: null,
+		thirdMerchantBiz: {isValid: ''},
+		ruleValidate: {
+			name: [
+				{required: true, message: '名称不能为空', trigger: 'blur'}
+			]
+		},
+		q: {
+		    name: ''
+		},
+        merchList: [],
+	},
+	methods: {
+		query: function () {
+			vm.reload();
+		},
+		add: function () {
+			vm.showList = false;
+			vm.title = "新增";
+            vm.getMerchList();
+			vm.thirdMerchantBiz = {isValid: 0};
+		},
+		update: function (event) {
+            let thirdMerchSn = getSelectedRow();
+			if (thirdMerchSn == null) {
+				return;
+			}
+			vm.showList = false;
+            vm.title = "修改";
+            vm.getMerchList();
+
+            vm.getInfo(thirdMerchSn)
+		},
+		saveOrUpdate: function (event) {
+            let url = vm.thirdMerchantBiz.thirdMerchSn == null ? "../thirdmerchantbiz/save" : "../thirdmerchantbiz/update";
+			$.ajax({
+				type: "POST",
+			    url: url,
+			    contentType: "application/json",
+			    data: JSON.stringify(vm.thirdMerchantBiz),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+			});
+		},
+		del: function (event) {
+            let thirdMerchSns = getSelectedRows();
+			if (thirdMerchSns == null){
+				return;
+			}
+
+			confirm('确定要删除选中的记录?', function () {
+				$.ajax({
+					type: "POST",
+				    url: "../thirdmerchantbiz/delete",
+				    contentType: "application/json",
+				    data: JSON.stringify(thirdMerchSns),
+				    success: function (r) {
+						if (r.code == 0) {
+							alert('操作成功', function (index) {
+								$("#jqGrid").trigger("reloadGrid");
+							});
+						} else {
+							alert(r.msg);
+						}
+					}
+				});
+			});
+		},
+        getMerchList: function() {
+            $.get("../merch/queryAll", function (r) {
+                vm.merchList = r.list;
+            });
+        },
+		getInfo: function(thirdMerchSn){
+			$.get("../thirdmerchantbiz/info/"+thirdMerchSn, function (r) {
+                vm.thirdMerchantBiz = r.thirdMerchantBiz;
+            });
+		},
+        reloadSearch: function() {
+            vm.q = {
+                name: ''
+            }
+            vm.reload();
+		},
+		reload: function (event) {
+			vm.showList = true;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+			$("#jqGrid").jqGrid('setGridParam', {
+                postData: {'name': vm.q.name},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+		},
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        }
+	}
+});