Browse Source

Merge branch 'master' of http://git.ds-bay.com/project/kmall-pt

csk 6 years ago
parent
commit
1c1c170ad3
100 changed files with 2409 additions and 533 deletions
  1. 28 5
      kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java
  2. 9 5
      kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java
  3. 7 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  4. 6 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java
  5. 7 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java
  6. 6 0
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  7. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysCusNationCodeController.java
  8. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysCusUnitCodeController.java
  9. 3 1
      kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java
  10. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/SysCusNationCodeDao.java
  11. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/SysCusUnitCodeDao.java
  12. 30 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  13. 55 60
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderRefundEntity.java
  14. 222 0
      kmall-admin/src/main/java/com/kmall/admin/entity/SysCusNationCodeEntity.java
  15. 188 0
      kmall-admin/src/main/java/com/kmall/admin/entity/SysCusUnitCodeEntity.java
  16. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/UserEntity.java
  17. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/SysCusNationCodeService.java
  18. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/SysCusUnitCodeService.java
  19. 17 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/AttributeServiceImpl.java
  20. 20 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/BrandServiceImpl.java
  21. 49 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/CategoryServiceImpl.java
  22. 58 39
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  23. 25 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  24. 28 16
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  25. 59 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/SysCusNationCodeServiceImpl.java
  26. 58 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/SysCusUnitCodeServiceImpl.java
  27. 3 1
      kmall-admin/src/main/resources/conf/common.properties
  28. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/AddressDao.xml
  29. 19 9
      kmall-admin/src/main/resources/mybatis/mapper/AttributeDao.xml
  30. 1 1
      kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml
  31. 15 3
      kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml
  32. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/CouponDao.xml
  33. 1 1
      kmall-admin/src/main/resources/mybatis/mapper/FootprintDao.xml
  34. 3 0
      kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml
  35. 7 1
      kmall-admin/src/main/resources/mybatis/mapper/GoodsAttributeDao.xml
  36. 24 1
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  37. 3 0
      kmall-admin/src/main/resources/mybatis/mapper/GoodsGalleryDao.xml
  38. 5 5
      kmall-admin/src/main/resources/mybatis/mapper/HelpTypeDao.xml
  39. 22 3
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  40. 24 4
      kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml
  41. 4 4
      kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml
  42. 1 1
      kmall-admin/src/main/resources/mybatis/mapper/SearchHistoryDao.xml
  43. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml
  44. 137 0
      kmall-admin/src/main/resources/mybatis/mapper/SysCusNationCodeDao.xml
  45. 125 0
      kmall-admin/src/main/resources/mybatis/mapper/SysCusUnitCodeDao.xml
  46. 5 30
      kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml
  47. 8 8
      kmall-admin/src/main/webapp/WEB-INF/page/shop/attribute.html
  48. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  49. 2 3
      kmall-admin/src/main/webapp/WEB-INF/page/shop/coupongrads.html
  50. 14 37
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  51. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/helptype.html
  52. 36 4
      kmall-admin/src/main/webapp/WEB-INF/page/shop/storeProductStock.html
  53. 3 3
      kmall-admin/src/main/webapp/WEB-INF/page/sys/oss.html
  54. 6 6
      kmall-admin/src/main/webapp/WEB-INF/page/sys/role.html
  55. 2 2
      kmall-admin/src/main/webapp/WEB-INF/page/sys/schedule.html
  56. 18 9
      kmall-admin/src/main/webapp/WEB-INF/page/sys/user.html
  57. 7 8
      kmall-admin/src/main/webapp/js/shop/attribute.js
  58. 21 0
      kmall-admin/src/main/webapp/js/shop/brand.js
  59. 18 0
      kmall-admin/src/main/webapp/js/shop/category.js
  60. 34 31
      kmall-admin/src/main/webapp/js/shop/coupongrads.js
  61. 1 1
      kmall-admin/src/main/webapp/js/shop/feedback.js
  62. 54 60
      kmall-admin/src/main/webapp/js/shop/goods.js
  63. 3 0
      kmall-admin/src/main/webapp/js/shop/goodsissue.js
  64. 5 5
      kmall-admin/src/main/webapp/js/shop/helptype.js
  65. 32 6
      kmall-admin/src/main/webapp/js/shop/order.js
  66. 5 1
      kmall-admin/src/main/webapp/js/shop/orderrefund.js
  67. 42 0
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  68. 1 1
      kmall-admin/src/main/webapp/js/sys/role.js
  69. 2 2
      kmall-admin/src/main/webapp/js/sys/schedule.js
  70. 15 8
      kmall-admin/src/main/webapp/js/sys/user.js
  71. 1 1
      kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java
  72. 16 1
      kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java
  73. 1 1
      kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java
  74. 2 1
      kmall-api/src/main/java/com/kmall/api/contants/Dict.java
  75. 3 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  76. 10 24
      kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java
  77. 2 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml
  78. 2 2
      kmall-common/src/main/java/com/kmall/common/controller/SysRoleController.java
  79. 3 4
      kmall-common/src/main/java/com/kmall/common/controller/SysUserController.java
  80. 2 0
      kmall-common/src/main/java/com/kmall/common/dao/SysUserRoleDao.java
  81. 30 0
      kmall-common/src/main/java/com/kmall/common/entity/SysUserEntity.java
  82. 2 0
      kmall-common/src/main/java/com/kmall/common/service/SysRoleMenuService.java
  83. 2 0
      kmall-common/src/main/java/com/kmall/common/service/SysRoleService.java
  84. 1 1
      kmall-common/src/main/java/com/kmall/common/service/SysUserRoleService.java
  85. 5 0
      kmall-common/src/main/java/com/kmall/common/service/impl/SysRoleMenuServiceImpl.java
  86. 34 3
      kmall-common/src/main/java/com/kmall/common/service/impl/SysRoleServiceImpl.java
  87. 2 5
      kmall-common/src/main/java/com/kmall/common/service/impl/SysUserRoleServiceImpl.java
  88. 62 4
      kmall-common/src/main/java/com/kmall/common/service/impl/SysUserServiceImpl.java
  89. 1 7
      kmall-common/src/main/java/com/kmall/common/shiro/UserRealm.java
  90. 1 1
      kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketBuilder.java
  91. 1 1
      kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketPrintUtil.java
  92. 64 0
      kmall-common/src/main/java/com/kmall/common/utils/wechat/ReaderXmlForDOM4J.java
  93. 18 0
      kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatRefundApiResult.java
  94. 54 45
      kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatRefundQueryResult.java
  95. 2 0
      kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatUtil.java
  96. 19 3
      kmall-common/src/main/resources/mybatis/mapper/SysUserDao.xml
  97. 8 3
      kmall-common/src/main/resources/mybatis/mapper/SysUserRoleDao.xml
  98. 2 2
      kmall-schedule/src/main/java/com/kmall/schedule/quartz/OrderTask.java
  99. 40 21
      kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java
  100. 8 6
      kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

+ 28 - 5
kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java

@@ -1,10 +1,9 @@
 package com.kmall.admin.controller;
 
+import com.google.common.collect.ImmutableBiMap;
 import com.kmall.admin.entity.AttributeEntity;
 import com.kmall.admin.service.AttributeService;
-import com.kmall.common.utils.PageUtils;
-import com.kmall.common.utils.Query;
-import com.kmall.common.utils.R;
+import com.kmall.common.utils.*;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -60,8 +59,16 @@ public class AttributeController {
     @RequestMapping("/save")
     @RequiresPermissions("attribute:save")
     public R save(@RequestBody AttributeEntity attribute) {
-        attributeService.save(attribute);
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
 
+        attributeService.save(attribute);
         return R.ok();
     }
 
@@ -71,8 +78,16 @@ public class AttributeController {
     @RequestMapping("/update")
     @RequiresPermissions("attribute:update")
     public R update(@RequestBody AttributeEntity attribute) {
-        attributeService.update(attribute);
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
 
+        attributeService.update(attribute);
         return R.ok();
     }
 
@@ -97,4 +112,12 @@ public class AttributeController {
 
         return R.ok().put("list", list);
     }
+
+    @RequestMapping("/query")
+    public R query(@RequestParam Map<String, Object> params) {
+
+        List<AttributeEntity> list = attributeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
 }

+ 9 - 5
kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java

@@ -124,8 +124,7 @@ public class CategoryController {
      * @return
      */
     @RequestMapping("/getCategorySelect")
-    public R getCategorySelect() {
-        Map<String, Object> map = new HashMap<>();
+    public R getCategorySelect(@RequestParam Map<String, Object> map) {
         map.put("parentId", "0");
         List<CategoryEntity> list = categoryService.queryList(map);
         return R.ok().put("list", list);
@@ -137,11 +136,10 @@ public class CategoryController {
      * @return
      */
     @RequestMapping("/getCategorySelectByParent")
-    public R getCategorySelectByParent(@RequestParam String parentId) {
+    public R getCategorySelectByParent(@RequestParam Map<String, Object> map) {
+        String parentId = map.get("parentId").toString();
         List<CategoryEntity> list = new ArrayList<>();
         if (StringUtils.isNotEmpty(parentId)) {
-            Map<String, Object> map = new HashMap<>();
-            map.put("parentId", parentId);
             list = categoryService.queryList(map);
         }
 
@@ -161,4 +159,10 @@ public class CategoryController {
         list.add(root);
         return R.ok().put("list", list);
     }
+
+    @RequestMapping("/getCategory")
+    public R getCategory(@RequestParam Map<String, Object> map) {
+        List<CategoryEntity> list = categoryService.queryList(map);
+        return R.ok().put("list", list);
+    }
 }

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

@@ -9,6 +9,8 @@ import com.kmall.admin.service.OrderExceptionRecordService;
 import com.kmall.admin.service.OrderProcessRecordService;
 import com.kmall.admin.service.OrderService;
 import com.kmall.api.contants.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.ShiroUtils;
 import com.kmall.common.utils.print.ticket.item.Ticket;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
@@ -48,6 +50,10 @@ public class OrderController {
     @RequestMapping("/list")
     @RequiresPermissions("order:list")
     public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user.getRoleType().equalsIgnoreCase("2")){
+            params.put("storeId", user.getStoreId());
+        }
         //查询列表数据
         Query query = new Query(params);
 
@@ -251,6 +257,7 @@ public class OrderController {
                 orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
                 orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
                 orderRefund.setModTime(new Date());
+                orderRefund.setOutRefundNo(result.getOut_refund_no());
                 if(mallOrderRefund !=null){
                     orderRefund.setId(mallOrderRefund.getId());
                     orderRefundService.update(orderRefund);//退款记录

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java

@@ -5,9 +5,11 @@ import java.util.Map;
 
 import com.kmall.admin.entity.OrderRefundEntity;
 import com.kmall.admin.service.OrderRefundService;
+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 org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -33,6 +35,10 @@ public class OrderRefundController {
     @RequiresPermissions("orderrefund:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user.getRoleType().equalsIgnoreCase("2")){
+            params.put("storeId", user.getStoreId());
+        }
         //查询列表数据
         Query query = new Query(params);
 

+ 7 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java

@@ -2,9 +2,12 @@ package com.kmall.admin.controller;
 
 import com.kmall.admin.entity.ProductStoreRelaEntity;
 import com.kmall.admin.service.ProductStoreRelaService;
+import com.kmall.api.contants.Dict;
+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 org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -33,6 +36,10 @@ public class ProductStoreRelaController {
     @RequestMapping("/list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user.getRoleType().equalsIgnoreCase("2")){
+            params.put("storeId", user.getStoreId());
+        }
         //查询列表数据
         Query query = new Query(params);
 

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

@@ -2,9 +2,11 @@ package com.kmall.admin.controller;
 
 import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.StoreService;
+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 org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -33,6 +35,10 @@ public class StoreController {
     @RequiresPermissions("store:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user.getRoleType().equalsIgnoreCase("2")){
+            params.put("id", user.getStoreId());
+        }
         //查询列表数据
         Query query = new Query(params);
 

+ 106 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysCusNationCodeController.java

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.SysCusNationCodeEntity;
+import com.kmall.admin.service.SysCusNationCodeService;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+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 2018-11-10 15:26:44
+ */
+@Controller
+@RequestMapping("syscusnationcode")
+public class SysCusNationCodeController {
+    @Autowired
+    private SysCusNationCodeService sysCusNationCodeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("syscusnationcode:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysCusNationCodeEntity> sysCusNationCodeList = sysCusNationCodeService.queryList(query);
+        int total = sysCusNationCodeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysCusNationCodeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{sn}")
+    @RequiresPermissions("syscusnationcode:info")
+    @ResponseBody
+    public R info(@PathVariable("sn") String sn) {
+        SysCusNationCodeEntity sysCusNationCode = sysCusNationCodeService.queryObject(sn);
+
+        return R.ok().put("sysCusNationCode", sysCusNationCode);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("syscusnationcode:save")
+    @ResponseBody
+    public R save(@RequestBody SysCusNationCodeEntity sysCusNationCode) {
+        sysCusNationCodeService.save(sysCusNationCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("syscusnationcode:update")
+    @ResponseBody
+    public R update(@RequestBody SysCusNationCodeEntity sysCusNationCode) {
+        sysCusNationCodeService.update(sysCusNationCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("syscusnationcode:delete")
+    @ResponseBody
+    public R delete(@RequestBody String[]sns) {
+        sysCusNationCodeService.deleteBatch(sns);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysCusNationCodeEntity> list = sysCusNationCodeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 106 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysCusUnitCodeController.java

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.SysCusUnitCodeEntity;
+import com.kmall.admin.service.SysCusUnitCodeService;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+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 2018-11-10 15:34:36
+ */
+@Controller
+@RequestMapping("syscusunitcode")
+public class SysCusUnitCodeController {
+    @Autowired
+    private SysCusUnitCodeService sysCusUnitCodeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("syscusunitcode:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysCusUnitCodeEntity> sysCusUnitCodeList = sysCusUnitCodeService.queryList(query);
+        int total = sysCusUnitCodeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysCusUnitCodeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{sn}")
+    @RequiresPermissions("syscusunitcode:info")
+    @ResponseBody
+    public R info(@PathVariable("sn") String sn) {
+        SysCusUnitCodeEntity sysCusUnitCode = sysCusUnitCodeService.queryObject(sn);
+
+        return R.ok().put("sysCusUnitCode", sysCusUnitCode);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("syscusunitcode:save")
+    @ResponseBody
+    public R save(@RequestBody SysCusUnitCodeEntity sysCusUnitCode) {
+        sysCusUnitCodeService.save(sysCusUnitCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("syscusunitcode:update")
+    @ResponseBody
+    public R update(@RequestBody SysCusUnitCodeEntity sysCusUnitCode) {
+        sysCusUnitCodeService.update(sysCusUnitCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("syscusunitcode:delete")
+    @ResponseBody
+    public R delete(@RequestBody String[]sns) {
+        sysCusUnitCodeService.deleteBatch(sns);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysCusUnitCodeEntity> list = sysCusUnitCodeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 3 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java

@@ -123,17 +123,19 @@ public class UserController {
 
         ExcelExport ee = new ExcelExport("会员列表");
 
-        String[] header = new String[]{"会员名称", "性别", "会员级别", "手机号码"};
+        String[] header = new String[]{"会员微信名称", "会员名称", "性别", "会员级别", "手机号码", "身份证"};
 
         List<Map<String, Object>> list = new ArrayList<>();
 
         if (userList != null && userList.size() != 0) {
             for (UserEntity userEntity : userList) {
                 LinkedHashMap<String, Object> map = new LinkedHashMap<>();
+                map.put("NICKNAME", userEntity.getNickname());
                 map.put("USERNAME", userEntity.getUsername());
                 map.put("GENDER", userEntity.getGender() == 1 ? "男" : (userEntity.getGender() == 2 ? "女" : "未知"));
                 map.put("LEVEL_NAME", userEntity.getLevelName());
                 map.put("MOBILE", userEntity.getMobile());
+                map.put("IDNO", userEntity.getIdNo());
                 list.add(map);
             }
         }

+ 15 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/SysCusNationCodeDao.java

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.SysCusNationCodeEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 国别地区代码Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:26:44
+ */
+public interface SysCusNationCodeDao extends BaseDao<SysCusNationCodeEntity> {
+
+}

+ 15 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/SysCusUnitCodeDao.java

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.SysCusUnitCodeEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 计量单位代码Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:34:36
+ */
+public interface SysCusUnitCodeDao extends BaseDao<SysCusUnitCodeEntity> {
+
+}

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

@@ -111,6 +111,36 @@ public class OrderEntity implements Serializable {
 
     private String orderBizType;
 
+    private String isPaymentSend;
+
+    private String isEleOrderSend;
+
+    private String isCustomsSend;
+
+    public String getIsPaymentSend() {
+        return isPaymentSend;
+    }
+
+    public void setIsPaymentSend(String isPaymentSend) {
+        this.isPaymentSend = isPaymentSend;
+    }
+
+    public String getIsEleOrderSend() {
+        return isEleOrderSend;
+    }
+
+    public void setIsEleOrderSend(String isEleOrderSend) {
+        this.isEleOrderSend = isEleOrderSend;
+    }
+
+    public String getIsCustomsSend() {
+        return isCustomsSend;
+    }
+
+    public void setIsCustomsSend(String isCustomsSend) {
+        this.isCustomsSend = isCustomsSend;
+    }
+
     public String getOrderBizType() {
         return orderBizType;
     }

+ 55 - 60
kmall-admin/src/main/java/com/kmall/admin/entity/OrderRefundEntity.java

@@ -44,7 +44,7 @@ public class OrderRefundEntity implements Serializable {
      */
     private Date refundTime;
     /**
-     * 
+     *
      */
     private String creator;
     /**
@@ -60,12 +60,6 @@ public class OrderRefundEntity implements Serializable {
      */
     private String refundReason;
     /**
-     * 退款入账账户 1)退回银行卡:{银行名称}{卡类型}{卡尾号} 2)退回支付用户零钱:支付用户零钱3)退还商户:商户基本账户 商户结算银行账户4)退回支付用户零钱通:支付用户零钱通
-     */
-    private String refundRecvAccout;
-
-    private String wechatRefundStatusDes;
-    /**
      * 审核人
      */
     private String approver;
@@ -98,6 +92,12 @@ public class OrderRefundEntity implements Serializable {
      */
     private Date tstm;
 
+    private String refundRecvAccout;
+
+    private String wechatRefundStatusDes;
+
+
+
     /**
      * 冗余
      */
@@ -115,6 +115,54 @@ public class OrderRefundEntity implements Serializable {
 
     private String userName;
 
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
+    public Integer getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(Integer orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+
+    public BigDecimal getActualPrice() {
+        return actualPrice;
+    }
+
+    public void setActualPrice(BigDecimal actualPrice) {
+        this.actualPrice = actualPrice;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getWechatRefundStatusDes() {
+        return wechatRefundStatusDes;
+    }
+
+    public void setWechatRefundStatusDes(String wechatRefundStatusDes) {
+        this.wechatRefundStatusDes = wechatRefundStatusDes;
+    }
+
+    public String getRefundRecvAccout() {
+        return refundRecvAccout;
+    }
+
+    public void setRefundRecvAccout(String refundRecvAccout) {
+        this.refundRecvAccout = refundRecvAccout;
+    }
+
     /**
      * 设置:主键
      */
@@ -259,19 +307,6 @@ public class OrderRefundEntity implements Serializable {
         return refundReason;
     }
     /**
-     * 设置:退款入账账户 1)退回银行卡:{银行名称}{卡类型}{卡尾号} 2)退回支付用户零钱:支付用户零钱3)退还商户:商户基本账户 商户结算银行账户4)退回支付用户零钱通:支付用户零钱通
-     */
-    public void setRefundRecvAccout(String refundRecvAccout) {
-        this.refundRecvAccout = refundRecvAccout;
-    }
-
-    /**
-     * 获取:退款入账账户 1)退回银行卡:{银行名称}{卡类型}{卡尾号} 2)退回支付用户零钱:支付用户零钱3)退还商户:商户基本账户 商户结算银行账户4)退回支付用户零钱通:支付用户零钱通
-     */
-    public String getRefundRecvAccout() {
-        return refundRecvAccout;
-    }
-    /**
      * 设置:审核人
      */
     public void setApprover(String approver) {
@@ -375,44 +410,4 @@ public class OrderRefundEntity implements Serializable {
     public Date getTstm() {
         return tstm;
     }
-
-    public String getOrderSn() {
-        return orderSn;
-    }
-
-    public void setOrderSn(String orderSn) {
-        this.orderSn = orderSn;
-    }
-
-    public Integer getOrderStatus() {
-        return orderStatus;
-    }
-
-    public void setOrderStatus(Integer orderStatus) {
-        this.orderStatus = orderStatus;
-    }
-
-    public BigDecimal getActualPrice() {
-        return actualPrice;
-    }
-
-    public void setActualPrice(BigDecimal actualPrice) {
-        this.actualPrice = actualPrice;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getWechatRefundStatusDes() {
-        return wechatRefundStatusDes;
-    }
-
-    public void setWechatRefundStatusDes(String wechatRefundStatusDes) {
-        this.wechatRefundStatusDes = wechatRefundStatusDes;
-    }
 }

+ 222 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/SysCusNationCodeEntity.java

@@ -0,0 +1,222 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 国别地区代码实体
+ * 表名 sys_cus_nation_code
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:26:44
+ */
+public class SysCusNationCodeEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 内部编号
+     */
+    private String sn;
+    /**
+     * 代码
+     */
+    private String code;
+    /**
+     * 名称(简称)
+     */
+    private String name;
+    /**
+     * 英文名(简称)
+     */
+    private String ename;
+    /**
+     * 优普税率类型
+     */
+    private String discountsTaxType;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 是否有效,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 void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    /**
+     * 获取:内部编号
+     */
+    public String getSn() {
+        return sn;
+    }
+    /**
+     * 设置:代码
+     */
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    /**
+     * 获取:代码
+     */
+    public String getCode() {
+        return code;
+    }
+    /**
+     * 设置:名称(简称)
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 获取:名称(简称)
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * 设置:英文名(简称)
+     */
+    public void setEname(String ename) {
+        this.ename = ename;
+    }
+
+    /**
+     * 获取:英文名(简称)
+     */
+    public String getEname() {
+        return ename;
+    }
+    /**
+     * 设置:优普税率类型
+     */
+    public void setDiscountsTaxType(String discountsTaxType) {
+        this.discountsTaxType = discountsTaxType;
+    }
+
+    /**
+     * 获取:优普税率类型
+     */
+    public String getDiscountsTaxType() {
+        return discountsTaxType;
+    }
+    /**
+     * 设置:备注
+     */
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    /**
+     * 获取:备注
+     */
+    public String getRemark() {
+        return remark;
+    }
+    /**
+     * 设置:是否有效,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;
+    }
+}

+ 188 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/SysCusUnitCodeEntity.java

@@ -0,0 +1,188 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 计量单位代码实体
+ * 表名 sys_cus_unit_code
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:34:36
+ */
+public class SysCusUnitCodeEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 内部编号
+     */
+    private String sn;
+    /**
+     * 代码
+     */
+    private String code;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 是否有效,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 void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    /**
+     * 获取:内部编号
+     */
+    public String getSn() {
+        return sn;
+    }
+    /**
+     * 设置:代码
+     */
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    /**
+     * 获取:代码
+     */
+    public String getCode() {
+        return code;
+    }
+    /**
+     * 设置:名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 获取:名称
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * 设置:备注
+     */
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    /**
+     * 获取:备注
+     */
+    public String getRemark() {
+        return remark;
+    }
+    /**
+     * 设置:是否有效,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;
+    }
+}

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

@@ -49,6 +49,8 @@ public class UserEntity implements Serializable {
     //会员级别
     private String levelName;
 
+    private String idNo;
+
     /**
      * 设置:主键
      */
@@ -105,6 +107,14 @@ public class UserEntity implements Serializable {
         return gender;
     }
 
+    public String getIdNo() {
+        return idNo;
+    }
+
+    public void setIdNo(String idNo) {
+        this.idNo = idNo;
+    }
+
     /**
      * 设置:出生日期
      */

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

@@ -0,0 +1,72 @@
+package com.kmall.admin.service;
+
+import com.kmall.admin.entity.SysCusNationCodeEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 国别地区代码Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:26:44
+ */
+public interface SysCusNationCodeService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param sn 主键
+     * @return 实体
+     */
+    SysCusNationCodeEntity queryObject(String sn);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<SysCusNationCodeEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param sysCusNationCode 实体
+     * @return 保存条数
+     */
+    int save(SysCusNationCodeEntity sysCusNationCode);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param sysCusNationCode 实体
+     * @return 更新条数
+     */
+    int update(SysCusNationCodeEntity sysCusNationCode);
+
+    /**
+     * 根据主键删除
+     *
+     * @param sn
+     * @return 删除条数
+     */
+    int delete(String sn);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param sns
+     * @return 删除条数
+     */
+    int deleteBatch(String[] sns);
+}

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

@@ -0,0 +1,72 @@
+package com.kmall.admin.service;
+
+import com.kmall.admin.entity.SysCusUnitCodeEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 计量单位代码Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:34:36
+ */
+public interface SysCusUnitCodeService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param sn 主键
+     * @return 实体
+     */
+    SysCusUnitCodeEntity queryObject(String sn);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<SysCusUnitCodeEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param sysCusUnitCode 实体
+     * @return 保存条数
+     */
+    int save(SysCusUnitCodeEntity sysCusUnitCode);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param sysCusUnitCode 实体
+     * @return 更新条数
+     */
+    int update(SysCusUnitCodeEntity sysCusUnitCode);
+
+    /**
+     * 根据主键删除
+     *
+     * @param sn
+     * @return 删除条数
+     */
+    int delete(String sn);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param sns
+     * @return 删除条数
+     */
+    int deleteBatch(String[] sns);
+}

+ 17 - 1
kmall-admin/src/main/java/com/kmall/admin/service/impl/AttributeServiceImpl.java

@@ -1,11 +1,15 @@
 package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.AttributeDao;
+import com.kmall.admin.dao.GoodsAttributeDao;
 import com.kmall.admin.entity.AttributeEntity;
+import com.kmall.admin.entity.GoodsAttributeEntity;
 import com.kmall.admin.service.AttributeService;
+import com.kmall.common.utils.RRException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -14,6 +18,8 @@ import java.util.Map;
 public class AttributeServiceImpl implements AttributeService {
 	@Autowired
 	private AttributeDao attributeDao;
+	@Autowired
+	private GoodsAttributeDao goodsAttributeDao;
 	
 	@Override
 	public AttributeEntity queryObject(Integer id){
@@ -47,7 +53,17 @@ public class AttributeServiceImpl implements AttributeService {
 	
 	@Override
 	public void deleteBatch(Integer[] ids){
-		attributeDao.deleteBatch(ids);
+		for (Integer id : ids) {
+			AttributeEntity attribute = queryObject(id);
+			Map<String, Object> map = new HashMap<>();
+			map.put("attributeId", id);
+			List<GoodsAttributeEntity> goodsAttributeEntityList = goodsAttributeDao.queryList(map);
+
+			if (goodsAttributeEntityList != null && goodsAttributeEntityList.size() > 0) {
+				throw new RRException("商品参数【" + attribute.getName() + "】还有【" + goodsAttributeEntityList.size() + "】个商品在使用,删除失败!");
+			}
+			delete(id);
+		}
 	}
 	
 }

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

@@ -1,11 +1,15 @@
 package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.BrandDao;
+import com.kmall.admin.dao.GoodsDao;
 import com.kmall.admin.entity.BrandEntity;
+import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.service.BrandService;
+import com.kmall.common.utils.RRException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -20,6 +24,8 @@ import java.util.Map;
 public class BrandServiceImpl implements BrandService {
     @Autowired
     private BrandDao brandDao;
+    @Autowired
+    private GoodsDao goodsDao;
 
     @Override
     public BrandEntity queryObject(Integer id) {
@@ -53,6 +59,19 @@ public class BrandServiceImpl implements BrandService {
 
     @Override
     public int deleteBatch(Integer[] ids) {
-        return brandDao.deleteBatch(ids);
+        for (Integer id : ids) {
+            BrandEntity brand = queryObject(id);
+
+            Map<String, Object> map = new HashMap<>();
+            map.put("brandId", id);
+            List<GoodsEntity> goodsList = goodsDao.queryList(map);
+
+            if (goodsList != null && goodsList.size() > 0) {
+                throw new RRException("品牌【" + brand.getName() + "】下还存在【" + goodsList.size() + "】个商品,删除失败!");
+            }
+            delete(id);
+        }
+
+        return 1;
     }
 }

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

@@ -1,12 +1,16 @@
 package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.CategoryDao;
+import com.kmall.admin.dao.GoodsDao;
 import com.kmall.admin.entity.CategoryEntity;
+import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.service.CategoryService;
 import com.kmall.api.contants.Dict;
+import com.kmall.common.utils.RRException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -21,6 +25,8 @@ import java.util.Map;
 public class CategoryServiceImpl implements CategoryService {
     @Autowired
     private CategoryDao categoryDao;
+    @Autowired
+    private GoodsDao goodsDao;
 
     @Override
     public CategoryEntity queryObject(Integer id) {
@@ -41,6 +47,10 @@ public class CategoryServiceImpl implements CategoryService {
     public int save(CategoryEntity category) {
         if (Dict.Level.item_L1.getItem().equals(category.getLevel())) {
             category.setParentId(0);
+        } else {
+            if (category.getParentId() == null) {
+                throw new RRException("请选择父级分类!");
+            }
         }
         return categoryDao.save(category);
     }
@@ -56,7 +66,44 @@ public class CategoryServiceImpl implements CategoryService {
     }
 
     @Override
-    public int deleteBatch(Integer[]ids) {
-        return categoryDao.deleteBatch(ids);
+    public int deleteBatch(Integer[] ids) {
+        for (Integer id : ids) {
+            CategoryEntity category = queryObject(id);
+            Map<String, Object> map = new HashMap<>();
+            if (category.getParentId() == 0) {
+                map.put("parentId", id);
+                List<CategoryEntity> categoryEntityList = queryList(map);
+
+                if (categoryEntityList != null && categoryEntityList.size() > 0) {
+                    int goodsTotal = 0;
+                    for (CategoryEntity categoryEntity : categoryEntityList) {
+                        map.clear();
+                        map.put("categoryId", categoryEntity.getId());
+                        List<GoodsEntity> goodsEntityList = goodsDao.queryList(map);
+                        if (goodsEntityList != null) {
+                            goodsTotal += goodsEntityList.size();
+                        }
+                    }
+
+                    if (goodsTotal > 0) {
+                        throw new RRException("【" + category.getName() + "】商品类型下还有【" + goodsTotal + "】个商品,无法删除!");
+                    } else {
+                        for (CategoryEntity categoryEntity : categoryEntityList) {
+                            delete(categoryEntity.getId());
+                        }
+                    }
+                }
+            } else{
+                map.clear();
+                map.put("categoryId",id);
+                List<GoodsEntity> goodsEntityList = goodsDao.queryList(map);
+                if (goodsEntityList != null && goodsEntityList.size() > 0) {
+                    throw new RRException("【" + category.getName() + "】商品类型下还有【" + goodsEntityList.size() + "】个商品,无法删除!");
+                }
+            }
+
+            delete(id);
+        }
+        return 1;
     }
 }

+ 58 - 39
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -33,7 +33,7 @@ public class GoodsServiceImpl implements GoodsService {
     @Autowired
     private GoodsAttributeDao goodsAttributeDao;
     @Autowired
-    private AttributeCategoryDao attributeCategoryDao;
+    private AttributeDao attributeDao;
     @Autowired
     private ProductDao productDao;
     @Autowired
@@ -93,25 +93,30 @@ public class GoodsServiceImpl implements GoodsService {
         builder.put("goodsUnit", "商品单位");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
-        builder.put("goodsRate", "商品税率");
-        builder.put("retailPrice", "零售价格");
         builder.put("isHot", "热销");
 
-        if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
-            // 海关信息,普通货物可不添加
-            builder.put("sku", "SKU");
-            builder.put("prodBarcode", "产品编码");
-            builder.put("brand", "产品品牌");
-            builder.put("unitCode", "计量单位代码");
-            builder.put("cusGoodsCode", "海关商品编码");
-            builder.put("ciqProdModel", "国检规格型号");
-            builder.put("oriCntCode", "原产国代码");
-            builder.put("cusDeclEle", "海关申报要素");
-            builder.put("cusRecCode", "海关备案编号");
-        }
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
+        } else {
+            if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
+                // 海关信息,普通货物可不添加
+                builder.put("sku", "SKU");
+                builder.put("goodsRate", "商品税率");
+                builder.put("retailPrice", "零售价");
+                builder.put("prodBarcode", "产品编码");
+                builder.put("brand", "产品品牌");
+                builder.put("unitCode", "计量单位代码");
+                builder.put("cusGoodsCode", "海关商品编码");
+                builder.put("ciqProdModel", "国检规格型号");
+                builder.put("oriCntCode", "原产国代码");
+                builder.put("cusDeclEle", "海关申报要素");
+                builder.put("cusRecCode", "海关备案编号");
+            }
+            r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+            if (Integer.valueOf(r.get("code").toString()) != 0) {
+                throw new RRException(r.get("msg").toString());
+            }
         }
 
         // 商品轮播图
@@ -132,6 +137,10 @@ public class GoodsServiceImpl implements GoodsService {
         }
 
         // 添加商品
+        if (Dict.orderBizType.item_02.getItem().equals(goods.getGoodsBizType())
+                || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
+            goods.setIsHot(0);
+        }
         goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setAddTime(new Date());
         goods.setIsDelete(0);
@@ -157,12 +166,12 @@ public class GoodsServiceImpl implements GoodsService {
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
             for (GoodsAttributeEntity item : attributeEntityList) {
                 if (item.getIsDelete() == 0) {
-                    if (item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
+                    if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
                         item.setGoodsId(id);
                         goodsAttributeDao.save(item);
-                    } else if (item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
-                        throw new RRException("商品属性【" + attributeCategoryDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
-                    } else if (item.getAttributeId() == null) {
+                    } else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
+                        throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
+                    } else if (item.getId() == null && item.getAttributeId() == null) {
                         continue;
                     }
                 }
@@ -206,25 +215,31 @@ public class GoodsServiceImpl implements GoodsService {
         builder.put("goodsUnit", "商品单位");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
-        builder.put("goodsRate", "商品税率");
         builder.put("isHot", "热销");
 
-        if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
-            // 海关信息,普通货物可不添加
-            builder.put("sku", "SKU");
-            builder.put("retailPrice", "零售价");
-            builder.put("prodBarcode", "产品编码");
-            builder.put("brand", "产品品牌");
-            builder.put("unitCode", "计量单位代码");
-            builder.put("cusGoodsCode", "海关商品编码");
-            builder.put("ciqProdModel", "国检规格型号");
-            builder.put("oriCntCode", "原产国代码");
-            builder.put("cusDeclEle", "海关申报要素");
-            builder.put("cusRecCode", "海关备案编号");
-        }
+
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
+        } else {
+            if (!Dict.orderBizType.item_11.getItem().equals(goods.getGoodsBizType())) {
+                // 海关信息,普通货物可不添加
+                builder.put("sku", "SKU");
+                builder.put("goodsRate", "商品税率");
+                builder.put("retailPrice", "零售价");
+                builder.put("prodBarcode", "产品编码");
+                builder.put("brand", "产品品牌");
+                builder.put("unitCode", "计量单位代码");
+                builder.put("cusGoodsCode", "海关商品编码");
+                builder.put("ciqProdModel", "国检规格型号");
+                builder.put("oriCntCode", "原产国代码");
+                builder.put("cusDeclEle", "海关申报要素");
+                builder.put("cusRecCode", "海关备案编号");
+            }
+            r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+            if (Integer.valueOf(r.get("code").toString()) != 0) {
+                throw new RRException(r.get("msg").toString());
+            }
         }
 
         // 商品轮播图
@@ -246,6 +261,10 @@ public class GoodsServiceImpl implements GoodsService {
         }
 
         // 修改商品
+        if (Dict.orderBizType.item_02.getItem().equals(goods.getGoodsBizType())
+                || Dict.orderBizType.item_10.getItem().equals(goods.getGoodsBizType())) {
+            goods.setIsHot(0);
+        }
         goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setIsDelete(0);
         goods.setIsNew(0);
@@ -280,14 +299,14 @@ public class GoodsServiceImpl implements GoodsService {
         if (attributeEntityList != null && attributeEntityList.size() > 0) {
             for (GoodsAttributeEntity item : attributeEntityList) {
                 if (item.getIsDelete() == 0) {
-                    if (item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
+                     if (item.getId() != null) {
+                        goodsAttributeDao.update(item);
+                    } else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNotEmpty(item.getValue())) {
                         item.setGoodsId(goods.getId());
                         goodsAttributeDao.save(item);
-                    } else if (item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
-                        throw new RRException("商品属性【" + attributeCategoryDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
-                    } else if (item.getId() != null) {
-                        goodsAttributeDao.update(item);
-                    } else if (item.getAttributeId() == null) {
+                    } else if (item.getId() == null && item.getAttributeId() != null && StringUtils.isNullOrEmpty(item.getValue())) {
+                        throw new RRException("商品属性【" + attributeDao.queryObject(item.getAttributeId()).getName() + "】值不能为空!");
+                    } else if (item.getId() == null && item.getAttributeId() == null) {
                         continue;
                     }
                 } else if (item.getIsDelete() == 1) {

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

@@ -143,6 +143,30 @@ public class OrderServiceImpl implements OrderService {
         if (0 == shippingStatus) {
             throw new RRException("此订单未发货,不能确认收货!");
         }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_301.getItem())) {
+            throw new RRException("此订单已完成!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_0.getItem())) {
+            throw new RRException("此订单待付款!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_100.getItem())) {
+            throw new RRException("此订单付款中!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_101.getItem())) {
+            throw new RRException("此订单已取消!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_102.getItem())) {
+            throw new RRException("此订单已删除!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_201.getItem())) {
+            throw new RRException("此订单还未发货!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_401.getItem())) {
+            throw new RRException("此订单已退款!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.valueOf(Dict.orderStatus.item_402.getItem())) {
+            throw new RRException("此订单已退款!");
+        }
         orderEntity.setShippingStatus(2);
         orderEntity.setOrderStatus(301);
         orderEntity.setConfirmTime(new Date());
@@ -240,7 +264,7 @@ public class OrderServiceImpl implements OrderService {
         orderRefund.setRefundId(result.getRefund_id());
         orderRefund.setOutRefundNo(result.getOut_refund_no());
         orderRefund.setRefundMoney(BigDecimal.valueOf(Long.valueOf(result.getRefund_fee())).divide(Constant.ONE_HUNDRED));
-        orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_2.getItem()));//退款成功
+        orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_5.getItem()));//退款处理中
         orderRefund.setModTime(new Date());
 
         if(mallOrderRefund !=null){

+ 28 - 16
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -61,26 +61,32 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
 
     @Override
     public int save(ProductStoreRelaEntity productStoreRela) {
+        GoodsEntity goodsEntity = null;
         Map<String, Object> valideDate = MapBeanUtil.fromObject(productStoreRela);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("storeId", "门店");
         builder.put("goodsId", "商品");
         builder.put("stockNum", "库存");
 
-        GoodsEntity goodsEntity = goodsDao.queryObject(productStoreRela.getGoodsId());
-        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            // 普通商品校验商品规格
-            builder.put("specification", "规格");
-            builder.put("retailPrice", "零售价");
-            builder.put("marketPrice", "市场价");
-        }
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
+        } else {
+            goodsEntity = goodsDao.queryObject(productStoreRela.getGoodsId());
+            if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
+                // 普通商品校验商品规格
+                builder.put("specification", "规格");
+                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());
+            }
         }
 
         Map<String, Object> map = new HashMap();
-        map.put("sku", goodsEntity.getSku());
+        map.put("goodsId", goodsEntity.getId());
         map.put("storeId", productStoreRela.getStoreId());
         List<ProductStoreRelaEntity> storeRelaList = querySameList(map);
         if (storeRelaList != null && storeRelaList.size() > 0) {
@@ -122,26 +128,32 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
 
     @Override
     public int update(ProductStoreRelaEntity productStoreRela) {
+        GoodsEntity goodsEntity = null;
         Map<String, Object> valideDate = MapBeanUtil.fromObject(productStoreRela);
         ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
         builder.put("storeId", "门店");
         builder.put("goodsId", "商品");
         builder.put("stockNum", "库存");
 
-        GoodsEntity goodsEntity = goodsDao.queryObject(productStoreRela.getGoodsId());
-        if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
-            // 普通商品校验商品规格
-            builder.put("specification", "规格");
-            builder.put("retailPrice", "零售价");
-            builder.put("marketPrice", "市场价");
-        }
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());
+        } else {
+            goodsEntity = goodsDao.queryObject(productStoreRela.getGoodsId());
+            if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
+                // 普通商品校验商品规格
+                builder.put("specification", "规格");
+                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());
+            }
         }
 
         Map<String, Object> map = new HashMap();
-        map.put("sku", goodsEntity.getSku());
+        map.put("goodsId", goodsEntity.getId());
         map.put("storeId", productStoreRela.getStoreId());
         map.put("id", productStoreRela.getId());
         List<ProductStoreRelaEntity> storeRelaList = querySameList(map);

+ 59 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/SysCusNationCodeServiceImpl.java

@@ -0,0 +1,59 @@
+package com.kmall.admin.service.impl;
+
+import com.kmall.admin.dao.SysCusNationCodeDao;
+import com.kmall.admin.entity.SysCusNationCodeEntity;
+import com.kmall.admin.service.SysCusNationCodeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 国别地区代码Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:26:44
+ */
+@Service("sysCusNationCodeService")
+public class SysCusNationCodeServiceImpl implements SysCusNationCodeService {
+    @Autowired
+    private SysCusNationCodeDao sysCusNationCodeDao;
+
+    @Override
+    public SysCusNationCodeEntity queryObject(String sn) {
+        return sysCusNationCodeDao.queryObject(sn);
+    }
+
+    @Override
+    public List<SysCusNationCodeEntity> queryList(Map<String, Object> map) {
+        return sysCusNationCodeDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return sysCusNationCodeDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(SysCusNationCodeEntity sysCusNationCode) {
+        return sysCusNationCodeDao.save(sysCusNationCode);
+    }
+
+    @Override
+    public int update(SysCusNationCodeEntity sysCusNationCode) {
+        return sysCusNationCodeDao.update(sysCusNationCode);
+    }
+
+    @Override
+    public int delete(String sn) {
+        return sysCusNationCodeDao.delete(sn);
+    }
+
+    @Override
+    public int deleteBatch(String[]sns) {
+        return sysCusNationCodeDao.deleteBatch(sns);
+    }
+}

+ 58 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/SysCusUnitCodeServiceImpl.java

@@ -0,0 +1,58 @@
+package com.kmall.admin.service.impl;
+
+import com.kmall.admin.dao.SysCusUnitCodeDao;
+import com.kmall.admin.entity.SysCusUnitCodeEntity;
+import com.kmall.admin.service.SysCusUnitCodeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 计量单位代码Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-10 15:34:36
+ */
+@Service("sysCusUnitCodeService")
+public class SysCusUnitCodeServiceImpl implements SysCusUnitCodeService {
+    @Autowired
+    private SysCusUnitCodeDao sysCusUnitCodeDao;
+
+    @Override
+    public SysCusUnitCodeEntity queryObject(String sn) {
+        return sysCusUnitCodeDao.queryObject(sn);
+    }
+
+    @Override
+    public List<SysCusUnitCodeEntity> queryList(Map<String, Object> map) {
+        return sysCusUnitCodeDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return sysCusUnitCodeDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(SysCusUnitCodeEntity sysCusUnitCode) {
+        return sysCusUnitCodeDao.save(sysCusUnitCode);
+    }
+
+    @Override
+    public int update(SysCusUnitCodeEntity sysCusUnitCode) {
+        return sysCusUnitCodeDao.update(sysCusUnitCode);
+    }
+
+    @Override
+    public int delete(String sn) {
+        return sysCusUnitCodeDao.delete(sn);
+    }
+
+    @Override
+    public int deleteBatch(String[]sns) {
+        return sysCusUnitCodeDao.deleteBatch(sns);
+    }
+}

+ 3 - 1
kmall-admin/src/main/resources/conf/common.properties

@@ -3,8 +3,10 @@
 
 #测试apikey
 #yunpian.sms.apikey=1dd75986321871d706334e60b89c4021
+#前海电商apikey
+#yunpian.sms.apikey=3084e52ffff6adb96a67995b43edfb93
 #生产apikey
-yunpian.sms.apikey=3084e52ffff6adb96a67995b43edfb93
+yunpian.sms.apikey=6968bd2d54ceaba25d6211301831059f
 
 #url
 yunpian.sms.url=https://sms.yunpian.com/v2/sms/single_send.json

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

@@ -30,7 +30,7 @@
         mall_address.county_Name,
         mall_address.detail_Info,
         mall_address.is_default,
-        mall_user.username shop_user_name
+        mall_user.nickname shop_user_name
         from mall_address LEFT JOIN mall_user ON mall_address.user_id = mall_user.id
         where mall_address.id = #{id}
     </select>
@@ -48,7 +48,7 @@
         mall_address.county_Name,
         mall_address.detail_Info,
         mall_address.is_default,
-        mall_user.username shop_user_name
+        mall_user.nickname shop_user_name
         from mall_address LEFT JOIN mall_user ON mall_address.user_id = mall_user.id
         WHERE 1=1
         <if test="userId != null">

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

@@ -25,22 +25,22 @@
 	</select>
 
     <select id="queryList" resultType="com.kmall.admin.entity.AttributeEntity">
-        select
+        SELECT
         a.id,
         a.attribute_category_id,
-        a.name,
+        a.NAME,
         a.input_type,
-        a.value,
+        a.VALUE,
         a.sort_order,
-        ac.name category_name
-        from mall_attribute a LEFT JOIN mall_attribute_category ac
-        ON a.attribute_category_id = ac.id
+        c.NAME category_name
+        FROM mall_attribute a
+        LEFT JOIN mall_category c ON a.attribute_category_id = c.id
         WHERE 1=1
         <if test="name != null and name.trim() != ''">
             AND a.name LIKE concat('%', #{name},'%')
         </if>
         <if test="categoryName != null and categoryName.trim() != ''">
-            AND ac.name LIKE concat('%', #{categoryName},'%')
+            AND c.name LIKE concat('%', #{categoryName},'%')
         </if>
         <if test="attributeCategoryId != null and attributeCategoryId.trim() != ''">
             AND a.attribute_category_id = #{attributeCategoryId}
@@ -59,8 +59,18 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-		select count(*) from mall_attribute
-		WHERE 1=1
+		select count(*) from mall_attribute a
+        LEFT JOIN mall_category c ON a.attribute_category_id = c.id
+        WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND a.name LIKE concat('%', #{name},'%')
+        </if>
+        <if test="categoryName != null and categoryName.trim() != ''">
+            AND c.name LIKE concat('%', #{categoryName},'%')
+        </if>
+        <if test="attributeCategoryId != null and attributeCategoryId.trim() != ''">
+            AND a.attribute_category_id = #{attributeCategoryId}
+        </if>
 	</select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.AttributeEntity" useGeneratedKeys="true" keyProperty="id">

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

@@ -27,7 +27,7 @@
 	</select>
 
     <select id="queryList" resultMap="cartMap">
-        select a.* ,b.username as user_name
+        select a.* ,b.nickname as user_name
         from mall_cart a
         left join mall_user b on a.user_id = b.id
         where 1=1

+ 15 - 3
kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml

@@ -72,6 +72,9 @@
 		<if test="isShow != null and isShow != ''">
 			AND `is_show` = #{isShow}
 		</if>
+		<if test="isL2 != null and isL2 != ''">
+			AND `parent_id` != #{isL2}
+		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -88,9 +91,18 @@
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_category
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+		<if test="name != null and name.trim() != ''">
+			AND `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}
+		</if>
+		<if test="isL2 != null and isL2 != ''">
+			AND `parent_id` != #{isL2}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.CategoryEntity">

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

@@ -118,8 +118,8 @@
             <if test="sendEndDate != null">`send_end_date` = #{sendEndDate},</if>
             <if test="useStartDate != null">`use_start_date` = #{useStartDate},</if>
             <if test="useEndDate != null">`use_end_date` = #{useEndDate},</if>
-            <if test="minGoodsAmount != null">`min_goods_amount` = #{minGoodsAmount}</if>
-            <if test="isAll != null">`is_all` = #{isAll}</if>
+            <if test="minGoodsAmount != null">`min_goods_amount` = #{minGoodsAmount},</if>
+            <if test="isAll != null">`is_all` = #{isAll},</if>
         </set>
         where id = #{id}
     </update>

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

@@ -18,7 +18,7 @@
 	</select>
 
     <select id="queryList" resultMap="footprintMap">
-        select a.* ,b.username as user_name,c.name as goods_name
+        select a.* ,b.nickname as user_name,c.name as goods_name
         from mall_footprint a
         left join mall_user b on a.user_id = b.id
         left join mall_goods c on a.goods_id = c.id

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/FreightDao.xml

@@ -88,6 +88,9 @@
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>
+		<if test="id != null and id != ''">
+			AND id NOT LIKE concat('%',#{id},'%')
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.FreightEntity" useGeneratedKeys="true" keyProperty="id">

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

@@ -36,6 +36,9 @@
         <if test="goodsId != null and goodsId != ''">
             AND mall_goods_attribute.goods_id = #{goodsId}
         </if>
+        <if test="attributeId != null and attributeId != ''">
+            AND mall_goods_attribute.attribute_id = #{attributeId}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -53,7 +56,10 @@
         select count(*) from mall_goods_attribute
         WHERE 1=1
         <if test="goodsId != null and goodsId != ''">
-            AND mall_goods_attribute.goods_id = #{goodsId}
+            AND goods_id = #{goodsId}
+        </if>
+        <if test="attributeId != null and attributeId != ''">
+            AND attribute_id = #{attributeId}
         </if>
     </select>
 

+ 24 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -101,6 +101,12 @@
         <if test="freightId != null and freightId != ''">
             AND mall_goods.freight_id = #{freightId}
         </if>
+        <if test="brandId != null and brandId != ''">
+            AND mall_goods.brand_id = #{brandId}
+        </if>
+        <if test="categoryId != null and categoryId != ''">
+            AND mall_goods.category_id = #{categoryId}
+        </if>
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
@@ -170,10 +176,27 @@
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
+        <if test="freightId != null and freightId != ''">
+            AND mall_goods.freight_id = #{freightId}
+        </if>
+        <if test="brandId != null and brandId != ''">
+            AND mall_goods.brand_id = #{brandId}
+        </if>
+        <if test="categoryId != null and categoryId != ''">
+            AND mall_goods.category_id = #{categoryId}
+        </if>
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
-        AND mall_goods.is_Delete = #{isDelete}
+        <if test="category != null and category != ''">
+            AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
+        </if>
+        <if test="categoryTwo != null and categoryTwo != ''">
+            AND mall_goods.category_id = #{categoryTwo}
+        </if>
+        <if test="isDelete != null and isDelete != ''">
+            AND mall_goods.is_Delete = #{isDelete}
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/GoodsGalleryDao.xml

@@ -59,6 +59,9 @@
         <if test="goodsName != null and goodsName.trim() != ''">
             AND mall_goods.name LIKE concat('%',#{goodsName},'%')
         </if>
+        <if test="goodsId != null">
+            AND mall_goods_gallery.goods_id = #{goodsId}
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsGalleryEntity" useGeneratedKeys="true" keyProperty="id">

+ 5 - 5
kmall-admin/src/main/resources/mybatis/mapper/HelpTypeDao.xml

@@ -25,8 +25,8 @@
     		`sort`
 		from mall_help_type
 		WHERE 1=1
-		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+		<if test="typeName != null and typeName.trim() != ''">
+			AND type_name LIKE concat('%',#{typeName},'%')
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -44,9 +44,9 @@
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_help_type
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+		<if test="typeName != null and typeName.trim() != ''">
+			AND type_name LIKE concat('%',#{typeName},'%')
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.HelpTypeEntity" useGeneratedKeys="true" keyProperty="id">

+ 22 - 3
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -48,6 +48,9 @@
         <result property="deliveryRemark" column="delivery_remark"/>
         <result property="predictTime" column="predict_time"/>
         <result property="orderBizType" column="order_biz_type"/>
+        <result property="isPaymentSend" column="is_payment_send"/>
+        <result property="isEleOrderSend" column="is_ele_order_send"/>
+        <result property="isCustomsSend" column="is_customs_send"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
@@ -70,10 +73,20 @@
     </select>
 
     <select id="queryList" resultType="com.kmall.admin.entity.OrderEntity">
-        select o.*,u.username as username
-        from mall_order o
-        left join mall_user u on o.user_id = u.id
+        SELECT
+        o.*,
+        u.username AS username,
+        p.is_payment_send,
+        p.is_ele_order_send,
+        p.is_customs_send
+        FROM
+        mall_order o
+        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="storeId != null">
+            AND o.store_id = #{storeId}
+        </if>
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
         </if>
@@ -110,6 +123,9 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_order o WHERE 1=1
+        <if test="storeId != null">
+            AND o.store_id = #{storeId}
+        </if>
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
         </if>
@@ -128,6 +144,9 @@
         <if test="orderType != null and orderType.trim() != ''">
             AND o.order_type = #{orderType}
         </if>
+        <if test="ids != null and ids.trim() != ''">
+            AND o.id in (${ids})
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.OrderEntity" useGeneratedKeys="true" keyProperty="id">

+ 24 - 4
kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml

@@ -7,16 +7,24 @@
         <result property="id" column="id"/>
         <result property="orderId" column="order_id"/>
         <result property="userId" column="user_id"/>
+        <result property="outRefundNo" column="out_refund_no"/>
+        <result property="refundId" column="refund_id"/>
         <result property="refundType" column="refund_type"/>
         <result property="refundTime" column="refund_time"/>
         <result property="creator" column="creator"/>
         <result property="refundMoney" column="refund_money"/>
-        <result property="refundReason" column="refund_reason"/>
         <result property="refundStatus" column="refund_status"/>
-        <result property="wechatRefundStatusDes" column="wechat_refund_status_des"/>
+        <result property="refundReason" column="refund_reason"/>
         <result property="approver" column="approver"/>
         <result property="approvalTime" column="approval_time"/>
         <result property="approvalRemark" column="approval_remark"/>
+        <result property="createSn" column="create_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+        <result property="refundRecvAccout" column="refund_recv_accout"/>
+        <result property="wechatRefundStatusDes" column="wechat_refund_status_des"/>
         <result property="orderSn" column="order_sn"/>
         <result property="orderStatus" column="order_status"/>
         <result property="actualPrice" column="actual_price"/>
@@ -79,6 +87,9 @@
         <if test="orderId != null">
             AND o.id = #{orderId}
         </if>
+        <if test="storeId != null">
+            AND o.store_id = #{storeId}
+        </if>
         <if test="shippingStatus != null and shippingStatus.trim() != ''">
             AND o.shipping_status = #{shippingStatus}
         </if>
@@ -119,6 +130,12 @@
         <if test="orderSn != null and orderSn.trim() != ''">
             AND o.order_sn LIKE concat('%',#{orderSn},'%')
         </if>
+        <if test="userName != null and userName.trim() != ''">
+            AND u.username LIKE concat('%',#{userName},'%')
+        </if>
+        <if test="storeId != null">
+            AND o.store_id = #{storeId}
+        </if>
         <if test="orderId != null">
             AND o.id = #{orderId}
         </if>
@@ -154,7 +171,8 @@
 			`wechat_refund_status_des`,
 			`approver`,
 			`approval_time`,
-			`approval_remark`)
+			`approval_remark`,
+			`out_refund_no`)
 		values(
 			#{orderId},
 			#{userId},
@@ -166,7 +184,8 @@
 			#{wechatRefundStatusDes},
 			#{approver},
 			#{approvalTime},
-			#{approvalRemark})
+			#{approvalRemark},
+			#{outRefundNo})
 	</insert>
 
     <update id="update" parameterType="com.kmall.admin.entity.OrderRefundEntity">
@@ -183,6 +202,7 @@
             <if test="approver != null">`approver` = #{approver},</if>
             <if test="approvalTime != null">`approval_time` = #{approvalTime},</if>
             <if test="approvalRemark != null">`approval_remark` = #{approvalRemark},</if>
+            <if test="outRefundNo != null">`out_refund_no` = #{outRefundNo},</if>
         </set>
         where id = #{id}
     </update>

+ 4 - 4
kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml

@@ -126,7 +126,7 @@
         <if test="productId != null">
             AND a.product_id = #{productId}
         </if>
-        <if test="storeId != null and storeId.trim() != ''">
+        <if test="storeId != null and storeId != ''">
             AND s.id = #{storeId}
         </if>
         <choose>
@@ -165,8 +165,8 @@
         LEFT JOIN mall_category cg ON b.category_id = cg.id
         left join mall_store s on a.store_id = s.id
         WHERE 1=1 and b.is_delete = 0
-        <if test="sku != null">
-            AND b.sku = #{sku}
+        <if test="goodsId != null">
+            AND b.id = #{goodsId}
         </if>
         <if test="storeId != null">
             AND a.store_id = #{storeId}
@@ -210,7 +210,7 @@
         <if test="productId != null">
             AND a.product_id = #{productId}
         </if>
-        <if test="storeId != null and storeId.trim() != ''">
+        <if test="storeId != null and storeId != ''">
             AND s.id = #{storeId}
         </if>
     </select>

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

@@ -18,7 +18,7 @@
 	</select>
 
     <select id="queryList" resultMap="searchHistoryMap">
-        select a.* ,b.username as user_name
+        select a.* ,b.nickname as user_name
         from mall_search_history a
         left join mall_user b on a.user_id = b.id
         <choose>

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml

@@ -87,6 +87,9 @@
 		<if test="storeNumber != null and storeNumber.trim() != ''">
 			AND storeNumber LIKE concat('%',#{store_number},'%')
 		</if>
+		<if test="id != null">
+			AND id = #{id}
+		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -109,6 +112,9 @@
 		<if test="storeNumber != null and storeNumber.trim() != ''">
 			AND storeNumber LIKE concat('%',#{store_number},'%')
 		</if>
+		<if test="id != null">
+			AND id = #{id}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.StoreEntity" useGeneratedKeys="true" keyProperty="id">

+ 137 - 0
kmall-admin/src/main/resources/mybatis/mapper/SysCusNationCodeDao.xml

@@ -0,0 +1,137 @@
+<?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.SysCusNationCodeDao">
+
+    <resultMap type="com.kmall.admin.entity.SysCusNationCodeEntity" id="sysCusNationCodeMap">
+        <result property="sn" column="sn"/>
+        <result property="code" column="code"/>
+        <result property="name" column="name"/>
+        <result property="ename" column="ename"/>
+        <result property="discountsTaxType" column="discounts_tax_type"/>
+        <result property="remark" column="remark"/>
+        <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.SysCusNationCodeEntity">
+		select
+			`sn`,
+			`code`,
+			`name`,
+			`ename`,
+			`discounts_tax_type`,
+			`remark`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from sys_cus_nation_code
+		where sn = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.SysCusNationCodeEntity">
+		select
+    		`sn`,
+    		`code`,
+    		`name`,
+    		`ename`,
+    		`discounts_tax_type`,
+    		`remark`,
+    		`is_valid`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from sys_cus_nation_code
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by sn desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from sys_cus_nation_code
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.admin.entity.SysCusNationCodeEntity">
+		insert into sys_cus_nation_code(
+			`sn`,
+			`code`,
+			`name`,
+			`ename`,
+			`discounts_tax_type`,
+			`remark`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{sn},
+			#{code},
+			#{name},
+			#{ename},
+			#{discountsTaxType},
+			#{remark},
+			#{isValid},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.admin.entity.SysCusNationCodeEntity">
+		update sys_cus_nation_code 
+		<set>
+			<if test="code != null">`code` = #{code}, </if>
+			<if test="name != null">`name` = #{name}, </if>
+			<if test="ename != null">`ename` = #{ename}, </if>
+			<if test="discountsTaxType != null">`discounts_tax_type` = #{discountsTaxType}, </if>
+			<if test="remark != null">`remark` = #{remark}, </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 sn = #{sn}
+	</update>
+	
+	<delete id="delete">
+		delete from sys_cus_nation_code where sn = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from sys_cus_nation_code where sn in 
+		<foreach item="sn" collection="array" open="(" separator="," close=")">
+			#{sn}
+		</foreach>
+	</delete>
+
+</mapper>

+ 125 - 0
kmall-admin/src/main/resources/mybatis/mapper/SysCusUnitCodeDao.xml

@@ -0,0 +1,125 @@
+<?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.SysCusUnitCodeDao">
+
+    <resultMap type="com.kmall.admin.entity.SysCusUnitCodeEntity" id="sysCusUnitCodeMap">
+        <result property="sn" column="sn"/>
+        <result property="code" column="code"/>
+        <result property="name" column="name"/>
+        <result property="remark" column="remark"/>
+        <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.SysCusUnitCodeEntity">
+		select
+			`sn`,
+			`code`,
+			`name`,
+			`remark`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from sys_cus_unit_code
+		where sn = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.SysCusUnitCodeEntity">
+		select
+    		`sn`,
+    		`code`,
+    		`name`,
+    		`remark`,
+    		`is_valid`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from sys_cus_unit_code
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by sn desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from sys_cus_unit_code
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.admin.entity.SysCusUnitCodeEntity">
+		insert into sys_cus_unit_code(
+			`sn`,
+			`code`,
+			`name`,
+			`remark`,
+			`is_valid`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{sn},
+			#{code},
+			#{name},
+			#{remark},
+			#{isValid},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.admin.entity.SysCusUnitCodeEntity">
+		update sys_cus_unit_code 
+		<set>
+			<if test="code != null">`code` = #{code}, </if>
+			<if test="name != null">`name` = #{name}, </if>
+			<if test="remark != null">`remark` = #{remark}, </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 sn = #{sn}
+	</update>
+	
+	<delete id="delete">
+		delete from sys_cus_unit_code where sn = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from sys_cus_unit_code where sn in 
+		<foreach item="sn" collection="array" open="(" separator="," close=")">
+			#{sn}
+		</foreach>
+	</delete>
+
+</mapper>

+ 5 - 30
kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml

@@ -18,46 +18,21 @@
         <result property="registerIp" column="register_ip"/>
         <result property="avatar" column="avatar"/>
         <result property="weixinOpenid" column="weixin_openid"/>
+        <result property="id" column="id_no"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.UserEntity">
-		select
-			id,
-			username,
-			password,
-			gender,
-			birthday,
-			register_time,
-			last_login_time,
-			last_login_ip,
-			user_level_id,
-			nickname,
-			mobile,
-			register_ip,
-			avatar,
-			weixin_openid
+		select *
 		from mall_user
 		where id = #{id}
 	</select>
 
     <select id="queryList" resultType="com.kmall.admin.entity.UserEntity">
         select
-        mall_user.id,
-        mall_user.username,
-        mall_user.password,
-        mall_user.gender,
-        mall_user.birthday,
-        mall_user.register_time,
-        mall_user.last_login_time,
-        mall_user.last_login_ip,
-        mall_user.user_level_id,
-        mall_user.nickname,
-        mall_user.mobile,
-        mall_user.register_ip,
-        mall_user.avatar,
-        mall_user.weixin_openid,
+        mall_user.*,
         mall_user_level.name levelName
-        from mall_user LEFT JOIN mall_user_level ON mall_user.user_level_id=mall_user_level.id
+        from mall_user
+        LEFT JOIN mall_user_level ON mall_user.user_level_id=mall_user_level.id
         WHERE 1=1
         <if test="username != null and username.trim() != ''">
             and username like concat('%',#{username},'%')

+ 8 - 8
kmall-admin/src/main/webapp/WEB-INF/page/shop/attribute.html

@@ -13,7 +13,7 @@
                     <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                 </i-col>
                 <i-col span="4">
-                    <i-input v-model="q.categoryName" @on-enter="query" placeholder="所属类"/>
+                    <i-input v-model="q.categoryName" @on-enter="query" placeholder="所属类"/>
                 </i-col>
                 <i-button @click="query">查询</i-button>
             </div>
@@ -39,18 +39,18 @@
             <Form-item label="名称" prop="name">
                 <i-input v-model="attribute.name" placeholder="名称"/>
             </Form-item>
-            <Form-item label="所属种类" prop="attributeCategoryId" style="width: 268px;">
+            <Form-item label="所属分类" prop="attributeCategoryId">
                 <i-select v-model="attribute.attributeCategoryId" filterable>
                     <i-option v-for="category in categories" :value="category.id" :key="category.id">{{category.name}}
                     </i-option>
                 </i-select>
             </Form-item>
-            <!--<Form-item label="类型" prop="inputType">-->
-            <!--<i-input v-model="attribute.inputType" placeholder="类型"/>-->
-            <!--</Form-item>-->
-            <!--<Form-item label="值" prop="value">-->
-            <!--<i-input v-model="attribute.value" placeholder="值"/>-->
-            <!--</Form-item>-->
+            <!--<Form-item label="类型" prop="inputType">
+            <i-input v-model="attribute.inputType" placeholder="类型"/>
+            </Form-item>
+            <Form-item label="值" prop="value">
+            <i-input v-model="attribute.value" placeholder="值"/>
+            </Form-item>-->
             <Form-item label="排序" prop="sortOrder">
                 <Input-number :min="0" :step="1" v-model="attribute.sortOrder" placeholder="排序" style="width: 188px;"/>
             </Form-item>

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

@@ -38,7 +38,7 @@
             </Form-item>
             <Row>
                 <i-col span="16">
-                    <Form-item label="图片" prop="imageUrl">
+                    <Form-item label="图片" prop="listPicUrl">
                         <i-input v-model="brand.listPicUrl" placeholder="图片" readonly/>
                     </Form-item>
                 </i-col>

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

@@ -41,8 +41,7 @@
             <Form-item label="优惠券名称" prop="name">
                 <i-input v-model="coupon.name" placeholder="优惠券名称"/>
             </Form-item>
-
-            <Form-item label="状态" prop="status">
+            <!--<Form-item label="状态" prop="status">
                 <Radio-group v-model="coupon.status">
                     <Radio label="1">
                         <span>正常</span>
@@ -51,7 +50,7 @@
                         <span>失效</span>
                     </Radio>
                 </Radio-group>
-            </Form-item>
+            </Form-item>-->
             <Form-item label="赠送金额" prop="typeMoney">
                 <Input-number :min="0" v-model="coupon.typeMoney" placeholder="赠送金额" style="width: 188px;"/>
             </Form-item>

+ 14 - 37
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -104,6 +104,7 @@
         <Tabs value="name1">
             <Tab-Pane label="通用信息" name="name1">
                 <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
+                <span style="margin-left: 142px; font-size: 12px; color: red;">修改商品二级分类将清空商品参数列表</span>
                     <Form-item label="商品类型" prop="categoryId">
                         <!--<i-input v-model="goods.categoryName" @on-click="categoryTree" icon="eye" readonly="readonly" placeholder="商品类型"/>-->
                         <i-select v-model="goods.attributeCategory" placeholder="商品分类" filterable @on-change="changeCategories"
@@ -112,7 +113,7 @@
                                       :key="category.id">{{category.name}}
                             </i-option>
                         </i-select>
-                        <i-select v-model="goods.categoryId" placeholder="商品二级分类" filterable
+                        <i-select v-model="goods.categoryId" placeholder="商品二级分类" filterable @on-change="getAttributes"
                                   label-in-value style="width: 268px;">
                             <i-option v-for="category in categoriesTwo" :value="category.id"
                                       :key="category.id">{{category.name}}
@@ -226,8 +227,12 @@
                     <Form-item label="海关备案编号" prop="cusRecCode">
                         <i-input v-model="goods.cusRecCode" placeholder="海关备案编号"/>
                     </Form-item>
-                    <Form-item label="计量单位代码" prop="unitCode">
-                        <i-input v-model="goods.unitCode" placeholder="计量单位代码"/>
+                    <Form-item label="计量单位" prop="unitCode">
+                        <i-select v-model="goods.unitCode" filterable placeholder="计量单位"
+                                  label-in-value>
+                            <i-option v-for="cusUnitCode in cusUnitCodeList" :value="cusUnitCode.code" :key="cusUnitCode.sn">{{cusUnitCode.name}}
+                            </i-option>
+                        </i-select>
                     </Form-item>
                     <Form-item label="海关商品编码" prop="cusGoodsCode">
                         <i-input v-model="goods.cusGoodsCode" placeholder="海关商品编码"/>
@@ -235,8 +240,12 @@
                     <Form-item label="国检规格型号" prop="ciqProdModel" >
                         <i-input v-model="goods.ciqProdModel" placeholder="国检规格型号"/>
                     </Form-item>
-                    <Form-item label="原产国代码" prop="oriCntCode">
-                        <i-input v-model="goods.oriCntCode" placeholder="原产国代码"/>
+                    <Form-item label="原产国" prop="oriCntCode">
+                        <i-select v-model="goods.oriCntCode" filterable placeholder="原产国"
+                                  label-in-value>
+                            <i-option v-for="cusNationCode in cusNationCodeList" :value="cusNationCode.code" :key="cusNationCode.sn">{{cusNationCode.name}}
+                            </i-option>
+                        </i-select>
                     </Form-item>
                     <Form-item label="海关申报要素" prop="cusDeclEle">
                         <i-input v-model="goods.cusDeclEle" placeholder="海关申报要素"/>
@@ -395,38 +404,6 @@
     <ul id="categoryTree" class="ztree"></ul>
 </div>
 
-<div id="qrcode" style="display: none;padding: 10px;">
-    <div id="qrcodeCanvas" style="margin: 53px 0 0 93px"></div>
-</div>
-
-
-<div id="qrcImg" style="display:none">
-    <img class="qrcImg align-center" src="">
-    <img class="upLogo align-center-middle" src="" >
-</div>
-
 <script src="${rc.contextPath}/js/shop/goods.js?_${date.systemTime}"></script>
 </body>
-
-<style>
-    .align-center {
-        position:absolute;
-        margin: auto;
-        top:0px;
-        bottom: 0px;
-        right: 0px;
-        left: 0px;
-    }
-
-    .align-center-middle {
-        position:absolute;
-        height: 30px;
-        width: 30px;
-        margin: auto;
-        top:0px;
-        bottom: 0px;
-        right: 0px;
-        left: 0px;
-    }
-</style>
 </html>

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

@@ -10,7 +10,7 @@
         <Row :gutter="16">
             <div class="search-group">
                 <i-col span="4">
-                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                    <i-input v-model="q.typeName" @on-enter="query" placeholder="名称"/>
                 </i-col>
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>

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

@@ -64,21 +64,21 @@
                 <i-col span="4">
                     <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品编码"/>
                 </i-col>
-                <i-col span="4">
+                <!--<i-col span="4">
                     <i-input v-model="q.productSn" @on-enter="query" placeholder="规格编码"/>
-                </i-col>
+                </i-col>-->
                 <i-button @click="query">查询</i-button>
                 <i-button @click="reloadSearch">重置</i-button>
             </div>
             <div class="buttons-group">
-                #if($shiro.hasPermission("productstorerela:upload"))
+                <!--#if($shiro.hasPermission("productstorerela:upload"))
                 <i-col style="display: inline-grid;">
                     <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError"
                             action="../goods/upload">
                         <i-button type="ghost" icon="ios-cloud-upload-outline">导入</i-button>
                     </Upload>
                 </i-col>
-                #end
+                #end-->
                 #if($shiro.hasPermission("productstorerela:save"))
                 <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                 #end
@@ -140,6 +140,38 @@
     <ul id="categoryTree" class="ztree"></ul>
 </div>
 
+<div id="qrcode" style="display: none;padding: 10px;">
+    <div id="qrcodeCanvas" style="margin: 53px 0 0 93px"></div>
+</div>
+
+
+<div id="qrcImg" style="display:none">
+    <img class="qrcImg align-center" src="">
+    <img class="upLogo align-center-middle" src="" >
+</div>
+
 <script src="${rc.contextPath}/js/shop/storeProductStock.js?_${date.systemTime}"></script>
 </body>
+
+<style>
+    .align-center {
+        position:absolute;
+        margin: auto;
+        top:0px;
+        bottom: 0px;
+        right: 0px;
+        left: 0px;
+    }
+
+    .align-center-middle {
+        position:absolute;
+        height: 30px;
+        width: 30px;
+        margin: auto;
+        top:0px;
+        bottom: 0px;
+        right: 0px;
+        left: 0px;
+    }
+</style>
 </html>

+ 3 - 3
kmall-admin/src/main/webapp/WEB-INF/page/sys/oss.html

@@ -9,12 +9,12 @@
 <div id="rrapp" v-cloak>
     <div v-show="showList">
         <Row :gutter="16">
-            <div class="search-group">
+            <!--<div class="search-group">
                 <i-button type="success" @click="addConfig"><i class="fa fa-sun-o"></i>&nbsp;云存储配置</i-button>
                 <i-button type="primary" id="upload"><i class="fa fa-plus"></i>&nbsp;上传文件</i-button>
-            </div>
+            </div>-->
             <div class="buttons-group">
-                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
+                <!--<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>-->
                 <i-button type="success" @click="lookImg"><i class="fa fa-eye"></i>&nbsp;预览</i-button>
             </div>
         </Row>

+ 6 - 6
kmall-admin/src/main/webapp/WEB-INF/page/sys/role.html

@@ -36,23 +36,23 @@
             <Form-item label="角色名称" prop="roleName">
                 <i-input v-model="role.roleName" placeholder="角色名称"/>
             </Form-item>
-            <Form-item label="所属部门" prop="deptName">
+            <!--<Form-item label="所属部门" prop="deptName">
                 <i-input type="text" v-model="role.deptName" icon="eye" readonly="readonly"
                          @on-click="deptTree" readonly="readonly" placeholder="所属部门"/>
-            </Form-item>
+            </Form-item>-->
             <Form-item label="备注" prop="remark">
                 <i-input type="textarea" v-model="role.remark" placeholder="备注"/>
             </Form-item>
             <Form-item label="功能权限">
-                <div style="overflow-y: auto;max-height: 250px">
+                <div style="overflow-y: auto; max-height: 250px; border: 1px solid #cccccc;">
                     <ul id="menuTree" class="ztree"></ul>
                 </div>
             </Form-item>
-            <Form-item label="数据权限">
-                <div style="overflow-y: auto;max-height: 250px">
+            <!--<Form-item label="数据权限">
+                <div style="overflow-y: auto; max-height: 250px; border: 1px solid #cccccc;">
                     <ul id="dataTree" class="ztree"></ul>
                 </div>
-            </Form-item>
+            </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>

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/sys/schedule.html

@@ -9,7 +9,7 @@
     <div v-show="showList">
         <Row :gutter="16">
             <i-col span="4">
-                <i-input v-model="q.beanName" @on-enter="query" placeholder="bean名称"/>
+                <i-input v-model="q.methodName" @on-enter="query" placeholder="方法名称"/>
             </i-col>
             <i-button @click="query">查询</i-button>
             #if($shiro.hasPermission("sys:schedule:save"))
@@ -41,7 +41,7 @@
         <i-col span="12">
             <Card>
                 <p slot="title">{{title}}</p>
-                <i-form ref="formValidate" :model="schedule" :rules="ruleValidate" :label-width="80">
+                <i-form ref="formValidate" :model="schedule" :rules="ruleValidate" :label-width="100">
                     <Form-item label="bean名称" prop="beanName">
                         <i-input v-model="schedule.beanName" placeholder="spring bean名称,如:testTask"/>
                     </Form-item>

+ 18 - 9
kmall-admin/src/main/webapp/WEB-INF/page/sys/user.html

@@ -32,27 +32,36 @@
 
     <Card v-show="!showList">
         <p slot="title">{{title}}</p>
-        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
+        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="120">
             <Form-item label="用户名" prop="username">
                 <i-input v-model="user.username" placeholder="登录账号"/>
             </Form-item>
-            <Form-item label="所属部门" prop="deptName">
+            <!--<Form-item label="所属部门" prop="deptName">
                 <i-input type="text" v-model="user.deptName" icon="eye" readonly="readonly"
                          @on-click="deptTree" readonly="readonly" placeholder="所属部门"/>
-            </Form-item>
+            </Form-item>-->
             <Form-item label="邮箱" prop="email">
                 <i-input v-model="user.email" placeholder="邮箱"/>
             </Form-item>
-
             <Form-item label="手机号" prop="mobile">
                 <i-input v-model="user.mobile" placeholder="手机号"/>
             </Form-item>
-            <Form-item label="角色" prop="roleIdList">
-                <Checkbox-group v-model="user.roleIdList">
-                    <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
-                </Checkbox-group>
+            <Form-item label="角色" prop="roleId">
+                <i-select v-model="user.roleId" filterable placeholder="角色" label-in-value>
+                    <i-option v-for="role in roleList" :value="role.roleId" :key="role.roleId">{{role.roleName}}</i-option>
+                </i-select>
+            </Form-item>
+            <Form-item label="数据角色类型" prop="roleType">
+                <Radio-group v-model="user.roleType">
+                    <Radio label="1">操作员</Radio>
+                    <Radio label="2">店员</Radio>
+                </Radio-group>
+            </Form-item>
+            <Form-item label="门店" prop="storeId">
+                <i-select v-model="user.storeId" filterable placeholder="门店" label-in-value>
+                    <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
+                </i-select>
             </Form-item>
-
             <Form-item label="状态" prop="status">
                 <Radio-group v-model="user.status">
                     <Radio label="0">

+ 7 - 8
kmall-admin/src/main/webapp/js/shop/attribute.js

@@ -4,7 +4,7 @@ $(function () {
         datatype: "json",
         colModel: [
             {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
-            {label: '所属类', name: 'categoryName', index: 'attribute_category_id', width: 80},
+            {label: '所属类', name: 'categoryName', index: 'attribute_category_id', width: 80},
             {label: '名称', name: 'name', index: 'name', width: 80},
             // {label: '类型', name: 'inputType', index: 'input_type', width: 80},
             // {label: '值', name: 'value', index: 'value', width: 80},
@@ -41,11 +41,11 @@ var vm = new Vue({
     data: {
         showList: true,
         title: null,
-        attribute: {},
+        attribute: { sortOrder: '' },
         ruleValidate: {
-            name: [
+            /*name: [
                 {required: true, message: '名称不能为空', trigger: 'blur'}
-            ]
+            ]*/
         },
         q: {
             name: '',
@@ -61,6 +61,7 @@ var vm = new Vue({
             vm.showList = false;
             vm.title = "新增";
             vm.attribute = {};
+            vm.attribute = { sortOrder: '' };
             vm.categories = [];
             this.getCategories();
         },
@@ -132,14 +133,12 @@ var vm = new Vue({
             vm.handleReset('formValidate');
         },
         getCategories: function () {
-            $.get("../attributecategory/queryAll", function (r) {
+            $.get("../category/getCategory?isL2=0", function (r) {
                 vm.categories = r.list;
             });
         },
         handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
+            vm.saveOrUpdate();
         },
         handleReset: function (name) {
             handleResetForm(this, name);

+ 21 - 0
kmall-admin/src/main/webapp/js/shop/brand.js

@@ -74,6 +74,27 @@ var vm = new Vue({
         ruleValidate: {
             name: [
                 {required: true, message: '品牌名称不能为空', trigger: 'blur'}
+            ],
+            listPicUrl: [
+                {required: true, message: '品牌图片不能为空', trigger: 'blur'}
+            ],
+            simpleDesc: [
+                {required: true, message: '品牌描述不能为空', trigger: 'blur'}
+            ],
+            picUrl: [
+                {required: true, message: '品牌图片不能为空', trigger: 'blur'}
+            ],
+            // sortOrder: [
+            //     {required: true, message: '排序不能为空', trigger: 'blur'}
+            // ],
+            // floorPrice: [
+            //     {required: true, message: '展示价格不能为空', trigger: 'blur'}
+            // ],
+            appListPicUrl: [
+                {required: true, message: 'app显示图片不能为空', trigger: 'blur'}
+            ],
+            newPicUrl: [
+                {required: true, message: '新品牌图片不能为空', trigger: 'blur'}
             ]
         },
         q: {

+ 18 - 0
kmall-admin/src/main/webapp/js/shop/category.js

@@ -62,6 +62,24 @@ var vm = new Vue({
         ruleValidate: {
             name: [
                 {required: true, message: '分类名称不能为空', trigger: 'blur'}
+            ],
+            frontDesc: [
+                {required: true, message: '描述不能为空', trigger: 'blur'}
+            ],
+            bannerUrl: [
+                {required: true, message: 'banner图片不能为空', trigger: 'blur'}
+            ],
+            iconUrl: [
+                {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'}
             ]
         },
         q: {

+ 34 - 31
kmall-admin/src/main/webapp/js/shop/coupongrads.js

@@ -13,43 +13,46 @@ $(function () {
         colModel: [
             {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
             {label: '优惠券名称', name: 'name', index: 'name', width: 120},
-            // {
-            //     label: '优惠券类型', name: 'couponType', index: 'couponType', width: 80, formatter: function (value) {
-            //     if (value == 0) {
-            //         return '通用优惠券';
-            //     } else if (value == 1) {
-            //         return '门店优惠券';
-            //     } else if (value == 2) {
-            //         return '产品优惠券';
-            //     }
-            //     return '-';
-            // }
-            // },
-            {
-                label: '状态', name: 'status', index: 'status', width: 50, formatter: function (value) {
-                if (value == 0) {
-                    return '失效';
-                } else if (value == 1) {
-                    return '正常';
+            /*{
+                label: '优惠券类型', name: 'couponType', index: 'couponType', width: 80,
+                formatter: function (value) {
+                    if (value == 0) {
+                        return '通用优惠券';
+                    } else if (value == 1) {
+                        return '门店优惠券';
+                    } else if (value == 2) {
+                        return '产品优惠券';
+                    }
+                    return '-';
                 }
-                return '-';
-            }
-            },
+            },*/
+            /*{
+                label: '状态', name: 'status', index: 'status', width: 50,
+                formatter: function (value) {
+                    if (value == 0) {
+                        return '失效';
+                    } else if (value == 1) {
+                        return '正常';
+                    }
+                    return '-';
+                }
+            },*/
             {label: '订单最小金额', name: 'minAmount', index: 'minAmount', width: 80},
             {label: '订单最大金额', name: 'maxAmount', index: 'maxAmount', width: 80},
             {label: '金额', name: 'typeMoney', index: 'type_money', width: 80},
             // {label: '最小商品金额', name: 'minGoodsAmount', index: 'min_goods_amount', width: 80},
             {label: '有效天数', name: 'invalidDays', index: 'invalidDays', width: 80},
-            // {
-            //     label: '操作', width: 70, align: 'center', sortable: false, formatter: function (value, col, row) {
-            //     if (row.couponType == 1) {
-            //         return '<button class="btn btn-outline btn-info ivu-btn-small" onclick="vm.lookCouponStoreList(' + row.id + ',\'' + row.name + '\')"><i class="fa fa-info-circle"></i>&nbsp;门店列表</button>&nbsp;';
-            //     } else if (row.couponType == 2) {
-            //         return '<button class="btn btn-outline btn-info ivu-btn-small" onclick="vm.lookCouponProductList(' + row.id + ',\'' + row.name + '\')"><i class="fa fa-info-circle"></i>&nbsp;产品列表</button>&nbsp;';
-            //     }
-            //     return '';
-            // }
-            // }
+            /*{
+                label: '操作', width: 70, align: 'center', sortable: false,
+                    formatter: function (value, col, row) {
+                    if (row.couponType == 1) {
+                        return '<button class="btn btn-outline btn-info ivu-btn-small" onclick="vm.lookCouponStoreList(' + row.id + ',\'' + row.name + '\')"><i class="fa fa-info-circle"></i>&nbsp;门店列表</button>&nbsp;';
+                    } else if (row.couponType == 2) {
+                        return '<button class="btn btn-outline btn-info ivu-btn-small" onclick="vm.lookCouponProductList(' + row.id + ',\'' + row.name + '\')"><i class="fa fa-info-circle"></i>&nbsp;产品列表</button>&nbsp;';
+                    }
+                    return '';
+                }
+            }*/
         ]
     });
 });

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

@@ -141,7 +141,7 @@ let vm = new Vue({
             vm.showList = true;
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
             $("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.userName},
+                postData: {'userName': vm.q.userName},
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');

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

@@ -49,15 +49,6 @@ $(function () {
                 formatter: function (value) {
                     return transDate(value, 'yyyy-MM-dd hh:mm:ss');
                 }
-            },
-            {
-                label: '操作', width: 60, align: 'center', sortable: false, formatter: function (value, col, row) {
-                    let htmlStr = '';
-                    if (row.goodsBizType == '02' || row.goodsBizType == '10') {
-                        htmlStr = '<button class="btn btn-outline btn-primary" onclick="vm.qrcodeCanvas(' + row.id + ')"><i class="fa fa-qrcode"></i>二维码</button>';
-                    }
-                    return htmlStr;
-                }
             }
         ],
         viewrecords: true,
@@ -143,7 +134,10 @@ var vm = new Vue({
         specifications: [],
         brands: [],
         freights: [],
-        showInput: true
+        showInput: true,
+        categoryId: '',
+        cusUnitCodeList: [],
+        cusNationCodeList: []
     },
     methods: {
         delSpeRow: function (index) {
@@ -195,13 +189,14 @@ var vm = new Vue({
             vm.macros = [];
             vm.brands = [];
             vm.freights = [];
+            vm.cusUnitCodeList = [];
+            vm.cusNationCodeList = [];
             vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
-            vm.attributeCategories = [];
             vm.getMacro();
             vm.getBrand();
             vm.getFreights();
-            vm.getAttributeCategories();
-            vm.getAttributes();
+            vm.getCusUnitCodeList();
+            vm.getCusNationCode();
             vm.showInput = true;
         },
         update: function (event) {
@@ -213,22 +208,21 @@ var vm = new Vue({
             vm.title = "修改";
             vm.uploadList = [];
             vm.getInfo(id);
+            var opt = {};
+            opt.value = vm.goods.categoryId;
+            opt.flag = 1;
+            vm.getAttributes(opt);
             vm.getMacro();
             vm.getBrand();
+            vm.getCusUnitCodeList();
+            vm.getCusNationCode();
             vm.getFreights();
-            vm.getAttributeCategories();
             vm.getGoodsGallery(id);
-            vm.getAttributes();
             vm.showInput = true;
             if (vm.goods.goodsBizType == '10' || vm.goods.goodsBizType == '02') {
                 vm.showInput = false;
             }
         },
-        getAttributes: function () {
-            $.get("../attribute/queryAll", function (r) {
-                vm.attributes = r.list;
-            });
-        },
         getMacro: function () {
             // 获取货品业务类型
             $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
@@ -236,11 +230,20 @@ var vm = new Vue({
             });
         },
         getBrand: function () {
-            // 获取货品业务类型
             $.get("../brand/queryAll", function (r) {
                 vm.brands = r.list;
             });
         },
+        getCusUnitCodeList: function () {
+            $.get("../syscusunitcode/queryAll", function (r) {
+                vm.cusUnitCodeList = r.list;
+            });
+        },
+        getCusNationCode: function () {
+            $.get("../syscusnationcode/queryAll", function (r) {
+                vm.cusNationCodeList = r.list;
+            });
+        },
         getFreights: function() {
             $.get("../freight/queryAll", function (r) {
                 vm.freights = r.list;
@@ -251,11 +254,6 @@ var vm = new Vue({
                 vm.uploadList = r.list;
             });
         },
-        getAttributeCategories: function () {
-            $.get("../attributecategory/queryAll", function (r) {
-                vm.attributeCategories = r.list;
-            });
-        },
         saveOrUpdate: function (event) {
             var url = vm.goods.id == null ? "../goods/save" : "../goods/update";
             vm.goods.goodsDesc = $('#goodsDesc').editable('getHTML');
@@ -374,8 +372,10 @@ var vm = new Vue({
         getInfo: function (id) {
             $.get("../goods/info/" + id, function (r) {
                 vm.goods = r.goods;
+                vm.categoryId = r.goods.categoryId;
                 // vm.getCategory();
-                var opt = {}; opt.value = vm.goods.attributeCategory;
+                var opt = {};
+                opt.value = vm.goods.attributeCategory;
                 vm.changeCategories(opt);
                 if (r.goods.attributeEntityList.length > 0) {
                     vm.attributeEntityList = r.goods.attributeEntityList;
@@ -387,6 +387,7 @@ var vm = new Vue({
                 } else {
                     vm.productEntityList = [{'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0}];
                 }
+
                 $('#goodsDesc').editable('setHTML', vm.goods.goodsDesc);
             });
         },
@@ -458,12 +459,33 @@ var vm = new Vue({
             var value = opt.value;
             $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
                 vm.queryCategoriesTwo = r.list;
-                // vm.reload();
             });
         },
+        getAttributes: function (opt) {
+            var value = opt.value;
+            $.get("../attribute/query?attributeCategoryId=" + value, function (r) {
+                vm.attributes = r.list;
+            });
+
+            if (opt.flag != 1 && !(value === vm.categoryId)) {
+                if (vm.attributeEntityList.length > 0 && vm.attributeEntityList[0].attributeId != '') {
+                    for (var i = 0; i < vm.attributeEntityList.length; i++) {
+                        if (!(vm.attributeEntityList[0].attributeId === '')) {
+                            vm.attributeEntityList[i].isDelete = 1;
+                        }
+                    }
+
+                    var goodsId = '';
+                    if (vm.goods) {
+                        goodsId = vm.goods.id;
+                    }
+                    vm.attributeEntityList.unshift({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+                }
+            }
+        },
         changeCategories: function (opt) {
             var value = opt.value;
-            $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
+            $.get("../category/getCategorySelectByParent?isShow=1&parentId=" + value, function (r) {
                 vm.categoriesTwo = r.list;
             });
         },
@@ -523,43 +545,15 @@ var vm = new Vue({
         },
         eyeImage: function (e) {
             eyeImage($(e.target).attr('src'));
-        },
-        qrcodeCanvas: function(id) {
-            $("#qrcodeCanvas").html("");
-            $("#qrcodeCanvas").qrcode({
-                render : "canvas",    //设置渲染方式,有table和canvas,使用canvas方式渲染性能相对来说比较好
-                text : "emato../goods/goods?id=" + id,    //扫描二维码后显示的内容,可以直接填一个网址,扫描二维码后自动跳向该链接
-                width : "100",               //二维码的宽度
-                height : "100",              //二维码的高度
-                background : "#ffffff",       //二维码的后景色
-                foreground : "#000000",        //二维码的前景色
-                src: '../../statics/img/logo.jpg'             //二维码中间的图片
-            });
-
-            var qrcSrc = $("canvas")[0].toDataURL();
-            $("#qrcImg .qrcImg").attr("src", qrcSrc);
-            var upLogSrc = "../../statics/img/logo.jpg";
-            $("#qrcImg .upLogo").attr("src", upLogSrc);
-            $("#qrcImg").show();//隐藏canvas部分
-
-            openWindow({
-                title: "二维码",
-                area: ['400px', '400px'],
-                content: jQuery("#qrcode"),
-                btn: ["打印"],
-                btn1: function (index) {
-                    $("#qrcImg").print({});
-                    $("#qrcImg").hide();
-                    layer.close(index);
-                }
-            });
         }
     },
     mounted() {
         // this.uploadList = this.$refs.upload.fileList;
         $.get("../category/getCategorySelect", function (r) {
             vm.queryCategories = r.list;
+        });
+        $.get("../category/getCategorySelect?isShow=1", function (r) {
             vm.categories = r.list;
-        })
+        });
     }
 });

+ 3 - 0
kmall-admin/src/main/webapp/js/shop/goodsissue.js

@@ -41,6 +41,9 @@ var vm = new Vue({
         ruleValidate: {
             question: [
                 {required: true, message: '问题不能为空', trigger: 'blur'}
+            ],
+            answer: [
+                {required: true, message: '回答不能为空', trigger: 'blur'}
             ]
         },
         q: {

+ 5 - 5
kmall-admin/src/main/webapp/js/shop/helptype.js

@@ -39,12 +39,12 @@ let vm = new Vue({
         title: null,
 		helpType: {},
 		ruleValidate: {
-			name: [
-				{required: true, message: '名称不能为空', trigger: 'blur'}
+            typeName: [
+				{required: true, message: '问题分类不能为空', trigger: 'blur'}
 			]
 		},
 		q: {
-		    name: ''
+            typeName: ''
 		}
 	},
 	methods: {
@@ -115,7 +115,7 @@ let vm = new Vue({
 		},
         reloadSearch: function() {
             vm.q = {
-                name: ''
+                typeName: ''
             }
             vm.reload();
 		},
@@ -123,7 +123,7 @@ let vm = new Vue({
 			vm.showList = true;
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
 			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.name},
+                postData: {'typeName': vm.q.typeName},
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');

+ 32 - 6
kmall-admin/src/main/webapp/js/shop/order.js

@@ -42,21 +42,23 @@ $(function () {
                 label: '订单状态', name: 'orderStatus', index: 'order_status', width: 80,
                 formatter: function (value) {
                     if (value == '0') {
-                        return '待付款';
+                        return '订单创建成功等待付款';
+                    } else if (value == '100') {
+                        return '订单付款中';
                     } else if (value == '101') {
                         return '订单已取消';
                     } else if (value == '102') {
                         return '订单已删除';
                     } else if (value == '201') {
-                        return '订单已付款';
+                        return '订单已付款,等待发货';
                     } else if (value == '300') {
                         return '订单已发货';
                     } else if (value == '301') {
                         return '用户确认收货';
                     } else if (value == '401') {
-                        return '退款';
+                        return '没有发货,退款';
                     } else if (value == '402') {
-                        return '完成';
+                        return '已收货,退款退货';
                     }
                     return value;
                 }
@@ -70,6 +72,8 @@ $(function () {
                         return '付款中';
                     } else if (value == '2') {
                         return '已付款';
+                    } else if (value == '3') {
+                        return '退款中';
                     } else if (value == '4') {
                         return '退款';
                     }
@@ -115,7 +119,10 @@ $(function () {
                             htmlStr += '<button class="btn btn-outline btn-primary" onclick="vm.printDetail(' + row.id + ')"><i class="fa fa-print"></i>打印</button>&nbsp;';
                         }
                         if (row.orderStatus == 0) {
-                            htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.refundUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;取消</button>&nbsp;';
+                            htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.cancelUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;取消</button>&nbsp;';
+                        }
+                        if (row.isPaymentSend == 0 || row.isEleOrderSend == 0  || row.isCustomsSend == 0) {
+                            htmlStr += '<button class="btn btn-outline btn-danger" onclick="vm.refundUpdate(' + row.id + ')"><i class="fa fa-times-circle-o"></i>&nbsp;退款</button>&nbsp;';
                         }
                     }
                     return htmlStr;
@@ -345,7 +352,7 @@ let vm = new Vue({
                 }
             });
         },
-        refundUpdate: function (rowId) {
+        cancelUpdate: function (rowId) {
             let params = {};
             params.orderId = rowId;
 
@@ -363,6 +370,25 @@ let vm = new Vue({
                     }
                 }
             });
+        },
+        refundUpdate: function (rowId) {
+            let params = {};
+            params.orderId = rowId;
+
+            $.ajax({
+                type: "POST",
+                url: '../order/refund',
+                data: params,
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('退款成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+            });
         }
     },
     created: function () {

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

@@ -41,6 +41,10 @@ $(function () {
                         return '退款成功';
                     } else if (value == '3') {
                         return '已拒绝';
+                    } else if (value == '4') {
+                        return '微信退款失败';
+                    } else if (value == '5') {
+                        return '微信退款处理中';
                     }
                     return value;
                 }
@@ -208,7 +212,7 @@ var vm = new Vue({
                 data: params,
                 success: function (r) {
                     if (r.code === 0) {
-                        alert('取消成功', function (index) {
+                        alert('退款成功', function (index) {
                             vm.reload();
                         });
                     } else {

+ 42 - 0
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -37,6 +37,15 @@ $(function () {
                     jQuery("#jqGrid").jqGrid('setGridParam', {page: $('#XtoPage').val()});
                 }
             },
+            {
+                label: '操作', width: 60, align: 'center', sortable: false, formatter: function (value, col, row) {
+                let htmlStr = '';
+                if (row.goodsBizType == '02' || row.goodsBizType == '10') {
+                    htmlStr = '<button class="btn btn-outline btn-primary" onclick="vm.qrcodeCanvas(' + row.goodsId + ')"><i class="fa fa-qrcode"></i>二维码</button>';
+                }
+                return htmlStr;
+            }
+            }
         ],
         viewrecords: true,
         height: 385,
@@ -294,6 +303,39 @@ var vm = new Vue({
         },
         handleReset: function (name) {
             handleResetForm(this, name);
+        },
+        qrcodeCanvas: function(id) {
+            $("#qrcodeCanvas").html("");
+            $("#qrcodeCanvas").qrcode({
+                render : "canvas",    //设置渲染方式,有table和canvas,使用canvas方式渲染性能相对来说比较好
+                text : "emato../goods/goods?id=" + id,    //扫描二维码后显示的内容,可以直接填一个网址,扫描二维码后自动跳向该链接
+                width : "100",               //二维码的宽度
+                height : "100",              //二维码的高度
+                background : "#ffffff",       //二维码的后景色
+                foreground : "#000000",        //二维码的前景色
+                src: '../../statics/img/logo.jpg'             //二维码中间的图片
+            });
+
+            var qrcSrc = $("canvas")[0].toDataURL();
+            $("#qrcImg .qrcImg").attr("src", qrcSrc);
+            var upLogSrc = "../../statics/img/logo.jpg";
+            $("#qrcImg .upLogo").attr("src", upLogSrc);
+            $("#qrcImg").show();//隐藏canvas部分
+
+            openWindow({
+                title: "二维码",
+                area: ['400px', '400px'],
+                content: jQuery("#qrcode"),
+                btn: ["打印"],
+                btn1: function (index) {
+                    $("#qrcImg").show();
+                    $("#qrcImg").print({});
+                    $("#qrcImg").hide();
+                    layer.close(index);
+                }
+            });
+
+            $("#qrcImg").hide();
         }
     },
     mounted() {

+ 1 - 1
kmall-admin/src/main/webapp/js/sys/role.js

@@ -5,7 +5,7 @@ $(function () {
         colModel: [
             {label: '角色ID', name: 'roleId', index: "role_id", key: true, hidden: true},
             {label: '角色名称', name: 'roleName', index: "role_name", width: 75},
-            {label: '所属部门', name: 'deptName', width: 75},
+            // {label: '所属部门', name: 'deptName', width: 75},
             {label: '备注', name: 'remark', width: 100},
             {
                 label: '创建时间', name: 'createTime', index: "create_time", width: 80, formatter: function (value) {

+ 2 - 2
kmall-admin/src/main/webapp/js/sys/schedule.js

@@ -48,7 +48,7 @@ var vm = new Vue({
     el: '#rrapp',
     data: {
         q: {
-            beanName: null
+            methodName: null
         },
         showList: true,
         title: null,
@@ -204,7 +204,7 @@ var vm = new Vue({
             vm.showList = true;
             var page = $("#jqGrid").jqGrid('getGridParam', 'page');
             $("#jqGrid").jqGrid('setGridParam', {
-                postData: {'beanName': vm.q.beanName},
+                postData: {'methodName': vm.q.methodName},
                 page: page
             }).trigger("reloadGrid");
         },

+ 15 - 8
kmall-admin/src/main/webapp/js/sys/user.js

@@ -5,7 +5,7 @@ $(function () {
         colModel: [
             {label: '用户ID', name: 'userId', index: "user_id", key: true, hidden: true},
             {label: '用户名', name: 'username', width: 75},
-            {label: '所属部门', name: 'deptName', width: 75},
+            // {label: '所属部门', name: 'deptName', width: 75},
             {label: '邮箱', name: 'email', width: 90},
             {label: '手机号', name: 'mobile', width: 100},
             {
@@ -77,7 +77,7 @@ var vm = new Vue({
             roleIdList: []
         },
         ruleValidate: {
-            username: [
+            /*username: [
                 {required: true, message: '姓名不能为空', trigger: 'blur'}
             ],
             email: [
@@ -86,8 +86,9 @@ var vm = new Vue({
             ],
             mobile: [
                 {required: true, message: '手机号不能为空', trigger: 'blur'}
-            ]
-        }
+            ]*/
+        },
+        storeList: []
     },
     methods: {
         query: function () {
@@ -95,13 +96,19 @@ var vm = new Vue({
         },
         add: function () {
             vm.showList = false;
-            vm.title = "新增(默认密码:888888)";
+            vm.title = "新增(默认密码:111111)";
             vm.roleList = {};
-            vm.user = {status: 1, roleIdList: [], deptId: '', deptName: ''};
-
+            vm.user = {status: 1, roleIdList: [], deptId: '', deptName: '', storeId: '', roleType: 2};
+            vm.storeList = [];
             //获取角色信息
             this.getRoleList();
             vm.getDept();
+            vm.getStoreList();
+        },
+        getStoreList: function() {
+            $.get("../store/queryAll", function (r) {
+                vm.storeList = r.list;
+            });
         },
         getDept: function () {
             //加载部门树
@@ -110,7 +117,6 @@ var vm = new Vue({
                 var node = ztree.getNodeByParam("deptId", vm.user.deptId);
                 if (node != null) {
                     ztree.selectNode(node);
-
                     vm.user.deptName = node.name;
                 }
             })
@@ -127,6 +133,7 @@ var vm = new Vue({
             $.get("../sys/user/info/" + userId, function (r) {
                 vm.user = r.user;
                 //获取角色信息
+                vm.getStoreList();
                 vm.getRoleList();
                 vm.getDept();
             });

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -129,7 +129,7 @@ public class ApiGoodsController extends ApiBaseAction {
         Long storeId = getStoreId();
         GoodsVo info = goodsService.queryObjectByStoreId(id, storeId);
         if(info == null){
-
+            return toResponsFail("此商品不存在");
         }
         BrandVo brand = apiBrandService.queryObject(info.getBrand_id());
         resultObj.put("brand", brand);

+ 16 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java

@@ -16,6 +16,7 @@ import com.kmall.common.utils.Constant;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.wechat.WechatRefundApiResult;
 import com.kmall.common.utils.wechat.WechatUtil;
+import io.swagger.models.auth.In;
 import org.apache.commons.collections.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -396,13 +397,27 @@ public class ApiOrderController extends ApiBaseAction {
             orderRefund.setModTime(new Date());
             if(list.size()>1){//多条订单
                 orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_2.getItem()));//部分退款
+            }else{
+                orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));//用户全额退款
             }
             orderRefund.setRefundMoney(orderInfo.getActual_price());
 
             if(mallOrderRefund !=null){
+                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_2.getItem()) ){
+                    return toResponsFail("该订单已退款成功,请勿重复申请");
+                }
+                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_5.getItem()) ){
+                    return toResponsFail("该订单在退款处理中,请勿重复申请");
+                }
+                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_1.getItem()) ){
+                    return toResponsFail("该订单在退款申请中,请勿重复申请");
+                }
                 orderRefund.setId(mallOrderRefund.getId());
                 apiOrderRefundService.update(orderRefund);
-                return toResponsMsgSuccess("该订单已申请过退款,重新申请成功");
+                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_4.getItem()) ||
+                        mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_3.getItem())){
+                    return toResponsMsgSuccess("重新申请订单成功");
+                }
             }else{
                 orderRefund.setCreateTime(new Date());
                 apiOrderRefundService.save(orderRefund);

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java

@@ -58,7 +58,7 @@ public class ApiUserController extends ApiBaseAction {
         String sms_code = SendMsgUtil.createRandomVcode();
         String phone = jsonParams.getString("phone");
 //        String msgContent = "【前海电商】手机验证码为:"+sms_code;
-        String msgContent = "【中网小程序】亲爱的"+loginUser.getNickname()+",您的验证码是"+sms_code+"。有效期为5分钟,请尽快验证";
+        String msgContent = "【中网小程序】亲爱的,您的验证码是"+sms_code+"。有效期为5分钟,请尽快验证";
 
         System.out.println("msgContent:"+msgContent);
         // 一分钟之内不能重复发送短信

+ 2 - 1
kmall-api/src/main/java/com/kmall/api/contants/Dict.java

@@ -334,11 +334,12 @@ public class Dict {
     }
 
     /**
-     * 订单状态: 0 订单创建成功等待付款, 101 订单已取消, 102 订单已删除,201 订单已付款,等待发货,300 订单已发货, 301 用户确认收货,400 维权申请中
+     * 订单状态: 0 订单创建成功等待付款,100订单付款中, 101 订单已取消, 102 订单已删除,201 订单已付款,等待发货,300 订单已发货, 301 用户确认收货,400 维权申请中
      * 401 没有发货,退款 402 已收货,退款退货
      */
     public enum orderStatus {
         item_0("0", "订单创建成功等待付款"),
+        item_100("100", "订单付款中"),
         item_101("101", "订单已取消"),
         item_102("102", "订单已删除"),
         item_201("201", "订单已付款"),

+ 3 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java

@@ -597,6 +597,9 @@ public class OrderVo implements Serializable {
                 case 0:
                     order_status_text = "未付款";
                     break;
+                case 100:
+                    order_status_text = "付款中";
+                    break;
                 case 201:
                     order_status_text = "等待发货";
                     break;

+ 10 - 24
kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java

@@ -77,7 +77,8 @@ public class ApiPayService {
         for (OrderVo orderInfo: orderVoList) {
             // 业务处理
             orderInfo.setPay_id(prepay_id);
-            orderInfo.setPay_status(1); // 付款中
+            orderInfo.setPay_status(Integer.parseInt(Dict.payStatus.item_1.getItem())); // 付款中
+            orderInfo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_100.getItem()));
             orderService.update(orderInfo);
 
             Map map = new HashMap();
@@ -135,9 +136,8 @@ public class ApiPayService {
                     mallOrderExceptionRecord.setCreateTime(new Date());
                     mallOrderExceptionRecordMapper.save(mallOrderExceptionRecord);//支付订单异常记录
                 }
-                if(Dict.orderStatus.item_0.getItem().equalsIgnoreCase(orderInfo.getOrder_status()+"")
-                        && (Dict.payStatus.item_0.getItem().equalsIgnoreCase(orderInfo.getPay_status()+"") || Dict.payStatus.item_1.getItem().equalsIgnoreCase(orderInfo.getPay_status()+""))
-                        ){
+                if(Dict.orderStatus.item_100.getItem().equalsIgnoreCase(orderInfo.getOrder_status()+"")
+                        && Dict.payStatus.item_1.getItem().equalsIgnoreCase(orderInfo.getPay_status()+"")){
 
                     OrderProcessRecordEntity processRecordEntity = orderProcessRecordMapper.queryObjectByOrderSn(orderInfo.getOrder_sn());
                     if(processRecordEntity != null){
@@ -153,7 +153,7 @@ public class ApiPayService {
                     orderInfo.setPayTransactionId(transaction_id);
                     orderInfo.setPay_status(Integer.parseInt(Dict.payStatus.item_2.getItem()));
                     orderInfo.setPay_time(timeEnd);//微信下单完成时间
-                    if (orderInfo.getOrder_status() == 0) {
+                    if (orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_100.getItem())) {
                         orderInfo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
                     }
                     orderService.update(orderInfo);
@@ -193,10 +193,10 @@ public class ApiPayService {
     }
 
 
-    /**
+   /* *//**
      * 退款
-     * @param orderInfo
-     */
+     * @param
+     *//*
     @Transactional
     public void refund(OrderVo orderInfo,WechatRefundApiResult result,String reason) {
         boolean needUpdateStock = true;
@@ -261,15 +261,7 @@ public class ApiPayService {
             storeRelaEntity.setStockNum(storeRelaEntity.getStockNum() + orderGoodsEntity.getNumber());//库存数量
             apiProductStoreRelaMapper.update(storeRelaEntity);
         }
-        /*// 是否是团购订单
-        if (null != orderInfo.getOrder_type() && orderInfo.getOrder_type().equals("2")) {
-            GoodsGroupOpenDetailVo openVo = apiGoodsGroupOpenDetailService.queryObject(orderInfo.getActivity_id());
-            if (null != openVo) {
-                openVo.setAttend_status(3);
-                apiGoodsGroupOpenDetailService.update(openVo);
-            }
-        }*/
-    }
+    }*/
 
 
     @Transactional
@@ -303,13 +295,7 @@ public class ApiPayService {
                             orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
                             orderRefund.setWechatRefundStatusDes("退款异常");
                         }
-                        String account = refundApiResult.getRefund_recv_accout();
-                        try{
-                            account = new String(account.getBytes("UTF-8"), "ISO-8859-1");
-                        }catch (Exception e){
-                            logger.error("转换异常:",e);
-                        }
-                        orderRefund.setRefundRecvAccout(account);
+                        orderRefund.setRefundRecvAccout(refundApiResult.getRefund_recv_accout());
                         orderRefund.setId(mallOrderRefund.getId());
                         mallOrderRefundMapper.update(orderRefund);//更新订单退款信息
 

+ 2 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

@@ -554,7 +554,8 @@
 
     <select id="queryUcenterMap" resultType="map">
         select count(a.id) as orders, sum(case a.order_status when 0 then 1 else 0 end ) as unPayNum, sum(case a.order_status when 300 then 1 else 0 end ) as unTakeNum
-        ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum, sum(case a.order_status when 301 then 1 else 0 end ) as unEvalNum
+        ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum,
+        sum(case a.order_status when 301 then 1 else 0 end and case a.comment_count when 0 then 1 else 0 end ) as unEvalNum
         from mall_order a
         left join mall_comment b on a.id = b.order_id
         where 1 = 1

+ 2 - 2
kmall-common/src/main/java/com/kmall/common/controller/SysRoleController.java

@@ -99,8 +99,8 @@ public class SysRoleController extends AbstractController {
     @RequestMapping("/save")
     @RequiresPermissions("sys:role:save")
     public R save(@RequestBody SysRoleEntity role) {
-        ValidatorUtils.validateEntity(role);
-
+        // 非空检验
+        // ValidatorUtils.validateEntity(role);
         role.setCreateUserId(getUserId());
         sysRoleService.save(role);
 

+ 3 - 4
kmall-common/src/main/java/com/kmall/common/controller/SysUserController.java

@@ -68,6 +68,7 @@ public class SysUserController extends AbstractController {
     @SysLog("修改密码")
     @RequestMapping("/password")
     public R password(String password, String newPassword) {
+        Assert.isBlank(password, "原密码不为能空");
         Assert.isBlank(newPassword, "新密码不为能空");
 
         //sha256加密
@@ -109,8 +110,7 @@ public class SysUserController extends AbstractController {
     @RequestMapping("/save")
     @RequiresPermissions("sys:user:save")
     public R save(@RequestBody SysUserEntity user) {
-        ValidatorUtils.validateEntity(user, AddGroup.class);
-
+        //ValidatorUtils.validateEntity(user);
         user.setCreateUserId(getUserId());
         sysUserService.save(user);
 
@@ -124,8 +124,7 @@ public class SysUserController extends AbstractController {
     @RequestMapping("/update")
     @RequiresPermissions("sys:user:update")
     public R update(@RequestBody SysUserEntity user) {
-        ValidatorUtils.validateEntity(user, UpdateGroup.class);
-
+        //ValidatorUtils.validateEntity(user);
         user.setCreateUserId(getUserId());
         sysUserService.update(user);
 

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/dao/SysUserRoleDao.java

@@ -17,4 +17,6 @@ public interface SysUserRoleDao extends BaseDao<SysUserRoleEntity> {
      * 根据用户ID,获取角色ID列表
      */
     List<Long> queryRoleIdList(Long userId);
+
+    int deleteByRoleId(Long roleId);
 }

+ 30 - 0
kmall-common/src/main/java/com/kmall/common/entity/SysUserEntity.java

@@ -75,6 +75,12 @@ public class SysUserEntity implements Serializable {
      */
     private String deptName;
 
+    private Long roleId;
+
+    private Integer storeId;
+
+    private String roleType;
+
     private Set<String> permsSet;
 
     /**
@@ -95,6 +101,14 @@ public class SysUserEntity implements Serializable {
         return userId;
     }
 
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
     /**
      * 设置:用户名
      *
@@ -167,6 +181,22 @@ public class SysUserEntity implements Serializable {
         return mobile;
     }
 
+    public Integer getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(Integer storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getRoleType() {
+        return roleType;
+    }
+
+    public void setRoleType(String roleType) {
+        this.roleType = roleType;
+    }
+
     /**
      * 设置:状态  0:禁用   1:正常
      *

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/service/SysRoleMenuService.java

@@ -19,4 +19,6 @@ public interface SysRoleMenuService {
      */
     List<Long> queryMenuIdList(Long roleId);
 
+    int delete(Long roleId);
+
 }

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/service/SysRoleService.java

@@ -27,6 +27,8 @@ public interface SysRoleService {
 
     void deleteBatch(Long[] roleIds);
 
+    void delete(Long roleId);
+
     /**
      * 查询用户创建的角色ID列表
      */

+ 1 - 1
kmall-common/src/main/java/com/kmall/common/service/SysUserRoleService.java

@@ -12,7 +12,7 @@ import java.util.List;
  */
 public interface SysUserRoleService {
 
-    void saveOrUpdate(Long userId, List<Long> roleIdList);
+    void saveOrUpdate(Long userId, Long roleId);
 
     /**
      * 根据用户ID,获取角色ID列表

+ 5 - 0
kmall-common/src/main/java/com/kmall/common/service/impl/SysRoleMenuServiceImpl.java

@@ -44,4 +44,9 @@ public class SysRoleMenuServiceImpl implements SysRoleMenuService {
         return sysRoleMenuDao.queryMenuIdList(roleId);
     }
 
+    @Override
+    public int delete(Long roleId) {
+        return sysRoleMenuDao.delete(roleId);
+    }
+
 }

+ 34 - 3
kmall-common/src/main/java/com/kmall/common/service/impl/SysRoleServiceImpl.java

@@ -1,7 +1,9 @@
 package com.kmall.common.service.impl;
 
 import com.kmall.common.dao.SysRoleDao;
+import com.kmall.common.dao.SysUserRoleDao;
 import com.kmall.common.entity.SysRoleEntity;
+import com.kmall.common.entity.SysUserRoleEntity;
 import com.kmall.common.service.SysRoleDeptService;
 import com.kmall.common.service.SysRoleMenuService;
 import com.kmall.common.service.SysRoleService;
@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -29,6 +32,8 @@ public class SysRoleServiceImpl implements SysRoleService {
     @Autowired
     private SysRoleDao sysRoleDao;
     @Autowired
+    private SysUserRoleDao sysUserRoleDao;
+    @Autowired
     private SysRoleMenuService sysRoleMenuService;
     @Autowired
     private SysUserService sysUserService;
@@ -53,6 +58,10 @@ public class SysRoleServiceImpl implements SysRoleService {
     @Override
     @Transactional
     public void save(SysRoleEntity role) {
+        if (role.getMenuIdList() == null || role.getMenuIdList().size() <= 0) {
+            throw new RRException("功能权不能为空!");
+        }
+
         role.setCreateTime(new Date());
         sysRoleDao.save(role);
 
@@ -63,12 +72,16 @@ public class SysRoleServiceImpl implements SysRoleService {
         sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
 
         //保存角色与部门关系
-        sysRoleDeptService.saveOrUpdate(role.getRoleId(), role.getDeptIdList());
+        //sysRoleDeptService.saveOrUpdate(role.getRoleId(), role.getDeptIdList());
     }
 
     @Override
     @Transactional
     public void update(SysRoleEntity role) {
+        if (role.getMenuIdList() == null || role.getMenuIdList().size() <= 0) {
+            throw new RRException("功能权不能为空!");
+        }
+
         sysRoleDao.update(role);
 
         //检查权限是否越权
@@ -77,13 +90,31 @@ public class SysRoleServiceImpl implements SysRoleService {
         //更新角色与菜单关系
         sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
         //保存角色与部门关系
-        sysRoleDeptService.saveOrUpdate(role.getRoleId(), role.getDeptIdList());
+        //sysRoleDeptService.saveOrUpdate(role.getRoleId(), role.getDeptIdList());
     }
 
     @Override
     @Transactional
     public void deleteBatch(Long[] roleIds) {
-        sysRoleDao.deleteBatch(roleIds);
+        for (Long id : roleIds) {
+            SysRoleEntity role = queryObject(id);
+
+            Map<String, Object> map = new HashMap<>();
+            map.put("roleId", id);
+            List<SysUserRoleEntity> userEntityList = sysUserRoleDao.queryList(map);
+
+            if (userEntityList != null && userEntityList.size() > 0) {
+                throw new RRException("角色【" + role.getRoleName() + "】还有【" + userEntityList.size() + "】个管理员正在使用,删除失败!");
+            }
+            sysUserRoleDao.deleteByRoleId(id);
+            sysRoleMenuService.delete(id);
+            delete(id);
+        }
+    }
+
+    @Override
+    public void delete(Long roleId) {
+        sysRoleDao.delete(roleId);
     }
 
     @Override

+ 2 - 5
kmall-common/src/main/java/com/kmall/common/service/impl/SysUserRoleServiceImpl.java

@@ -23,10 +23,7 @@ public class SysUserRoleServiceImpl implements SysUserRoleService {
     private SysUserRoleDao sysUserRoleDao;
 
     @Override
-    public void saveOrUpdate(Long userId, List<Long> roleIdList) {
-        if (roleIdList.size() == 0) {
-            return;
-        }
+    public void saveOrUpdate(Long userId, Long roleId) {
 
         //先删除用户与角色关系
         sysUserRoleDao.delete(userId);
@@ -34,7 +31,7 @@ public class SysUserRoleServiceImpl implements SysUserRoleService {
         //保存用户与角色关系
         Map<String, Object> map = new HashMap<>();
         map.put("userId", userId);
-        map.put("roleIdList", roleIdList);
+        map.put("roleId", roleId);
         sysUserRoleDao.save(map);
     }
 

+ 62 - 4
kmall-common/src/main/java/com/kmall/common/service/impl/SysUserServiceImpl.java

@@ -1,13 +1,13 @@
 package com.kmall.common.service.impl;
 
+import com.google.common.collect.ImmutableBiMap;
 import com.kmall.common.Global;
 import com.kmall.common.dao.SysUserDao;
 import com.kmall.common.entity.SysUserEntity;
 import com.kmall.common.service.SysRoleService;
 import com.kmall.common.service.SysUserRoleService;
 import com.kmall.common.service.SysUserService;
-import com.kmall.common.utils.Constant;
-import com.kmall.common.utils.RRException;
+import com.kmall.common.utils.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.crypto.hash.Sha256Hash;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -70,6 +70,35 @@ public class SysUserServiceImpl implements SysUserService {
     @Override
     @Transactional
     public void save(SysUserEntity user) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(user);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("username", "用户名");
+        builder.put("email", "邮箱");
+        builder.put("mobile", "手机号");
+        builder.put("roleType", "数据角色类型");
+        builder.put("status", "状态");
+        builder.put("roleId", "角色");
+
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        } else {
+            if (!"1".equals(user.getRoleType())) {
+                builder.put("storeId", "门店");
+            }
+            r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+            if (Integer.valueOf(r.get("code").toString()) != 0) {
+                throw new RRException(r.get("msg").toString());
+            }
+        }
+
+        if (!user.getEmail().matches("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$")) {
+            throw new RRException("邮箱格式错误!");
+        }
+        if (!PhoneFormatCheckUtils.isPhoneLegal(user.getMobile())) {
+            throw new RRException("手机号格式错误!");
+        }
+
         user.setCreateTime(new Date());
         //sha256加密
         user.setPassword(new Sha256Hash(Global.DEFAULT_PASS_WORD).toHex());
@@ -79,12 +108,41 @@ public class SysUserServiceImpl implements SysUserService {
         checkRole(user);
 
         //保存用户与角色关系
-        sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
+        sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleId());
     }
 
     @Override
     @Transactional
     public void update(SysUserEntity user) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(user);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("username", "用户名");
+        builder.put("email", "邮箱");
+        builder.put("mobile", "手机号");
+        builder.put("roleType", "数据角色类型");
+        builder.put("status", "状态");
+        builder.put("roleId", "角色");
+
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        } else {
+            if (!"1".equals(user.getRoleType())) {
+                builder.put("storeId", "门店");
+            }
+            r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+            if (Integer.valueOf(r.get("code").toString()) != 0) {
+                throw new RRException(r.get("msg").toString());
+            }
+        }
+
+        if (!user.getEmail().matches("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$")) {
+            throw new RRException("邮箱格式错误!");
+        }
+        if (!PhoneFormatCheckUtils.isPhoneLegal(user.getMobile())) {
+            throw new RRException("手机号格式错误!");
+        }
+
         if (StringUtils.isBlank(user.getPassword())) {
             user.setPassword(new Sha256Hash(Global.DEFAULT_PASS_WORD).toHex());
         } else {
@@ -96,7 +154,7 @@ public class SysUserServiceImpl implements SysUserService {
         checkRole(user);
 
         //保存用户与角色关系
-        sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
+        sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleId());
     }
 
     @Override

+ 1 - 7
kmall-common/src/main/java/com/kmall/common/shiro/UserRealm.java

@@ -68,13 +68,7 @@ public class UserRealm extends AuthorizingRealm {
         Long userId = user.getUserId();
         //系统管理员,拥有最高权限
         List<String> permsList = null;
-        if (userId == 1) {
-            List<SysMenuEntity> menuList = sysMenuDao.queryList(new HashMap<String, Object>());
-            permsList = new ArrayList<>(menuList.size());
-            for (SysMenuEntity menu : menuList) {
-                permsList.add(menu.getPerms());
-            }
-        } else {
+        if (userId != null) {
             permsList = sysUserDao.queryAllPerms(userId);
         }
         //用户权限列表

+ 1 - 1
kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketBuilder.java

@@ -64,7 +64,7 @@ public class TicketBuilder implements Printable {
         //获取字体的高度
         float fontHeigthTit = fontTit.getSize2D();
 
-        yIdx += (y + fontHeigthTit);
+        yIdx += (fontHeigthTit);
         //yIdx += y;
         g2.drawString(ticket.getTicketHead().getTitle(), xIdx + 50, yIdx);
 

+ 1 - 1
kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketPrintUtil.java

@@ -48,7 +48,7 @@ public class TicketPrintUtil {
         ticket.setTicketCommonFont(commonFont);
 
         // 打印
-        TicketPrinter.print2(ticket);
+        TicketPrinter.print(ticket);
         return ticket;
     }
 

+ 64 - 0
kmall-common/src/main/java/com/kmall/common/utils/wechat/ReaderXmlForDOM4J.java

@@ -0,0 +1,64 @@
+package com.kmall.common.utils.wechat;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.util.Iterator;
+
+/**
+ * 获取请求微信订单查询接口返回xml中的state
+ * @author huangyq
+ * @version 1.0
+ * 2018-05-24 15:53
+ */
+public class ReaderXmlForDOM4J {
+
+    public static WechatRefundQueryResult parse(String protocolXML, int count) {
+        WechatRefundQueryResult querySuccessResponseDto = new WechatRefundQueryResult();
+        try {
+            Document doc=(Document) DocumentHelper.parseText(protocolXML);
+            Element books = doc.getRootElement();
+            // Iterator users_subElements = books.elementIterator("UID");//指定获取那个元素
+            Iterator Elements = books.elementIterator();
+            while(Elements.hasNext()){
+                Element element = (Element)Elements.next();
+                String out_refund_no ="out_refund_no_"+(count);
+                String refund_account ="refund_account_"+(count);
+                String refund_channel ="refund_channel_"+(count);
+                String refund_fee ="refund_fee_"+(count);
+                String refund_id ="refund_id_"+(count);
+                String refund_recv_accout ="refund_recv_accout_"+(count);
+                String refund_status ="refund_status_"+(count);
+                String refund_success_time ="refund_success_time_"+(count);
+                if(out_refund_no.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setOut_refund_no(element.getText());
+                }
+                if(refund_account.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_account(element.getText());
+                }
+                if(refund_channel.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_channel(element.getText());
+                }
+                if(refund_fee.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_fee(element.getText());
+                }
+                if(refund_id.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_id(element.getText());
+                }
+                if(refund_recv_accout.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_recv_accout(element.getText());
+                }
+                if(refund_status.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_status(element.getText());
+                }
+                if(refund_success_time.equalsIgnoreCase(element.getName())){
+                    querySuccessResponseDto.setRefund_success_time(element.getText());
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return querySuccessResponseDto;
+    }
+}

+ 18 - 0
kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatRefundApiResult.java

@@ -30,6 +30,24 @@ public class WechatRefundApiResult {
 	private String refund_account;//退款资金来源
 	private String refund_recv_accout;//退款入账账户
 	private String success_time;//退款成功时间
+	/**
+	 * SUCCESS—支付成功
+	 REFUND—转入退款
+	 NOTPAY—未支付
+	 CLOSED—已关闭
+	 REVOKED—已撤销(刷卡支付)
+	 USERPAYING--用户支付中
+	 PAYERROR--支付失败(其他原因,如银行返回失败)
+	 */
+	private String trade_state;//交易状态
+
+	public String getTrade_state() {
+		return trade_state;
+	}
+
+	public void setTrade_state(String trade_state) {
+		this.trade_state = trade_state;
+	}
 
 	public String getRefund_account() {
 		return refund_account;

+ 54 - 45
kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatRefundQueryResult.java

@@ -7,6 +7,7 @@ package com.kmall.common.utils.wechat;
  * 2018-11-02 10:22
  */
 public class WechatRefundQueryResult {
+    private String xmlStr;
     private String return_code;
     private String return_msg;
 
@@ -26,23 +27,23 @@ public class WechatRefundQueryResult {
     private String fee_type;//货币种类 默认人民币:CNY
     private String cash_fee;//现金支付金额	现金支付金额,单位为分,只能为整数
     private String refund_count;//退款笔数
-    private String out_refund_no_0;//商户退款单号
-    private String refund_id_0;//微信退款单号
-    private String refund_channel_0;//退款渠道 ORIGINAL—原路退款 BALANCE—退回到余额 OTHER_BALANCE—原账户异常退到其他余额账户 OTHER_BANKCARD—原银行卡异常退到其他银行卡
-    private String refund_fee_0;//申请退款金额	 退款总金额,单位为分,可以做部分退款
-    private String settlement_refund_fee_0;//退款金额
+    private String out_refund_no;//商户退款单号
+    private String refund_id;//微信退款单号
+    private String refund_channel;//退款渠道 ORIGINAL—原路退款 BALANCE—退回到余额 OTHER_BALANCE—原账户异常退到其他余额账户 OTHER_BANKCARD—原银行卡异常退到其他银行卡
+    private String refund_fee;//申请退款金额	 退款总金额,单位为分,可以做部分退款
+    private String settlement_refund_fee;//退款金额
     /**
      * SUCCESS—退款成功
      REFUNDCLOSE—退款关闭。
      PROCESSING—退款处理中
      CHANGE—退款异常,退款到银行发现用户的卡作废或者冻结了,导致原路退款银行卡失败
      */
-    private String refund_status_0;//退款状态
+    private String refund_status;//退款状态
     /**
      * REFUND_SOURCE_RECHARGE_FUNDS---可用余额退款/基本账户
      REFUND_SOURCE_UNSETTLED_FUNDS---未结算资金退款
      */
-    private String refund_account_0;//退款资金来源
+    private String refund_account;//退款资金来源
     /**
      * 取当前退款单的退款入账方
      1)退回银行卡:
@@ -55,8 +56,16 @@ public class WechatRefundQueryResult {
      4)退回支付用户零钱通:
      支付用户零钱通
      */
-    private String refund_recv_accout_0;
-    private String refund_success_time_0;//退款成功时间
+    private String refund_recv_accout;
+    private String refund_success_time;//退款成功时间
+
+    public String getXmlStr() {
+        return xmlStr;
+    }
+
+    public void setXmlStr(String xmlStr) {
+        this.xmlStr = xmlStr;
+    }
 
     public String getReturn_code() {
         return return_code;
@@ -202,75 +211,75 @@ public class WechatRefundQueryResult {
         this.refund_count = refund_count;
     }
 
-    public String getOut_refund_no_0() {
-        return out_refund_no_0;
+    public String getOut_refund_no() {
+        return out_refund_no;
     }
 
-    public void setOut_refund_no_0(String out_refund_no_0) {
-        this.out_refund_no_0 = out_refund_no_0;
+    public void setOut_refund_no(String out_refund_no) {
+        this.out_refund_no = out_refund_no;
     }
 
-    public String getRefund_id_0() {
-        return refund_id_0;
+    public String getRefund_id() {
+        return refund_id;
     }
 
-    public void setRefund_id_0(String refund_id_0) {
-        this.refund_id_0 = refund_id_0;
+    public void setRefund_id(String refund_id) {
+        this.refund_id = refund_id;
     }
 
-    public String getRefund_channel_0() {
-        return refund_channel_0;
+    public String getRefund_channel() {
+        return refund_channel;
     }
 
-    public void setRefund_channel_0(String refund_channel_0) {
-        this.refund_channel_0 = refund_channel_0;
+    public void setRefund_channel(String refund_channel) {
+        this.refund_channel = refund_channel;
     }
 
-    public String getRefund_fee_0() {
-        return refund_fee_0;
+    public String getRefund_fee() {
+        return refund_fee;
     }
 
-    public void setRefund_fee_0(String refund_fee_0) {
-        this.refund_fee_0 = refund_fee_0;
+    public void setRefund_fee(String refund_fee) {
+        this.refund_fee = refund_fee;
     }
 
-    public String getSettlement_refund_fee_0() {
-        return settlement_refund_fee_0;
+    public String getSettlement_refund_fee() {
+        return settlement_refund_fee;
     }
 
-    public void setSettlement_refund_fee_0(String settlement_refund_fee_0) {
-        this.settlement_refund_fee_0 = settlement_refund_fee_0;
+    public void setSettlement_refund_fee(String settlement_refund_fee) {
+        this.settlement_refund_fee = settlement_refund_fee;
     }
 
-    public String getRefund_status_0() {
-        return refund_status_0;
+    public String getRefund_status() {
+        return refund_status;
     }
 
-    public void setRefund_status_0(String refund_status_0) {
-        this.refund_status_0 = refund_status_0;
+    public void setRefund_status(String refund_status) {
+        this.refund_status = refund_status;
     }
 
-    public String getRefund_account_0() {
-        return refund_account_0;
+    public String getRefund_account() {
+        return refund_account;
     }
 
-    public void setRefund_account_0(String refund_account_0) {
-        this.refund_account_0 = refund_account_0;
+    public void setRefund_account(String refund_account) {
+        this.refund_account = refund_account;
     }
 
-    public String getRefund_recv_accout_0() {
-        return refund_recv_accout_0;
+    public String getRefund_recv_accout() {
+        return refund_recv_accout;
     }
 
-    public void setRefund_recv_accout_0(String refund_recv_accout_0) {
-        this.refund_recv_accout_0 = refund_recv_accout_0;
+    public void setRefund_recv_accout(String refund_recv_accout) {
+        this.refund_recv_accout = refund_recv_accout;
     }
 
-    public String getRefund_success_time_0() {
-        return refund_success_time_0;
+    public String getRefund_success_time() {
+        return refund_success_time;
     }
 
-    public void setRefund_success_time_0(String refund_success_time_0) {
-        this.refund_success_time_0 = refund_success_time_0;
+    public void setRefund_success_time(String refund_success_time) {
+        this.refund_success_time = refund_success_time;
     }
 }

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatUtil.java

@@ -71,6 +71,7 @@ public class WechatUtil {
         //请求微信
         String reponseXml = sendSSLPostToWx(mapToXml, WechatConfig.getSslcsf());
         WechatRefundApiResult result = (WechatRefundApiResult) XmlUtil.xmlStrToBean(reponseXml, WechatRefundApiResult.class);
+        result.setOut_refund_no((String)params.get("out_refund_no"));
         return result;
     }
 
@@ -171,6 +172,7 @@ public class WechatUtil {
             String xmlStr = EntityUtils.toString(entity, "UTF-8");
             System.out.println(xmlStr);
             WechatRefundQueryResult result = (WechatRefundQueryResult) XmlUtil.xmlStrToBean(xmlStr, WechatRefundQueryResult.class);
+            result.setXmlStr(xmlStr);
 //            Map<String, Object> result = XmlUtil.xmlStrToMap(xmlStr);//.xmlStrToBean(xmlStr, WechatRefundApiResult.class);
             return result;
             //将信息保存到数据库

+ 19 - 3
kmall-common/src/main/resources/mybatis/mapper/SysUserDao.xml

@@ -3,11 +3,22 @@
 
 <mapper namespace="com.kmall.common.dao.SysUserDao">
 	<select id="queryObject" resultType="com.kmall.common.entity.SysUserEntity">
-		select * from sys_user where user_id = #{value}
+		SELECT
+		u.*, ( SELECT d.NAME FROM sys_dept d WHERE d.dept_id = u.dept_id ) deptName, ur.role_id
+		FROM
+		sys_user u
+		LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
+		where u.user_id = #{value}
 	</select>
 	
 	<select id="queryList" resultType="com.kmall.common.entity.SysUserEntity">
-		select u.*, (select d.name from sys_dept d where d.dept_id = u.dept_id) deptName from sys_user u
+		SELECT
+		u.*,
+		( SELECT d.NAME FROM sys_dept d WHERE d.dept_id = u.dept_id ) deptName,
+		ur.role_id
+		FROM
+		sys_user u
+		LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
 		<where>
 			<if test="createUserId != null">
 				and `create_user_id` = #{createUserId} 
@@ -74,6 +85,8 @@
 			`status`, 
 			`create_user_id`,
 			`dept_id`,
+			`store_id`,
+			`role_type`,
 			`create_time`
 		)
 		values
@@ -86,6 +99,8 @@
 			#{status}, 
 			#{createUserId},
 			#{deptId},
+			#{storeId},
+			#{roleType},
 			#{createTime}
 		)
 	</insert>
@@ -94,11 +109,12 @@
 		update sys_user 
 		<set> 
 			<if test="username != null">`username` = #{username}, </if>
-			<if test="password != null">`password` = #{password}, </if>
 			<if test="email != null">`email` = #{email}, </if>
 			<if test="mobile != null">`mobile` = #{mobile}, </if>
 			<if test="status != null">`status` = #{status}, </if>
 			<if test="deptId != null">`dept_id` = #{deptId}, </if>
+			<if test="storeId != null">`store_id` = #{storeId}, </if>
+			<if test="roleType != null">`role_type` = #{roleType}, </if>
 		</set>
 		where user_id = #{userId} 
 		<if test="createUserId != null">

+ 8 - 3
kmall-common/src/main/resources/mybatis/mapper/SysUserRoleDao.xml

@@ -9,6 +9,9 @@
 			<if test="userId != null">
 				user_id = #{userId}
 			</if>
+			<if test="roleId != null">
+				role_id = #{roleId}
+			</if>
 		</where>
 	</select>
  
@@ -19,17 +22,19 @@
 			`role_id`
 		)
 		values
-		<foreach collection="roleIdList" item="item" index="index" separator="," >
 		(
 			#{userId}, 
-			#{item}
+			#{roleId}
 		)
-		</foreach>
 	</insert>
 	
 	<delete id="delete">
 		delete from sys_user_role where user_id = #{value}
 	</delete>
+
+	<delete id="deleteByRoleId">
+		delete from sys_user_role where role_id = #{value}
+	</delete>
 	
 	<select id="queryRoleIdList" resultType="long">
 		select role_id from sys_user_role where user_id = #{value}

+ 2 - 2
kmall-schedule/src/main/java/com/kmall/schedule/quartz/OrderTask.java

@@ -50,7 +50,7 @@ public class OrderTask {
      * 方法描述:查询已申请退款订单以及退款中订单,查询微信退款更新订单状态
      * 二分钟更新订单
      */
-    @Scheduled(fixedRate = 1000 * 60 * 2)
+    @Scheduled(fixedRate = 1000 * 60 * 1)
     public void refundUpdate() {
         logger.info(">>>>>>>>>>>>>>>>>>>>refundUpdate is start ");
         qzOrderService.refundUpdate();
@@ -61,7 +61,7 @@ public class OrderTask {
      * 方法描述:查询支付中的订单以及小程序更新支付信息异常订单,查询微信订单更新订单状态
      * 二分钟更新订单
      */
-    @Scheduled(fixedRate = 1000 * 60 * 2)
+    @Scheduled(fixedRate = 1000 * 60 * 1)
     public void orderQueryUpdate() {
         logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is start ");
         qzOrderService.orderQueryUpdate();

+ 40 - 21
kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java

@@ -1,5 +1,7 @@
 package com.kmall.schedule.service;
 
+import com.kmall.common.utils.Constant;
+import com.kmall.common.utils.wechat.ReaderXmlForDOM4J;
 import com.kmall.common.utils.wechat.WechatRefundApiResult;
 import com.kmall.common.utils.wechat.WechatRefundQueryResult;
 import com.kmall.common.utils.wechat.WechatUtil;
@@ -222,27 +224,44 @@ public class QzOrderService {
                 if (result.getReturn_code().equalsIgnoreCase("SUCCESS")) {
                     if(result.getResult_code().equalsIgnoreCase("SUCCESS")) {
                         Map refundRaram = new HashMap();
-                        Date successTime = DateUtils.strToDate(result.getRefund_success_time_0());
-                        refundRaram.put("refundTime", successTime);
-                        refundRaram.put("outRefundNo", result.getOut_refund_no_0());
-                        refundRaram.put("refundId", result.getRefund_id_0());
-                        refundRaram.put("refundMoney", result.getRefund_fee_0());
-                        if (result.getRefund_status_0().equalsIgnoreCase("SUCCESS")) {
-                            refundRaram.put("refundStatus", 2);
-                            refundRaram.put("wechat_refund_status_des", "退款成功");
-                        } else if (result.getRefund_status_0().equalsIgnoreCase("REFUNDCLOSE")) {
-                            refundRaram.put("refundStatus", 4);
-                            refundRaram.put("wechat_refund_status_des", "退款关闭");
-                        } else if (result.getRefund_status_0().equalsIgnoreCase("PROCESSING")) {
-                            refundRaram.put("refundStatus", 5);
-                            refundRaram.put("wechat_refund_status_des", "退款处理中");
-                        } else if (result.getRefund_status_0().equalsIgnoreCase("CHANGE")) {
-                            refundRaram.put("refundStatus", 4);
-                            refundRaram.put("wechat_refund_status_des", "退款异常");
+                        int msgCount = Integer.parseInt(result.getRefund_count());
+                        for (int i = 0; i < msgCount; i++) {
+                            WechatRefundQueryResult querySuccessResponseDto = ReaderXmlForDOM4J.parse(result.getXmlStr(), i);
+                            if (result.getReturn_code().equalsIgnoreCase("SUCCESS")) {
+                                if (result.getResult_code().equalsIgnoreCase("SUCCESS")) {
+                                    result.setRefund_success_time(querySuccessResponseDto.getRefund_success_time());
+                                    result.setOut_refund_no(querySuccessResponseDto.getOut_refund_no());
+                                    result.setRefund_account(querySuccessResponseDto.getRefund_account());
+                                    result.setRefund_channel(querySuccessResponseDto.getRefund_channel());
+                                    result.setRefund_fee(querySuccessResponseDto.getRefund_fee());
+                                    result.setRefund_id(querySuccessResponseDto.getRefund_id());
+                                    result.setRefund_recv_accout(querySuccessResponseDto.getRefund_recv_accout());
+                                    result.setRefund_status(querySuccessResponseDto.getRefund_status());
+
+                                    Date successTime = DateUtils.strToDate(result.getRefund_success_time());
+                                    refundRaram.put("refundTime", successTime);
+                                    refundRaram.put("outRefundNo", result.getOut_refund_no());
+                                    refundRaram.put("refundId", result.getRefund_id());
+                                    refundRaram.put("refundMoney", BigDecimal.valueOf(Long.valueOf(result.getRefund_fee())).divide(Constant.ONE_HUNDRED));
+                                    if (result.getRefund_status().equalsIgnoreCase("SUCCESS")) {
+                                        refundRaram.put("refundStatus", 2);
+                                        refundRaram.put("wechat_refund_status_des", "退款成功");
+                                    } else if (result.getRefund_status().equalsIgnoreCase("REFUNDCLOSE")) {
+                                        refundRaram.put("refundStatus", 4);
+                                        refundRaram.put("wechat_refund_status_des", "退款关闭");
+                                    } else if (result.getRefund_status().equalsIgnoreCase("PROCESSING")) {
+                                        refundRaram.put("refundStatus", 5);
+                                        refundRaram.put("wechat_refund_status_des", "退款处理中");
+                                    } else if (result.getRefund_status().equalsIgnoreCase("CHANGE")) {
+                                        refundRaram.put("refundStatus", 4);
+                                        refundRaram.put("wechat_refund_status_des", "退款异常");
+                                    }
+                                    refundRaram.put("refundRecvAccout", result.getRefund_recv_accout());
+                                    refundRaram.put("orderRefundId", result.getOut_refund_no());
+                                    qzOrderMapper.updateOrderRefund(refundRaram);//更新订单退款信息
+                                }
+                            }
                         }
-                        refundRaram.put("refundRecvAccout", result.getRefund_recv_accout_0());
-                        refundRaram.put("orderRefundId", result.getOut_refund_no_0());
-                        qzOrderMapper.updateOrderRefund(refundRaram);//更新订单退款信息
 
                         Map orderRaram = new HashMap();
                         orderRaram.put("payStatus", 4);
@@ -278,7 +297,7 @@ public class QzOrderService {
                 String orderId = MapUtils.getString("order_id", map);
                 WechatRefundApiResult result = WechatUtil.wxOrderQuery(out_trade_no);
                 if (result.getReturn_code().equalsIgnoreCase("SUCCESS")) {
-                    if(result.getResult_code().equalsIgnoreCase("SUCCESS")) {
+                    if(result.getResult_code().equalsIgnoreCase("SUCCESS") && result.getTrade_state().equalsIgnoreCase("SUCCESS")) {
                         Date successTime = DateUtils.convertStringToDate(result.getTime_end(),DateUtils.DATE_TIME_PATTERN_YYYY_MM_DD_HH_MM_SS);
 
                         Map orderRaram = new HashMap();

+ 8 - 6
kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

@@ -28,7 +28,7 @@
         AND c.store_id = a.store_id
         WHERE 1 = 1
         AND a.add_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -15 MINUTE)
-        AND a.order_status = 0 and a.order_type = 1
+        AND a.order_status in (0,100) and a.order_type = 1
     </select>
     <update id="unpayPastUpdate">
         UPDATE mall_order a
@@ -50,13 +50,15 @@
     <select id="queryRefundOrderList" resultType="map">
         select a.pay_transaction_id,a.merch_order_sn,a.order_sn,a.order_status,a.pay_status,f.out_refund_no,f.refund_id,f.order_id,f.id 'orderRefundId'
         from mall_order a
-        inner join mall_order_refund f on a.id = f.order_id	where (f.out_refund_no is null or f.refund_id is null) and a.order_status != '101' and f.refund_status
-        not in (1,3,4)
+        inner join mall_order_refund f on a.id = f.order_id	where (f.out_refund_no is null or f.refund_id is null
+        or f.refund_time is null or f.wechat_refund_status_des is null) and a.order_status = '401' and f.refund_status
+        in (2,5)
     </select>
 
     <select id="queryPayingOrderList" resultType="map">
 		select a.pay_transaction_id,a.order_sn,a.order_status,a.pay_status,a.id 'order_id',a.merch_order_sn
-        from mall_order a where (a.order_status = '201' and a.pay_status not in (0,3,4)) and (a.pay_transaction_id = '' or a.pay_transaction_id is null or a.pay_time is null or a.pay_time = '')
+        from mall_order a where (a.order_status in ('100','201') and a.pay_status in (1,2))
+        and (a.pay_transaction_id = '' or a.pay_transaction_id is null or a.pay_time is null or a.pay_time = '')
     </select>
 
 
@@ -75,14 +77,14 @@
     <update id="updateOrderRefund" parameterType="map">
         UPDATE mall_order_refund a
         <set>
-            <if test="outRefundNo != null">a.out_refund_no = #{outRefundNo},</if>
             <if test="refundId != null">a.refund_id = #{refundId},</if>
             <if test="refundMoney != null">a.refund_money = #{refundMoney},</if>
             <if test="refundStatus != null">a.refund_status = #{refundStatus},</if>
             <if test="refundRecvAccout != null">a.refund_recv_accout = #{refundRecvAccout},</if>
             <if test="refundTime != null">a.refund_time = #{refundTime},</if>
+            <if test="wechat_refund_status_des != null">a.wechat_refund_status_des = #{wechat_refund_status_des},</if>
         </set>
         WHERE 1 = 1
-        AND a.id = #{orderRefundId}
+        AND a.out_refund_no = #{orderRefundId}
     </update>
 </mapper>

Some files were not shown because too many files changed in this diff