瀏覽代碼

中网小程序微信国际(香港)支付admin模块提交

hyq 6 年之前
父節點
當前提交
f0fc2bda70
共有 100 個文件被更改,包括 8569 次插入0 次删除
  1. 26 0
      kmall-admin/kmall-admin.iml
  2. 75 0
      kmall-admin/pom.xml
  3. 36 0
      kmall-admin/src/main/java/com/kmall/admin/Test.java
  4. 30 0
      kmall-admin/src/main/java/com/kmall/admin/annotation/DataFilter.java
  5. 126 0
      kmall-admin/src/main/java/com/kmall/admin/aop/DataFilterAspect.java
  6. 85 0
      kmall-admin/src/main/java/com/kmall/admin/aop/SysLogAspect.java
  7. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/AdController.java
  8. 100 0
      kmall-admin/src/main/java/com/kmall/admin/controller/AdPositionController.java
  9. 91 0
      kmall-admin/src/main/java/com/kmall/admin/controller/AddressController.java
  10. 100 0
      kmall-admin/src/main/java/com/kmall/admin/controller/AttributeCategoryController.java
  11. 135 0
      kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java
  12. 125 0
      kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java
  13. 93 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CartController.java
  14. 185 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java
  15. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ChannelController.java
  16. 94 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CollectController.java
  17. 131 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CommentController.java
  18. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CommentPictureController.java
  19. 120 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CouponController.java
  20. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/CouponGoodsController.java
  21. 82 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ExportExceptionDataController.java
  22. 111 0
      kmall-admin/src/main/java/com/kmall/admin/controller/FeedbackController.java
  23. 100 0
      kmall-admin/src/main/java/com/kmall/admin/controller/FootprintController.java
  24. 145 0
      kmall-admin/src/main/java/com/kmall/admin/controller/FreightController.java
  25. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/FreightItemController.java
  26. 91 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsAttributeController.java
  27. 280 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  28. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsGalleryController.java
  29. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsGroupController.java
  30. 121 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsGroupOpenController.java
  31. 124 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsIssueController.java
  32. 118 0
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsSpecificationController.java
  33. 134 0
      kmall-admin/src/main/java/com/kmall/admin/controller/HelpIssueController.java
  34. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/HelpTypeController.java
  35. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/KeywordsController.java
  36. 113 0
      kmall-admin/src/main/java/com/kmall/admin/controller/MerchController.java
  37. 138 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OfflineCartController.java
  38. 684 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  39. 101 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderGoodsController.java
  40. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderProcessRecordController.java
  41. 125 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java
  42. 120 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductController.java
  43. 127 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ProductStoreRelaController.java
  44. 91 0
      kmall-admin/src/main/java/com/kmall/admin/controller/RelatedGoodsController.java
  45. 91 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SearchHistoryController.java
  46. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/ShippingController.java
  47. 101 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SpecificationController.java
  48. 162 0
      kmall-admin/src/main/java/com/kmall/admin/controller/StoreController.java
  49. 109 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SupplierController.java
  50. 100 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysConfigController.java
  51. 118 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysCusNationCodeController.java
  52. 121 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysCusUnitCodeController.java
  53. 139 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysDeptController.java
  54. 49 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysLogController.java
  55. 113 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysMacroController.java
  56. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysNoticeController.java
  57. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysNoticeUserController.java
  58. 154 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java
  59. 22 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysPageController.java
  60. 106 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysPrinterController.java
  61. 168 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysRegionController.java
  62. 145 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysSmsLogController.java
  63. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/TopicCategoryController.java
  64. 99 0
      kmall-admin/src/main/java/com/kmall/admin/controller/TopicController.java
  65. 153 0
      kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java
  66. 98 0
      kmall-admin/src/main/java/com/kmall/admin/controller/UserCouponController.java
  67. 100 0
      kmall-admin/src/main/java/com/kmall/admin/controller/UserLevelController.java
  68. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/AdDao.java
  69. 14 0
      kmall-admin/src/main/java/com/kmall/admin/dao/AdPositionDao.java
  70. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/AddressDao.java
  71. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/AttributeCategoryDao.java
  72. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/AttributeDao.java
  73. 18 0
      kmall-admin/src/main/java/com/kmall/admin/dao/BrandDao.java
  74. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CartDao.java
  75. 19 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CategoryDao.java
  76. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ChannelDao.java
  77. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CollectDao.java
  78. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CommentDao.java
  79. 21 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CommentPictureDao.java
  80. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CouponDao.java
  81. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/CouponGoodsDao.java
  82. 18 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ExportExceptionDataDao.java
  83. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FeedbackDao.java
  84. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FootprintDao.java
  85. 24 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FreightDao.java
  86. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FreightItemDao.java
  87. 22 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsAttributeDao.java
  88. 27 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  89. 22 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsGalleryDao.java
  90. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsGroupDao.java
  91. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsGroupOpenDao.java
  92. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsGroupOpenDetailDao.java
  93. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsIssueDao.java
  94. 23 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsSpecificationDao.java
  95. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/HelpIssueDao.java
  96. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/HelpTypeDao.java
  97. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/KeywordsDao.java
  98. 23 0
      kmall-admin/src/main/java/com/kmall/admin/dao/MerchDao.java
  99. 25 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OfflineCartDao.java
  100. 73 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java

+ 26 - 0
kmall-admin/kmall-admin.iml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+        </webroots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 75 - 0
kmall-admin/pom.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>kmall-pt-global</artifactId>
+        <groupId>com.kmall</groupId>
+        <version>3.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>kmall-admin</artifactId>
+    <packaging>war</packaging>
+    <description>管理后台</description>
+
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.kmall</groupId>
+            <artifactId>kmall-common</artifactId>
+            <version>${kmall-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.kmall</groupId>
+            <artifactId>kmall-gen</artifactId>
+            <version>${kmall-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.kmall</groupId>
+            <artifactId>kmall-schedule</artifactId>
+            <version>${kmall-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.kmall</groupId>
+            <artifactId>kmall-api</artifactId>
+            <version>${kmall-version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
+                    <webResources>
+                        <resource>
+                            <directory>src/main/resources/conf</directory>
+                            <targetPath>WEB-INF/classes/conf</targetPath>
+                            <filtering>true</filtering>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 36 - 0
kmall-admin/src/main/java/com/kmall/admin/Test.java

@@ -0,0 +1,36 @@
+/*
+ * 创建时间:2017-08-19 08:55
+ * 项目名称:kmall_pt
+ * 类名称:Test.java
+ * 包名称:com.kmall.admin
+ *
+ * 修改履历:
+ *          日期              修正者        主要内容
+ *                                      
+ *
+ * Copyright (c) 2016-2017 兆尹科技
+ */
+package com.kmall.admin;
+
+/**
+ * 名称:Test <br>
+ * 描述:<br>
+ *
+ * @author Scott
+ * @version 1.0
+ * @since 1.0.0
+ */
+public class Test {
+    public static void main(String[] args) {
+        //Integer使用equals判断
+        Integer a = 127;
+        Integer b = 127;
+        System.out.println(a == b);
+        Integer c = 129;
+        Integer d = 129;
+        System.out.println(c == d);
+
+        System.out.println(c.equals(d));
+
+    }
+}

+ 30 - 0
kmall-admin/src/main/java/com/kmall/admin/annotation/DataFilter.java

@@ -0,0 +1,30 @@
+package com.kmall.admin.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 数据过滤
+ *
+ * @author Scott
+ * @email
+ * @date 2017年10月23日 下午13:13:23
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface DataFilter {
+    /**
+     * sql中数据创建用户(通常传入TABLE.CREATE_USER_ID)的别名
+     */
+    String userAlias() default "";
+
+    /**
+     * sql中数据deptId的别名
+     */
+    String deptAlias() default "";
+
+    /**
+     * true:没有本部门数据权限,也能查询本人数据  暂时不使用
+     */
+    boolean self() default true;
+}

+ 126 - 0
kmall-admin/src/main/java/com/kmall/admin/aop/DataFilterAspect.java

@@ -0,0 +1,126 @@
+package com.kmall.admin.aop;
+
+import com.kmall.admin.annotation.DataFilter;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.service.SysRoleDeptService;
+import com.kmall.common.utils.Constant;
+import com.kmall.common.utils.RRException;
+import com.kmall.common.utils.ShiroUtils;
+import org.apache.commons.lang.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据过滤,切面处理类
+ *
+ * @author Scott
+ * @email
+ * @date 2017年10月23日 下午13:33:35
+ */
+@Aspect
+@Component
+public class DataFilterAspect {
+    @Autowired
+    private SysRoleDeptService sysRoleDeptService;
+
+    @Pointcut("@annotation(com.kmall.admin.annotation.DataFilter)")
+    public void dataFilterCut() {
+
+    }
+
+    @Before("dataFilterCut()")
+    public void dataFilter(JoinPoint point) throws Throwable {
+        //获取参数
+        Object params = point.getArgs()[0];
+        if (params != null && params instanceof Map) {
+            SysUserEntity user = ShiroUtils.getUserEntity();
+
+            //如果不是超级管理员,则只能查询权限数据
+            if (user.getUserId() != Constant.SUPER_ADMIN) {
+                Map map = (Map) params;
+                map.put("filterSql", getFilterSQL(user, point));
+            }
+
+            return;
+        }
+
+        throw new RRException("数据权限接口的参数必须为Map类型,且不能为NULL");
+    }
+
+    /**
+     * 获取数据过滤的SQL
+     */
+    private String getFilterSQL(SysUserEntity user, JoinPoint point) {
+        MethodSignature signature = (MethodSignature) point.getSignature();
+        DataFilter dataFilter = signature.getMethod().getAnnotation(DataFilter.class);
+
+        String userAlias = dataFilter.userAlias();
+        String deptAlias = dataFilter.deptAlias();
+
+        StringBuilder filterSql = new StringBuilder();
+
+        //取出当前登录用户的部门权限
+        String alias = getAliasByUser(user.getUserId());
+        if (StringUtils.isNotEmpty(alias)) {
+            filterSql.append(" and (");
+            filterSql.append(deptAlias);
+            filterSql.append(" in ");
+            filterSql.append(" ( ");
+            filterSql.append(alias);
+            filterSql.append(" ) ");
+            if (StringUtils.isNotBlank(userAlias)) {
+                filterSql.append(" or ");
+                filterSql.append(userAlias);
+                filterSql.append("=");
+                filterSql.append(user.getUserId());
+            }
+            filterSql.append(" ) ");
+        } else if (StringUtils.isNotBlank(userAlias)) {
+            filterSql.append(" and ");
+            filterSql.append(userAlias);
+            filterSql.append("=");
+            filterSql.append(user.getUserId());
+            filterSql.append(" ");
+        }
+        //没有部门数据权限,也能查询本人数据
+        if (dataFilter.self()) {
+            filterSql.append(" or ");
+            filterSql.append(userAlias);
+            filterSql.append("=");
+            filterSql.append(user.getUserId());
+            filterSql.append(" ");
+        }
+        return filterSql.toString();
+    }
+
+    /**
+     * 取出当前登录用户的部门权限
+     *
+     * @param userId 登录用户Id
+     * @return 部门权限
+     */
+    private String getAliasByUser(Long userId) {
+        @SuppressWarnings("unchecked")
+        List<Long> roleOrglist = sysRoleDeptService.queryDeptIdListByUserId(userId);
+        StringBuilder roleStr = new StringBuilder();
+        String alias = "";
+        if (roleOrglist != null && !roleOrglist.isEmpty()) {
+            for (Long roleId : roleOrglist) {
+                roleStr.append(",");
+                roleStr.append("'");
+                roleStr.append(roleId);
+                roleStr.append("'");
+            }
+            alias = roleStr.toString().substring(1, roleStr.length());
+        }
+        return alias;
+    }
+}

+ 85 - 0
kmall-admin/src/main/java/com/kmall/admin/aop/SysLogAspect.java

@@ -0,0 +1,85 @@
+package com.kmall.admin.aop;
+
+import com.alibaba.fastjson.JSON;
+import com.kmall.common.annotation.SysLog;
+import com.kmall.common.entity.SysLogEntity;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.service.SysLogService;
+import com.kmall.common.utils.HttpContextUtils;
+import com.kmall.common.utils.IPUtils;
+import com.kmall.common.utils.ShiroUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+import java.util.Date;
+
+
+/**
+ * 系统日志,切面处理类
+ *
+ * @author Scott
+ * @email
+ * @date 2017年3月8日 上午11:07:35
+ */
+@Aspect
+@Component
+public class SysLogAspect {
+    @Autowired
+    private SysLogService sysLogService;
+
+    @Pointcut("@annotation(com.kmall.common.annotation.SysLog)")
+    public void logPointCut() {
+
+    }
+
+    @Before("logPointCut()")
+    public void saveSysLog(JoinPoint joinPoint) {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+
+        SysLogEntity sysLog = new SysLogEntity();
+        SysLog syslog = method.getAnnotation(SysLog.class);
+        if (syslog != null) {
+            //注解上的描述
+            sysLog.setOperation(syslog.value());
+        }
+
+        //请求的方法名
+        String className = joinPoint.getTarget().getClass().getName();
+        String methodName = signature.getName();
+        sysLog.setMethod(className + "." + methodName + "()");
+
+        //请求的参数
+        Object[] args = joinPoint.getArgs();
+        String params = JSON.toJSONString(args[0]);
+        sysLog.setParams(params);
+
+        //获取request
+        HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
+        //设置IP地址
+        sysLog.setIp(IPUtils.getIpAddr(request));
+
+        //用户名
+        SysUserEntity sysUserEntity = ShiroUtils.getUserEntity();
+        String username = "";
+        if ("login".equals(methodName)) {
+            username = params;
+        }
+        if (null != sysUserEntity) {
+            username = ShiroUtils.getUserEntity().getUsername();
+        }
+        sysLog.setUsername(username);
+
+        sysLog.setCreateDate(new Date());
+        //保存系统日志
+        sysLogService.save(sysLog);
+    }
+
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.AdEntity;
+import com.kmall.admin.service.AdService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 09:37:35
+ */
+@RestController
+@RequestMapping("ad")
+public class AdController {
+    @Autowired
+    private AdService adService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("ad:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<AdEntity> adList = adService.queryList(query);
+        int total = adService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(adList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("ad:info")
+    public R info(@PathVariable("id") Integer id) {
+        AdEntity ad = adService.queryObject(id);
+
+        return R.ok().put("ad", ad);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("ad:save")
+    public R save(@RequestBody AdEntity ad) {
+        adService.save(ad);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("ad:update")
+    public R update(@RequestBody AdEntity ad) {
+        adService.update(ad);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("ad:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        adService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<AdEntity> list = adService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 100 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/AdPositionController.java

@@ -0,0 +1,100 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.AdPositionEntity;
+import com.kmall.admin.service.AdPositionService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 12:02:42
+ */
+@RestController
+@RequestMapping("adposition")
+public class AdPositionController {
+    @Autowired
+    private AdPositionService adPositionService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("adposition:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<AdPositionEntity> adPositionList = adPositionService.queryList(query);
+        int total = adPositionService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(adPositionList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("adposition:info")
+    public R info(@PathVariable("id") Integer id) {
+        AdPositionEntity adPosition = adPositionService.queryObject(id);
+
+        return R.ok().put("adPosition", adPosition);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("adposition:save")
+    public R save(@RequestBody AdPositionEntity adPosition) {
+        adPositionService.save(adPosition);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("adposition:update")
+    public R update(@RequestBody AdPositionEntity adPosition) {
+        adPositionService.update(adPosition);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("adposition:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        adPositionService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<AdPositionEntity> list = adPositionService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 91 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/AddressController.java

@@ -0,0 +1,91 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.AddressEntity;
+import com.kmall.admin.service.AddressService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-16 17:22:46
+ */
+@RestController
+@RequestMapping("address")
+public class AddressController {
+    @Autowired
+    private AddressService addressService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("address:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<AddressEntity> addressList = addressService.queryList(query);
+        int total = addressService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(addressList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("address:info")
+    public R info(@PathVariable("id") Integer id) {
+        AddressEntity address = addressService.queryObject(id);
+
+        return R.ok().put("address", address);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("address:save")
+    public R save(@RequestBody AddressEntity address) {
+        addressService.save(address);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("address:update")
+    public R update(@RequestBody AddressEntity address) {
+        addressService.update(address);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("address:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        addressService.deleteBatch(ids);
+
+        return R.ok();
+    }
+}

+ 100 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/AttributeCategoryController.java

@@ -0,0 +1,100 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.AttributeCategoryEntity;
+import com.kmall.admin.service.AttributeCategoryService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-17 16:13:27
+ */
+@RestController
+@RequestMapping("attributecategory")
+public class AttributeCategoryController {
+    @Autowired
+    private AttributeCategoryService attributeCategoryService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("attributecategory:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<AttributeCategoryEntity> attributeCategoryList = attributeCategoryService.queryList(query);
+        int total = attributeCategoryService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(attributeCategoryList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("attributecategory:info")
+    public R info(@PathVariable("id") Integer id) {
+        AttributeCategoryEntity attributeCategory = attributeCategoryService.queryObject(id);
+
+        return R.ok().put("attributeCategory", attributeCategory);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("attributecategory:save")
+    public R save(@RequestBody AttributeCategoryEntity attributeCategory) {
+        attributeCategoryService.save(attributeCategory);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("attributecategory:update")
+    public R update(@RequestBody AttributeCategoryEntity attributeCategory) {
+        attributeCategoryService.update(attributeCategory);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("attributecategory:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        attributeCategoryService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<AttributeCategoryEntity> list = attributeCategoryService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 135 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/AttributeController.java

@@ -0,0 +1,135 @@
+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.admin.utils.ParamUtils;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-17 16:48:17
+ */
+@RestController
+@RequestMapping("attribute")
+public class AttributeController {
+    @Autowired
+    private AttributeService attributeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("attribute:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<AttributeEntity> attributeList = attributeService.queryList(query);
+        int total = attributeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(attributeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("attribute:info")
+    public R info(@PathVariable("id") Integer id) {
+        AttributeEntity attribute = attributeService.queryObject(id);
+
+        return R.ok().put("attribute", attribute);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("attribute:save")
+    public R save(@RequestBody AttributeEntity attribute) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        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();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("attribute:update")
+    public R update(@RequestBody AttributeEntity attribute) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(attribute);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("name", "名称");
+        builder.put("attributeCategoryId", "所属分类");
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        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();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("attribute:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        attributeService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<AttributeEntity> list = attributeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    @RequestMapping("/query")
+    public R query(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<AttributeEntity> list = attributeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 125 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java

@@ -0,0 +1,125 @@
+package com.kmall.admin.controller;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.entity.BrandEntity;
+import com.kmall.admin.service.BrandService;
+import com.kmall.admin.utils.ParamUtils;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 17:59:15
+ */
+@RestController
+@RequestMapping("brand")
+public class BrandController {
+    @Autowired
+    private BrandService brandService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("brand:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<BrandEntity> brandList = brandService.queryList(query);
+        int total = brandService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(brandList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("brand:info")
+    public R info(@PathVariable("id") Integer id) {
+        BrandEntity brand = brandService.queryObject(id);
+
+        return R.ok().put("brand", brand);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("brand:save")
+    public R save(@RequestBody BrandEntity brand) {
+
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(brand);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+
+
+        brandService.save(brand);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("brand:update")
+    public R update(@RequestBody BrandEntity brand) {
+
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(brand);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+
+        brandService.update(brand);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("brand:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        brandService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<BrandEntity> list = brandService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 93 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CartController.java

@@ -0,0 +1,93 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CartEntity;
+import com.kmall.admin.service.CartService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:06
+ */
+@RestController
+@RequestMapping("cart")
+public class CartController {
+	@Autowired
+	private CartService cartService;
+	
+	/**
+	 * 列表
+	 */
+	@RequestMapping("/list")
+	@RequiresPermissions("cart:list")
+	public R list(@RequestParam Map<String, Object> params){
+		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+		//查询列表数据
+        Query query = new Query(params);
+
+		List<CartEntity> cartList = cartService.queryList(query);
+		int total = cartService.queryTotal(query);
+		
+		PageUtils pageUtil = new PageUtils(cartList, total, query.getLimit(), query.getPage());
+		
+		return R.ok().put("page", pageUtil);
+	}
+	
+	
+	/**
+	 * 信息
+	 */
+	@RequestMapping("/info/{id}")
+	@RequiresPermissions("cart:info")
+	public R info(@PathVariable("id") Integer id){
+		CartEntity cart = cartService.queryObject(id);
+		
+		return R.ok().put("cart", cart);
+	}
+	
+	/**
+	 * 保存
+	 */
+	@RequestMapping("/save")
+	@RequiresPermissions("cart:save")
+	public R save(@RequestBody CartEntity cart){
+		cartService.save(cart);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 修改
+	 */
+	@RequestMapping("/update")
+	@RequiresPermissions("cart:update")
+	public R update(@RequestBody CartEntity cart){
+		cartService.update(cart);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 删除
+	 */
+	@RequestMapping("/delete")
+	@RequiresPermissions("cart:delete")
+	public R delete(@RequestBody Integer[] ids){
+		cartService.deleteBatch(ids);
+		
+		return R.ok();
+	}
+	
+}

+ 185 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java

@@ -0,0 +1,185 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CategoryEntity;
+import com.kmall.admin.service.CategoryService;
+import com.kmall.admin.utils.ParamUtils;
+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.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-21 15:32:31
+ */
+@RestController
+@RequestMapping("category")
+public class CategoryController {
+    @Autowired
+    private CategoryService categoryService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("category:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<CategoryEntity> categoryList = categoryService.queryList(query);
+        int total = categoryService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(categoryList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("category:info")
+    public R info(@PathVariable("id") Integer id) {
+        CategoryEntity category = categoryService.queryObject(id);
+
+        return R.ok().put("category", category);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("category:save")
+    public R save(@RequestBody CategoryEntity category) {
+        categoryService.save(category);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("category:update")
+    public R update(@RequestBody CategoryEntity category) {
+        categoryService.update(category);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("category:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        categoryService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<CategoryEntity> list = categoryService.queryList(params);
+        //添加顶级菜单
+        CategoryEntity root = new CategoryEntity();
+        root.setId(0);
+        root.setName("一级分类");
+        root.setParentId(-1);
+        root.setOpen(true);
+        list.add(root);
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查看信息(全部加载页面渲染太慢!)
+     */
+    @RequestMapping("/getAreaTree")
+    public R getAreaTree() {
+
+        Map<String, Object> map = new HashMap<>();
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+
+        List<CategoryEntity> list = categoryService.queryList(map);
+        for (CategoryEntity sysRegionEntity : list) {
+            sysRegionEntity.setValue(sysRegionEntity.getId() + "");
+            sysRegionEntity.setLabel(sysRegionEntity.getName());
+        }
+        List<CategoryEntity> node = TreeUtils.factorTree(list);
+
+        return R.ok().put("node", node);
+    }
+
+    /**
+     * 查询
+     *
+     * @return
+     */
+    @RequestMapping("/getCategorySelect")
+    public R getCategorySelect(@RequestParam Map<String, Object> map) {
+        map.put("parentId", "0");
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+        List<CategoryEntity> list = categoryService.queryList(map);
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查询
+     *
+     * @return
+     */
+    @RequestMapping("/getCategorySelectByParent")
+    public R getCategorySelectByParent(@RequestParam Map<String, Object> map) {
+        String parentId = map.get("parentId").toString();
+        List<CategoryEntity> list = new ArrayList<>();
+        if (StringUtils.isNotEmpty(parentId)) {
+            ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+
+            list = categoryService.queryList(map);
+        }
+
+        return R.ok().put("list", list);
+    }
+
+    @RequestMapping("/query")
+    public R query(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        params.put("isShow", 1);
+        List<CategoryEntity> list = categoryService.queryList(params);
+        //添加顶级菜单
+        CategoryEntity root = new CategoryEntity();
+        root.setId(0);
+        root.setName("一级分类");
+        root.setParentId(-1);
+        root.setOpen(true);
+        list.add(root);
+        return R.ok().put("list", list);
+    }
+
+    @RequestMapping("/getCategory")
+    public R getCategory(@RequestParam Map<String, Object> map) {
+        ParamUtils.setQueryPowerByRoleType(map, "storeId", "merchSn", false);
+
+        List<CategoryEntity> list = categoryService.queryList(map);
+        return R.ok().put("list", list);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ChannelController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.ChannelEntity;
+import com.kmall.admin.service.ChannelService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-22 19:19:56
+ */
+@RestController
+@RequestMapping("channel")
+public class ChannelController {
+    @Autowired
+    private ChannelService channelService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("channel:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ChannelEntity> channelList = channelService.queryList(query);
+        int total = channelService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(channelList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("channel:info")
+    public R info(@PathVariable("id") Integer id) {
+        ChannelEntity channel = channelService.queryObject(id);
+
+        return R.ok().put("channel", channel);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("channel:save")
+    public R save(@RequestBody ChannelEntity channel) {
+        channelService.save(channel);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("channel:update")
+    public R update(@RequestBody ChannelEntity channel) {
+        channelService.update(channel);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("channel:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        channelService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<ChannelEntity> list = channelService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 94 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CollectController.java

@@ -0,0 +1,94 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CollectEntity;
+import com.kmall.admin.service.CollectService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:06
+ */
+@RestController
+@RequestMapping("collect")
+public class CollectController {
+	@Autowired
+	private CollectService collectService;
+	
+	/**
+	 * 列表
+	 */
+	@RequestMapping("/list")
+	@RequiresPermissions("collect:list")
+	public R list(@RequestParam Map<String, Object> params){
+
+		ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+		//查询列表数据
+        Query query = new Query(params);
+
+		List<CollectEntity> collectList = collectService.queryList(query);
+		int total = collectService.queryTotal(query);
+		
+		PageUtils pageUtil = new PageUtils(collectList, total, query.getLimit(), query.getPage());
+		
+		return R.ok().put("page", pageUtil);
+	}
+	
+	
+	/**
+	 * 信息
+	 */
+	@RequestMapping("/info/{id}")
+	@RequiresPermissions("collect:info")
+	public R info(@PathVariable("id") Integer id){
+		CollectEntity collect = collectService.queryObject(id);
+		
+		return R.ok().put("collect", collect);
+	}
+	
+	/**
+	 * 保存
+	 */
+	@RequestMapping("/save")
+	@RequiresPermissions("collect:save")
+	public R save(@RequestBody CollectEntity collect){
+		collectService.save(collect);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 修改
+	 */
+	@RequestMapping("/update")
+	@RequiresPermissions("collect:update")
+	public R update(@RequestBody CollectEntity collect){
+		collectService.update(collect);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 删除
+	 */
+	@RequestMapping("/delete")
+	@RequiresPermissions("collect:delete")
+	public R delete(@RequestBody Integer[] ids){
+		collectService.deleteBatch(ids);
+		
+		return R.ok();
+	}
+	
+}

+ 131 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CommentController.java

@@ -0,0 +1,131 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CommentEntity;
+import com.kmall.admin.service.CommentService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-28 17:03:40
+ */
+@RestController
+@RequestMapping("comment")
+public class CommentController {
+    @Autowired
+    private CommentService commentService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("comment:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<CommentEntity> commentList = commentService.queryList(query);
+        int total = commentService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(commentList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("comment:info")
+    public R info(@PathVariable("id") Integer id) {
+        CommentEntity comment = commentService.queryObject(id);
+
+        return R.ok().put("comment", comment);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("comment:save")
+    public R save(@RequestBody CommentEntity comment) {
+        commentService.save(comment);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("comment:update")
+    public R update(@RequestBody CommentEntity comment) {
+        commentService.update(comment);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("comment:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        commentService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<CommentEntity> list = commentService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 修改状态
+     */
+    @RequestMapping("/toggleStatus")
+    @RequiresPermissions("comment:toggleStatus")
+    public R toggleStatus(@RequestBody CommentEntity comment) {
+        commentService.toggleStatus(comment);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改状态
+     */
+    @RequestMapping("/toggleStatusBatch")
+    @RequiresPermissions("comment:toggleStatus")
+    public R toggleStatusBatch(@RequestBody Integer[] ids) {
+        commentService.toggleStatusBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        int sum = commentService.queryTotal(params);
+
+        return R.ok().put("sum", sum);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CommentPictureController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CommentPictureEntity;
+import com.kmall.admin.service.CommentPictureService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 评价图片Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-29 14:45:55
+ */
+@RestController
+@RequestMapping("commentpicture")
+public class CommentPictureController {
+    @Autowired
+    private CommentPictureService commentPictureService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("commentpicture:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<CommentPictureEntity> commentPictureList = commentPictureService.queryList(query);
+        int total = commentPictureService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(commentPictureList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("commentpicture:info")
+    public R info(@PathVariable("id") Integer id) {
+        CommentPictureEntity commentPicture = commentPictureService.queryObject(id);
+
+        return R.ok().put("commentPicture", commentPicture);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("commentpicture:save")
+    public R save(@RequestBody CommentPictureEntity commentPicture) {
+        commentPictureService.save(commentPicture);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("commentpicture:update")
+    public R update(@RequestBody CommentPictureEntity commentPicture) {
+        commentPictureService.update(commentPicture);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("commentpicture:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        commentPictureService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<CommentPictureEntity> list = commentPictureService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 120 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CouponController.java

@@ -0,0 +1,120 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CouponEntity;
+import com.kmall.admin.service.CouponService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 优惠券Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 12:53:26
+ */
+@RestController
+@RequestMapping("coupon")
+public class CouponController {
+    @Autowired
+    private CouponService couponService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("coupon:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<CouponEntity> couponList = couponService.queryList(query);
+        int total = couponService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(couponList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("coupon:info")
+    public R info(@PathVariable("id") Integer id) {
+        CouponEntity coupon = couponService.queryObject(id);
+
+        return R.ok().put("coupon", coupon);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("coupon:save")
+    public R save(@RequestBody CouponEntity coupon) {
+        couponService.save(coupon);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("coupon:update")
+    public R update(@RequestBody CouponEntity coupon) {
+        couponService.update(coupon);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("coupon:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        couponService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<CouponEntity> list = couponService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 按用户、商品下发优惠券
+     *
+     * @param params
+     * @return
+     */
+    @RequiresPermissions("coupon:publish")
+    @RequestMapping(value = "publish", method = RequestMethod.POST)
+    public R publish(@RequestBody Map<String, Object> params) {
+        return couponService.publish(params);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CouponGoodsController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.CouponGoodsEntity;
+import com.kmall.admin.service.CouponGoodsService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 优惠券关联商品Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-29 21:50:17
+ */
+@RestController
+@RequestMapping("coupongoods")
+public class CouponGoodsController {
+    @Autowired
+    private CouponGoodsService couponGoodsService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("coupongoods:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<CouponGoodsEntity> couponGoodsList = couponGoodsService.queryList(query);
+        int total = couponGoodsService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(couponGoodsList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("coupongoods:info")
+    public R info(@PathVariable("id") Integer id) {
+        CouponGoodsEntity couponGoods = couponGoodsService.queryObject(id);
+
+        return R.ok().put("couponGoods", couponGoods);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("coupongoods:save")
+    public R save(@RequestBody CouponGoodsEntity couponGoods) {
+        couponGoodsService.save(couponGoods);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("coupongoods:update")
+    public R update(@RequestBody CouponGoodsEntity couponGoods) {
+        couponGoodsService.update(couponGoods);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("coupongoods:delete")
+    public R delete(@RequestBody Integer[]ids) {
+        couponGoodsService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<CouponGoodsEntity> list = couponGoodsService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 82 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ExportExceptionDataController.java

@@ -0,0 +1,82 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.ExportExceptionDataEntity;
+import com.kmall.admin.service.ExportExceptionDataService;
+import com.kmall.common.constant.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;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 数据导入异常数据记录Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-07 09:41:15
+ */
+@Controller
+@RequestMapping("exportexceptiondata")
+public class ExportExceptionDataController {
+    @Autowired
+    private ExportExceptionDataService exportExceptionDataService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("exportexceptiondata:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if (user != null) {
+            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+                params.put("storeId", user.getStoreId());
+                params.put("merchSn", user.getMerchSn());
+            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+                params.put("merchSn", user.getMerchSn());
+            }
+        }
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ExportExceptionDataEntity> exportExceptionDataList = exportExceptionDataService.queryList(query);
+        int total = exportExceptionDataService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(exportExceptionDataList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("exportexceptiondata:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        ExportExceptionDataEntity exportExceptionData = exportExceptionDataService.queryObject(id);
+
+        return R.ok().put("exportExceptionData", exportExceptionData);
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<ExportExceptionDataEntity> list = exportExceptionDataService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 111 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/FeedbackController.java

@@ -0,0 +1,111 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.FeedbackEntity;
+import com.kmall.admin.service.FeedbackService;
+import com.kmall.common.constant.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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 15:03:25
+ */
+@RestController
+@RequestMapping("feedback")
+public class FeedbackController {
+    @Autowired
+    private FeedbackService feedbackService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("feedback:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if (user != null) {
+            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+                params.put("storeId", user.getStoreId());
+                params.put("merchSn", user.getMerchSn());
+            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+                params.put("merchSn", user.getMerchSn());
+            }
+        }
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<FeedbackEntity> feedbackList = feedbackService.queryList(query);
+        int total = feedbackService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(feedbackList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{msgId}")
+    @RequiresPermissions("feedback:info")
+    public R info(@PathVariable("msgId") Integer msgId) {
+        FeedbackEntity feedback = feedbackService.queryObject(msgId);
+
+        return R.ok().put("feedback", feedback);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("feedback:save")
+    public R save(@RequestBody FeedbackEntity feedback) {
+        feedbackService.save(feedback);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("feedback:update")
+    public R update(@RequestBody FeedbackEntity feedback) {
+        feedbackService.update(feedback);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("feedback:delete")
+    public R delete(@RequestBody Integer[]msgIds) {
+        feedbackService.deleteBatch(msgIds);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<FeedbackEntity> list = feedbackService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 100 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/FootprintController.java

@@ -0,0 +1,100 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.FootprintEntity;
+import com.kmall.admin.service.FootprintService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:08
+ */
+@RestController
+@RequestMapping("footprint")
+public class FootprintController {
+    @Autowired
+    private FootprintService footprintService;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("footprint:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<FootprintEntity> footprintList = footprintService.queryList(query);
+        int total = footprintService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(footprintList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("footprint:info")
+    public R info(@PathVariable("id") Integer id) {
+        FootprintEntity footprint = footprintService.queryObject(id);
+
+        return R.ok().put("footprint", footprint);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("footprint:save")
+    public R save(@RequestBody FootprintEntity footprint) {
+        footprintService.save(footprint);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("footprint:update")
+    public R update(@RequestBody FootprintEntity footprint) {
+        footprintService.update(footprint);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("footprint:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        footprintService.deleteBatch(ids);
+
+        return R.ok();
+    }
+    /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        int hitCount = footprintService.queryTotal(params);
+
+        return R.ok().put("hitCount", hitCount);
+    }
+
+}

+ 145 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/FreightController.java

@@ -0,0 +1,145 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.entity.FreightEntity;
+import com.kmall.admin.entity.FreightItemEntity;
+import com.kmall.admin.service.FreightService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.entity.SysUserEntity;
+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.*;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-21 21:19:49
+ */
+@RestController
+@RequestMapping("freight")
+public class FreightController {
+    @Autowired
+    private FreightService freightService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("freight:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<FreightEntity> freightList = freightService.queryList(query);
+        int total = freightService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(freightList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("freight:info")
+    public R info(@PathVariable("id") Integer id) {
+        FreightEntity freight = freightService.queryObject(id);
+
+        return R.ok().put("freight", freight);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("freight:save")
+    public R save(@RequestBody FreightEntity freight) {
+
+        if (freight.getFreightItemEntityList() == null || freight.getFreightItemEntityList().size() == 0) {
+            throw new RRException("配送区域及运费不能为空");
+        }
+
+        for (FreightItemEntity freightItemEntity : freight.getFreightItemEntityList()) {
+            if (freightItemEntity != null) {
+                Map<String, Object> valideDate = MapBeanUtil.fromObject(freightItemEntity);
+                ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+                builder.put("firstPiece", "首件");
+                builder.put("freight", "运费");
+                builder.put("continuePiece", "续件");
+                builder.put("renew", "续费");
+                R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+                if (Integer.valueOf(r.get("code").toString()) != 0) {
+                    throw new RRException(r.get("msg").toString());
+                }
+            }
+        }
+
+
+        freightService.save(freight);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("freight:update")
+    public R update(@RequestBody FreightEntity freight) {
+
+        if (freight.getFreightItemEntityList() == null || freight.getFreightItemEntityList().size() == 0) {
+            throw new RRException("配送区域及运费不能为空");
+        }
+
+        for (FreightItemEntity freightItemEntity : freight.getFreightItemEntityList()) {
+            if (freightItemEntity != null) {
+                Map<String, Object> valideDate = MapBeanUtil.fromObject(freightItemEntity);
+                ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+                builder.put("firstPiece", "首件");
+                builder.put("freight", "运费");
+                builder.put("continuePiece", "续件");
+                builder.put("renew", "续费");
+                R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+                if (Integer.valueOf(r.get("code").toString()) != 0) {
+                    throw new RRException(r.get("msg").toString());
+                }
+            }
+        }
+
+        freightService.update(freight);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("freight:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        freightService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<FreightEntity> list = freightService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.FreightItemEntity;
+import com.kmall.admin.service.FreightItemService;
+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-10-22 15:18:16
+ */
+@Controller
+@RequestMapping("freightitem")
+public class FreightItemController {
+    @Autowired
+    private FreightItemService freightItemService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("freightitem:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<FreightItemEntity> freightItemList = freightItemService.queryList(query);
+        int total = freightItemService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(freightItemList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("freightitem:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        FreightItemEntity freightItem = freightItemService.queryObject(id);
+
+        return R.ok().put("freightItem", freightItem);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("freightitem:save")
+    @ResponseBody
+    public R save(@RequestBody FreightItemEntity freightItem) {
+        freightItemService.save(freightItem);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("freightitem:update")
+    @ResponseBody
+    public R update(@RequestBody FreightItemEntity freightItem) {
+        freightItemService.update(freightItem);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("freightitem:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        freightItemService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<FreightItemEntity> list = freightItemService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 91 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsAttributeController.java

@@ -0,0 +1,91 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.GoodsAttributeEntity;
+import com.kmall.admin.service.GoodsAttributeService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:08
+ */
+@RestController
+@RequestMapping("goodsattribute")
+public class GoodsAttributeController {
+	@Autowired
+	private GoodsAttributeService goodsAttributeService;
+	
+	/**
+	 * 列表
+	 */
+	@RequestMapping("/list")
+	@RequiresPermissions("goodsattribute:list")
+	public R list(@RequestParam Map<String, Object> params){
+		//查询列表数据
+        Query query = new Query(params);
+
+		List<GoodsAttributeEntity> goodsAttributeList = goodsAttributeService.queryList(query);
+		int total = goodsAttributeService.queryTotal(query);
+		
+		PageUtils pageUtil = new PageUtils(goodsAttributeList, total, query.getLimit(), query.getPage());
+		
+		return R.ok().put("page", pageUtil);
+	}
+	
+	
+	/**
+	 * 信息
+	 */
+	@RequestMapping("/info/{id}")
+	@RequiresPermissions("goodsattribute:info")
+	public R info(@PathVariable("id") Integer id){
+		GoodsAttributeEntity goodsAttribute = goodsAttributeService.queryObject(id);
+		
+		return R.ok().put("goodsAttribute", goodsAttribute);
+	}
+	
+	/**
+	 * 保存
+	 */
+	@RequestMapping("/save")
+	@RequiresPermissions("goodsattribute:save")
+	public R save(@RequestBody GoodsAttributeEntity goodsAttribute){
+		goodsAttributeService.save(goodsAttribute);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 修改
+	 */
+	@RequestMapping("/update")
+	@RequiresPermissions("goodsattribute:update")
+	public R update(@RequestBody GoodsAttributeEntity goodsAttribute){
+		goodsAttributeService.update(goodsAttribute);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 删除
+	 */
+	@RequestMapping("/delete")
+	@RequiresPermissions("goodsattribute:delete")
+	public R delete(@RequestBody Integer[] ids){
+		goodsAttributeService.deleteBatch(ids);
+		
+		return R.ok();
+	}
+	
+}

+ 280 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -0,0 +1,280 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.dto.GoodsDto;
+import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.admin.entity.GoodsGalleryEntity;
+import com.kmall.admin.service.GoodsGalleryService;
+import com.kmall.admin.service.GoodsService;
+import com.kmall.admin.service.OfflineCartService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.JxlsXmlTemplateName;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import com.kmall.common.utils.ShiroUtils;
+import com.kmall.common.utils.excel.ExcelUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.*;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-21 21:19:49
+ */
+@RestController
+@RequestMapping("goods")
+public class GoodsController {
+    @Autowired
+    private GoodsService goodsService;
+    @Autowired
+    private GoodsGalleryService goodsGalleryService;
+    @Autowired
+    private OfflineCartService offlineCartService;
+    @Autowired
+    private ExcelUtil excelUtil;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goods:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        //查询列表数据
+        Query query = new Query(params);
+
+        query.put("isDelete", 0);
+        List<GoodsEntity> goodsList = goodsService.queryList(query);
+        int total = goodsService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goods:info")
+    public R info(@PathVariable("id") Integer id) {
+        GoodsEntity goods = goodsService.queryObject(id);
+        if(goods != null) {
+            GoodsGalleryEntity goodsGalleryEntity =goodsGalleryService.queryVideoObjectByGoodId(goods.getId());
+            if(goodsGalleryEntity != null){
+                goods.setVideoUrl(goodsGalleryEntity.getImgUrl());
+            }
+        }
+        return R.ok().put("goods", goods);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goods:save")
+    public R save(@RequestBody GoodsEntity goods) {
+        goodsService.save(goods);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goods:update")
+    public R update(@RequestBody GoodsEntity goods) {
+        goodsService.update(goods);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goods:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        goodsService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        params.put("isDelete", 0);
+        List<GoodsEntity> list = goodsService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+
+    /**
+     * 商品回收站
+     *
+     * @param params
+     * @return
+     */
+    @RequestMapping("/historyList")
+    public R historyList(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        //查询列表数据
+        Query query = new Query(params);
+
+        query.put("isDelete", 1);
+        List<GoodsEntity> goodsList = goodsService.queryList(query);
+        int total = goodsService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 商品从回收站恢复
+     */
+    @RequestMapping("/back")
+    @RequiresPermissions("goods:back")
+    public R back(@RequestBody Integer[] ids) {
+        goodsService.back(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "merchSn", true);
+        params.put("isDelete", 0);
+        int sum = goodsService.queryTotal(params);
+        return R.ok().put("goodsSum", sum);
+    }
+
+    /**
+     * 上架
+     */
+    @RequestMapping("/enSale")
+    public R enSale(@RequestBody Integer id) {
+        goodsService.enSale(id);
+
+        return R.ok();
+    }
+
+    /**
+     * 上架
+     */
+    @RequestMapping("/enSaleBatch")
+    public R enSaleBatch(@RequestBody Integer[] ids) {
+        goodsService.enSaleBatch(ids);
+
+        return R.ok();
+    }
+
+
+    /**
+     * 下架
+     */
+    @RequestMapping("/unSale")
+    public R unSale(@RequestBody Integer id) {
+        goodsService.unSale(id);
+
+        return R.ok();
+    }
+
+    /**
+     * 下架
+     */
+    @RequestMapping("/unSaleBatch")
+    public R unSaleBatch(@RequestBody Integer[] ids) {
+        goodsService.unSaleBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 上传文件
+     */
+    @RequestMapping("/upload")
+    public R upload(@RequestParam("file") MultipartFile file) {
+        List<GoodsDto> goodsDtoList = new ArrayList<>();//商品信息
+        try {
+            Map<String, Object> beans = new HashMap<String, Object>();
+            beans.put("GoodsDtoList", goodsDtoList);
+            if (file.isEmpty()) {
+                return R.error("文件不能为空!");
+            }
+            excelUtil.readExcel(JxlsXmlTemplateName.GOODS_DTO_LIST, beans, file.getInputStream());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("导入失败!");
+        }
+        goodsService.uploadExcel(goodsDtoList,1);
+        //上传文件
+        return R.ok();
+    }
+    /**
+     * 上传文件
+     */
+    @RequestMapping("/generalGoodsUpload")
+    public R generalGoodsUpload(@RequestParam("file") MultipartFile file) {
+        List<GoodsDto> generalGoodsDtoList = new ArrayList<>();//商品信息
+        try {
+            Map<String, Object> beans = new HashMap<String, Object>();
+            beans.put("GeneralGoodsDtoList", generalGoodsDtoList);
+            if (file.isEmpty()) {
+                return R.error("文件不能为空!");
+            }
+            excelUtil.readExcel(JxlsXmlTemplateName.GENERAL_GOODS_DTO_LIST, beans, file.getInputStream());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.error("导入失败!");
+        }
+        goodsService.uploadExcel(generalGoodsDtoList,2);
+        //上传文件
+        return R.ok();
+    }
+
+    /*@RequestMapping("/scannInfo")
+    @RequiresPermissions("goods:scannInfo")
+    public R scannInfo(@RequestParam Map<String, Object> params) {
+        String goodsSn = (String)params.get("goodsSn");
+        GoodsEntity goods = goodsService.queryObjectByGoodsSnAndBizType(goodsSn);
+        if(goods == null) {
+            return R.error("商品信息不存在");
+        }
+        List<OfflineCartEntity> cartEntityList = offlineCartService.offlineGoodsCart(goods);
+
+        return R.ok().put("cartEntityList", cartEntityList);
+    }*/
+    @RequestMapping("/scannInfo/{prodBarcode}")
+    @RequiresPermissions("goods:scannInfo")
+    public R scannInfo(@PathVariable("prodBarcode")String prodBarcode) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user == null) {
+            return R.error("用户登录超时,请重新登录");
+        }
+        if (!user.getRoleType().equalsIgnoreCase("2")) {
+            return R.error("该操作只允许店员账户操作");
+        }
+        GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(prodBarcode);
+        if(goods == null) {
+            return R.error("商品信息不存在");
+        }
+        return R.ok().put("goods", goods);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsGalleryController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.GoodsGalleryEntity;
+import com.kmall.admin.service.GoodsGalleryService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 14:41:43
+ */
+@RestController
+@RequestMapping("goodsgallery")
+public class GoodsGalleryController {
+    @Autowired
+    private GoodsGalleryService goodsGalleryService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goodsgallery:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<GoodsGalleryEntity> goodsGalleryList = goodsGalleryService.queryList(query);
+        int total = goodsGalleryService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsGalleryList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goodsgallery:info")
+    public R info(@PathVariable("id") Integer id) {
+        GoodsGalleryEntity goodsGallery = goodsGalleryService.queryObject(id);
+
+        return R.ok().put("goodsGallery", goodsGallery);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goodsgallery:save")
+    public R save(@RequestBody GoodsGalleryEntity goodsGallery) {
+        goodsGalleryService.save(goodsGallery);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goodsgallery:update")
+    public R update(@RequestBody GoodsGalleryEntity goodsGallery) {
+        goodsGalleryService.update(goodsGallery);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goodsgallery:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        goodsGalleryService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        params.put("fileType","0");
+        List<GoodsGalleryEntity> list = goodsGalleryService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.GoodsGroupEntity;
+import com.kmall.admin.service.GoodsGroupService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-10-24 09:51:21
+ */
+@Controller
+@RequestMapping("goodsgroup")
+public class GoodsGroupController {
+    @Autowired
+    private GoodsGroupService goodsGroupService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goodsgroup:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<GoodsGroupEntity> goodsGroupList = goodsGroupService.queryList(query);
+        int total = goodsGroupService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsGroupList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goodsgroup:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        GoodsGroupEntity goodsGroup = goodsGroupService.queryObject(id);
+
+        return R.ok().put("goodsGroup", goodsGroup);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goodsgroup:save")
+    @ResponseBody
+    public R save(@RequestBody GoodsGroupEntity goodsGroup) {
+        goodsGroupService.save(goodsGroup);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goodsgroup:update")
+    @ResponseBody
+    public R update(@RequestBody GoodsGroupEntity goodsGroup) {
+        goodsGroupService.update(goodsGroup);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goodsgroup:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[] ids) {
+        goodsGroupService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<GoodsGroupEntity> list = goodsGroupService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 121 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsGroupOpenController.java

@@ -0,0 +1,121 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.GoodsGroupOpenEntity;
+import com.kmall.admin.service.GoodsGroupOpenService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-10-23 22:06:59
+ */
+@Controller
+@RequestMapping("goodsgroupopen")
+public class GoodsGroupOpenController {
+    @Autowired
+    private GoodsGroupOpenService goodsGroupOpenService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goodsgroupopen:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<GoodsGroupOpenEntity> goodsGroupOpenList = goodsGroupOpenService.queryList(query);
+        int total = goodsGroupOpenService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsGroupOpenList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goodsgroupopen:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Long id) {
+        GoodsGroupOpenEntity goodsGroupOpen = goodsGroupOpenService.queryObject(id);
+
+        return R.ok().put("goodsGroupOpen", goodsGroupOpen);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goodsgroupopen:save")
+    @ResponseBody
+    public R save(@RequestBody GoodsGroupOpenEntity goodsGroupOpen) {
+        goodsGroupOpenService.save(goodsGroupOpen);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goodsgroupopen:update")
+    @ResponseBody
+    public R update(@RequestBody GoodsGroupOpenEntity goodsGroupOpen) {
+        goodsGroupOpenService.update(goodsGroupOpen);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goodsgroupopen:delete")
+    @ResponseBody
+    public R delete(@RequestBody Long[] ids) {
+        goodsGroupOpenService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<GoodsGroupOpenEntity> list = goodsGroupOpenService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 取消团购订单
+     */
+    @RequestMapping("/cancelGroup")
+    @RequiresPermissions("goodsgroupopen:update")
+    @ResponseBody
+    public R cancelGroup(@RequestBody Integer id) {
+        int result = goodsGroupOpenService.cancelGroup(id);
+        if (result == 0) {
+            return R.error("取消失败");
+        }
+        return R.ok();
+    }
+
+}

+ 124 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsIssueController.java

@@ -0,0 +1,124 @@
+package com.kmall.admin.controller;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.entity.GoodsIssueEntity;
+import com.kmall.admin.service.GoodsIssueService;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 14:12:34
+ */
+@RestController
+@RequestMapping("goodsissue")
+public class GoodsIssueController {
+    @Autowired
+    private GoodsIssueService goodsIssueService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goodsissue:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if (user != null) {
+            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+                params.put("storeId", user.getStoreId());
+                params.put("merchSn", user.getMerchSn());
+            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+                params.put("merchSn", user.getMerchSn());
+            }
+        }
+        //查询列表数据
+        Query query = new Query(params);
+        List<GoodsIssueEntity> goodsIssueList = goodsIssueService.queryList(query);
+        int total = goodsIssueService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsIssueList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goodsissue:info")
+    public R info(@PathVariable("id") Integer id) {
+        GoodsIssueEntity goodsIssue = goodsIssueService.queryObject(id);
+
+        return R.ok().put("goodsIssue", goodsIssue);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goodsissue:save")
+    public R save(@RequestBody GoodsIssueEntity goodsIssue) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(goodsIssue);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        goodsIssueService.save(goodsIssue);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goodsissue:update")
+    public R update(@RequestBody GoodsIssueEntity goodsIssue) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(goodsIssue);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        goodsIssueService.update(goodsIssue);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goodsissue:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        goodsIssueService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<GoodsIssueEntity> list = goodsIssueService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 118 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsSpecificationController.java

@@ -0,0 +1,118 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.GoodsSpecificationEntity;
+import com.kmall.admin.entity.SpecificationEntity;
+import com.kmall.admin.service.GoodsSpecificationService;
+import com.kmall.admin.service.SpecificationService;
+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.web.bind.annotation.*;
+
+import java.util.*;
+
+/**
+ * 商品对应规格表值表Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-31 11:15:55
+ */
+@RestController
+@RequestMapping("goodsspecification")
+public class GoodsSpecificationController {
+    @Autowired
+    private GoodsSpecificationService goodsSpecificationService;
+    @Autowired
+    private SpecificationService specificationService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("goodsspecification:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<GoodsSpecificationEntity> goodsSpecificationList = goodsSpecificationService.queryList(query);
+        int total = goodsSpecificationService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(goodsSpecificationList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("goodsspecification:info")
+    public R info(@PathVariable("id") Integer id) {
+        GoodsSpecificationEntity goodsSpecification = goodsSpecificationService.queryObject(id);
+
+        return R.ok().put("goodsSpecification", goodsSpecification);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("goodsspecification:save")
+    public R save(@RequestBody GoodsSpecificationEntity goodsSpecification) {
+        goodsSpecificationService.save(goodsSpecification);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("goodsspecification:update")
+    public R update(@RequestBody GoodsSpecificationEntity goodsSpecification) {
+        goodsSpecificationService.update(goodsSpecification);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("goodsspecification:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        goodsSpecificationService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        List<GoodsSpecificationEntity> list = goodsSpecificationService.queryList(params);
+        List<Integer> goodsSpecificationIds = new ArrayList();
+        if (null != list) {
+            for (GoodsSpecificationEntity specificationEntity : list) {
+                if (!goodsSpecificationIds.contains(specificationEntity.getSpecificationId())) {
+                    goodsSpecificationIds.add(specificationEntity.getSpecificationId());
+                }
+            }
+        }
+        Map param = new HashMap();
+        param.put("ids", goodsSpecificationIds);
+        List<SpecificationEntity> specificationEntityList = specificationService.queryList(param);
+        Collections.sort(specificationEntityList, new Comparator<SpecificationEntity>() {
+            @Override
+            public int compare(SpecificationEntity o1, SpecificationEntity o2) {
+                return o1.getSortOrder().compareTo(o2.getSortOrder());
+            }
+        });
+        return R.ok().put("list", list).put("specificationEntityList", specificationEntityList);
+    }
+
+}

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

@@ -0,0 +1,134 @@
+package com.kmall.admin.controller;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.entity.HelpIssueEntity;
+import com.kmall.admin.service.HelpIssueService;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.*;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-01 21:09:54
+ */
+@Controller
+@RequestMapping("helpissue")
+public class HelpIssueController {
+    @Autowired
+    private HelpIssueService helpIssueService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("helpissue:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if (user != null) {
+            if (Dict.roleType.item_2.getItem().equals(user.getRoleType())) {
+                params.put("storeId", user.getStoreId());
+                params.put("merchSn", user.getMerchSn());
+            } else if (Dict.roleType.item_3.getItem().equals(user.getRoleType())) {
+                params.put("merchSn", user.getMerchSn());
+            }
+        }
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<HelpIssueEntity> helpIssueList = helpIssueService.queryList(query);
+        int total = helpIssueService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(helpIssueList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("helpissue:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        HelpIssueEntity helpIssue = helpIssueService.queryObject(id);
+
+        return R.ok().put("helpIssue", helpIssue);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("helpissue:save")
+    @ResponseBody
+    public R save(@RequestBody HelpIssueEntity helpIssue) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(helpIssue);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        builder.put("typeId", "问题分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        helpIssueService.save(helpIssue);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("helpissue:update")
+    @ResponseBody
+    public R update(@RequestBody HelpIssueEntity helpIssue) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(helpIssue);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeId", "门店");
+        builder.put("typeId", "问题分类");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        helpIssueService.update(helpIssue);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("helpissue:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        helpIssueService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<HelpIssueEntity> list = helpIssueService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.HelpTypeEntity;
+import com.kmall.admin.service.HelpTypeService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-01 21:09:55
+ */
+@Controller
+@RequestMapping("helptype")
+public class HelpTypeController {
+    @Autowired
+    private HelpTypeService helpTypeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("helptype:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<HelpTypeEntity> helpTypeList = helpTypeService.queryList(query);
+        int total = helpTypeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(helpTypeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("helptype:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        HelpTypeEntity helpType = helpTypeService.queryObject(id);
+
+        return R.ok().put("helpType", helpType);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("helptype:save")
+    @ResponseBody
+    public R save(@RequestBody HelpTypeEntity helpType) {
+        helpTypeService.save(helpType);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("helptype:update")
+    @ResponseBody
+    public R update(@RequestBody HelpTypeEntity helpType) {
+        helpTypeService.update(helpType);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("helptype:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        helpTypeService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<HelpTypeEntity> list = helpTypeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/KeywordsController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.KeywordsEntity;
+import com.kmall.admin.service.KeywordsService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 热闹关键词表Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-25 21:23:41
+ */
+@RestController
+@RequestMapping("keywords")
+public class KeywordsController {
+    @Autowired
+    private KeywordsService keywordsService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("keywords:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<KeywordsEntity> keywordsList = keywordsService.queryList(query);
+        int total = keywordsService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(keywordsList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("keywords:info")
+    public R info(@PathVariable("id") Integer id) {
+        KeywordsEntity keywords = keywordsService.queryObject(id);
+
+        return R.ok().put("keywords", keywords);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("keywords:save")
+    public R save(@RequestBody KeywordsEntity keywords) {
+        keywordsService.save(keywords);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("keywords:update")
+    public R update(@RequestBody KeywordsEntity keywords) {
+        keywordsService.update(keywords);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("keywords:delete")
+    public R delete(@RequestBody Integer[]ids) {
+        keywordsService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<KeywordsEntity> list = keywordsService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 113 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/MerchController.java

@@ -0,0 +1,113 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.MerchEntity;
+import com.kmall.admin.service.MerchService;
+import com.kmall.admin.utils.ParamUtils;
+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;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-06 09:41:34
+ */
+@Controller
+@RequestMapping("merch")
+public class MerchController {
+    @Autowired
+    private MerchService merchService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("merch:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", true);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<MerchEntity> merchList = merchService.queryList(query);
+        int total = merchService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(merchList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("merch:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        MerchEntity merch = merchService.queryObject(id);
+
+        return R.ok().put("merch", merch);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("merch:save")
+    @ResponseBody
+    public R save(@RequestBody MerchEntity merch) {
+        merchService.save(merch);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("merch:update")
+    @ResponseBody
+    public R update(@RequestBody MerchEntity merch) {
+        merchService.update(merch);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("merch:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[] ids) {
+        merchService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, null, "roleMerchSn", true);
+
+        List<MerchEntity> list = merchService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 138 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OfflineCartController.java

@@ -0,0 +1,138 @@
+package com.kmall.admin.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.admin.entity.OfflineCartEntity;
+import com.kmall.admin.service.GoodsService;
+import com.kmall.admin.service.OfflineCartService;
+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;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-29 15:14:59
+ */
+@Controller
+@RequestMapping("offlinecart")
+public class OfflineCartController {
+    @Autowired
+    private OfflineCartService offlineCartService;
+    @Autowired
+    private GoodsService goodsService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("offlinecart:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<OfflineCartEntity> offlineCartList = offlineCartService.queryList(query);
+        int total = offlineCartService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(offlineCartList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("offlinecart:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        OfflineCartEntity offlineCart = offlineCartService.queryObject(id);
+
+        return R.ok().put("offlineCart", offlineCart);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("offlinecart:save")
+    @ResponseBody
+    public R save(@RequestBody OfflineCartEntity offlineCart) {
+        offlineCartService.save(offlineCart);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("offlinecart:update")
+    @ResponseBody
+    public R update(@RequestBody OfflineCartEntity offlineCart) {
+        offlineCartService.update(offlineCart);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("offlinecart:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        offlineCartService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<OfflineCartEntity> list = offlineCartService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+    @RequestMapping("/infoList")
+    @RequiresPermissions("offlinecart:infoList")
+    @ResponseBody
+    public R infoList(@RequestBody List<OfflineCartEntity> offlineCartEntityList) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        offlineCartService.deleteByUserId(user.getUserId());
+        List<OfflineCartEntity> cartEntityList = new ArrayList<>();
+        for (OfflineCartEntity cartEntity:offlineCartEntityList) {
+            GoodsEntity goods = goodsService.queryObjectByProdBarcodeAndBizType(cartEntity.getProdBarcode());
+            cartEntityList = offlineCartService.offlineGoodsCart(goods);
+        }
+
+        return R.ok().put("list", cartEntityList);
+    }
+    /**
+     * 删除
+     */
+    @RequestMapping("/deleteByUserId")
+    @RequiresPermissions("offlinecart:deleteByUserId")
+    @ResponseBody
+    public R deleteByUserId() {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        offlineCartService.deleteByUserId(user.getUserId());
+        return R.ok();
+    }
+}

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

@@ -0,0 +1,684 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.*;
+import com.kmall.admin.service.*;
+import com.kmall.admin.service.OrderExceptionRecordService;
+import com.kmall.admin.service.OrderProcessRecordService;
+import com.kmall.admin.service.OrderService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.*;
+import com.kmall.common.utils.pingan.PinganUtil;
+import com.kmall.common.utils.pingan.dto.PinganResponseDto;
+import com.kmall.common.utils.print.ticket.item.Ticket;
+import com.kmall.common.utils.wechat.WechatMicropayApiResult;
+import com.kmall.common.utils.wechat.WechatRefundApiResult;
+import com.kmall.common.utils.wechat.WechatReverseApiResult;
+import com.kmall.common.utils.wechat.WechatUtil;
+import com.kmall.common.utils.wechat.wxglobal.WechatGlobalUtil;
+import com.kmall.common.utils.wechat.wxglobal.dto.WechatGlobalRefundApiResult;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+
+/**
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:09
+ */
+@RestController
+@RequestMapping("order")
+public class OrderController {
+    private Logger logger = Logger.getLogger(OrderController.class);
+    @Autowired
+    private OrderService orderService;
+    @Autowired
+    private OrderProcessRecordService orderProcessRecordService;
+    @Autowired
+    private OrderRefundService orderRefundService;
+    @Autowired
+    private OrderExceptionRecordService orderExceptionRecordService;
+    @Autowired
+    private StoreService storeService;
+    @Autowired
+    private OrderWXPayRecordService orderWXPayRecordService;
+    @Autowired
+    private PinganResponseService pinganResponseService;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("order:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+        query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+        List<OrderEntity> orderList = orderService.queryList(query);
+        int total = orderService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(orderList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("order:info")
+    public R info(@PathVariable("id") Long id) {
+        OrderEntity order = orderService.queryObject(id);
+        return R.ok().put("order", order);
+    }
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/infos/{id}")
+    @RequiresPermissions("order:infos")
+    public R infos(@PathVariable("id") Long id) {
+        OrderEntity order = orderService.queryInfos(id);
+        return R.ok().put("order", order);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("order:save")
+    public R save(@RequestBody OrderEntity order) {
+        orderService.save(order);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("order:update")
+    public R update(@RequestBody OrderEntity order) {
+        orderService.update(order);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("order:delete")
+    public R delete(@RequestBody Long[] ids) {
+        orderService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        List<OrderEntity> list = orderService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        int sum = orderService.queryTotal(params);
+
+        return R.ok().put("sum", sum);
+    }
+
+    /**
+     * 确定收货
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping("/confirm")
+    @RequiresPermissions("order:confirm")
+    public R confirm(@RequestBody Long id) {
+        orderService.confirm(id);
+
+        return R.ok();
+    }
+
+    /**
+     * 发货
+     *
+     * @param order
+     * @return
+     */
+    @RequestMapping("/sendGoods")
+    @RequiresPermissions("order:sendGoods")
+    public R sendGoods(@RequestBody OrderEntity order) {
+        orderService.sendGoods(order);
+
+        return R.ok();
+    }
+
+    /**
+     * 跟踪快递轨迹
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping("/getLogistics/{id}")
+    @RequiresPermissions("order:getLogistics")
+    public R getLogistics(@PathVariable("id") Long id) {
+        Map result = orderService.getLogistics(id);
+        return R.ok().put("result", result);
+    }
+
+    /**
+     * 获取订单清关信息
+     *
+     * @param orderSn
+     * @return
+     */
+    @RequestMapping("/getProcess/{orderSn}")
+    @RequiresPermissions("order:getProcess")
+    public R getProcess(@PathVariable("orderSn") String orderSn) {
+        OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordService.queryObjectByOrderSn(orderSn);
+        if (orderProcessRecordEntity != null) {
+            if (orderProcessRecordEntity.getShipmentStartTime() != null) {
+                orderProcessRecordEntity.setShipmentStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getShipmentStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getShipmentSuccTime() != null) {
+                orderProcessRecordEntity.setShipmentSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getShipmentSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getCustomsStartTime() != null) {
+                orderProcessRecordEntity.setCustomsStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getCustomsStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getCustomsSuccTime() != null) {
+                orderProcessRecordEntity.setCustomsSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getCustomsSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getWaybillStartTime() != null) {
+                orderProcessRecordEntity.setWaybillStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getWaybillStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getWaybillSuccTime() != null) {
+                orderProcessRecordEntity.setWaybillSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getWaybillSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getEleOrderStartTime() != null) {
+                orderProcessRecordEntity.setEleOrderStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getEleOrderStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getEleOrderSuccTime() != null) {
+                orderProcessRecordEntity.setEleOrderSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getEleOrderSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getAddOrderStartTime() != null) {
+                orderProcessRecordEntity.setAddOrderStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getAddOrderStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getAddOrderSuccTime() != null) {
+                orderProcessRecordEntity.setAddOrderSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getAddOrderSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getPaySuccTime() != null) {
+                orderProcessRecordEntity.setPaySuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getPaySuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getPayStartTime() != null) {
+                orderProcessRecordEntity.setPayStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getPayStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getPaymentStartTime() != null) {
+                orderProcessRecordEntity.setPaymentStartTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getPaymentStartTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+            if (orderProcessRecordEntity.getPaymentSuccTime() != null) {
+                orderProcessRecordEntity.setPaymentSuccTimeStr(
+                        DateUtils.format(orderProcessRecordEntity.getPaymentSuccTime(), DateUtils.DATE_TIME_PATTERN));
+            }
+        }
+        return R.ok().put("orderProcessRecordEntity", orderProcessRecordEntity);
+    }
+
+    /**
+     * 打印小票
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping("/printMsg")
+    public R printMsg(@RequestBody Long id) {
+        Ticket ticket = orderService.printMsg(id);
+        return R.ok().put("ticket", ticket);
+    }
+
+    /**
+     * 订单取消请求
+     */
+    @RequiresPermissions(value = {"order:refund"})
+    @RequestMapping(value = "cancel", method = RequestMethod.POST)
+    public Object cancel(Long orderId) {
+        OrderEntity orderInfo = orderService.queryObject(orderId);
+        if (null == orderInfo) {
+            return R.error("订单不存在");
+        }
+
+        if (orderInfo.getOrderStatus() != 0) {
+            return R.error("订单状态不支持取消");
+        }
+
+        orderService.cancelOrder(orderInfo);
+        return R.ok();
+    }
+
+    /**
+     * 订单退款请求
+     */
+    @RequiresPermissions(value = {"order:refund"})
+    @RequestMapping(value = "refund", method = RequestMethod.POST)
+    public Object refund(Long orderId, String refundId, BigDecimal refundMoney) {
+        OrderEntity orderInfo = orderService.queryObject(orderId);
+        if (null == orderInfo) {
+            return R.error("订单不存在");
+        }
+        if (orderInfo.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_401.getItem()) ||
+            orderInfo.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_402.getItem())) {
+            return R.error("订单已退款");
+        }
+        Double totalActualPrice = orderService.getTotalActualPrice(orderInfo.getMerchOrderSn());
+        if (totalActualPrice == null) {
+            totalActualPrice = 0d;
+        }
+        OrderProcessRecordEntity processRecordEntity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrderSn());
+        if(org.apache.commons.lang.StringUtils.isNotEmpty(processRecordEntity.getIsCustomsSend())) {
+            if (processRecordEntity.getIsCustomsSend().equalsIgnoreCase("2")) {
+                return R.error("订单正在清关中,不能退款");
+            }
+            if (processRecordEntity.getIsCustomsSend().equalsIgnoreCase("1")) {
+                return R.error("订单已清关完成,不能退款");
+            }
+        }
+        String refundResult = "";
+        if (orderInfo.getOrderStatus() != Integer.parseInt(Dict.orderStatus.item_0.getItem())) {
+            if (orderInfo.getPayFlag().equalsIgnoreCase(Dict.payFlag.item_wxglobalpay.getItem())) {
+                refundResult = wxGlobalRefund(orderInfo, totalActualPrice);
+                if (StringUtils.isNotBlank(refundResult)) {
+                    return R.error(refundResult);
+                }
+            } else if (orderInfo.getPayFlag().equalsIgnoreCase(Dict.payFlag.item_pingan.getItem())) {
+                refundResult = pinganRefund(orderInfo, refundId);
+                if (StringUtils.isNotBlank(refundResult)) {
+                    return R.error(refundResult);
+                }
+            } else{
+                refundResult = wxRefund(orderInfo,totalActualPrice);
+                if(StringUtils.isNotBlank(refundResult)){
+                    return R.error(refundResult);
+                }
+            }
+        }
+        return R.ok("退款成功");
+    }
+
+    /**
+     * 平安申请退款
+     * @param orderInfo
+     * @return
+     */
+    private String pinganRefund(OrderEntity orderInfo, String refundId){
+        Integer refundAmount =  orderInfo.getActualPrice().multiply(new BigDecimal(100)).intValue();
+        PinganResponseDto responseDto = PinganUtil.pinganPayRefund(orderInfo.getMerchOrderSn(), refundId, refundAmount, null);
+
+        if (!Objects.isNull(responseDto)) {
+            responseDto.setOutNo(orderInfo.getMerchOrderSn());
+            responseDto.setCreateTime(new Date());
+            pinganResponseService.save(responseDto);
+
+            if ("0".equals(responseDto.getErrcode())) {
+                JSONObject tradeResult = JSONObject.fromObject(responseDto.getDatajson());
+                if (Dict.pinganRefundStatus.item_1.getItem().equals(tradeResult.getString("status"))) {
+                    orderService.pinganRefund(orderInfo, tradeResult, refundId);
+                } else {
+                    OrderRefundEntity mallOrderRefund = orderRefundService.queryObjectByOrderId(orderInfo.getId());
+                    OrderRefundEntity orderRefund = new OrderRefundEntity();
+                    orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
+                    orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
+                    orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
+                    orderRefund.setModTime(new Date());
+                    orderRefund.setOutRefundNo(tradeResult.getString("ord_no"));
+                    if (mallOrderRefund != null) {
+                        orderRefund.setId(mallOrderRefund.getId());
+                        orderRefundService.update(orderRefund);//退款记录
+                    }
+                    OrderExceptionRecordEntity mallOrderExceptionRecord = new OrderExceptionRecordEntity();
+                    mallOrderExceptionRecord.setUserId(Integer.parseInt(orderInfo.getUserId() + ""));
+                    mallOrderExceptionRecord.setOrderSn(orderInfo.getOrderSn());
+                    mallOrderExceptionRecord.setExceptionStatus(Dict.exceptionStatus.item_03.getItem());
+                    mallOrderExceptionRecord.setExceptionContent("退款失败");
+                    mallOrderExceptionRecord.setCreateTime(new Date());
+                    orderExceptionRecordService.save(mallOrderExceptionRecord);
+                    return "发起平安支付退款失败!";
+                }
+            } else {
+                return responseDto.getMsg();
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 微信申请退款
+     * @param orderInfo
+     * @param totalActualPrice
+     * @return
+     */
+    private String wxRefund(OrderEntity orderInfo,Double totalActualPrice){
+        WechatRefundApiResult result = WechatUtil.wxRefund(orderInfo.getMerchOrderSn().toString(), totalActualPrice,
+                orderInfo.getActualPrice().doubleValue());
+        if (result.getResult_code().equals(WechatUtil.WXTradeState.SUCCESS.getCode())) {
+            orderService.refund(orderInfo, result);
+        } else {
+            OrderRefundEntity mallOrderRefund = orderRefundService.queryObjectByOrderId(orderInfo.getId());
+            OrderRefundEntity orderRefund = new OrderRefundEntity();
+            orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
+            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);//退款记录
+            }
+            OrderExceptionRecordEntity mallOrderExceptionRecord = new OrderExceptionRecordEntity();
+            mallOrderExceptionRecord.setUserId(Integer.parseInt(orderInfo.getUserId() + ""));
+            mallOrderExceptionRecord.setOrderSn(orderInfo.getOrderSn());
+            mallOrderExceptionRecord.setExceptionStatus(Dict.exceptionStatus.item_03.getItem());
+            mallOrderExceptionRecord.setExceptionContent("退款失败" + result.getErr_code_des());
+            mallOrderExceptionRecord.setCreateTime(new Date());
+            orderExceptionRecordService.save(mallOrderExceptionRecord);
+            return result.getErr_code_des();
+        }
+        return "";
+    }
+
+    /**
+     * 微信国际申请退款
+     * @param orderInfo
+     * @param totalActualPrice
+     * @return
+     */
+    private String wxGlobalRefund(OrderEntity orderInfo,Double totalActualPrice){
+        WechatGlobalRefundApiResult result = WechatGlobalUtil.wxRefund(orderInfo.getMerchOrderSn().toString(), totalActualPrice,
+                orderInfo.getActualPrice().doubleValue());
+        OrderRefundEntity mallOrderRefund = orderRefundService.queryObjectByOrderId(orderInfo.getId());
+        if(result.getCode() != null){
+            if(result.getCode().equalsIgnoreCase("ERROR")){
+                OrderRefundEntity orderRefund = new OrderRefundEntity();
+                orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
+                orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
+                orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
+                orderRefund.setOutRefundNo(result.getOut_refund_no());
+                orderRefund.setModTime(new Date());
+                if (mallOrderRefund != null) {
+                    orderRefund.setId(mallOrderRefund.getId());
+                    orderRefundService.update(orderRefund);//退款记录
+                }
+            }
+            OrderExceptionRecordEntity mallOrderExceptionRecord = new OrderExceptionRecordEntity();
+            mallOrderExceptionRecord.setUserId(Integer.parseInt(orderInfo.getUserId() + ""));
+            mallOrderExceptionRecord.setOrderSn(orderInfo.getOrderSn());
+            mallOrderExceptionRecord.setExceptionStatus(Dict.exceptionStatus.item_03.getItem());
+            mallOrderExceptionRecord.setExceptionContent("退款失败" + result.getMessage());
+            mallOrderExceptionRecord.setCreateTime(new Date());
+            orderExceptionRecordService.save(mallOrderExceptionRecord);
+            logger.info(">>>>>>>>>>>>>>>>>>>>wxGlobalOrderQuery 微信查询接口调用失败: " + result.getMessage());
+            return result.getMessage();
+        }else {
+            OrderRefundEntity orderRefund = new OrderRefundEntity();
+            orderRefund.setOutRefundNo(result.getOut_refund_no());
+            if (mallOrderRefund != null) {//记录订单退款编号
+                orderRefund.setId(mallOrderRefund.getId());
+                orderRefundService.update(orderRefund);
+            }
+            orderService.globalRefund(orderInfo, result);
+        }
+        return "";
+    }
+    /**
+     * 订单退款请求
+     */
+    @RequiresPermissions(value = {"order:offilineRefund"})
+    @RequestMapping(value = "offilineRefund", method = RequestMethod.POST)
+    public Object offilineRefund(Long orderId) {
+        OrderEntity orderInfo = orderService.queryObject(orderId);
+        if (null == orderInfo) {
+            return R.error("订单不存在");
+        }
+        if (orderInfo.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_401.getItem()) ||
+            orderInfo.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_402.getItem())) {
+            return R.error("订单已退款");
+        }
+
+        if (orderInfo.getOrderStatus() != Integer.parseInt(Dict.orderStatus.item_0.getItem())) {
+            if (Dict.payFlag.item_cash.getItem().equals(orderInfo.getPayFlag())) {
+                //现金支付,直接修改订单状态
+                orderService.refund(orderInfo, null);
+            } else if (Dict.payFlag.item_weixin.getItem().equals(orderInfo.getPayFlag())) {
+                //微信线下扫码支付
+                WechatRefundApiResult result = WechatUtil
+                        .wxRefund(orderInfo.getOrderSnWx(), orderInfo.getActualPrice().doubleValue(),
+                                  orderInfo.getActualPrice().doubleValue());
+                if (result.getResult_code().equals(WechatUtil.WXTradeState.SUCCESS.getCode())) {
+                    orderService.refund(orderInfo, result);
+                } else {
+                    OrderRefundEntity mallOrderRefund = orderRefundService.queryObjectByOrderId(orderInfo.getId());
+                    OrderRefundEntity orderRefund = new OrderRefundEntity();
+                    orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
+                    orderRefund.setRefundMoney(BigDecimal.valueOf(orderInfo.getActualPrice().doubleValue()));
+                    orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
+                    orderRefund.setOutRefundNo(result.getOut_refund_no());
+                    orderRefund.setModTime(new Date());
+                    if (mallOrderRefund != null) {
+                        orderRefund.setId(mallOrderRefund.getId());
+                        orderRefundService.update(orderRefund);//退款记录
+                    }
+
+                    OrderExceptionRecordEntity mallOrderExceptionRecord = new OrderExceptionRecordEntity();
+                    mallOrderExceptionRecord.setUserId(Integer.parseInt(orderInfo.getUserId() + ""));
+                    mallOrderExceptionRecord.setOrderSn(orderInfo.getOrderSn());
+                    mallOrderExceptionRecord.setExceptionStatus(Dict.exceptionStatus.item_03.getItem());
+                    mallOrderExceptionRecord.setExceptionContent("退款失败" + result.getErr_code_des());
+                    mallOrderExceptionRecord.setCreateTime(new Date());
+                    orderExceptionRecordService.save(mallOrderExceptionRecord);
+
+                    return R.error(result.getErr_code_des());
+                }
+            }
+
+        }
+
+        return R.ok("退款成功");
+    }
+
+    /**
+     * 获取首页展示信息--会员购买率相关
+     *
+     * @param params
+     * @return
+     */
+    @RequestMapping("/getUserOrderInfo")
+    public R getUserOrderInfo(@RequestParam Map<String, Object> params) {
+        int result = orderService.getUserOrderInfo(params);
+
+        return R.ok().put("result", result);
+    }
+
+    @RequiresPermissions(value = {"order:orderSubmit"})
+    @RequestMapping(value = "orderSubmit", method = RequestMethod.POST)
+    @ResponseBody
+    public R orderSubmit(@RequestBody List<OfflineCartEntity> offlineCartEntityList) {
+        Map resultObj = null;
+        try {
+            SysUserEntity user = ShiroUtils.getUserEntity();
+            resultObj = orderService.orderSubmit(offlineCartEntityList, user);
+            if (((Integer) resultObj.get("errno")) != 0) {
+                return R.error((String) resultObj.get("errmsg"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return R.ok("订单提交成功");
+    }
+
+    /**
+     * 确认付款
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping("/confirmPay")
+    @RequiresPermissions("order:confirmPay")
+    public R confirmPay(@RequestBody Long id) {
+        orderService.confirmPay(id, Dict.payFlag.item_cash.getItem(), null);
+
+        return R.ok();
+    }
+
+    @RequestMapping("/offilineOrderList")
+    @RequiresPermissions("order:offilineOrderList")
+    public R offilineOrderList(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+        query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_1.getItem());
+        List<OrderEntity> orderList = orderService.queryOffilineOrderList(query);
+        int total = orderService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(orderList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    @RequestMapping("/offlineInfos/{id}")
+    @RequiresPermissions("order:offlineInfos")
+    public R queryObjectBySysUser(@PathVariable("id") Long id) {
+        OrderEntity order = orderService.queryObjectBySysUser(id);
+        List<OrderWXPayRecordEntity> payRecords = orderWXPayRecordService.getRecordsByOutTradeNo(order.getOrderSn());
+        order.setPayRecordList(payRecords);
+        return R.ok().put("order", order);
+    }
+
+
+    @RequestMapping("/wxMicropayPay")
+    @RequiresPermissions("order:wxMicropayPay")
+    public R wxMicropayPay(Long id, String auth_code) {
+        R r = null;
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if (user == null) {
+            throw new RRException("用户登录超时,请重新登录");
+        }
+        if (!user.getRoleType().equalsIgnoreCase("2")) {
+            throw new RRException("该操作只允许店员账户操作");
+        }
+        OrderEntity orderEntity = orderService.queryObject(id);
+        if (orderEntity.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_201.getItem())) {
+            throw new RRException("此订单已付款!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_301.getItem())) {
+            throw new RRException("此订单已完成!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_101.getItem())) {
+            throw new RRException("此订单已取消!");
+        }
+        if (orderEntity.getOrderStatus() == Integer.parseInt(Dict.orderStatus.item_102.getItem())) {
+            throw new RRException("此订单已删除!");
+        }
+
+        //保存支付记录
+        OrderWXPayRecordEntity orderWXPayRecordCurrent = orderWXPayRecordService.saveRecord(orderEntity);
+
+        StoreEntity store = storeService.queryObject(orderEntity.getStoreId());
+        WechatMicropayApiResult wechatMicropayApiResult = WechatUtil
+                .wxMicropay(store.getMerchName() + "-" + store.getStoreName(), orderEntity.getOrderBizType(), null,
+                            orderWXPayRecordCurrent.getOutTradeNoWX(), orderEntity.getActualPrice().doubleValue(),
+                            "127.0.0.1", auth_code);
+        orderWXPayRecordService.updateRecord(orderWXPayRecordCurrent.getId(), wechatMicropayApiResult);
+
+        //当支付成功时,修改订单,并把其他支付记录撤销
+        if (WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatMicropayApiResult.getTrade_state())) {
+            //查询当前订单所有的支付记录
+            List<OrderWXPayRecordEntity> orderWXPayRecordEntitys =
+                    orderWXPayRecordService.getRecordsByOutTradeNo(orderEntity.getOrderSn());
+            for (OrderWXPayRecordEntity orderWXPayRecordTemp : orderWXPayRecordEntitys) {
+                //查询出来的记录不等于当前记录,并且未撤销,未关闭时,撤销订单
+                if (orderWXPayRecordTemp.getId() != orderWXPayRecordCurrent.getId() &&
+                    (!WechatUtil.WXTradeState.REVOKED.getCode().equals(orderWXPayRecordTemp.getTradeState()) ||
+                     !WechatUtil.WXTradeState.CLOSED.getCode().equals(orderWXPayRecordTemp.getTradeState()))) {
+                    WechatReverseApiResult wechatReverseApiResult =
+                            WechatUtil.wxReverse(orderWXPayRecordTemp.getOutTradeNoWX());
+                    //撤销订单成功
+                    if (WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatReverseApiResult.getReturn_code()) &&
+                            WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatReverseApiResult.getResult_code())) {
+                        //调用订单查询接口
+                        WechatRefundApiResult wechatRefundApiResult =
+                                WechatUtil.wxOrderQuery(orderWXPayRecordTemp.getOutTradeNoWX());
+                        if (WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatRefundApiResult.getReturn_code()) &&
+                                WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatRefundApiResult.getResult_code())) {
+                            // 修改订单支付记录
+                            orderWXPayRecordService
+                                    .updateWXPayRecordTradeState(orderWXPayRecordTemp.getId(), wechatRefundApiResult);
+                        }
+                    }
+                }
+            }
+            orderService.confirmPay(id, Dict.payFlag.item_weixin.getItem(), orderWXPayRecordCurrent.getOutTradeNoWX());
+            r = R.ok();
+            //用户支付中
+        } else if (WechatUtil.WXTradeState.USERPAYING.getCode().equals(wechatMicropayApiResult.getTrade_state())) {
+            r = R.error(WechatUtil.WXTradeState.USERPAYING.getCodeZn() + ",稍等片刻后请刷新页面重新查看订单状态");
+            //用户支付失败
+        } else if (WechatUtil.WXTradeState.PAYERROR.getCode().equals(wechatMicropayApiResult.getTrade_state())) {
+            WechatReverseApiResult wechatReverseApiResult =
+                    WechatUtil.wxReverse(orderWXPayRecordCurrent.getOutTradeNoWX());
+            //撤销订单成功
+            if (WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatReverseApiResult.getReturn_code()) &&
+                    WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatReverseApiResult.getResult_code())) {
+                //调用订单查询接口
+                WechatRefundApiResult wechatRefundApiResult =
+                        WechatUtil.wxOrderQuery(orderWXPayRecordCurrent.getOutTradeNoWX());
+                if (WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatRefundApiResult.getReturn_code()) &&
+                        WechatUtil.WXTradeState.SUCCESS.getCode().equals(wechatRefundApiResult.getResult_code())) {
+                    // 修改订单支付记录
+                    orderWXPayRecordService
+                            .updateWXPayRecordTradeState(orderWXPayRecordCurrent.getId(), wechatRefundApiResult);
+                }
+                r = R.error(orderWXPayRecordCurrent.getErrCodeDes());
+            } else {
+                r = R.error(wechatReverseApiResult.getErr_code_des());
+            }
+
+        }
+        return r;
+    }
+}

+ 101 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderGoodsController.java

@@ -0,0 +1,101 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.OrderGoodsEntity;
+import com.kmall.admin.service.OrderGoodsService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:09
+ */
+@RestController
+@RequestMapping("ordergoods")
+public class OrderGoodsController {
+	@Autowired
+	private OrderGoodsService orderGoodsService;
+	
+	/**
+	 * 列表
+	 */
+	@RequestMapping("/list")
+	@RequiresPermissions("ordergoods:list")
+	public R list(@RequestParam Map<String, Object> params){
+		//查询列表数据
+        Query query = new Query(params);
+
+		List<OrderGoodsEntity> orderGoodsList = orderGoodsService.queryList(query);
+		int total = orderGoodsService.queryTotal(query);
+		
+		PageUtils pageUtil = new PageUtils(orderGoodsList, total, query.getLimit(), query.getPage());
+		
+		return R.ok().put("page", pageUtil);
+	}
+	
+	
+	/**
+	 * 信息
+	 */
+	@RequestMapping("/info/{id}")
+	@RequiresPermissions("ordergoods:info")
+	public R info(@PathVariable("id") Integer id){
+		OrderGoodsEntity orderGoods = orderGoodsService.queryObject(id);
+		
+		return R.ok().put("orderGoods", orderGoods);
+	}
+	
+	/**
+	 * 保存
+	 */
+	@RequestMapping("/save")
+	@RequiresPermissions("ordergoods:save")
+	public R save(@RequestBody OrderGoodsEntity orderGoods){
+		orderGoodsService.save(orderGoods);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 修改
+	 */
+	@RequestMapping("/update")
+	@RequiresPermissions("ordergoods:update")
+	public R update(@RequestBody OrderGoodsEntity orderGoods){
+		orderGoodsService.update(orderGoods);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 删除
+	 */
+	@RequestMapping("/delete")
+	@RequiresPermissions("ordergoods:delete")
+	public R delete(@RequestBody Integer[] ids){
+		orderGoodsService.deleteBatch(ids);
+		
+		return R.ok();
+	}
+
+	/**
+	 * 查看所有列表
+	 */
+	@RequestMapping("/queryAll")
+	public R queryAll(@RequestParam Map<String, Object> params) {
+
+		List<OrderGoodsEntity> list = orderGoodsService.queryList(params);
+
+		return R.ok().put("list", list);
+	}
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.OrderProcessRecordEntity;
+import com.kmall.admin.service.OrderProcessRecordService;
+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.web.bind.annotation.*;
+
+
+/**
+ * 订单流转过程记录表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-10-27 16:38:50
+ */
+@RestController
+@RequestMapping("orderprocessrecord")
+public class OrderProcessRecordController {
+    @Autowired
+    private OrderProcessRecordService orderProcessRecordService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("orderprocessrecord:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<OrderProcessRecordEntity> orderProcessRecordList = orderProcessRecordService.queryList(query);
+        int total = orderProcessRecordService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(orderProcessRecordList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("orderprocessrecord:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        OrderProcessRecordEntity orderProcessRecord = orderProcessRecordService.queryObject(id);
+
+        return R.ok().put("orderProcessRecord", orderProcessRecord);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("orderprocessrecord:save")
+    @ResponseBody
+    public R save(@RequestBody OrderProcessRecordEntity orderProcessRecord) {
+        orderProcessRecordService.save(orderProcessRecord);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("orderprocessrecord:update")
+    @ResponseBody
+    public R update(@RequestBody OrderProcessRecordEntity orderProcessRecord) {
+        orderProcessRecordService.update(orderProcessRecord);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("orderprocessrecord:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        orderProcessRecordService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<OrderProcessRecordEntity> list = orderProcessRecordService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,125 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.OrderRefundEntity;
+import com.kmall.admin.service.OrderRefundService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.service.SysUserService;
+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;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 订单退款记录表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-01 10:16:41
+ */
+@Controller
+@RequestMapping("orderrefund")
+public class OrderRefundController {
+    @Autowired
+    private OrderRefundService orderRefundService;
+    @Autowired
+    private SysUserService sysUserService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("orderrefund:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<OrderRefundEntity> orderRefundList = orderRefundService.queryList(query);
+        for (OrderRefundEntity entity: orderRefundList
+             ) {
+            if(entity.getIsOnfflineOrder().equalsIgnoreCase(Dict.isOnfflineOrder.item_1.getItem())) {
+                SysUserEntity sysUserEntity = sysUserService.queryObject(entity.getUserId().longValue());
+                entity.setUserName("操作店员:"+sysUserEntity.getUsername());
+            }
+        }
+        int total = orderRefundService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(orderRefundList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("orderrefund:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        OrderRefundEntity orderRefund = orderRefundService.queryObject(id);
+
+        if(orderRefund.getIsOnfflineOrder().equalsIgnoreCase(Dict.isOnfflineOrder.item_1.getItem())) {
+            SysUserEntity sysUserEntity = sysUserService.queryObject(orderRefund.getUserId().longValue());
+            orderRefund.setUserName("操作店员:"+sysUserEntity.getUsername());
+        }
+        return R.ok().put("orderRefund", orderRefund);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("orderrefund:save")
+    @ResponseBody
+    public R save(@RequestBody OrderRefundEntity orderRefund) {
+        orderRefundService.save(orderRefund);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("orderrefund:update")
+    @ResponseBody
+    public R update(@RequestBody OrderRefundEntity orderRefund) {
+        orderRefundService.update(orderRefund);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("orderrefund:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        orderRefundService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        List<OrderRefundEntity> list = orderRefundService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 120 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ProductController.java

@@ -0,0 +1,120 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.ProductEntity;
+import com.kmall.admin.service.GoodsSpecificationService;
+import com.kmall.admin.service.ProductService;
+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.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-30 14:31:21
+ */
+@RestController
+@RequestMapping("product")
+public class ProductController {
+    @Autowired
+    private ProductService productService;
+    @Autowired
+    private GoodsSpecificationService goodsSpecificationService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("product:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ProductEntity> productList = productService.queryList(query);
+        int total = productService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(productList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("product:info")
+    public R info(@PathVariable("id") Integer id) {
+        ProductEntity product = productService.queryObject(id);
+        return R.ok().put("product", product);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("product:save")
+    public R save(@RequestBody ProductEntity product) {
+        productService.save(product);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("product:update")
+    public R update(@RequestBody ProductEntity product) {
+        productService.update(product);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("product:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        productService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     *
+     * @param params
+     * @return
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<ProductEntity> list = productService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 根据goodsId查询商品
+     *
+     * @param goodsId
+     * @return
+     */
+    @RequestMapping("/queryByGoodsId/{goodsId}")
+    public R queryByGoodsId(@PathVariable("goodsId") String goodsId) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("goodsId", goodsId);
+        List<ProductEntity> list = productService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,127 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.ProductStoreRelaEntity;
+import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.service.ProductStoreRelaService;
+import com.kmall.admin.service.StoreService;
+import com.kmall.admin.utils.ParamUtils;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-27 19:12:46
+ */
+@Controller
+@RequestMapping("productstorerela")
+public class ProductStoreRelaController {
+    @Autowired
+    private ProductStoreRelaService productStoreRelaService;
+    @Autowired
+    private StoreService storeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ProductStoreRelaEntity> productStoreRelaList = productStoreRelaService.queryList(query);
+        int total = productStoreRelaService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(productStoreRelaList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        ProductStoreRelaEntity productStoreRela = productStoreRelaService.queryObject(id);
+
+        return R.ok().put("productStoreRela", productStoreRela);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("productstorerela:save")
+    @ResponseBody
+    public R save(@RequestBody ProductStoreRelaEntity productStoreRela) {
+
+        if (productStoreRela.getStoreId() != null) {
+            StoreEntity store = storeService.queryObject(productStoreRela.getStoreId().intValue());
+            if (store != null) {
+                productStoreRela.setMerchSn(store.getMerchSn());
+            }
+        }
+        productStoreRelaService.save(productStoreRela);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("productstorerela:update")
+    @ResponseBody
+    public R update(@RequestBody ProductStoreRelaEntity productStoreRela) {
+        if (null == productStoreRela.getProductId() || null == productStoreRela.getGoodsId() ||
+            null == productStoreRela.getStoreId()) {
+            return R.error("信息不全,保存失败");
+        }
+
+        StoreEntity store = storeService.queryObject(productStoreRela.getStoreId().intValue());
+        if (store != null) {
+            productStoreRela.setMerchSn(store.getMerchSn());
+        }
+
+        productStoreRelaService.update(productStoreRela);
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("productstorerela:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[] ids) {
+        productStoreRelaService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+
+        List<ProductStoreRelaEntity> list = productStoreRelaService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 91 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/RelatedGoodsController.java

@@ -0,0 +1,91 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.RelatedGoodsEntity;
+import com.kmall.admin.service.RelatedGoodsService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:09
+ */
+@RestController
+@RequestMapping("relatedgoods")
+public class RelatedGoodsController {
+	@Autowired
+	private RelatedGoodsService relatedGoodsService;
+	
+	/**
+	 * 列表
+	 */
+	@RequestMapping("/list")
+	@RequiresPermissions("relatedgoods:list")
+	public R list(@RequestParam Map<String, Object> params){
+		//查询列表数据
+        Query query = new Query(params);
+
+		List<RelatedGoodsEntity> relatedGoodsList = relatedGoodsService.queryList(query);
+		int total = relatedGoodsService.queryTotal(query);
+		
+		PageUtils pageUtil = new PageUtils(relatedGoodsList, total, query.getLimit(), query.getPage());
+		
+		return R.ok().put("page", pageUtil);
+	}
+	
+	
+	/**
+	 * 信息
+	 */
+	@RequestMapping("/info/{id}")
+	@RequiresPermissions("relatedgoods:info")
+	public R info(@PathVariable("id") Integer id){
+		RelatedGoodsEntity relatedGoods = relatedGoodsService.queryObject(id);
+		
+		return R.ok().put("relatedGoods", relatedGoods);
+	}
+	
+	/**
+	 * 保存
+	 */
+	@RequestMapping("/save")
+	@RequiresPermissions("relatedgoods:save")
+	public R save(@RequestBody RelatedGoodsEntity relatedGoods){
+		relatedGoodsService.save(relatedGoods);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 修改
+	 */
+	@RequestMapping("/update")
+	@RequiresPermissions("relatedgoods:update")
+	public R update(@RequestBody RelatedGoodsEntity relatedGoods){
+		relatedGoodsService.update(relatedGoods);
+		
+		return R.ok();
+	}
+	
+	/**
+	 * 删除
+	 */
+	@RequestMapping("/delete")
+	@RequiresPermissions("relatedgoods:delete")
+	public R delete(@RequestBody Integer[] ids){
+		relatedGoodsService.deleteBatch(ids);
+		
+		return R.ok();
+	}
+	
+}

+ 91 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SearchHistoryController.java

@@ -0,0 +1,91 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SearchHistoryEntity;
+import com.kmall.admin.service.SearchHistoryService;
+import com.kmall.admin.utils.ParamUtils;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:10
+ */
+@RestController
+@RequestMapping("searchhistory")
+public class SearchHistoryController {
+    @Autowired
+    private SearchHistoryService searchHistoryService;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("searchhistory:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SearchHistoryEntity> searchHistoryList = searchHistoryService.queryList(query);
+        int total = searchHistoryService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(searchHistoryList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("searchhistory:info")
+    public R info(@PathVariable("id") Integer id) {
+        SearchHistoryEntity searchHistory = searchHistoryService.queryObject(id);
+
+        return R.ok().put("searchHistory", searchHistory);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("searchhistory:save")
+    public R save(@RequestBody SearchHistoryEntity searchHistory) {
+        searchHistoryService.save(searchHistory);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("searchhistory:update")
+    public R update(@RequestBody SearchHistoryEntity searchHistory) {
+        searchHistoryService.update(searchHistory);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("searchhistory:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        searchHistoryService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/ShippingController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.ShippingEntity;
+import com.kmall.admin.service.ShippingService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-09-04 21:42:24
+ */
+@RestController
+@RequestMapping("shipping")
+public class ShippingController {
+    @Autowired
+    private ShippingService shippingService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("shipping:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<ShippingEntity> shippingList = shippingService.queryList(query);
+        int total = shippingService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(shippingList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("shipping:info")
+    public R info(@PathVariable("id") Integer id) {
+        ShippingEntity shipping = shippingService.queryObject(id);
+
+        return R.ok().put("shipping", shipping);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("shipping:save")
+    public R save(@RequestBody ShippingEntity shipping) {
+        shippingService.save(shipping);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("shipping:update")
+    public R update(@RequestBody ShippingEntity shipping) {
+        shippingService.update(shipping);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("shipping:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        shippingService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<ShippingEntity> list = shippingService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 101 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SpecificationController.java

@@ -0,0 +1,101 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SpecificationEntity;
+import com.kmall.admin.service.SpecificationService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 规格表
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:10
+ */
+@RestController
+@RequestMapping("specification")
+public class SpecificationController {
+    @Autowired
+    private SpecificationService specificationService;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("specification:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SpecificationEntity> specificationList = specificationService.queryList(query);
+        int total = specificationService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(specificationList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("specification:info")
+    public R info(@PathVariable("id") Integer id) {
+        SpecificationEntity specification = specificationService.queryObject(id);
+
+        return R.ok().put("specification", specification);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("specification:save")
+    public R save(@RequestBody SpecificationEntity specification) {
+        specificationService.save(specification);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("specification:update")
+    public R update(@RequestBody SpecificationEntity specification) {
+        specificationService.update(specification);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("specification:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        specificationService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SpecificationEntity> list = specificationService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,162 @@
+package com.kmall.admin.controller;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.entity.StoreEntity;
+import com.kmall.admin.service.StoreService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.*;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-02 00:53:32
+ */
+@Controller
+@RequestMapping("store")
+public class StoreController {
+    @Autowired
+    private StoreService storeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("store:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<StoreEntity> storeList = storeService.queryList(query);
+        int total = storeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(storeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("store:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        StoreEntity store = storeService.queryObject(id);
+
+        return R.ok().put("store", store);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("store:save")
+    @ResponseBody
+    public R save(@RequestBody StoreEntity store) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user == null) {
+            return R.error("用户登录超时,请重新登录");
+        }
+        if (user.getRoleType().equalsIgnoreCase("2")) {
+            return R.error("当前用户角色为【店员】,店员不能新增其他门店信息");
+        }
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(store);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeName", "门店名称");
+        builder.put("storeNumber", "门店编号");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+        builder.put("thirdPartyMerchName", "第三方商户名称");
+        builder.put("latitude", "纬度");
+        builder.put("longitude", "经度");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        storeService.save(store);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("store:update")
+    @ResponseBody
+    public R update(@RequestBody StoreEntity store) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        if(user == null) {
+            return R.error("用户登录超时,请重新登录");
+        }
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(store);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchSn", "商户");
+        builder.put("storeName", "门店名称");
+        builder.put("storeNumber", "门店编号");
+        builder.put("thirdPartyMerchCode", "第三方商户编号");
+        builder.put("thirdPartyMerchName", "第三方商户名称");
+        builder.put("latitude", "纬度");
+        builder.put("longitude", "经度");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        storeService.update(store);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("store:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[] ids) {
+        storeService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+
+        List<StoreEntity> list = storeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/getStoresByMerch")
+    @ResponseBody
+    public R getStoresByMerch(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "id", "merchSn", false);
+
+        List<StoreEntity> list = storeService.queryList(params);
+        return R.ok().put("list", list);
+    }
+}

+ 109 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SupplierController.java

@@ -0,0 +1,109 @@
+package com.kmall.admin.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.SupplierEntity;
+import com.kmall.admin.service.SupplierService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.api.service.common.CommonPropertiesBuilder;
+import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
+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-26 15:14:24
+ */
+@Controller
+@RequestMapping("supplier")
+public class SupplierController {
+    @Autowired
+    private SupplierService supplierService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("supplier:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SupplierEntity> supplierList = supplierService.queryList(query);
+        int total = supplierService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(supplierList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("supplier:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        SupplierEntity supplier = supplierService.queryObject(id);
+        return R.ok().put("supplier", supplier);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("supplier:save")
+    @ResponseBody
+    public R save(@RequestBody SupplierEntity supplier) {
+        supplierService.save(supplier);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("supplier:update")
+    @ResponseBody
+    public R update(@RequestBody SupplierEntity supplier) {
+        supplierService.update(supplier);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("supplier:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        supplierService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        List<SupplierEntity> list = supplierService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 100 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysConfigController.java

@@ -0,0 +1,100 @@
+package com.kmall.admin.controller;
+
+import com.kmall.common.annotation.SysLog;
+import com.kmall.common.controller.AbstractController;
+import com.kmall.common.entity.SysConfigEntity;
+import com.kmall.common.service.SysConfigService;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import com.kmall.common.validator.ValidatorUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 系统配置信息
+ *
+ * @author Scott
+ * @email
+ * @date 2016年12月4日 下午6:55:53
+ */
+@RestController
+@RequestMapping("/sys/config")
+public class SysConfigController extends AbstractController {
+    @Autowired
+    private SysConfigService sysConfigService;
+
+    /**
+     * 所有配置列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:config:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+        List<SysConfigEntity> configList = sysConfigService.queryList(query);
+        int total = sysConfigService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(configList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 配置信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:config:info")
+    public R info(@PathVariable("id") Long id) {
+        SysConfigEntity config = sysConfigService.queryObject(id);
+
+        return R.ok().put("config", config);
+    }
+
+    /**
+     * 保存配置
+     */
+    @SysLog("保存配置")
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:config:save")
+    public R save(@RequestBody SysConfigEntity config) {
+        ValidatorUtils.validateEntity(config);
+
+        sysConfigService.save(config);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改配置
+     */
+    @SysLog("修改配置")
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:config:update")
+    public R update(@RequestBody SysConfigEntity config) {
+        ValidatorUtils.validateEntity(config);
+
+        sysConfigService.update(config);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除配置
+     */
+    @SysLog("删除配置")
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:config:delete")
+    public R delete(@RequestBody Long[] ids) {
+        sysConfigService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+}

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

@@ -0,0 +1,118 @@
+package com.kmall.admin.controller;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.SysCusNationCodeEntity;
+import com.kmall.admin.service.SysCusNationCodeService;
+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;
+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) {
+
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        sysCusNationCode.setCreaterSn(user.getUserId().toString());
+        sysCusNationCode.setCreateTime(new Date());
+        sysCusNationCode.setModerSn(user.getUserId().toString());
+        sysCusNationCode.setModTime(new Date());
+
+        sysCusNationCodeService.save(sysCusNationCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("syscusnationcode:update")
+    @ResponseBody
+    public R update(@RequestBody SysCusNationCodeEntity sysCusNationCode) {
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        sysCusNationCode.setModerSn(user.getUserId().toString());
+        sysCusNationCode.setModTime(new Date());
+        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);
+    }
+}

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

@@ -0,0 +1,121 @@
+package com.kmall.admin.controller;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.SysCusUnitCodeEntity;
+import com.kmall.admin.service.SysCusUnitCodeService;
+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;
+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) {
+
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        sysCusUnitCode.setCreaterSn(user.getUserId().toString());
+        sysCusUnitCode.setCreateTime(new Date());
+        sysCusUnitCode.setModerSn(user.getUserId().toString());
+        sysCusUnitCode.setModTime(new Date());
+
+        sysCusUnitCodeService.save(sysCusUnitCode);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("syscusunitcode:update")
+    @ResponseBody
+    public R update(@RequestBody SysCusUnitCodeEntity sysCusUnitCode) {
+
+        SysUserEntity user = ShiroUtils.getUserEntity();
+        sysCusUnitCode.setModerSn(user.getUserId().toString());
+        sysCusUnitCode.setModTime(new Date());
+
+        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);
+    }
+}

+ 139 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysDeptController.java

@@ -0,0 +1,139 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SysDeptEntity;
+import com.kmall.admin.service.SysDeptService;
+import com.kmall.common.controller.AbstractController;
+import com.kmall.common.utils.Constant;
+import com.kmall.common.utils.R;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 部门管理
+ *
+ * @author liepngjun
+ * @email
+ * @date 2017-09-17 23:58:47
+ */
+@RestController
+@RequestMapping("/sys/dept")
+public class SysDeptController extends AbstractController {
+    @Autowired
+    private SysDeptService sysDeptService;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:dept:list")
+    public R list() {
+        Map<String, Object> map = new HashMap<>();
+        //如果不是超级管理员,则只能查询本部门及子部门数据
+        if (getUserId() != Constant.SUPER_ADMIN) {
+            map.put("deptFilter", sysDeptService.getSubDeptIdList(getDeptId()));
+        }
+        List<SysDeptEntity> deptList = sysDeptService.queryList(map);
+        return R.ok().put("list", deptList);
+    }
+
+    /**
+     * 选择部门(添加、修改菜单)
+     */
+    @RequestMapping("/select")
+    @RequiresPermissions("sys:dept:select")
+    public R select() {
+        Map<String, Object> map = new HashMap<>();
+        //如果不是超级管理员,则只能查询本部门及子部门数据
+        if (getUserId() != Constant.SUPER_ADMIN) {
+            map.put("deptFilter", sysDeptService.getSubDeptIdList(getDeptId()));
+        }
+        List<SysDeptEntity> deptList = sysDeptService.queryList(map);
+
+        //添加一级部门
+        if (getUserId() == Constant.SUPER_ADMIN) {
+            SysDeptEntity root = new SysDeptEntity();
+            root.setDeptId(0L);
+            root.setName("一级部门");
+            root.setParentId(-1L);
+            root.setOpen(true);
+            deptList.add(root);
+        }
+
+        return R.ok().put("deptList", deptList);
+    }
+
+    /**
+     * 上级部门Id(管理员则为0)
+     */
+    @RequestMapping("/info")
+    @RequiresPermissions("sys:dept:list")
+    public R info() {
+        long deptId = 0;
+        if (getUserId() != Constant.SUPER_ADMIN) {
+            SysDeptEntity dept = sysDeptService.queryObject(getDeptId());
+            deptId = dept.getParentId();
+        }
+
+        return R.ok().put("deptId", deptId);
+    }
+
+    /**
+     * 信息
+     */
+    @RequestMapping("/info/{deptId}")
+    @RequiresPermissions("sys:dept:info")
+    public R info(@PathVariable("deptId") Long deptId) {
+        SysDeptEntity dept = sysDeptService.queryObject(deptId);
+
+        return R.ok().put("dept", dept);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:dept:save")
+    public R save(@RequestBody SysDeptEntity dept) {
+        sysDeptService.save(dept);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:dept:update")
+    public R update(@RequestBody SysDeptEntity dept) {
+        sysDeptService.update(dept);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:dept:delete")
+    public R delete(long deptId) {
+        //判断是否有子部门
+        List<Long> deptList = sysDeptService.queryDetpIdList(deptId);
+        if (deptList.size() > 0) {
+            return R.error("请先删除子部门");
+        }
+
+        sysDeptService.delete(deptId);
+
+        return R.ok();
+    }
+
+}

+ 49 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysLogController.java

@@ -0,0 +1,49 @@
+package com.kmall.admin.controller;
+
+import com.kmall.common.entity.SysLogEntity;
+import com.kmall.common.service.SysLogService;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 系统日志
+ *
+ * @author Scott
+ * @email
+ * @date 2017-03-08 10:40:56
+ */
+@Controller
+@RequestMapping("/sys/log")
+public class SysLogController {
+    @Autowired
+    private SysLogService sysLogService;
+
+    /**
+     * 列表
+     */
+    @ResponseBody
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:log:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+        List<SysLogEntity> sysLogList = sysLogService.queryList(query);
+        int total = sysLogService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysLogList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+}

+ 113 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysMacroController.java

@@ -0,0 +1,113 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SysMacroEntity;
+import com.kmall.admin.service.SysMacroService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 通用字典表Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-22 11:48:16
+ */
+@RestController
+@RequestMapping("sys/macro")
+public class SysMacroController {
+    @Autowired
+    private SysMacroService sysMacroService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:macro:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysMacroEntity> sysMacroList = sysMacroService.queryList(query);
+        int total = sysMacroService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysMacroList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{macroId}")
+    @RequiresPermissions("sys:macro:info")
+    public R info(@PathVariable("macroId") Long macroId) {
+        SysMacroEntity sysMacro = sysMacroService.queryObject(macroId);
+
+        return R.ok().put("macro", sysMacro);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:macro:save")
+    public R save(@RequestBody SysMacroEntity sysMacro) {
+        sysMacroService.save(sysMacro);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:macro:update")
+    public R update(@RequestBody SysMacroEntity sysMacro) {
+        sysMacroService.update(sysMacro);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:macro:delete")
+    public R delete(@RequestBody Long[] macroIds) {
+        sysMacroService.deleteBatch(macroIds);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysMacroEntity> list = sysMacroService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查询数据字典
+     *
+     * @param value
+     * @return
+     */
+    @RequestMapping("/queryMacrosByValue")
+    public R queryMacrosByValue(@RequestParam String value) {
+
+        List<SysMacroEntity> list = sysMacroService.queryMacrosByValue(value);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SysNoticeEntity;
+import com.kmall.admin.service.SysNoticeService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 通知Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-11-16 22:00:56
+ */
+@Controller
+@RequestMapping("sys/notice")
+public class SysNoticeController {
+    @Autowired
+    private SysNoticeService sysNoticeService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:notice:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysNoticeEntity> sysNoticeList = sysNoticeService.queryList(query);
+        int total = sysNoticeService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysNoticeList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:notice:info")
+    @ResponseBody
+    public R info(@PathVariable("id") String id) {
+        SysNoticeEntity sysNotice = sysNoticeService.queryObject(id);
+
+        return R.ok().put("sysNotice", sysNotice);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:notice:save")
+    @ResponseBody
+    public R save(@RequestBody SysNoticeEntity sysNotice) {
+        sysNoticeService.save(sysNotice);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:notice:update")
+    @ResponseBody
+    public R update(@RequestBody SysNoticeEntity sysNotice) {
+        sysNoticeService.update(sysNotice);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:notice:delete")
+    @ResponseBody
+    public R delete(@RequestBody String[]ids) {
+        sysNoticeService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysNoticeEntity> list = sysNoticeService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SysNoticeUserEntity;
+import com.kmall.admin.service.SysNoticeUserService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 通知和用户关系表Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-11-16 22:00:57
+ */
+@Controller
+@RequestMapping("sys/noticeuser")
+public class SysNoticeUserController {
+    @Autowired
+    private SysNoticeUserService sysNoticeUserService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:noticeuser:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysNoticeUserEntity> sysNoticeUserList = sysNoticeUserService.queryList(query);
+        int total = sysNoticeUserService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysNoticeUserList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:noticeuser:info")
+    @ResponseBody
+    public R info(@PathVariable("id") String id) {
+        SysNoticeUserEntity sysNoticeUser = sysNoticeUserService.queryObject(id);
+
+        return R.ok().put("sysNoticeUser", sysNoticeUser);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:noticeuser:save")
+    @ResponseBody
+    public R save(@RequestBody SysNoticeUserEntity sysNoticeUser) {
+        sysNoticeUserService.save(sysNoticeUser);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:noticeuser:update")
+    @ResponseBody
+    public R update(@RequestBody SysNoticeUserEntity sysNoticeUser) {
+        sysNoticeUserService.update(sysNoticeUser);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:noticeuser:delete")
+    @ResponseBody
+    public R delete(@RequestBody String[]ids) {
+        sysNoticeUserService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysNoticeUserEntity> list = sysNoticeUserService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 154 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java

@@ -0,0 +1,154 @@
+package com.kmall.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.kmall.admin.entity.SysOssEntity;
+import com.kmall.common.fileserver.util.FileManager;
+import com.kmall.common.oss.CloudStorageConfig;
+import com.kmall.common.oss.OSSFactory;
+import com.kmall.common.service.SysConfigService;
+import com.kmall.admin.service.SysOssService;
+import com.kmall.common.utils.*;
+import com.kmall.common.validator.ValidatorUtils;
+import com.kmall.common.validator.group.AliyunGroup;
+import com.kmall.common.validator.group.QcloudGroup;
+import com.kmall.common.validator.group.QiniuGroup;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 文件上传
+ *
+ * @author Scott
+ * @email
+ * @date 2017-03-25 12:13:26
+ */
+@RestController
+@RequestMapping("sys/oss")
+public class SysOssController {
+    @Autowired
+    private SysOssService sysOssService;
+    @Autowired
+    private SysConfigService sysConfigService;
+
+    private final static String KEY = ConfigConstant.CLOUD_STORAGE_CONFIG_KEY;
+
+    /**
+     * 列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:oss:all")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+        List<SysOssEntity> sysOssList = sysOssService.queryList(query);
+        int total = sysOssService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysOssList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 云存储配置信息
+     */
+    @RequestMapping("/config")
+    @RequiresPermissions("sys:oss:all")
+    public R config() {
+        CloudStorageConfig config = sysConfigService.getConfigObject(KEY, CloudStorageConfig.class);
+
+        return R.ok().put("config", config);
+    }
+
+
+    /**
+     * 保存云存储配置信息
+     */
+    @RequestMapping("/saveConfig")
+    @RequiresPermissions("sys:oss:all")
+    public R saveConfig(@RequestBody CloudStorageConfig config) {
+        //校验类型
+        ValidatorUtils.validateEntity(config);
+
+        if (config.getType() == Constant.CloudService.QINIU.getValue()) {
+            //校验七牛数据
+            ValidatorUtils.validateEntity(config, QiniuGroup.class);
+        } else if (config.getType() == Constant.CloudService.ALIYUN.getValue()) {
+            //校验阿里云数据
+            ValidatorUtils.validateEntity(config, AliyunGroup.class);
+        } else if (config.getType() == Constant.CloudService.QCLOUD.getValue()) {
+            //校验腾讯云数据
+            ValidatorUtils.validateEntity(config, QcloudGroup.class);
+        }
+
+
+        sysConfigService.updateValueByKey(KEY, JSON.toJSONString(config));
+
+        return R.ok();
+    }
+
+
+    /**
+     * 上传文件
+     */
+    @RequestMapping("/upload")
+    @RequiresPermissions("sys:oss:all")
+    public R upload(@RequestParam("file") MultipartFile file) throws Exception {
+        if (file.isEmpty()) {
+            throw new RRException("上传文件不能为空");
+        }
+        //上传文件
+        String url = FileManager.upload(file);
+
+        //保存文件信息
+        SysOssEntity ossEntity = new SysOssEntity();
+        ossEntity.setUrl(url);
+        ossEntity.setCreateDate(new Date());
+        sysOssService.save(ossEntity);
+
+        R r = new R();
+        r.put("url", url);
+        r.put("link", url);
+        return r;
+    }
+
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:oss:all")
+    public R delete(@RequestBody Long[] ids) {
+        sysOssService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查询所有列表
+     */
+    @RequestMapping("/queryAll")
+    public List<String> queryAll(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        List<SysOssEntity> sysOssList = sysOssService.queryList(params);
+
+        List<String> list = new ArrayList<>();
+        if (null != sysOssList && sysOssList.size() > 0) {
+            for (SysOssEntity item : sysOssList) {
+                list.add(item.getUrl());
+            }
+        }
+        return list;
+    }
+}

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysPageController.java

@@ -0,0 +1,22 @@
+package com.kmall.admin.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * 系统页面视图
+ *
+ * @author Scott
+ * @email
+ * @date 2016年11月24日 下午11:05:27
+ */
+@Controller
+public class SysPageController {
+
+    @RequestMapping("{module}/{url}.html")
+    public String page(@PathVariable("module") String module, @PathVariable("url") String url) {
+        return module + "/" + url + ".html";
+    }
+
+}

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

@@ -0,0 +1,106 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.SysPrinterEntity;
+import com.kmall.admin.service.SysPrinterService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 飞鸽打印机Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-02 00:41:31
+ */
+@Controller
+@RequestMapping("sys/printer")
+public class SysPrinterController {
+    @Autowired
+    private SysPrinterService sysPrinterService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:printer:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysPrinterEntity> sysPrinterList = sysPrinterService.queryList(query);
+        int total = sysPrinterService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(sysPrinterList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:printer:info")
+    @ResponseBody
+    public R info(@PathVariable("id") Integer id) {
+        SysPrinterEntity sysPrinter = sysPrinterService.queryObject(id);
+
+        return R.ok().put("sysPrinter", sysPrinter);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:printer:save")
+    @ResponseBody
+    public R save(@RequestBody SysPrinterEntity sysPrinter) {
+        sysPrinterService.save(sysPrinter);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:printer:update")
+    @ResponseBody
+    public R update(@RequestBody SysPrinterEntity sysPrinter) {
+        sysPrinterService.update(sysPrinter);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:printer:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]ids) {
+        sysPrinterService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<SysPrinterEntity> list = sysPrinterService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 168 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysRegionController.java

@@ -0,0 +1,168 @@
+package com.kmall.admin.controller;
+
+import com.kmall.common.cache.RegionCacheUtil;
+import com.kmall.common.entity.SysRegionEntity;
+import com.kmall.admin.service.SysRegionService;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import com.kmall.common.utils.TreeUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-16 21:19:31
+ */
+@RestController
+@RequestMapping("sys/region")
+public class SysRegionController {
+    @Autowired
+    private SysRegionService sysRegionService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:region:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysRegionEntity> regionList = sysRegionService.queryList(query);
+        int total = sysRegionService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(regionList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:region:info")
+    public R info(@PathVariable("id") Integer id) {
+        SysRegionEntity region = sysRegionService.queryObject(id);
+
+        return R.ok().put("region", region);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:region:save")
+    public R save(@RequestBody SysRegionEntity region) {
+        sysRegionService.save(region);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:region:update")
+    public R update(@RequestBody SysRegionEntity region) {
+        sysRegionService.update(region);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:region:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        sysRegionService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查询所有国家
+     *
+     * @return
+     */
+    @RequestMapping("/getAllCountry")
+    public R getAllCountry() {
+        List<SysRegionEntity> list = RegionCacheUtil.getAllCountry();
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查询所有省份
+     *
+     * @return
+     */
+    @RequestMapping("/getAllProvice")
+    public R getAllProvice(@RequestParam(required = false) Integer areaId) {
+        List<SysRegionEntity> list = RegionCacheUtil.getAllProviceByParentId(areaId);
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查询所有城市
+     *
+     * @return
+     */
+    @RequestMapping("/getAllCity")
+    public R getAllCity(@RequestParam(required = false) Integer areaId) {
+        List<SysRegionEntity> list = RegionCacheUtil.getChildrenCity(areaId);
+        return R.ok().put("list", list);
+    }
+
+
+    /**
+     * 查询所有区县
+     *
+     * @return
+     */
+    @RequestMapping("/getChildrenDistrict")
+    public R getChildrenDistrict(@RequestParam(required = false) Integer areaId) {
+        List<SysRegionEntity> list = RegionCacheUtil.getChildrenDistrict(areaId);
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 查看信息(全部加载页面渲染太慢!)
+     */
+    @RequestMapping("/getAreaTree")
+    public R getAreaTree() {
+        List<SysRegionEntity> list = RegionCacheUtil.sysRegionEntityList;
+        for (SysRegionEntity sysRegionEntity : list) {
+            sysRegionEntity.setValue(sysRegionEntity.getId() + "");
+            sysRegionEntity.setLabel(sysRegionEntity.getName());
+        }
+        List<SysRegionEntity> node = TreeUtils.factorTree(list);
+
+        return R.ok().put("node", node);
+    }
+
+    @RequestMapping("/getAreaByType")
+    public R getAreaByType(@RequestParam(required = false) Integer type) {
+
+        List<SysRegionEntity> list = new ArrayList<>();
+        if (type.equals(0)) {
+
+        } else if (type.equals(1)) {//省份
+            list = RegionCacheUtil.getAllCountry();
+        } else if (type.equals(2)) {
+            list = RegionCacheUtil.getAllProvice();
+        } else if (type.equals(3)) {
+            list = RegionCacheUtil.getAllCity();
+        }
+        return R.ok().put("list", list);
+    }
+}

+ 145 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysSmsLogController.java

@@ -0,0 +1,145 @@
+package com.kmall.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.entity.SmsConfig;
+import com.kmall.common.entity.SysSmsLogEntity;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.service.SysConfigService;
+import com.kmall.common.service.SysSmsLogService;
+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.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @date 2017-12-16 23:38:05
+ */
+@RestController
+@RequestMapping("/sys/smslog")
+public class SysSmsLogController {
+    @Autowired
+    private SysSmsLogService smsLogService;
+    @Autowired
+    private SysConfigService sysConfigService;
+
+    private final static String KEY = ConfigConstant.SMS_CONFIG_KEY;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("sys:smslog:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<SysSmsLogEntity> smsLogList = smsLogService.queryList(query);
+        int total = smsLogService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(smsLogList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("sys:smslog:info")
+    @ResponseBody
+    public R info(@PathVariable("id") String id) {
+        SysSmsLogEntity smsLog = smsLogService.queryObject(id);
+
+        return R.ok().put("smsLog", smsLog);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("sys:smslog:save")
+    @ResponseBody
+    public R save(@RequestBody SysSmsLogEntity smsLog) {
+        smsLogService.save(smsLog);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("sys:smslog:update")
+    @ResponseBody
+    public R update(@RequestBody SysSmsLogEntity smsLog) {
+        smsLogService.update(smsLog);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("sys:smslog:delete")
+    @ResponseBody
+    public R delete(@RequestBody String[] ids) {
+        smsLogService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+
+        List<SysSmsLogEntity> list = smsLogService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+
+    /**
+     * 短信配置信息
+     */
+    @RequestMapping("/config")
+    public R config() {
+        SmsConfig config = sysConfigService.getConfigObject(KEY, SmsConfig.class);
+
+        return R.ok().put("config", config);
+    }
+
+    /**
+     * 保存短信配置信息
+     */
+    @RequestMapping("/saveConfig")
+    public R saveConfig(@RequestBody SmsConfig config) {
+        sysConfigService.updateValueByKey(KEY, JSON.toJSONString(config));
+        return R.ok();
+    }
+
+    /**
+     * 发送短信
+     */
+    @RequestMapping("/sendSms")
+    @ResponseBody
+    public R sendSms(@RequestBody SysSmsLogEntity smsLog) {
+        SysSmsLogEntity sysSmsLogEntity = smsLogService.sendSms(smsLog);
+        return R.ok().put("result", sysSmsLogEntity);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/TopicCategoryController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.TopicCategoryEntity;
+import com.kmall.admin.service.TopicCategoryService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-20 15:41:56
+ */
+@RestController
+@RequestMapping("topiccategory")
+public class TopicCategoryController {
+    @Autowired
+    private TopicCategoryService topicCategoryService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("topiccategory:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<TopicCategoryEntity> topicCategoryList = topicCategoryService.queryList(query);
+        int total = topicCategoryService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(topicCategoryList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("topiccategory:info")
+    public R info(@PathVariable("id") Integer id) {
+        TopicCategoryEntity topicCategory = topicCategoryService.queryObject(id);
+
+        return R.ok().put("topicCategory", topicCategory);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("topiccategory:save")
+    public R save(@RequestBody TopicCategoryEntity topicCategory) {
+        topicCategoryService.save(topicCategory);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("topiccategory:update")
+    public R update(@RequestBody TopicCategoryEntity topicCategory) {
+        topicCategoryService.update(topicCategory);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("topiccategory:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        topicCategoryService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<TopicCategoryEntity> list = topicCategoryService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 99 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/TopicController.java

@@ -0,0 +1,99 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.TopicEntity;
+import com.kmall.admin.service.TopicService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-20 14:10:08
+ */
+@RestController
+@RequestMapping("topic")
+public class TopicController {
+    @Autowired
+    private TopicService topicService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("topic:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<TopicEntity> topicList = topicService.queryList(query);
+        int total = topicService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(topicList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("topic:info")
+    public R info(@PathVariable("id") Integer id) {
+        TopicEntity topic = topicService.queryObject(id);
+
+        return R.ok().put("topic", topic);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("topic:save")
+    public R save(@RequestBody TopicEntity topic) {
+        topicService.save(topic);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("topic:update")
+    public R update(@RequestBody TopicEntity topic) {
+        topicService.update(topic);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("topic:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        topicService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<TopicEntity> list = topicService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 153 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/UserController.java

@@ -0,0 +1,153 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.UserEntity;
+import com.kmall.admin.service.UserService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.entity.SysUserEntity;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import com.kmall.common.utils.ShiroUtils;
+import com.kmall.common.utils.excel.ExcelExport;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-16 15:02:28
+ */
+@RestController
+@RequestMapping("user")
+public class UserController {
+    @Autowired
+    private UserService userService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("user:list")
+    public R list(@RequestParam Map<String, Object> params) {
+
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<UserEntity> userList = userService.queryList(query);
+        int total = userService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(userList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("user:info")
+    public R info(@PathVariable("id") Integer id) {
+        UserEntity user = userService.queryObject(id);
+
+        return R.ok().put("user", user);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("user:save")
+    public R save(@RequestBody UserEntity user) {
+        userService.save(user);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("user:update")
+    public R update(@RequestBody UserEntity user) {
+        userService.update(user);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("user:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        userService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<UserEntity> userList = userService.queryList(params);
+
+        return R.ok().put("list", userList);
+    }
+
+    /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        int sum = userService.queryTotal(params);
+
+        return R.ok().put("userSum", sum);
+    }
+
+    /**
+     * 导出会员
+     */
+    @RequestMapping("/export")
+    @RequiresPermissions("user:export")
+    public R export(@RequestParam Map<String, Object> params, HttpServletResponse response) {
+
+        List<UserEntity> userList = userService.queryList(params);
+
+        ExcelExport ee = new ExcelExport("会员列表");
+
+        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);
+            }
+        }
+
+        ee.addSheetByMap("会员", list, header);
+        ee.export(response);
+        return R.ok();
+    }
+
+}

+ 98 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/UserCouponController.java

@@ -0,0 +1,98 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.UserCouponEntity;
+import com.kmall.admin.service.UserCouponService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 15:40:33
+ */
+@RestController
+@RequestMapping("usercoupon")
+public class UserCouponController {
+    @Autowired
+    private UserCouponService userCouponService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<UserCouponEntity> userCouponList = userCouponService.queryList(query);
+        int total = userCouponService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(userCouponList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("usercoupon:info")
+    public R info(@PathVariable("id") Integer id) {
+        UserCouponEntity userCoupon = userCouponService.queryObject(id);
+
+        return R.ok().put("userCoupon", userCoupon);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("usercoupon:save")
+    public R save(@RequestBody UserCouponEntity userCoupon) {
+        userCouponService.save(userCoupon);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("usercoupon:update")
+    public R update(@RequestBody UserCouponEntity userCoupon) {
+        userCouponService.update(userCoupon);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("usercoupon:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        userCouponService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<UserCouponEntity> list = userCouponService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 100 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/UserLevelController.java

@@ -0,0 +1,100 @@
+package com.kmall.admin.controller;
+
+import com.kmall.admin.entity.UserLevelEntity;
+import com.kmall.admin.service.UserLevelService;
+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.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Controller
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-16 16:52:22
+ */
+@RestController
+@RequestMapping("userlevel")
+public class UserLevelController {
+    @Autowired
+    private UserLevelService userLevelService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @RequiresPermissions("userlevel:list")
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<UserLevelEntity> userLevelList = userLevelService.queryList(query);
+        int total = userLevelService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(userLevelList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{id}")
+    @RequiresPermissions("userlevel:info")
+    public R info(@PathVariable("id") Integer id) {
+        UserLevelEntity userLevel = userLevelService.queryObject(id);
+
+        return R.ok().put("userLevel", userLevel);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @RequiresPermissions("userlevel:save")
+    public R save(@RequestBody UserLevelEntity userLevel) {
+        userLevelService.save(userLevel);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @RequiresPermissions("userlevel:update")
+    public R update(@RequestBody UserLevelEntity userLevel) {
+        userLevelService.update(userLevel);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @RequiresPermissions("userlevel:delete")
+    public R delete(@RequestBody Integer[] ids) {
+        userLevelService.deleteBatch(ids);
+
+        return R.ok();
+    }
+
+    /**
+     * 查询所有数据
+     *
+     * @return
+     */
+    @RequestMapping("queryAll")
+    public R queryAll(@RequestParam Map<String, Object> params) {
+        List<UserLevelEntity> userLevelList = userLevelService.queryList(params);
+        return R.ok().put("list", userLevelList);
+    }
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.AdEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 09:37:35
+ */
+public interface AdDao extends BaseDao<AdEntity> {
+
+}

+ 14 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/AdPositionDao.java

@@ -0,0 +1,14 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.AdPositionEntity;
+import com.kmall.common.dao.BaseDao;
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 12:02:42
+ */
+public interface AdPositionDao extends BaseDao<AdPositionEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.AddressEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-16 17:22:46
+ */
+public interface AddressDao extends BaseDao<AddressEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.AttributeCategoryEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-17 16:13:27
+ */
+public interface AttributeCategoryDao extends BaseDao<AttributeCategoryEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.AttributeEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-17 16:48:17
+ */
+public interface AttributeDao extends BaseDao<AttributeEntity> {
+
+}

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

@@ -0,0 +1,18 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.BrandEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 17:59:15
+ */
+public interface BrandDao extends BaseDao<BrandEntity> {
+    BrandEntity queryObjectByName(@Param("brandName")String brandName,@Param("merchSn")String merchSn);
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CartEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:06
+ */
+public interface CartDao extends BaseDao<CartEntity> {
+	
+}

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

@@ -0,0 +1,19 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CategoryEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-21 15:32:31
+ */
+public interface CategoryDao extends BaseDao<CategoryEntity> {
+    CategoryEntity queryObjectByName(@Param("cateGoryName") String cateGoryName,@Param("merchSn")String merchSn);
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.ChannelEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-22 19:19:56
+ */
+public interface ChannelDao extends BaseDao<ChannelEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CollectEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:06
+ */
+public interface CollectDao extends BaseDao<CollectEntity> {
+	
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CommentEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-28 17:03:40
+ */
+public interface CommentDao extends BaseDao<CommentEntity> {
+
+}

+ 21 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/CommentPictureDao.java

@@ -0,0 +1,21 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CommentPictureEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 评价图片Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-29 14:45:55
+ */
+public interface CommentPictureDao extends BaseDao<CommentPictureEntity> {
+    /**
+     * 根据commentId删除
+     *
+     * @param commentId
+     * @return
+     */
+    int deleteByCommentId(Integer commentId);
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CouponEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-19 12:53:26
+ */
+public interface CouponDao extends BaseDao<CouponEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.CouponGoodsEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 优惠券关联商品Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-29 21:50:17
+ */
+public interface CouponGoodsDao extends BaseDao<CouponGoodsEntity> {
+
+}

+ 18 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ExportExceptionDataDao.java

@@ -0,0 +1,18 @@
+package com.kmall.admin.dao;
+
+
+import com.kmall.admin.entity.ExportExceptionDataEntity;
+import com.kmall.common.dao.BaseDao;
+import org.springframework.stereotype.Component;
+
+/**
+ * 数据导入异常数据记录Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-07 09:41:15
+ */
+@Component
+public interface ExportExceptionDataDao extends BaseDao<ExportExceptionDataEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.FeedbackEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 15:03:25
+ */
+public interface FeedbackDao extends BaseDao<FeedbackEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.FootprintEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 
+ * 
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:08
+ */
+public interface FootprintDao extends BaseDao<FootprintEntity> {
+	
+}

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

@@ -0,0 +1,24 @@
+package com.kmall.admin.dao;
+
+
+import com.kmall.admin.entity.FreightEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-10-22 15:18:16
+ */
+public interface FreightDao extends BaseDao<FreightEntity> {
+    Integer queryMaxId();
+
+    List<FreightEntity> queryEntity(Map<String, Object> map);
+
+    FreightEntity queryObjectByName(@Param("defaultFreight")String defaultFreight,@Param("merchSn")String merchSn);
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.FreightItemEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-10-22 15:18:16
+ */
+public interface FreightItemDao extends BaseDao<FreightItemEntity> {
+    int deleteByFreId(Integer freId);
+}

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsAttributeDao.java

@@ -0,0 +1,22 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsAttributeEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:08
+ */
+public interface GoodsAttributeDao extends BaseDao<GoodsAttributeEntity> {
+
+    int updateByGoodsIdAttributeId(GoodsAttributeEntity goodsAttributeEntity);
+
+    /**
+     * 根据商品ID删除
+     *
+     * @param goodsId
+     * @return
+     */
+    int deleteByGoodsId(Long goodsId);
+}

+ 27 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -0,0 +1,27 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-21 21:19:49
+ */
+public interface GoodsDao extends BaseDao<GoodsEntity> {
+    Long queryMaxId();
+
+    GoodsEntity queryObjectBySn(String goodsSn);
+
+    GoodsEntity queryObjectByProdBarcodeAndBizType(String goodsSn);
+
+    List<GoodsEntity> querySame(Map<String, Object> map);
+
+    GoodsEntity queryObjectByProdBarcode(@Param("prodBarcode") String prodBarcode, @Param("merchSn") String merchSn,@Param("goodsId")Long id);
+}

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsGalleryDao.java

@@ -0,0 +1,22 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsGalleryEntity;
+import com.kmall.common.dao.BaseDao;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 14:41:43
+ */
+public interface GoodsGalleryDao extends BaseDao<GoodsGalleryEntity> {
+    int deleteByGoodsId(Long goodsId);
+
+    GoodsGalleryEntity queryVideoObjectByGoodId(Long goodId);
+
+    List<GoodsGalleryEntity> queryObjectByGoodId(Long goodId);
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsGroupEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 团购Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-09-06 17:18:30
+ */
+public interface GoodsGroupDao extends BaseDao<GoodsGroupEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsGroupOpenEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-10-23 22:06:59
+ */
+public interface GoodsGroupOpenDao extends BaseDao<GoodsGroupOpenEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsGroupOpenDetailEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2018-05-17 14:04:43
+ */
+public interface GoodsGroupOpenDetailDao extends BaseDao<GoodsGroupOpenDetailEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsIssueEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-23 14:12:34
+ */
+public interface GoodsIssueDao extends BaseDao<GoodsIssueEntity> {
+
+}

+ 23 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsSpecificationDao.java

@@ -0,0 +1,23 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.GoodsSpecificationEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 商品对应规格表值表Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-31 11:15:55
+ */
+public interface GoodsSpecificationDao extends BaseDao<GoodsSpecificationEntity> {
+    /**
+     * 根据商品ID删除
+     *
+     * @param goodsId
+     * @return
+     */
+    int deleteByGoodsId(Long goodsId);
+
+    GoodsSpecificationEntity queryByGoodsId(Long goodsId);
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.HelpIssueEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-01 21:09:54
+ */
+public interface HelpIssueDao extends BaseDao<HelpIssueEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.HelpTypeEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-12-01 21:09:55
+ */
+public interface HelpTypeDao extends BaseDao<HelpTypeEntity> {
+
+}

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

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.KeywordsEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * 热闹关键词表Dao
+ *
+ * @author Scott
+ * @email
+ * @date 2017-08-25 21:23:41
+ */
+public interface KeywordsDao extends BaseDao<KeywordsEntity> {
+
+}

+ 23 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/MerchDao.java

@@ -0,0 +1,23 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.MerchEntity;
+import com.kmall.common.dao.BaseDao;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-12-06 09:41:34
+ */
+public interface MerchDao
+        extends BaseDao<MerchEntity> {
+
+    /**
+     * 根据商户编号查询商户信息
+     *
+     * @param merchSn 商户编号
+     * @return 商户信息
+     */
+    MerchEntity findByMerchSn(String merchSn);
+}

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

@@ -0,0 +1,25 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.OfflineCartEntity;
+import com.kmall.common.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2018-11-29 15:14:59
+ */
+public interface OfflineCartDao extends BaseDao<OfflineCartEntity> {
+
+    OfflineCartEntity queryObjectByGoodsIdAndType(@Param("goodsId") Integer goodsId, @Param("userId")Long userId);
+
+    List<OfflineCartEntity> queryOfflineCartByBizType(Map<String, Object> map);
+
+    int deleteByUserId(@Param("userId")long userId);
+
+}

+ 73 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java

@@ -0,0 +1,73 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.OrderEntity;
+import org.apache.ibatis.annotations.Param;
+import com.kmall.common.dao.BaseDao;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Scott
+ * @email
+ * @date 2017-08-13 10:41:09
+ */
+public interface OrderDao extends BaseDao<OrderEntity> {
+    void riderOrderUpdate(OrderEntity orderVo);
+
+    /**
+     * 获取活动Id
+     *
+     * @param activityId
+     */
+    OrderEntity queryObjectByActivityId(@Param("activityId") Long activityId, @Param("orderType") Integer orderType);
+
+    OrderEntity queryObjectBySysUser(Long id);
+    /**
+     * 已付款订单会员数
+     *
+     * @return
+     */
+    int getYfkOrderUserSum();
+
+    /**
+     * 有订单会员数
+     *
+     * @return
+     */
+    int getOderUserSum();
+
+    /**
+     * 今日订单数
+     *
+     * @return
+     */
+    int getTodayUserOrder();
+
+    /**
+     * 今日会员购物总额
+     *
+     * @return
+     */
+    int getTodayUserSales();
+
+    /**
+     * 总收入
+     *
+     * @return
+     */
+    int getIncomeSum();
+
+    /**
+     * 已支付订单数
+     *
+     * @return
+     */
+    int getPayedOrderCount();
+
+    Double getTotalActualPrice(@Param("merchOrderSn")String merchOrderSn);
+
+    List<OrderEntity> queryOffilineOrderList(Map<String, Object> map);
+
+    List<OrderEntity> queryObjectByMerchOrderSn(@Param("merchOrderSn")String merchOrderSn);
+}

部分文件因文件數量過多而無法顯示