Parcourir la source

修改规格保存逻辑

tianboguang il y a 3 ans
Parent
commit
a12d958bfb
89 fichiers modifiés avec 2020 ajouts et 8510 suppressions
  1. 0 115
      platform-admin/src/main/java/com/platform/controller/SysConfigController.java
  2. 0 46
      platform-admin/src/main/java/com/platform/controller/SysLogController.java
  3. 0 151
      platform-admin/src/main/java/com/platform/controller/SysMacroController.java
  4. 0 222
      platform-admin/src/main/java/com/platform/controller/SysOssController.java
  5. 0 30
      platform-admin/src/main/java/com/platform/controller/SysPageController.java
  6. 0 196
      platform-admin/src/main/java/com/platform/controller/SysRegionController.java
  7. 0 129
      platform-admin/src/main/java/com/platform/controller/SysSmsLogController.java
  8. 3 3
      platform-admin/src/main/resources/log4j.properties
  9. 5 1
      platform-api/pom.xml
  10. 1 4
      platform-api/src/main/java/com/platform/api/ApiAuthController.java
  11. 20 24
      platform-api/src/main/java/com/platform/api/ApiBrandController.java
  12. 2 4
      platform-api/src/main/java/com/platform/api/ApiUserController.java
  13. 0 1
      platform-api/src/main/java/com/platform/api/OpenApiNotifyController.java
  14. 26 0
      platform-api/src/main/java/com/platform/dao/SysUserRoleDao.java
  15. 21 0
      platform-api/src/main/java/com/platform/dao/TbRecommendMapper.java
  16. 56 0
      platform-api/src/main/java/com/platform/dao/TbSceneProMapper.java
  17. 28 0
      platform-api/src/main/java/com/platform/dao/TbUserMapper.java
  18. 85 0
      platform-api/src/main/java/com/platform/entity/TbRecommend.java
  19. 61 0
      platform-api/src/main/java/com/platform/provider/SceneSQLProvider.java
  20. 14 0
      platform-api/src/main/java/com/platform/service/RecommendService.java
  21. 25 0
      platform-api/src/main/java/com/platform/service/SceneProService.java
  22. 17 0
      platform-api/src/main/java/com/platform/service/SysUserRoleService.java
  23. 27 0
      platform-api/src/main/java/com/platform/service/UserService.java
  24. 25 0
      platform-api/src/main/java/com/platform/service/impl/RecommendServiceImpl.java
  25. 37 0
      platform-api/src/main/java/com/platform/service/impl/SysUserRoleServiceImpl.java
  26. 69 0
      platform-api/src/main/java/com/platform/service/impl/UserServiceImpl.java
  27. 166 0
      platform-api/src/main/java/com/platform/service/impl/ZhiHouseService.java
  28. 54 0
      platform-api/src/main/resources/com/platform/dao/SysUserRoleDao.xml
  29. 128 0
      platform-api/src/main/resources/com/platform/dao/TbRecommendMapper.xml
  30. 228 0
      platform-api/src/main/resources/com/platform/dao/TbUserMapper.xml
  31. 7 0
      platform-common/pom.xml
  32. 0 422
      platform-common/src/main/java/com/platform/controller/SysLoginController.java
  33. 75 0
      platform-common/src/main/java/com/platform/entity/SysRoleEntity.java
  34. 82 0
      platform-common/src/main/java/com/platform/entity/SysUserRoleEntity.java
  35. 405 0
      platform-common/src/main/java/com/platform/entity/TbScenePro.java
  36. 58 0
      platform-common/src/main/java/com/platform/entity/TbUser.java
  37. 0 34
      platform-common/src/main/java/com/platform/enums/SysRoleEnum.java
  38. 0 20
      platform-common/src/main/java/com/platform/log4j/GradeLogDailyRollingFileAppender.java
  39. 0 386
      platform-common/src/main/java/com/platform/service/impl/ZhiHouseService.java
  40. 5 77
      platform-common/src/main/java/com/platform/shiro/UserRealm.java
  41. 281 0
      platform-common/src/main/java/com/platform/vos/ResponseScene.java
  42. 1 0
      platform-common/src/main/java/com/platform/vos/TbUser.java
  43. 0 105
      platform-shop/src/main/java/com/platform/controller/AdController.java
  44. 0 101
      platform-shop/src/main/java/com/platform/controller/AdPositionController.java
  45. 0 92
      platform-shop/src/main/java/com/platform/controller/AddressController.java
  46. 0 246
      platform-shop/src/main/java/com/platform/controller/AppCensusController.java
  47. 0 102
      platform-shop/src/main/java/com/platform/controller/AttributeCategoryController.java
  48. 0 106
      platform-shop/src/main/java/com/platform/controller/AttributeController.java
  49. 0 562
      platform-shop/src/main/java/com/platform/controller/BrandController.java
  50. 0 100
      platform-shop/src/main/java/com/platform/controller/CartController.java
  51. 0 124
      platform-shop/src/main/java/com/platform/controller/CategoryController.java
  52. 0 104
      platform-shop/src/main/java/com/platform/controller/ChannelController.java
  53. 0 101
      platform-shop/src/main/java/com/platform/controller/CollectController.java
  54. 0 120
      platform-shop/src/main/java/com/platform/controller/CommentController.java
  55. 0 104
      platform-shop/src/main/java/com/platform/controller/CommentPictureController.java
  56. 0 260
      platform-shop/src/main/java/com/platform/controller/CouponController.java
  57. 0 109
      platform-shop/src/main/java/com/platform/controller/CouponGoodsController.java
  58. 0 105
      platform-shop/src/main/java/com/platform/controller/FeedbackController.java
  59. 0 99
      platform-shop/src/main/java/com/platform/controller/FootprintController.java
  60. 0 101
      platform-shop/src/main/java/com/platform/controller/GoodsAttributeController.java
  61. 0 605
      platform-shop/src/main/java/com/platform/controller/GoodsController.java
  62. 0 104
      platform-shop/src/main/java/com/platform/controller/GoodsGalleryController.java
  63. 0 104
      platform-shop/src/main/java/com/platform/controller/GoodsIssueController.java
  64. 0 136
      platform-shop/src/main/java/com/platform/controller/GoodsSpecificationController.java
  65. 0 111
      platform-shop/src/main/java/com/platform/controller/HelpIssueController.java
  66. 0 110
      platform-shop/src/main/java/com/platform/controller/HelpTypeController.java
  67. 0 107
      platform-shop/src/main/java/com/platform/controller/KeywordsController.java
  68. 0 448
      platform-shop/src/main/java/com/platform/controller/OrderController.java
  69. 0 111
      platform-shop/src/main/java/com/platform/controller/OrderGoodsController.java
  70. 0 134
      platform-shop/src/main/java/com/platform/controller/ProductController.java
  71. 0 149
      platform-shop/src/main/java/com/platform/controller/RecommendController.java
  72. 0 101
      platform-shop/src/main/java/com/platform/controller/RelatedGoodsController.java
  73. 0 67
      platform-shop/src/main/java/com/platform/controller/SceneController.java
  74. 0 100
      platform-shop/src/main/java/com/platform/controller/SearchHistoryController.java
  75. 0 104
      platform-shop/src/main/java/com/platform/controller/ShippingController.java
  76. 0 118
      platform-shop/src/main/java/com/platform/controller/SpecificationController.java
  77. 0 77
      platform-shop/src/main/java/com/platform/controller/SysUserController.java
  78. 0 224
      platform-shop/src/main/java/com/platform/controller/TmLiveRoomController.java
  79. 0 108
      platform-shop/src/main/java/com/platform/controller/TmSlideShowController.java
  80. 0 67
      platform-shop/src/main/java/com/platform/controller/TokenController.java
  81. 0 104
      platform-shop/src/main/java/com/platform/controller/TopicCategoryController.java
  82. 0 109
      platform-shop/src/main/java/com/platform/controller/TopicController.java
  83. 0 178
      platform-shop/src/main/java/com/platform/controller/UserController.java
  84. 0 123
      platform-shop/src/main/java/com/platform/controller/UserCouponController.java
  85. 0 105
      platform-shop/src/main/java/com/platform/controller/UserLevelController.java
  86. 0 108
      platform-shop/src/main/java/com/platform/controller/ZfbController.java
  87. 0 4
      platform-shop/src/main/java/com/platform/service/BrandService.java
  88. 8 143
      platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java
  89. 0 45
      platform-shop/src/main/java/com/platform/task/TestTask.java

+ 0 - 115
platform-admin/src/main/java/com/platform/controller/SysConfigController.java

@@ -1,115 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.SysLog;
-import com.platform.entity.Result;
-import com.platform.entity.SysConfigEntity;
-import com.platform.service.SysConfigService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-import com.platform.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;
-
-/**
- * 系统配置信息Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2016年12月4日 下午6:55:53
- */
-@RestController
-@RequestMapping("/sys/config")
-public class SysConfigController extends AbstractController {
-    @Autowired
-    private SysConfigService sysConfigService;
-
-    /**
-     * 所有配置列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-
-    /**
-     * 根据主键获取配置信息
-     *
-     * @param id 主键
-     * @return R
-     */
-    @RequestMapping("/info")
-    
-    public Result info(@RequestParam("id") Long id) {
-        SysConfigEntity config = sysConfigService.queryObject(id);
-
-        return Result.success( config);
-    }
-
-    /**
-     * 新增配置
-     *
-     * @param config 配置
-     * @return R
-     */
-    @SysLog("新增配置")
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody SysConfigEntity config) {
-        ValidatorUtils.validateEntity(config);
-
-        sysConfigService.save(config);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改配置
-     *
-     * @param config 配置
-     * @return R
-     */
-    @SysLog("修改配置")
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody SysConfigEntity config) {
-        ValidatorUtils.validateEntity(config);
-
-        sysConfigService.update(config);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除配置
-     *
-     * @param ids 主键集
-     * @return R
-     */
-    @SysLog("删除配置")
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Long[] ids) {
-        sysConfigService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-}

+ 0 - 46
platform-admin/src/main/java/com/platform/controller/SysLogController.java

@@ -1,46 +0,0 @@
-package com.platform.controller;
-
-import com.platform.entity.Result;
-import com.platform.service.SysLogService;
-import com.platform.utils.PageUtilsPlus;
-
-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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.util.Map;
-
-/**
- * 系统日志Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2017-03-08 10:40:56
- */
-@Controller
-@RequestMapping("/sys/log")
-public class SysLogController {
-    @Autowired
-    private SysLogService sysLogService;
-
-    /**
-     * 系统日志列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @ResponseBody
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        PageUtilsPlus pageUtil = sysLogService.queryPage(params);
-        return Result.success(pageUtil);
-    }
-
-}

+ 0 - 151
platform-admin/src/main/java/com/platform/controller/SysMacroController.java

@@ -1,151 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.SysLog;
-import com.platform.entity.Result;
-import com.platform.entity.SysMacroEntity;
-import com.platform.service.SysMacroService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2017-08-22 11:48:16
- */
-@RestController
-@RequestMapping("sys/macro")
-public class SysMacroController {
-    @Autowired
-    private SysMacroService sysMacroService;
-
-    /**
-     * 所有字典列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 根据主键获取字典信息
-     *
-     * @param macroId 主键
-     * @return R
-     */
-    @RequestMapping("/info")
-    
-    public Result info(@RequestParam("macroId") Long macroId) {
-        SysMacroEntity sysMacro = sysMacroService.queryObject(macroId);
-
-        return Result.success(sysMacro);
-    }
-
-    /**
-     * 新增字典
-     *
-     * @param sysMacro 字典
-     * @return R
-     */
-    @SysLog("新增字典")
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody SysMacroEntity sysMacro) {
-        sysMacroService.save(sysMacro);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改字典
-     *
-     * @param sysMacro 字典
-     * @return R
-     */
-    @SysLog("修改字典")
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody SysMacroEntity sysMacro) {
-        sysMacroService.update(sysMacro);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除字典
-     *
-     * @param macroIds 主键集
-     * @return R
-     */
-    @SysLog("删除字典")
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Long[] macroIds) {
-        sysMacroService.deleteBatch(macroIds);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看字典列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<SysMacroEntity> list = sysMacroService.queryList(params);
-
-        return Result.success( list);
-    }
-
-    /**
-     * 查看字典目录列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/queryAllParent")
-    public Result queryAllParent(@RequestBody Map<String, Object> params) {
-
-        List<SysMacroEntity> list = sysMacroService.queryAllParent(params);
-
-        return Result.success(list);
-    }
-
-    /**
-     * 根据value查询数据字典
-     *
-     * @param value value
-     * @return R
-     */
-    @RequestMapping("/queryMacrosByValue")
-    public Result queryMacrosByValue(@RequestParam String value) {
-
-        List<SysMacroEntity> list = sysMacroService.queryMacrosByValue(value);
-
-        return Result.success(list);
-    }
-}

+ 0 - 222
platform-admin/src/main/java/com/platform/controller/SysOssController.java

@@ -1,222 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.annotation.SysLog;
-import com.platform.entity.Result;
-import com.platform.entity.SysOssEntity;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.oss.CloudStorageConfig;
-import com.platform.oss.OSSFactory;
-import com.platform.service.SysConfigService;
-import com.platform.service.SysOssService;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.utils.*;
-import com.platform.validator.ValidatorUtils;
-import com.platform.validator.group.AliyunGroup;
-import com.platform.validator.group.DiskGroup;
-import com.platform.validator.group.QcloudGroup;
-import com.platform.validator.group.QiniuGroup;
-import com.platform.vos.TbUser;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.Logical;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.apache.shiro.authz.annotation.RequiresRoles;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.*;
-
-/**
- * 文件上传Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2017-03-25 12:13:26
- */
-@RestController
-@RequestMapping("sys/oss")
-@Slf4j
-public class SysOssController extends AbstractController{
-    @Autowired
-    private SysOssService sysOssService;
-    @Autowired
-    private SysConfigService sysConfigService;
-    @Autowired
-    private UploadToOssUtil uploadToOssUtil;
-
-    @Autowired
-    private OssCheckPointUploadUtil ossCheckPointUploadUtil;
-
-    @Value("${oss.query.url}")
-    private String ossQueryUrl;
-
-    @Value("${oss.video.file.path}")
-    private String ossVideoPath;
-
-    @Value("${video-file-path}")
-    private String videoLocalBackupPath;
-
-    private final static String KEY = Constant.CLOUD_STORAGE_CONFIG_KEY;
-
-    /**
-     * 列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        PageUtilsPlus pageUtil = sysOssService.queryPage(params);
-        return Result.success(pageUtil);
-    }
-
-
-    /**
-     * 获取云存储配置信息
-     *
-     * @return R
-     */
-    @RequestMapping("/config")
-    
-    public Result config() {
-        CloudStorageConfig config = sysConfigService.getConfigObject(KEY, CloudStorageConfig.class);
-
-        return Result.success(config);
-    }
-
-
-    /**
-     * 保存云存储配置信息
-     *
-     * @param config 配置信息
-     * @return R
-     */
-    @SysLog("保存云存储配置信息")
-    @RequestMapping("/saveConfig")
-    
-    public Result 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);
-        } else if (config.getType() == Constant.CloudService.DISCK.getValue()) {
-            //校验腾讯云数据
-            ValidatorUtils.validateEntity(config, DiskGroup.class);
-        }
-
-        sysConfigService.updateValueByKey(KEY, JSON.toJSONString(config));
-
-        return Result.success();
-    }
-
-    @ApiOperation(value = "上传视频")
-    @PostMapping("/upLoadVideo")
-    @ResponseBody
-    public Result uploadIntroduceVideo(@RequestParam("file") MultipartFile file) {
-        if (null == file) {
-            throw new CommonBaseException(ResultCodeEnum.D3001);
-        }
-        log.info("当前视频大小为:{} bytes" , file.getSize());
-        if(file.getSize() > 1024000000){
-            return Result.failure("视频不能超过1G");
-        }
-        String downLoanVideoPath = FileUtils.parseFile(file, videoLocalBackupPath);
-        log.info("视频文件已经下载到本地:{}", downLoanVideoPath);
-        //视频文件名一般为:xxx.mp4这种格式
-        String videoFilePureName = file.getOriginalFilename();
-        log.info("视频文件名为:{}", videoFilePureName);
-        //去掉格式,只获取纯名字
-        int index = videoFilePureName.indexOf(".");
-        //获取纯名字
-        if (index != -1) {
-            videoFilePureName = videoFilePureName.substring(0, index);
-        } else {
-            Random random = new Random();
-            videoFilePureName = "default_imag_" + random.nextInt(10000);
-            log.info("采用默认的图片名字:{}", videoFilePureName);
-        }
-        //这里默认第一帧图片是jpg格式
-        String imageFormatter = "jpg";
-        //视频在oss中的object name
-        String imageOssObjectName = ossVideoPath + videoFilePureName + "." + imageFormatter;
-        //截取视频第一帧图片
-        boolean cutFirstImageResult = FileUtils.executeCodecs(downLoanVideoPath, videoLocalBackupPath,
-                videoFilePureName, imageFormatter);
-
-        if (cutFirstImageResult) {
-            log.info("成功截取第一帧图片,将上传到oss上");
-            String imageLocalPath = videoLocalBackupPath + videoFilePureName + "." + imageFormatter;
-            uploadToOssUtil.uploadThenDelete(imageLocalPath, imageOssObjectName);
-            log.info("上传第一帧图片到oss完成");
-        }
-
-        String videoObjectName = ossVideoPath + file.getOriginalFilename();
-        ossCheckPointUploadUtil.doUploadThenDelete(downLoanVideoPath, videoObjectName);
-
-        Map<String, Object> resultMap = new HashMap<>();
-        resultMap.put("image", ossQueryUrl + imageOssObjectName);
-        resultMap.put("video", ossQueryUrl + videoObjectName);
-        return Result.success("视频文件上传oss结束", resultMap);
-    }
-
-    /**
-     * 上传文件
-     *
-     * @param file 文件
-     * @return R
-     * @throws Exception 异常
-     */
-    @RequestMapping("/upload")
-    public Result upload(@RequestParam("file") MultipartFile file) throws Exception {
-        if (file.isEmpty()) {
-            throw new RRException("上传文件不能为空");
-        }
-        //上传文件
-        String url = OSSFactory.build().upload(file);
-
-        //保存文件信息
-        SysOssEntity ossEntity = new SysOssEntity();
-        ossEntity.setUrl(url);
-        ossEntity.setCreateDate(new Date());
-        ossEntity.setUserId(getUserId());
-        if( getUser() != null){
-            ossEntity.setUsername(getUser().getUserName());
-        }
-        sysOssService.save(ossEntity);
-        HashMap<String,Object> map = new HashMap<>();
-        map.put("url", url);
-        map.put("link", url);
-        return Result.success(map);
-    }
-
-
-    /**
-     * 删除图片
-     *
-     * @param ids 主键集
-     * @return R
-     */
-    @SysLog("删除图片")
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Long[] ids) {
-        sysOssService.removeByIds(Arrays.asList(ids));
-
-        return Result.success();
-    }
-}

+ 0 - 30
platform-admin/src/main/java/com/platform/controller/SysPageController.java

@@ -1,30 +0,0 @@
-package com.platform.controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-/**
- * 系统页面视图Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2016年11月24日 下午11:05:27
- */
-@Controller
-public class SysPageController {
-
-    /**
-     * 视图路径
-     *
-     * @param module 模块
-     * @param url    url
-     * @return 页面视图路径
-     */
-    @RequestMapping("{module}/{url}.html")
-    public String page(@PathVariable("module") String module, @PathVariable("url") String url) {
-        return module + "/" + url + ".html";
-    }
-
-}

+ 0 - 196
platform-admin/src/main/java/com/platform/controller/SysRegionController.java

@@ -1,196 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.SysLog;
-import com.platform.cache.RegionCacheUtil;
-import com.platform.entity.Result;
-import com.platform.entity.SysRegionEntity;
-import com.platform.service.SysRegionService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-import com.platform.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 lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2017-11-04 11:19:31
- */
-@RestController
-@RequestMapping("sys/region")
-public class SysRegionController {
-    @Autowired
-    private SysRegionService sysRegionService;
-
-    /**
-     * 查看列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 根据主键获取信息
-     *
-     * @param id 主键
-     * @return R
-     */
-    @RequestMapping("/info")
-    
-    public Result info(@RequestParam("id") Integer id) {
-        SysRegionEntity region = sysRegionService.queryObject(id);
-
-        return Result.success(region);
-    }
-
-    /**
-     * 新增地址
-     *
-     * @param region 地址
-     * @return R
-     */
-    @SysLog("新增地址")
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody SysRegionEntity region) {
-        sysRegionService.save(region);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改地址
-     *
-     * @param region 地址
-     * @return R
-     */
-    @SysLog("修改地址")
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody SysRegionEntity region) {
-        sysRegionService.update(region);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除地址
-     *
-     * @param ids 主键集
-     * @return R
-     */
-    @SysLog("删除地址")
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        sysRegionService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查询所有国家
-     *
-     * @return R
-     */
-    @RequestMapping("/getAllCountry")
-    public Result getAllCountry() {
-        List<SysRegionEntity> list = RegionCacheUtil.getAllCountry();
-        return Result.success( list);
-    }
-
-    /**
-     * 查询所有省份
-     *
-     * @return R
-     */
-    @RequestMapping("/getAllProvice")
-    public Result getAllProvice(@RequestParam(required = false) Integer areaId) {
-        List<SysRegionEntity> list = RegionCacheUtil.getAllProviceByParentId(areaId);
-        return Result.success( list);
-    }
-
-    /**
-     * 查询所有城市
-     *
-     * @return R
-     */
-    @RequestMapping("/getAllCity")
-    public Result getAllCity(@RequestParam(required = false) Integer areaId) {
-        List<SysRegionEntity> list = RegionCacheUtil.getChildrenCity(areaId);
-        return Result.success(list);
-    }
-
-
-    /**
-     * 查询所有区县
-     *
-     * @return R
-     */
-    @RequestMapping("/getChildrenDistrict")
-    public Result getChildrenDistrict(@RequestParam(required = false) Integer areaId) {
-        List<SysRegionEntity> list = RegionCacheUtil.getChildrenDistrict(areaId);
-        return Result.success(list);
-    }
-
-    /**
-     * 查看信息(全部加载页面渲染太慢!)
-     *
-     * @return R
-     */
-    @RequestMapping("/getAreaTree")
-    public Result 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 Result.success(node);
-    }
-
-    /**
-     * 根据类型获取区域
-     *
-     * @param type 类型
-     * @return R
-     */
-    @RequestMapping("/getAreaByType")
-    public Result 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 Result.success( list);
-    }
-}

+ 0 - 129
platform-admin/src/main/java/com/platform/controller/SysSmsLogController.java

@@ -1,129 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.annotation.SysLog;
-import com.platform.entity.Result;
-import com.platform.entity.SmsConfig;
-import com.platform.entity.SysSmsLogEntity;
-import com.platform.service.SysConfigService;
-import com.platform.service.SysSmsLogService;
-import com.platform.utils.Constant;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2017-12-16 23:38:05
- */
-@RestController
-@RequestMapping("/sys/smslog")
-public class SysSmsLogController {
-    @Autowired
-    private SysSmsLogService smsLogService;
-    @Autowired
-    private SysConfigService sysConfigService;
-    /**
-     * 短信配置KEY
-     */
-    private final static String KEY = Constant.SMS_CONFIG_KEY;
-
-    /**
-     * 所有日志列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success( pageUtil);
-    }
-
-    /**
-     * 根据主键获取日志信息
-     *
-     * @param id 主键
-     * @return R
-     */
-    @RequestMapping("/info")
-    
-    public Result info(@RequestParam("id") String id) {
-        SysSmsLogEntity smsLog = smsLogService.queryObject(id);
-
-        return Result.success( smsLog);
-    }
-
-    /**
-     * 查看所有列表
-     *
-     * @param params 请求参数
-     * @return R
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<SysSmsLogEntity> list = smsLogService.queryList(params);
-
-        return Result.success(list);
-    }
-
-    /**
-     * 获取短信配置信息
-     *
-     * @return R
-     */
-    @RequestMapping("/config")
-    public Result config() {
-        SmsConfig config = sysConfigService.getConfigObject(KEY, SmsConfig.class);
-
-        return Result.success(config);
-    }
-
-    /**
-     * 保存短信配置信息
-     *
-     * @param config 短信配置信息
-     * @return R
-     */
-    @SysLog("保存短信配置信息")
-    @RequestMapping("/saveConfig")
-    public Result saveConfig(@RequestBody SmsConfig config) {
-        sysConfigService.updateValueByKey(KEY, JSON.toJSONString(config));
-        return Result.success();
-    }
-
-    /**
-     * 发送短信
-     *
-     * @param smsLog 短信
-     * @return R
-     */
-    @RequestMapping("/sendSms")
-    public Result sendSms(@RequestBody SysSmsLogEntity smsLog) {
-        //腾讯云短信平台
-//        SysSmsLogEntity sysSmsLogEntity = smsLogService.sendSms(smsLog);
-
-        //阿里云短信平台
-        SysSmsLogEntity sysSmsLogEntity = smsLogService.sendAliSms("SMS_184816840", smsLog);
-        return Result.success( sysSmsLogEntity);
-    }
-}

+ 3 - 3
platform-admin/src/main/resources/log4j.properties

@@ -18,7 +18,7 @@ log4j.appender.file.layout=org.apache.log4j.PatternLayout
 log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
 #INFO日志
 log4j.logger.info=info
-log4j.appender.info=com.platform.log4j.GradeLogDailyRollingFileAppender
+log4j.appender.info=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.info.File=../logs/info/info.log
 log4j.appender.info.datePattern='.'yyyy-MM-dd'.log'
 log4j.appender.info.append=true
@@ -28,7 +28,7 @@ log4j.appender.info.ImmediateFlush=true
 log4j.appender.info.layout=org.apache.log4j.PatternLayout
 log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
 #WARN日志
-log4j.appender.warn=com.platform.log4j.GradeLogDailyRollingFileAppender
+log4j.appender.warn=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.warn.File=../logs/warn/warn.log
 log4j.appender.warn.datePattern='.'yyyy-MM-dd'.log'
 log4j.appender.warn.append=true
@@ -38,7 +38,7 @@ log4j.appender.warn.ImmediateFlush=true
 log4j.appender.warn.layout=org.apache.log4j.PatternLayout
 log4j.appender.warn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
 #ERROR日志
-log4j.appender.error=com.platform.log4j.GradeLogDailyRollingFileAppender
+log4j.appender.error=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.error.File=../logs/error/error.log
 log4j.appender.error.datePattern='.'yyyy-MM-dd'.log'
 log4j.appender.error.append=true

+ 5 - 1
platform-api/pom.xml

@@ -17,7 +17,11 @@
             <version>1.0.0</version>
         </dependency>
 
-
+        <dependency>
+            <groupId>com.vdurmont</groupId>
+            <artifactId>emoji-java</artifactId>
+            <version>4.0.0</version>
+        </dependency>
 
     </dependencies>
 

+ 1 - 4
platform-api/src/main/java/com/platform/api/ApiAuthController.java

@@ -20,8 +20,6 @@ import com.platform.util.ApiUserUtils;
 import com.platform.util.CommonUtil;
 import com.platform.utils.*;
 import com.platform.validator.Assert;
-import com.platform.vos.ReturnDTO;
-import com.platform.vos.TbUser;
 import com.qiniu.util.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -200,8 +198,7 @@ public class ApiAuthController extends ApiBaseAction {
         }
 
         // 调用zfb 登录
-        ReturnDTO returnDTO = zhiHouseService.wcLogin(sessionData.getString("openid"),userVo.getMobile(),userVo.getGender(),userInfo.getNickName(),userInfo.getAvatarUrl());
-        String token = JSONObject.parseObject(JSONObject.toJSONString(returnDTO.getMessage())).getString("token");
+        String token = zhiHouseService.wcLogin(sessionData.getString("openid"),userVo.getMobile(),userVo.getGender(),userInfo.getNickName(),userInfo.getAvatarUrl());
 
         if (StringUtils.isNullOrEmpty(token)) {
             logger.error("登录失败");

+ 20 - 24
platform-api/src/main/java/com/platform/api/ApiBrandController.java

@@ -1,12 +1,10 @@
 package com.platform.api;
 
-import com.alibaba.fastjson.JSONObject;
+import com.fdage.micro.commom.respone.PageUtilsPlus;
 import com.platform.annotation.IgnoreAuth;
 import com.platform.entity.*;
 import com.platform.interceptor.AuthorizationInterceptor;
 import com.platform.service.ApiBrandService;
-import com.platform.service.ApiRecommendService;
-import com.platform.service.ApiUserService;
 import com.platform.service.custom.MyApiTmBrandTypeService;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.impl.ZhiHouseService;
@@ -14,7 +12,7 @@ import com.platform.util.ApiBaseAction;
 import com.platform.util.ApiPageUtils;
 import com.platform.utils.Query;
 import com.platform.vos.RequestScene;
-import com.platform.vos.TbUser;
+import com.platform.vos.ResponseScene;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
@@ -113,9 +111,9 @@ public class ApiBrandController extends ApiBaseAction {
             case 13:
                 List<BrandVo> list = zhiHouseService.queryRecomendsByType(type).parallelStream().map(entity->{
                     BrandVo vo = new BrandVo();
-                    vo.setName(entity.getString("title"));
-                    vo.setId(entity.getInteger("connectId"));
-                    vo.setAppListPicUrl(entity.getString("image"));
+                    vo.setName(entity.getTitle());
+                    vo.setId(entity.getConnectId().intValue());
+                    vo.setAppListPicUrl(entity.getImage());
                     return vo;
                 }).collect(Collectors.toList());
                 return toResponsSuccess(new ApiPageUtils(list, 3, 3, 1));
@@ -161,12 +159,9 @@ public class ApiBrandController extends ApiBaseAction {
             requestScene.setPage(Long.valueOf(page));
             requestScene.setLimit(Long.valueOf(size));
             requestScene.setToken(request.getHeader(AuthorizationInterceptor.LOGIN_TOKEN_KEY));
-            JSONObject mySceneJsonData = zhiHouseService.getSceneFromZhiHouse(requestScene);
-            logger.info("token:{}",requestScene.getToken());
-            logger.info("请求结果:{}",mySceneJsonData.toJSONString());
-            List<Object> mySceneList = mySceneJsonData.getJSONArray("list");
+            PageUtilsPlus mySceneJsonData = zhiHouseService.getSceneFromZhiHouse(requestScene);
             // 处理场景数据
-            result = new ApiPageUtils(mySceneList, mySceneJsonData.getInteger("totalCount"), size, page);
+            result = new ApiPageUtils(mySceneJsonData.getList(), (int)mySceneJsonData.getTotal(), size, page);
         }
         return toResponsSuccess(result);
 
@@ -189,9 +184,9 @@ public class ApiBrandController extends ApiBaseAction {
             }
             entity.setSceneUrl(entity.getLiveRoomUrl());
             // 获取场景数据
-            JSONObject sceneRes = zhiHouseService.queryBySceneNum(entity.getSceneNum(),request.getHeader(AuthorizationInterceptor.LOGIN_TOKEN_KEY));
+            TbScenePro sceneRes = zhiHouseService.queryBySceneNum(entity.getSceneNum());
             if(!ObjectUtils.isEmpty(sceneRes)){
-                entity.setSceneName(sceneRes.getString("sceneName"));
+                entity.setSceneName(sceneRes.getSceneName());
             }
             int canshow = 0;
             //检查是否有带看权限,并更新
@@ -205,15 +200,15 @@ public class ApiBrandController extends ApiBaseAction {
             requestScene.setSceneId(Long.valueOf(id));
             requestScene.setUserId(-1L);
             requestScene.setToken(request.getHeader(AuthorizationInterceptor.LOGIN_TOKEN_KEY));
-            JSONObject mySceneJsonData = zhiHouseService.getSceneFromZhiHouse(requestScene);
-            List<Object> mySceneList = mySceneJsonData.getJSONArray("list");
+            PageUtilsPlus mySceneJsonData = zhiHouseService.getSceneFromZhiHouse(requestScene);
+            List<ResponseScene> mySceneList = (List<ResponseScene>) mySceneJsonData.getList();
             entity = new BrandVo();
             if(!ObjectUtils.isEmpty(mySceneList)){
-                JSONObject sceneRes = JSONObject.parseObject(JSONObject.toJSONString(mySceneList.get(0)));
-                entity.setSceneUrl(sceneRes.getString("webSite"));
-                entity.setSceneName(sceneRes.getString("sceneName"));
-                entity.setAppListPicUrl(sceneRes.getString("appListPicUrl"));
-                entity.setSceneNum(sceneRes.getString("num"));
+                ResponseScene sceneRes = mySceneList.get(0);
+                entity.setSceneUrl(sceneRes.getWebSite());
+                entity.setSceneName(sceneRes.getSceneName());
+                entity.setAppListPicUrl(sceneRes.getAppListPicUrl());
+                entity.setSceneNum(sceneRes.getNum());
             }
         }
         resultObj.put("brand", entity);
@@ -227,11 +222,12 @@ public class ApiBrandController extends ApiBaseAction {
     @ApiOperation(value = "增加访问次数")
     @IgnoreAuth
     @GetMapping("increaseViewCount")
-    public Object increaseViewCount(@RequestParam Integer brandId,@RequestParam(required = false) Integer type) {
+    public Object increaseViewCount(@RequestParam Long brandId,@RequestParam(required = false) Integer type) {
         if(!(ObjectUtils.isEmpty(type) || type == 21 || type == 31)) {
-            return toResponsSuccess(brandService.increaseViewCount(brandId+""));
+            brandService.increaseViewCount(brandId+"");
         }
-        return toResponsSuccess(zhiHouseService.increaseViewCount(brandId));
+        zhiHouseService.increaseViewCount(brandId);
+        return Result.success();
     }
 
     /**

+ 2 - 4
platform-api/src/main/java/com/platform/api/ApiUserController.java

@@ -5,6 +5,7 @@ import com.github.qcloudsms.SmsSingleSenderResult;
 import com.platform.annotation.LoginUser;
 import com.platform.entity.Result;
 import com.platform.entity.SmsLogVo;
+import com.platform.entity.TbUser;
 import com.platform.entity.UserVo;
 import com.platform.exception.CommonBaseException;
 import com.platform.interceptor.AuthorizationInterceptor;
@@ -16,8 +17,6 @@ import com.platform.util.ApiBaseAction;
 import com.platform.utils.CharUtil;
 
 import com.platform.utils.SmsUtil;
-import com.platform.vos.ReturnDTO;
-import com.platform.vos.TbUser;
 import com.qiniu.util.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -97,8 +96,7 @@ public class ApiUserController extends ApiBaseAction {
         userService.update(loginUser);
         String token = request.getHeader(AuthorizationInterceptor.LOGIN_TOKEN_KEY);
         if(!ObjectUtils.isEmpty(loginUser.getMobile())){
-            ReturnDTO returnDTO = zhiHouseService.wcLogin(loginUser.getWeixin_openid(), loginUser.getMobile(),loginUser.getGender(), null, null);
-            token = JSONObject.parseObject(JSONObject.toJSONString(returnDTO.getMessage())).getString("token");
+            token = zhiHouseService.wcLogin(loginUser.getWeixin_openid(), loginUser.getMobile(),loginUser.getGender(), null, null);
             if (StringUtils.isNullOrEmpty(token)) {
                 logger.error("更新用户信息失败");
                 return toResponsFail("更新用户信息失败");

+ 0 - 1
platform-api/src/main/java/com/platform/api/OpenApiNotifyController.java

@@ -9,7 +9,6 @@ import com.platform.service.impl.ZhiHouseService;
 import com.platform.utils.CommonDataUtils;
 import com.platform.utils.SyncWxSubscribeServiceImpl;
 import com.platform.vos.OpenApiRequestVo;
-import com.platform.vos.TbUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 26 - 0
platform-api/src/main/java/com/platform/dao/SysUserRoleDao.java

@@ -0,0 +1,26 @@
+package com.platform.dao;
+
+import com.platform.entity.SysRoleEntity;
+import com.platform.entity.SysUserRoleEntity;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 用户与角色对应关系
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @date 2016年9月18日 上午9:34:46
+ */
+public interface SysUserRoleDao extends BaseDao<SysUserRoleEntity> {
+
+    /**
+     * 根据用户ID,获取角色ID列表
+     */
+    List<Long> queryRoleIdList(Long userId);
+
+    int saveOne(@Param("userId")long userId , @Param("roleId") long roleId);
+
+    List<SysRoleEntity> queryRoleList(Long userId);
+}

+ 21 - 0
platform-api/src/main/java/com/platform/dao/TbRecommendMapper.java

@@ -0,0 +1,21 @@
+package com.platform.dao;
+
+import com.platform.entity.TbRecommend;
+
+import java.util.List;
+
+public interface TbRecommendMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(TbRecommend record);
+
+    int insertSelective(TbRecommend record);
+
+    TbRecommend selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(TbRecommend record);
+
+    int updateByPrimaryKey(TbRecommend record);
+
+    List<TbRecommend> selectByType(Integer type);
+}

+ 56 - 0
platform-api/src/main/java/com/platform/dao/TbSceneProMapper.java

@@ -0,0 +1,56 @@
+package com.platform.dao;
+
+import com.platform.entity.TbScenePro;
+import com.platform.provider.SceneSQLProvider;
+import org.apache.ibatis.annotations.*;
+
+import java.util.List;
+
+@Mapper
+public interface TbSceneProMapper {
+
+    @Insert("insert into tb_scene_pro (scene_name, scene_dec, web_site, thumb, status," +
+            " data_source, user_id, pay_status, camera_id, phone_id, scene_logo, num, scene_type, recommend," +
+            " view_count, shoot_count, files_name, videos, gps, scene_scheme, rec_status, " +
+            " algorithm, ecs, space, firmware_version, build_type,  scene_source,house_id,create_time)" +
+            " values (#{scene.sceneName},#{scene.sceneDec},#{scene.webSite},#{scene.thumb},#{scene.status},#{scene.dataSource}" +
+            ",#{scene.userId},#{scene.payStatus},#{scene.cameraId},#{scene.phoneId},#{scene.sceneLogo},#{scene.num}" +
+            ",#{scene.sceneType},#{scene.recommend},#{scene.viewCount},#{scene.shootCount},#{scene.filesName},#{scene.videos}" +
+            ",#{scene.gps},#{scene.sceneScheme},#{scene.recStatus},#{scene.algorithm},#{scene.ecs},#{scene.space}" +
+            ",#{scene.firmwareVersion},#{scene.buildType},#{scene.sceneSource},#{scene.houseId},#{scene.createTime})")
+    @Options(useGeneratedKeys = true,keyProperty = "scene.id",keyColumn = "id")
+    void insert(@Param("scene") TbScenePro scene);
+
+    @Update("UPDATE tb_scene_pro SET scene_name = #{entity.sceneName}, scene_dec = #{entity.sceneDec}, web_site = #{entity.webSite}," +
+            " thumb = #{entity.thumb}, status = #{entity.status}, data_source = #{entity.dataSource}, user_id = #{entity.userId}," +
+            " pay_status = #{entity.payStatus}, camera_id = #{entity.cameraId}, phone_id = #{entity.phoneId}, scene_logo = #{entity.sceneLogo}," +
+            " num = #{entity.num}, scene_type = #{entity.sceneType}, recommend = #{entity.recommend}, view_count = #{entity.viewCount}," +
+            " shoot_count = #{entity.shootCount}, files_name = #{entity.filesName}, videos = #{entity.videos}, gps = #{entity.gps}," +
+            " scene_scheme = #{entity.sceneScheme}, rec_status = #{entity.recStatus},is_show = #{entity.isShow},lived = #{entity.lived}, algorithm = #{entity.algorithm}," +
+            " ecs = #{entity.ecs}, space = #{entity.space}, firmware_version =  #{entity.firmwareVersion}, build_type =  #{entity.buildType}," +
+            " scene_source =  #{entity.sceneSource},app_list_pic_url = #{entity.appListPicUrl} WHERE id =  #{entity.id}")
+    void update(@Param("entity") TbScenePro scene);
+
+
+    @Select("<script>" +
+            " SELECT * FROM tb_scene_pro WHERE id in " +
+            "<foreach collection=\"ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">" +
+            "  #{id}" +
+            " </foreach>" +
+            "</script>")
+    @ResultMap("TbScenePro")
+    List<TbScenePro> findByIds(@Param("ids") List<Long> ids);
+
+    @Update(" UPDATE tb_scene_pro SET view_count = view_count+1 WHERE num = #{sceneNum} ")
+    void updateViewCount(@Param("sceneNum") String sceneNum);
+
+    @Select(" SELECT * FROM tb_scene_pro WHERE num = #{num} AND rec_status = 'A'")
+    @ResultMap("TbScenePro")
+    TbScenePro findBySceneNum(String sceneNum);
+
+    @SelectProvider(type = SceneSQLProvider.class, method = "findAllScene")
+    @ResultMap("TbScenePro")
+    List<TbScenePro> findAllScene(@Param("userIds") String userIds, @Param("sceneName")String sceneName,
+                                 @Param("type") String type, @Param("likeNum") String searchKey,@Param("nums")String nums,
+                                  @Param("id")Long id,@Param("isShow") Integer isShow);
+}

+ 28 - 0
platform-api/src/main/java/com/platform/dao/TbUserMapper.java

@@ -0,0 +1,28 @@
+package com.platform.dao;
+
+
+import com.platform.entity.TbUser;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+@Mapper
+public interface TbUserMapper {
+
+    TbUser selectByUserNameAndPhone(@Param("userName") String userName, @Param("phone")String phone);
+    TbUser selectByAppid(String appid);
+
+    int insertSelective(TbUser record);
+
+    int updateByPrimaryKeySelective(TbUser record);
+
+    @Select("  select u.* ,r.role_id as roleId from tb_user u left join sys_user_role r on u.id = r.user_id  WHERE rec_status = 'A' and company_id =  #{companyId} ")
+    List<TbUser> getSysUserListByCompanyIds(@Param("companyId") Long companyId);
+
+    @Select(" select * from tb_user WHERE rec_status = 'A' and id =  #{userId} ")
+    TbUser getById(@Param("userId")Long userId);
+
+    List<TbUser> selectByPhones(@Param("phones") List<String> phones);
+}

+ 85 - 0
platform-api/src/main/java/com/platform/entity/TbRecommend.java

@@ -0,0 +1,85 @@
+package com.platform.entity;
+
+import java.util.Date;
+
+public class TbRecommend {
+    private Long id;
+
+    private String title;
+
+    private String image;
+
+    private Integer orderNum;
+
+    private Long connectId;
+
+    private String sceneUrl;
+
+    private Integer type;
+
+    private Date createTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title == null ? null : title.trim();
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image == null ? null : image.trim();
+    }
+
+    public Integer getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(Integer orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public Long getConnectId() {
+        return connectId;
+    }
+
+    public void setConnectId(Long connectId) {
+        this.connectId = connectId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getSceneUrl() {
+        return sceneUrl;
+    }
+
+    public void setSceneUrl(String sceneUrl) {
+        this.sceneUrl = sceneUrl;
+    }
+}

+ 61 - 0
platform-api/src/main/java/com/platform/provider/SceneSQLProvider.java

@@ -0,0 +1,61 @@
+package com.platform.provider;
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Map;
+
+public class SceneSQLProvider {
+
+    public String findAllScene(Map<String, Object> map) {
+        String sceneSql = getUnionSql() + " WHERE 1 = 1 and rec_status = 'A' and a.scene_type != 99";
+
+        sceneSql += " and (a.status = 1 or a.status = -2) and a.pay_status = 1 ";
+
+        if (map.get("userIds") != null) {
+            sceneSql += " and a.user_id in ( " + map.get("userIds") + ")";
+        }
+        if(!org.springframework.util.ObjectUtils.isEmpty(map.get("isShow"))){
+            sceneSql += " and a.is_show = #{isShow} ";
+        }
+        if(StringUtils.isNotEmpty((String)map.get("nums"))){
+            if (StringUtils.isNotEmpty((String)map.get("sceneName")) && StringUtils.isNotEmpty((String)map.get("cameraId"))) {
+                sceneSql += " and (a.scene_name like CONCAT('%',#{sceneName},'%') or a.num = #{likeNum} or a.camera_id in (" + map.get("cameraId") + ") or a.num in (" + map.get("nums") + "))";
+            } else if (StringUtils.isNotEmpty((String)map.get("sceneName"))) {
+                sceneSql += " and (a.scene_name like CONCAT('%',#{sceneName},'%') or a.num = #{likeNum} or a.num in (" + map.get("nums") + "))";
+            } else if(StringUtils.isNotEmpty((String)map.get("cameraId"))){
+                sceneSql += " and (a.camera_id in (" + map.get("cameraId") + ") or a.num in (" + map.get("nums") + "))";
+            }else{
+                sceneSql += " and a.num in (" + map.get("nums") + ")";
+            }
+        }else {
+            if (StringUtils.isNotEmpty((String)map.get("sceneName")) && StringUtils.isNotEmpty((String)map.get("cameraId"))) {
+                sceneSql += " and (a.scene_name like CONCAT('%',#{sceneName},'%') or a.num = #{likeNum} or a.camera_id in (" + map.get("cameraId") + "))";
+            } else if (StringUtils.isNotEmpty((String)map.get("sceneName")) && StringUtils.isNotEmpty((String)map.get("likeNum"))) {
+                sceneSql += " and a.scene_name like CONCAT('%',#{sceneName},'%') or a.num = #{likeNum}";
+            }else if(StringUtils.isNotEmpty((String)map.get("sceneName"))){
+                sceneSql += " and a.scene_name like CONCAT('%',#{sceneName},'%')";
+            }else if(StringUtils.isNotEmpty((String)map.get("cameraId"))){
+                sceneSql += " and a.camera_id in (" + map.get("cameraId") + ")";
+            }
+        }
+        if(ObjectUtils.isNotEmpty(map.get("id"))){
+            sceneSql += " and a.id = #{id}";
+        }
+        if (StringUtils.isNotEmpty((String)map.get("startDate")) && StringUtils.isNotEmpty((String)map.get("endDate"))) {
+            sceneSql += " and a.create_time >= #{startDate} and a.create_time <= #{endDate} ";
+        }else if(StringUtils.isNotEmpty((String)map.get("startDate"))){
+            sceneSql += " and a.create_time >= #{startDate}";
+        }else if(StringUtils.isNotEmpty((String)map.get("endDate"))){
+            sceneSql += " and a.create_time <= #{endDate} ";
+        }
+        sceneSql += " order by create_time desc";
+        return sceneSql;
+    }
+
+    private String getUnionSql() {
+        return " SELECT a.id,a.scene_name, a.scene_dec, a.web_site, a.thumb, a.scene_type," +
+                "a.create_time, a.status, a.user_id, a.pay_status, a.num, a.scene_scheme, a.shoot_count," +
+                "a.rec_status, a.space, a.recommend, a.view_count, a.build_type,a.app_list_pic_url FROM `tb_scene_pro` a ";
+    }
+}

+ 14 - 0
platform-api/src/main/java/com/platform/service/RecommendService.java

@@ -0,0 +1,14 @@
+package com.platform.service;
+
+import com.platform.entity.TbRecommend;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2018/12/7.
+ */
+public interface RecommendService {
+
+    List<TbRecommend> selectByType(Integer type);
+
+}

+ 25 - 0
platform-api/src/main/java/com/platform/service/SceneProService.java

@@ -0,0 +1,25 @@
+package com.platform.service;
+
+import com.fdage.micro.commom.respone.PageUtilsPlus;
+import com.github.pagehelper.PageInfo;
+import com.platform.entity.TbScenePro;
+import com.platform.vos.RequestScene;
+import com.platform.vos.ResponseScene;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2018/11/29.
+ */
+public interface SceneProService {
+
+    TbScenePro findBySceneNum(String sceneNum);
+
+    PageUtilsPlus getScenes(List<Long> userIds, RequestScene param);
+
+    void updateViewCount(String sceneNum);
+
+    List<TbScenePro> findByIds(List<Long> ids);
+
+    void update(TbScenePro scene);
+}

+ 17 - 0
platform-api/src/main/java/com/platform/service/SysUserRoleService.java

@@ -0,0 +1,17 @@
+package com.platform.service;
+
+import java.util.List;
+
+/**
+ * 用户与角色对应关系
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @date 2016年9月18日 上午9:43:24
+ */
+public interface SysUserRoleService {
+
+    int onlySave(Long userId , Long roleId);
+
+    List<Long> queryRoleIdList(Long userId);
+}

+ 27 - 0
platform-api/src/main/java/com/platform/service/UserService.java

@@ -0,0 +1,27 @@
+package com.platform.service;
+
+import com.platform.entity.TbUser;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2018/11/1.
+ */
+@Service
+public interface UserService {
+
+    TbUser selectByAppid(String appid);
+
+    TbUser selectByUserName(String phone);
+
+    int register(TbUser user);
+
+    int updateUser(TbUser user);
+
+    List<TbUser> getSysUserListByCompanyIds(Long deptId);
+
+    TbUser getById(Long userId);
+
+    List<TbUser> selectByPhones(List<String> phones);
+}

+ 25 - 0
platform-api/src/main/java/com/platform/service/impl/RecommendServiceImpl.java

@@ -0,0 +1,25 @@
+package com.platform.service.impl;
+
+import com.platform.dao.TbRecommendMapper;
+import com.platform.entity.TbRecommend;
+import com.platform.service.RecommendService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2018/12/7.
+ */
+@Service
+public class RecommendServiceImpl implements RecommendService {
+
+    @Autowired
+    private TbRecommendMapper mapper;
+
+    @Override
+    public List<TbRecommend> selectByType(Integer type) {
+        return mapper.selectByType(type);
+    }
+
+}

+ 37 - 0
platform-api/src/main/java/com/platform/service/impl/SysUserRoleServiceImpl.java

@@ -0,0 +1,37 @@
+package com.platform.service.impl;
+
+import com.platform.dao.SysUserRoleDao;
+import com.platform.service.SysUserRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * 用户与角色对应关系
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @date 2016年9月18日 上午9:45:48
+ */
+@Service("sysUserRoleService")
+public class SysUserRoleServiceImpl implements SysUserRoleService {
+    @Autowired
+    private SysUserRoleDao sysUserRoleDao;
+
+
+    @Override
+    public int onlySave(Long userId, Long roleId) {
+        if(userId==null || roleId==null){
+            return -1;
+        }
+        sysUserRoleDao.delete(userId);
+        return sysUserRoleDao.saveOne(userId , roleId);
+    }
+
+    @Override
+    public List<Long> queryRoleIdList(Long userId) {
+        return sysUserRoleDao.queryRoleIdList(userId);
+    }
+}

+ 69 - 0
platform-api/src/main/java/com/platform/service/impl/UserServiceImpl.java

@@ -0,0 +1,69 @@
+package com.platform.service.impl;
+
+import com.fdage.micro.commom.enums.SysRoleEnum;
+import com.platform.dao.TbUserMapper;
+import com.platform.entity.TbUser;
+import com.platform.service.SysUserRoleService;
+import com.platform.service.UserService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Created by Hb_zzZ on 2018/11/1.
+ */
+@Service
+public class UserServiceImpl implements UserService {
+
+    private static Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
+
+    @Autowired
+    private TbUserMapper mapper;
+
+    @Autowired
+    private SysUserRoleService sysUserRoleService;
+
+    @Override
+    public TbUser selectByAppid(String appid) {
+        return mapper.selectByAppid(appid);
+    }
+
+    @Override
+    public TbUser selectByUserName(String userName) {
+        return mapper.selectByUserNameAndPhone(userName,null);
+    }
+
+    @Override
+    public int register(TbUser user) {
+        mapper.insertSelective(user);
+        if(user.getRoleId() == null){
+            user.setRoleId(SysRoleEnum.VISITOR.getCode());
+        }
+        return sysUserRoleService.onlySave(user.getId(), user.getRoleId()); //新用户默认游客角色
+    }
+
+    @Override
+    public int updateUser(TbUser user) {
+        return mapper.updateByPrimaryKeySelective(user);
+    }
+
+    @Override
+    public List<TbUser> getSysUserListByCompanyIds(Long companyId) {
+        return mapper.getSysUserListByCompanyIds(companyId);
+    }
+
+
+    @Override
+    public TbUser getById(Long userId) {
+        return mapper.getById(userId);
+    }
+
+    @Override
+    public List<TbUser> selectByPhones(List<String> phones) {
+        return mapper.selectByPhones(phones);
+    }
+
+}

+ 166 - 0
platform-api/src/main/java/com/platform/service/impl/ZhiHouseService.java

@@ -0,0 +1,166 @@
+package com.platform.service.impl;
+
+import com.fdage.micro.commom.config.CommonConf;
+import com.fdage.micro.commom.dto.Result;
+import com.fdage.micro.commom.enums.UserEnum;
+import com.fdage.micro.commom.exception.BaseRuntimeException;
+import com.fdage.micro.commom.respone.PageUtilsPlus;
+import com.fdage.micro.commom.util.JwtUtil;
+import com.fdage.micro.commom.util.RedisUtils;
+import com.platform.entity.TbRecommend;
+import com.platform.entity.TbScenePro;
+import com.platform.entity.TbUser;
+import com.platform.service.RecommendService;
+import com.platform.service.SceneProService;
+import com.platform.service.SysUserRoleService;
+import com.platform.service.UserService;
+import com.platform.vos.RequestScene;
+import com.vdurmont.emoji.EmojiParser;
+import io.jsonwebtoken.Claims;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ZhiHouseService {
+    private static Logger logger = LoggerFactory.getLogger(ZhiHouseService.class);
+
+    @Value("${scenePath}")
+    private String zhiHouseHost;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private RedisUtils redisUtils;
+
+    @Value("${token.expireTime:86400}")
+    private Long tokenExpireTime;
+
+    @Autowired
+    private SceneProService sceneProService;
+
+    @Autowired
+    private SysUserRoleService sysUserRoleService;
+
+    @Autowired
+    private RecommendService recommendService;
+
+
+    public PageUtilsPlus getSceneFromZhiHouse(RequestScene param){
+        Claims claims = JwtUtil.parseJWT(param.getToken());
+        List<Long> userIds = Arrays.asList(Long.valueOf(claims.get("id", String.class)));
+        if (org.apache.commons.lang3.StringUtils.equals(param.getUserId() + "", "-1")) {
+            return sceneProService.getScenes(null, param);
+        } else if (!ObjectUtils.isEmpty(param.getPhone())) {
+            List<String> phones = new ArrayList<>();
+            if(param.getPhone().contains(";")){
+                phones = Arrays.asList(param.getPhone().split(";"));
+            }else{
+                phones.add(param.getPhone());
+            }
+            List<TbUser> users = userService.selectByPhones(phones);
+            userIds = users.stream().map(TbUser::getId).collect(Collectors.toList());
+        }
+        return sceneProService.getScenes(userIds, param);
+    }
+
+    public String wcLogin(String appId,String userName,Integer gender,String nickName,String avatar) {
+        if ( StringUtils.isEmpty(appId)) {
+            throw new BaseRuntimeException("参数缺失!");
+        }
+        TbUser user = userService.selectByAppid(appId);
+        if (org.springframework.util.ObjectUtils.isEmpty(user)) {
+            if(!org.springframework.util.ObjectUtils.isEmpty(userName)){
+                user = userService.selectByUserName(userName);
+            }
+            if (org.springframework.util.ObjectUtils.isEmpty(user)) {
+                user = new TbUser();
+                user.setUserName(userName);
+                if(org.springframework.util.ObjectUtils.isEmpty(userName)){
+                    user.setUserName("");
+                }
+                user.setUserPassword("");
+                user.setPhone(userName);
+                user.setAppid(appId);
+                user.setGender(gender);
+                user.setType(UserEnum.COMMON.getCode());
+                //将微信表情名称去掉
+                user.setNickName(EmojiParser.removeAllEmojis(nickName));
+                user.setHead(avatar);
+                userService.register(user);
+            } else {
+                user.setAppid(appId);
+                user.setGender(gender);
+                userService.updateUser(user);
+            }
+        }else if(!org.springframework.util.ObjectUtils.isEmpty(userName)  && org.springframework.util.ObjectUtils.isEmpty(user.getUserName())){
+            TbUser phoneUser = userService.selectByUserName(userName);
+            if(!org.springframework.util.ObjectUtils.isEmpty(phoneUser) && !phoneUser.getId().equals(user.getId())){
+                phoneUser.setAppid(user.getAppid());
+                phoneUser.setGender(user.getGender());
+                userService.updateUser(phoneUser);
+                user.setRecStatus("I");
+                userService.updateUser(user);
+                user = phoneUser;
+            }else{
+                user.setUserName(userName);
+                userService.updateUser(user);
+            }
+        }
+        //登录成功,生成tocken
+        Map<String, String> map = new HashMap<>();
+        map.put("id", user.getId().toString());
+        map.put("username", user.getUserName());
+        map.put("password", user.getUserPassword());
+        map.put("weixin_openid", user.getAppid());
+        String token = JwtUtil.createJWT(-1, map);
+        redisUtils.set(CommonConf.REDIS_APP_LOGIN_USER_TOKEN + user.getUserName(), token, tokenExpireTime);
+        user.setToken(token);
+        return token;
+    }
+
+    public void increaseViewCount(Long sceneId) {
+        if(!ObjectUtils.isEmpty(sceneId)){
+            List<TbScenePro> scenePros = sceneProService.findByIds(Arrays.asList(sceneId));
+            if(ObjectUtils.isEmpty(scenePros)){
+                return;
+            }
+            sceneProService.updateViewCount(scenePros.get(0).getNum());
+        }
+    }
+
+    public TbScenePro queryBySceneNum(String sceneNum) {
+       return sceneProService.findBySceneNum(sceneNum);
+    }
+
+    public TbUser queryByUserMobile(String phone) {
+        return userService.selectByUserName(phone);
+    }
+
+    public TbUser getByUserId(Long userId) {
+        TbUser user = userService.getById(userId);
+        user.setUserPassword(null);
+        //获取用户所属的角色列表
+        List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
+        if (null != roleIdList) {
+            user.setRoleIdList(roleIdList);
+        }
+        return user;
+    }
+
+    public Collection<TbRecommend> queryRecomendsByType(Integer type){
+        return recommendService.selectByType(type);
+    }
+}

+ 54 - 0
platform-api/src/main/resources/com/platform/dao/SysUserRoleDao.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.platform.dao.SysUserRoleDao">
+
+	<select id="queryList" resultType="com.platform.entity.SysUserRoleEntity">
+		select * from sys_user_role 
+		<where>
+			<if test="userId != null">
+				user_id = #{userId}
+			</if>
+		</where>
+	</select>
+
+	<select id="queryRoleList" resultType="com.platform.entity.SysRoleEntity">
+		select r.* from sys_user_role ur join sys_role r on ur.role_id = r.role_id where user_id = #{userId}
+	</select>
+ 
+	<insert id="save">
+		insert into sys_user_role
+		(
+			`user_id`, 
+			`role_id`
+		)
+		values
+		<foreach collection="roleIdList" item="item" index="index" separator="," >
+		(
+			#{userId}, 
+			#{item}
+		)
+		</foreach>
+	</insert>
+
+	<insert id="saveOne" >
+		insert into sys_user_role
+		(
+		`user_id`,
+		`role_id`
+		)
+		values
+		(
+			#{userId},
+			#{roleId}
+		)
+	</insert>
+	
+	<delete id="delete">
+		delete from sys_user_role where user_id = #{value}
+	</delete>
+	
+	<select id="queryRoleIdList" resultType="long">
+		select role_id from sys_user_role where user_id = #{value}
+	</select>
+</mapper>

+ 128 - 0
platform-api/src/main/resources/com/platform/dao/TbRecommendMapper.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.platform.dao.TbRecommendMapper">
+  <resultMap id="BaseResultMap" type="com.platform.entity.TbRecommend">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="image" jdbcType="VARCHAR" property="image" />
+    <result column="order_num" jdbcType="INTEGER" property="orderNum" />
+    <result column="connect_id" jdbcType="BIGINT" property="connectId" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, title, image, order_num, connect_id, type, create_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from tb_recommend
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from tb_recommend
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.platform.entity.TbRecommend">
+    insert into tb_recommend (id, title, image, 
+      order_num, connect_id, type, 
+      create_time)
+    values (#{id,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, 
+      #{orderNum,jdbcType=INTEGER}, #{connectId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.platform.entity.TbRecommend">
+    insert into tb_recommend
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="image != null">
+        image,
+      </if>
+      <if test="orderNum != null">
+        order_num,
+      </if>
+      <if test="connectId != null">
+        connect_id,
+      </if>
+      <if test="type != null">
+        type,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="image != null">
+        #{image,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNum != null">
+        #{orderNum,jdbcType=INTEGER},
+      </if>
+      <if test="connectId != null">
+        #{connectId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.platform.entity.TbRecommend">
+    update tb_recommend
+    <set>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="image != null">
+        image = #{image,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNum != null">
+        order_num = #{orderNum,jdbcType=INTEGER},
+      </if>
+      <if test="connectId != null">
+        connect_id = #{connectId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        type = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.platform.entity.TbRecommend">
+    update tb_recommend
+    set title = #{title,jdbcType=VARCHAR},
+      image = #{image,jdbcType=VARCHAR},
+      order_num = #{orderNum,jdbcType=INTEGER},
+      connect_id = #{connectId,jdbcType=BIGINT},
+      type = #{type,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <select id="selectByType" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from tb_recommend
+    where 1 = 1
+    <if test="_parameter  != null">
+      AND type = #{type}
+    </if>
+    order by order_num asc ,create_time desc
+  </select>
+</mapper>

+ 228 - 0
platform-api/src/main/resources/com/platform/dao/TbUserMapper.xml

@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.platform.dao.TbUserMapper">
+  <resultMap id="BaseResultMap" type="com.platform.entity.TbUser">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="user_name" jdbcType="VARCHAR" property="userName" />
+    <result column="user_password" jdbcType="VARCHAR" property="userPassword" />
+    <result column="appid" jdbcType="VARCHAR" property="appid" />
+    <result column="phone" jdbcType="VARCHAR" property="phone" />
+    <result column="nick_name" jdbcType="VARCHAR" property="nickName" />
+    <result column="memo_name" jdbcType="VARCHAR" property="memoName" />
+    <result column="head" jdbcType="VARCHAR" property="head" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="company_id" jdbcType="BIGINT" property="companyId" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="create_user" jdbcType="VARCHAR" property="createUser" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="update_user" jdbcType="VARCHAR" property="updateUser" />
+    <result column="fdkk_user" jdbcType="VARCHAR" property="fdkkUser" />
+    <result column="fdkk_password" jdbcType="VARCHAR" property="fdkkPassword" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.platform.entity.TbUser">
+    <result column="message" jdbcType="LONGVARCHAR" property="message" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, user_name, user_password, appid, phone, nick_name, memo_name, head, type, company_id, 
+    state, create_time, create_user, update_time, update_user,fdkk_user,fdkk_password
+  </sql>
+  <sql id="Blob_Column_List">
+    message
+  </sql>
+  <select id="selectByAppid" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from tb_user
+    where rec_status = 'A' and appid = #{appid}
+  </select>
+
+  <select id="selectByUserNameAndPhone" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from tb_user
+    where rec_status = 'A' and user_name = #{userName}
+    <if test="phone != null and phone !=''">
+      and phone = #{phone}
+    </if>
+  </select>
+
+  <insert id="insertSelective" parameterType="com.platform.entity.TbUser" useGeneratedKeys="true" keyProperty="id">
+    insert into tb_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userName != null">
+        user_name,
+      </if>
+      <if test="userPassword != null">
+        user_password,
+      </if>
+      <if test="appid != null">
+        appid,
+      </if>
+      <if test="phone != null">
+        phone,
+      </if>
+      <if test="nickName != null">
+        nick_name,
+      </if>
+      <if test="memoName != null">
+        memo_name,
+      </if>
+      <if test="head != null">
+        head,
+      </if>
+      <if test="type != null">
+        type,
+      </if>
+      <if test="companyId != null">
+        company_id,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="gender != null">
+        gender,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="updateUser != null">
+        update_user,
+      </if>
+      <if test="message != null">
+        message,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="userName != null">
+        #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="userPassword != null">
+        #{userPassword,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null">
+        #{phone,jdbcType=VARCHAR},
+      </if>
+      <if test="nickName != null">
+        #{nickName,jdbcType=VARCHAR},
+      </if>
+      <if test="memoName != null">
+        #{memoName,jdbcType=VARCHAR},
+      </if>
+      <if test="head != null">
+        #{head,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=BIGINT},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="gender != null">
+        #{gender,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUser != null">
+        #{updateUser,jdbcType=VARCHAR},
+      </if>
+      <if test="message != null">
+        #{message,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateByPrimaryKeySelective" parameterType="com.platform.entity.TbUser">
+    update tb_user
+    <set>
+      <if test="userName != null">
+        user_name = #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="userPassword != null">
+        user_password = #{userPassword,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        appid = #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="phone != null">
+        phone = #{phone,jdbcType=VARCHAR},
+      </if>
+      <if test="nickName != null">
+        nick_name = #{nickName,jdbcType=VARCHAR},
+      </if>
+      <if test="memoName != null">
+        memo_name = #{memoName,jdbcType=VARCHAR},
+      </if>
+      <if test="head != null">
+        head = #{head,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        type = #{type,jdbcType=INTEGER},
+      </if>
+      company_id = #{companyId,jdbcType=BIGINT},
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUser != null">
+        update_user = #{updateUser,jdbcType=VARCHAR},
+      </if>
+      <if test="message != null">
+        message = #{message,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="recStatus != null">
+        rec_status = #{recStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="gender != null">
+        gender = #{gender,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <select id="selectByPhones" resultMap="BaseResultMap">
+    select id, user_name, appid, phone, nick_name, head, memo_name
+    from tb_user
+    where rec_status = 'A' and phone in
+    <foreach collection="phones" item="phone" open="(" separator="," close=")">
+      #{phone}
+    </foreach>
+  </select>
+</mapper>

+ 7 - 0
platform-common/pom.xml

@@ -357,6 +357,13 @@
             <artifactId>java-jwt</artifactId>
             <version>3.4.0</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.fdage.micro</groupId>
+            <artifactId>unite-account-commom</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+
     </dependencies>
 
   <!--  <build>

+ 0 - 422
platform-common/src/main/java/com/platform/controller/SysLoginController.java

@@ -1,422 +0,0 @@
-//package com.platform.controller;
-//
-//import com.alibaba.fastjson.JSONArray;
-//import com.alibaba.fastjson.JSONObject;
-//import com.google.code.kaptcha.Constants;
-//import com.google.code.kaptcha.Producer;
-//import com.platform.annotation.SysLog;
-//import com.platform.entity.Result;
-//import com.platform.entity.SysSmsLogEntity;
-//import com.platform.entity.SysUserEntity;
-//import com.platform.enums.ResultCodeEnum;
-//import com.platform.exception.CommonBaseException;
-//import com.platform.service.impl.SysSmsLogServiceImpl;
-//import com.platform.service.impl.SysUserRoleServiceImpl;
-//import com.platform.service.impl.SysUserServiceImpl;
-//import com.platform.service.impl.ZhiHouseService;
-//import com.platform.utils.*;
-//import com.platform.vos.CurrentUserLoginVo;
-//import com.platform.vos.UserOnlyLoginVo;
-//import com.platform.vos.ZhiHouseUserLoginVo;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.slf4j.Slf4j;
-//import org.apache.commons.lang.StringUtils;
-//import org.apache.shiro.authc.*;
-//import org.apache.shiro.subject.Subject;
-//import org.springframework.beans.BeanUtils;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.http.HttpStatus;
-//import org.springframework.http.ResponseEntity;
-//import org.springframework.stereotype.Controller;
-//import org.springframework.transaction.annotation.Propagation;
-//import org.springframework.transaction.annotation.Transactional;
-//import org.springframework.util.CollectionUtils;
-//import org.springframework.util.ObjectUtils;
-//import org.springframework.web.bind.annotation.*;
-//import org.springframework.web.client.RestTemplate;
-//
-//import javax.imageio.ImageIO;
-//import javax.servlet.ServletOutputStream;
-//import javax.servlet.http.HttpServletResponse;
-//import java.awt.image.BufferedImage;
-//import java.io.IOException;
-//import java.time.Duration;
-//import java.time.LocalDateTime;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//
-///**
-// * 登录相关
-// *
-// * @author lipengjun
-// * @email 939961241@qq.com
-// * @date 2016年11月10日 下午1:15:31
-// */
-//@Api(tags = "系统登录相关")
-//@Controller
-//@Slf4j
-//public class SysLoginController {
-//
-//    public static final String SMS_AUTH_CODE_PRE = "login_sms_code:";
-//    @Autowired
-//    private Producer producer;
-//
-//    @Autowired
-//    private SysUserServiceImpl sysUserService;
-//
-//    @Autowired
-//    private SysSmsLogServiceImpl sysSmsLogService;
-//
-//    @Autowired
-//    private SysUserRoleServiceImpl sysUserRoleService;
-//
-//    @Value("${scenePath}")
-//    private String zhiHouseHost;
-//
-//    @Autowired
-//    private RestTemplate restTemplate;
-//
-//    @Autowired
-//    private ZhiHouseService zhiHouseService;
-//
-//
-//    @RequestMapping("captcha.jpg")
-//    public void captcha(HttpServletResponse response) throws IOException {
-//        response.setHeader("Cache-Control", "no-store, no-cache");
-//        response.setContentType("image/jpeg");
-//
-//        //生成文字验证码
-//        String text = producer.createText();
-//        //生成图片验证码
-//        BufferedImage image = producer.createImage(text);
-//        //保存到shiro session
-//        ShiroUtils.setSessionAttribute(Constants.KAPTCHA_SESSION_KEY, text);
-//
-//        ServletOutputStream out = response.getOutputStream();
-//        ImageIO.write(image, "jpg", out);
-//    }
-//
-//
-//    @ApiOperation(value = "验证短信验证码")
-//    @SysLog("验证短信验证码")
-//    @ResponseBody
-//    @PostMapping(value = "/sys/sms/authCodeValid")
-//    public Result smsAuthCodeValid(@RequestParam(name = "phoneNum") String phoneNum , @RequestParam(name = "smsCode") String smsCode) throws IOException {
-//
-//        if(StringUtils.isBlank(phoneNum) || StringUtils.isBlank(smsCode)){
-//            return Result.failure("手机号或者验证码不能为空");
-//        }
-//        String redisSmsCode = (String) LettuceRedisClientUtils.getValueByKey(SMS_AUTH_CODE_PRE + phoneNum + smsCode);
-//        log.info("缓存中的缓存码为:{},上送的为: {}" , redisSmsCode , smsCode);
-//        if(StringUtils.isBlank(redisSmsCode)){
-//            return Result.failure("验证码不正确或者已失效");
-//        }
-//        return Result.success();
-//    }
-//
-//    @ApiOperation(value = "发送短信校验码")
-//    @SysLog("发送短信校验码")
-//    @ResponseBody
-//    @PostMapping(value = "/sys/sms/authCode")
-//    public Result sendSmsMsg(@RequestParam(name = "phoneNum") String phoneNum , Long deptId) throws IOException {
-//
-//        if (StringUtils.isBlank(phoneNum)) {
-//            return Result.failure("手机号不能为空");
-//        }
-//        String regex = "^1[3-9][0-9]\\d{8}$";
-//        if (!phoneNum.matches(regex)) {
-//            return Result.failure("手机号不符合格式");
-//        }
-//        //校验是否是有效管理员
-//        if(null != deptId){
-//            SysUserEntity adminUser = sysUserService.queryByMobileAndDeptId(phoneNum , deptId);
-//            if(null == adminUser){
-//                return Result.failure("请正确填写所属公司管理员手机号码");
-//            }
-//            List<Long> roleIdList = sysUserRoleService.queryRoleIdList(adminUser.getUserId());
-//            if(CollectionUtils.isEmpty(roleIdList) || (!roleIdList.contains(5L) && !roleIdList.contains(6L))){
-//                return Result.failure("此手机对应的用户非管理员");
-//            }
-//
-//        }
-//
-//        // 一分钟之内不能重复发送短信
-//        SysSmsLogEntity smsLogVo = sysSmsLogService.querySmsCodeByPhoneNum(phoneNum);
-//        if (null != smsLogVo && null != smsLogVo.getCreateTime()) {
-//            Duration duration = Duration.between(smsLogVo.getCreateTime() , LocalDateTime.now());
-//            long millis = duration.toMillis();
-//            log.info("当前时间差为:{}[单位毫秒]" , millis);
-//            if (millis <= 60000L) {
-//                log.info("一分钟以内不能重复发短信");
-//                return Result.failure("短信已发送");
-//            }
-//        }
-//        //生成验证码
-//        String smsCode = CharUtil.getRandomNum(4);
-//        boolean falg = false;
-//        try {
-//            //阿里云短信平台
-//            falg = SmsUtil.sendAliSms(phoneNum, "{\"code\":\"" + smsCode + "\"}", "SMS_205075406");
-//        } catch (Exception e) {
-//            return Result.failure("短信发送失败");
-//        }
-//        if (falg) {
-//            SysSmsLogEntity sysSmsLogEntity = new SysSmsLogEntity();
-//            sysSmsLogEntity.setCreateTime(LocalDateTime.now());
-//            sysSmsLogEntity.setMobile(phoneNum);
-//            sysSmsLogEntity.setCode(smsCode);
-//            //发送状态 1标识成功,0标识失败
-//            sysSmsLogEntity.setSendStatus(1);
-//            sysSmsLogEntity.setContent("{\"code\":\"" + smsCode + "\"}");
-//            sysSmsLogService.save(sysSmsLogEntity);
-//            //将验证码存储redis中,有效期为5分钟,也就是300秒
-//            LettuceRedisClientUtils.setStrKeyValue(SMS_AUTH_CODE_PRE + phoneNum +  smsCode , smsCode , 300);
-//            return Result.success("短信发送成功",null);
-//        } else {
-//            return Result.failure("短信发送失败");
-//        }
-//    }
-//
-//    /**
-//     * 登录
-//     */
-//    @SysLog("登录")
-//    @ResponseBody
-//    @RequestMapping(value = "/sys/loginWithoutAuth", method = RequestMethod.POST)
-//    public Result onlyLogin(@RequestBody UserOnlyLoginVo userOnlyLoginVo){
-//
-//        ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
-//        userLoginVo.setUserName(userOnlyLoginVo.getUsername());
-//        //对前端传的密码解密
-//        String password = Base64Converter.decode(Base64Converter.subText(userOnlyLoginVo.getPassword()));
-//        userOnlyLoginVo.setPassword(password);
-//        userLoginVo.setUserPassword(userOnlyLoginVo.getPassword());
-//        userLoginVo.setArea("1234");
-//        String url = zhiHouseHost + "api/platform/login";
-//        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url, userLoginVo,String.class);
-//        if(kankanResult.getStatusCode()!= HttpStatus.OK){
-//            return Result.failure("账户验证失败");
-//        }
-//        //解析返回结果
-//        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
-//        log.info("四维看看返回登录数据:{}", kankanResult.getBody());
-//        Result result = parseResult(res, "登录失败", userLoginVo);
-//        if(StringUtils.equals(result.getCode().toString(), String.valueOf(Result.CODE_SUCCESS))){
-//            SysUserEntity manager = sysUserService.queryByUserMobile(userOnlyLoginVo.getUsername());
-//            if(!ObjectUtils.isEmpty(manager) && manager.getDeptId() != -1L){
-//                return Result.failure("操作失败,当前账号已被绑定");
-//            }
-//        }
-//        return result;
-//    }
-//
-//    /**
-//     * 登录
-//     */
-//    @SysLog("登录")
-//    @ResponseBody
-//    @RequestMapping(value = "/sys/login", method = RequestMethod.POST)
-//    public Result login(String username, String password, String captcha) throws IOException {
-////        String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
-////        if (null == kaptcha) {
-////            return Result.failure("验证码已失效");
-////        }
-////        if (!captcha.equalsIgnoreCase(kaptcha)) {
-////            return Result.failure("验证码不正确");
-////        }
-//
-//        //对前端传的密码解密
-//        password = Base64Converter.decode(Base64Converter.subText(password));
-//
-//        ResponseEntity<String> loginResult = zhiHouseService.login(username, password);
-//        if(loginResult.getStatusCode()!= HttpStatus.OK){
-//            return Result.failure("登录失败");
-//        }
-//        //解析返回结果
-//        JSONObject res = JSONObject.parseObject(loginResult.getBody());
-//        Result result = parseResultWithoutAddUser(res, "登录失败");
-////        if (null != result && result.getCode().equals(Result.CODE_SUCCESS)) {
-////            log.info("四维看看登录完成,将执行本地登录验证");
-////            try {
-////                Subject subject = ShiroUtils.getSubject();
-////                UsernamePasswordToken token = new UsernamePasswordToken(username, password);
-////                subject.login(token);
-////            } catch (UnknownAccountException | IncorrectCredentialsException | LockedAccountException e) {
-////                return Result.failure(e.getMessage());
-////            } catch (AuthenticationException e) {
-////                return Result.failure("账户验证失败");
-////            }
-////        }
-//        return result;
-//    }
-//    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
-//    public Result parseResultWithoutAddUser(JSONObject res, String defaultFailMsg) {
-//        if(ObjectUtils.isEmpty(res)){
-//            return Result.failure(defaultFailMsg);
-//        }
-//        int code = res.containsKey("code") ? res.getIntValue("code") : -10;
-//        if (200 != code) {
-//            return Result.failure(res.getString("message"));
-//        }
-//        Map<String, Object> resultMap = new HashMap<>();
-//        JSONObject dataObject = null;
-//        String tokenFromKankan = "";
-//        if (res.get("message") instanceof JSONArray) {
-//            log.info("四维看看登录返回的data是json数组");
-//            return Result.success();
-//        } else if (res.get("message") instanceof JSONObject) {
-//            log.info("四维看看登录返回的data是json object");
-//            //登录返回的就是jsonObject
-//            dataObject = (JSONObject) res.get("message");
-//            if(ObjectUtils.isEmpty(dataObject)){
-//                return Result.success(resultMap);
-//            }
-//            tokenFromKankan = dataObject.getString("token");
-//            if (StringUtils.isBlank(tokenFromKankan)) {
-//                throw new CommonBaseException(ResultCodeEnum.D101, "四维看看返回的token为空");
-//            }
-//            resultMap.put("token", tokenFromKankan);
-//            String nickName = dataObject.getString("nickName");
-//            String userName = dataObject.getString("userName");
-//            if (StringUtils.isBlank(userName)) {
-//                throw new CommonBaseException(ResultCodeEnum.D101, "看看返回用户名为空");
-//            }
-//            SysUserEntity dbUser = sysUserService.queryByUserMobile(userName);
-//            if (null == dbUser) {
-//                  return Result.failure(11 ,"账号未授权,请联系平台管理员授予相关权限。");
-//            }
-//            if (null != dbUser.getStatus() && dbUser.getStatus() == 0) {
-//                log.info("用户[{}]不可用", dbUser.getUsername());
-//                throw new CommonBaseException(ResultCodeEnum.D101, "用户已经不可用");
-//            }
-//            CurrentUserLoginVo userVo = new CurrentUserLoginVo();
-//            BeanUtils.copyProperties(dbUser,userVo);
-//            if(!ObjectUtils.isEmpty(dbUser.getDeptId())){
-//                // 获取用户所在企业信息
-//                JSONObject deptEntity = zhiHouseService.getComponyInfo(dbUser.getMobile());
-//                userVo.setDeptName(deptEntity.getString("name"));
-//                userVo.setDeptId(deptEntity.getLong("id"));
-//                userVo.setDeptManagerPhoneNum(deptEntity.getString("phoneNum"));
-//                userVo.setDeptExpirationDate(deptEntity.getDate("expirationDate"));
-//                userVo.setFdkkPassword(null);
-//            }
-//            resultMap.put("user", userVo);
-//            return Result.success(resultMap);
-//        } else {
-//            return Result.failure("四维看看返回数据测试异常");
-//        }
-//
-//
-//    }
-//
-//
-//    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
-//    public Result parseResult(JSONObject res, String defaultFailMsg, ZhiHouseUserLoginVo adminRegisterVo) {
-//        if(ObjectUtils.isEmpty(res)){
-//            return Result.failure(defaultFailMsg);
-//        }
-//        int code =res.containsKey("code")?res.getIntValue("code"): -10;
-//        if (200 != code) {
-//            return Result.failure(res.getString("message"));
-//        }
-//        Map<String, Object> resultMap = new HashMap<>();
-//        log.info("用户登录成功");
-//        if (res.get("message") instanceof JSONArray) {
-//            log.info("四维看看登录返回的data是json数组");
-//            return Result.success();
-//        } else if (res.get("message") instanceof JSONObject) {
-//            log.info("四维看看登录返回的data是json object");
-//            JSONObject dataObject = (JSONObject) res.get("message");
-//            if(ObjectUtils.isEmpty(dataObject)){
-//                return Result.success(resultMap);
-//            }
-//            String tokenFromKankan = dataObject.getString("token");
-//            if (StringUtils.isBlank(tokenFromKankan)) {
-//                throw new CommonBaseException(ResultCodeEnum.D101, "四维看看返回的token为空");
-//            }
-//            resultMap.put("token", tokenFromKankan);
-//            String nickName = dataObject.getString("nickName");
-//            String userName = dataObject.getString("userName");
-//            String password = dataObject.getString("userPassword");
-//            if (StringUtils.isBlank(userName)) {
-//                throw new CommonBaseException(ResultCodeEnum.D101, "看看返回用户名为空");
-//            }
-//            SysUserEntity dbUser = sysUserService.queryByUserMobile(userName);
-//            if (null == dbUser) {
-//                addNewUserWithDeptId(nickName,userName , password, -1L);
-//                dbUser = sysUserService.queryByUserMobile(adminRegisterVo.getUserName());
-//                if (null == dbUser) {
-//                    log.error("新插入的用户:{}重新捞取失败", adminRegisterVo.getUserName());
-//                    throw new CommonBaseException(ResultCodeEnum.D101, "获取用户失败");
-//                }
-//                //默认开通普通公司管理员的权限
-//                int insert = sysUserRoleService.onlySave(dbUser.getUserId(), 6L);
-//                if(insert != 1){
-//                    log.error("给用户[{}]开通普通管理员角色失败" , dbUser.getMobile());
-//                    throw new CommonBaseException(ResultCodeEnum.D101 , "新增普通管理员权限失败");
-//                }
-//            } else {
-//                if (null != dbUser.getStatus() && dbUser.getStatus() == 0) {
-//                    log.info("用户[{}]不可用", dbUser.getUsername());
-//                    throw new CommonBaseException(ResultCodeEnum.D101, "用户已经不可用");
-//                }
-//                if(!StringUtils.equals(nickName , dbUser.getUsername())){
-//                    log.info("修改了昵称,这里更新");
-//                    dbUser.setUsername(nickName);
-//                    sysUserService.updateOnly(dbUser);
-//                }
-//            }
-//            resultMap.put("user", dbUser);
-//            return Result.success(resultMap);
-//        } else {
-//            return Result.failure("四维看看返回数据测试异常");
-//        }
-//    }
-//
-//    public void addNewUserWithDeptId(String nickName, String phoneNum, String password, long deptId){
-//        if (StringUtils.isBlank(phoneNum)) {
-//            return;
-//        }
-//        SysUserEntity userEntity = new SysUserEntity();
-//        userEntity.setPassword(password);
-//        userEntity.setMobile(phoneNum);
-//        userEntity.setUsername(nickName);
-//        if(deptId >= 0){
-//            userEntity.setDeptId(deptId);
-//        }
-//        userEntity.setStatus(1);
-//        userEntity.setCreateUserId(1L);
-//        userEntity.setDeptId(-1L);
-//        sysUserService.addNewUserWithoutCheck(userEntity);
-//    }
-//
-//    public void addNewUserByPhone(String phoneNum, String password, int kankanUserId) {
-//        if (StringUtils.isBlank(phoneNum)) {
-//            return;
-//        }
-//        SysUserEntity userEntity = new SysUserEntity();
-//        userEntity.setPassword(password);
-//        userEntity.setMobile(phoneNum);
-//        userEntity.setUsername(phoneNum);
-//        userEntity.setStatus(1);
-//        //TODO:看看放这里是否合适
-//        userEntity.setCreateUserId(1L);
-//        //TODO:这里默认给76的默认部门
-//        userEntity.setDeptId(76L);
-//        sysUserService.addNewUserWithoutCheck(userEntity);
-//
-//    }
-//
-//    /**
-//     * 退出
-//     */
-//    @RequestMapping(value = "logout", method = RequestMethod.GET)
-//    public String logout() {
-//        ShiroUtils.logout();
-//        return "redirect:/";
-//    }
-//
-//}

+ 75 - 0
platform-common/src/main/java/com/platform/entity/SysRoleEntity.java

@@ -0,0 +1,75 @@
+package com.platform.entity;
+
+
+import lombok.Data;
+import org.hibernate.validator.constraints.NotBlank;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 角色
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @date 2016年9月18日 上午9:27:38
+ */
+@Data
+public class SysRoleEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 角色ID
+     */
+    private Long roleId;
+
+    /**
+     * 角色名称
+     */
+    @NotBlank(message = "角色名称不能为空")
+    private String roleName;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 创建者ID
+     */
+    private Long createUserId;
+
+    private List<Long> menuIdList;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 部门ID
+     */
+    private Long companyId;
+
+    /**
+     * 是否是平台角色
+     */
+    private int isPlatformRole;
+    /**
+     * 0 平台角色 1公司角色
+     */
+    private int roleType;
+
+    /**
+     * 部门名称
+     */
+    private String companyName;
+
+    /**
+     * 带看权利: 0->没有权限;1->有带看权限
+     */
+    private Integer canShow;
+
+    private List<Long> companyIdList;
+
+}

+ 82 - 0
platform-common/src/main/java/com/platform/entity/SysUserRoleEntity.java

@@ -0,0 +1,82 @@
+package com.platform.entity;
+
+
+import java.io.Serializable;
+
+/**
+ * 用户与角色对应关系
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @date 2016年9月18日 上午9:28:39
+ */
+public class SysUserRoleEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 用户ID
+     */
+    private Long userId;
+
+    /**
+     * 角色ID
+     */
+    private Long roleId;
+
+    /**
+     * 设置:
+     *
+     * @param id
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:
+     *
+     * @return Long
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * 设置:用户ID
+     *
+     * @param userId 用户ID
+     */
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取:用户ID
+     *
+     * @return Long
+     */
+    public Long getUserId() {
+        return userId;
+    }
+
+    /**
+     * 设置:角色ID
+     *
+     * @param roleId 角色ID
+     */
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    /**
+     * 获取:角色ID
+     *
+     * @return Long
+     */
+    public Long getRoleId() {
+        return roleId;
+    }
+
+}

+ 405 - 0
platform-common/src/main/java/com/platform/entity/TbScenePro.java

@@ -0,0 +1,405 @@
+package com.platform.entity;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+
+/**
+ * 场景表
+ */
+public class TbScenePro extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 661912133849676944L;
+    /**
+     * 场景名称
+     */
+    private String sceneName;
+    /**
+     * 场景描述
+     */
+    private String sceneDec;
+    /**
+     * 场景的链接地址
+     */
+    private String webSite;
+    /**
+     * 场景缩略图
+     */
+    private String thumb;
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示
+     */
+    private int status;
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    private String dataSource;
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费(八目场景指锁住),-2表示临时空间(八目场景)
+     */
+    private int payStatus;
+    /**
+     * 手机id
+     */
+    private String phoneId;
+    /**
+     * 大场景序号
+     */
+    private String num;
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居
+     */
+    private int sceneType;
+    /**
+     * 1表示推荐,0表示正常
+     */
+    private int recommend;
+    /**
+     * 浏览次数
+     */
+    private int viewCount;
+    /**
+     * 拍摄数量
+     */
+    private int shootCount;
+    /**
+     * 要gps定位
+     */
+    private String gps;
+    /**
+     * 方案:1是双目,2是转台,3是六目,4是八目
+     */
+    private int sceneScheme;
+    /**
+     * 用户表t_user的id
+     */
+    private Long userId;
+    /**
+     * 相机主表t_camera的id
+     */
+    private Long cameraId;
+    /**
+     * 容量
+     */
+    private BigInteger space;
+
+    /**
+     * 算法类型(sfm或slam)
+     */
+    private String algorithm;
+
+    /**
+     * 服务器的服务商
+     */
+    private String ecs;
+
+    /**
+     * 点位视频
+     */
+    private String videos;
+
+    /**
+     * 所有资源文件名
+     */
+    private String filesName;
+
+    /**
+     * 所有资源文件名
+     */
+    private String sceneLogo;
+
+    /**
+     * 硬件版本
+     */
+    private String firmwareVersion;
+
+    private String buildType;
+
+    /**
+     * 场景来源,相机拍摄10以内表示,1表示八目,
+     * 其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    private Integer sceneSource;
+
+    private String cooperationUserId;
+
+    /**
+     * 触发mq调度,事务最后触发
+     */
+    private String mqMsg;
+
+    private Long houseId;
+    private String workNumber;
+
+    //显示
+    private Integer isShow;
+
+    //app显示图片
+    private String appListPicUrl;
+
+    //是否生成直播间
+    private boolean lived;
+
+    public String getSceneName() {
+        return sceneName;
+    }
+
+    public void setSceneName(String sceneName) {
+        this.sceneName = sceneName;
+    }
+
+    public String getSceneDec() {
+        return sceneDec;
+    }
+
+    public void setSceneDec(String sceneDec) {
+        this.sceneDec = sceneDec;
+    }
+
+    public String getWebSite() {
+        return webSite;
+    }
+
+    public void setWebSite(String webSite) {
+        this.webSite = webSite;
+    }
+
+    public String getThumb() {
+        return thumb;
+    }
+
+    public void setThumb(String thumb) {
+        this.thumb = thumb;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public String getDataSource() {
+        return dataSource;
+    }
+
+    public void setDataSource(String dataSource) {
+        this.dataSource = dataSource;
+    }
+
+    public int getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(int payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public String getPhoneId() {
+        return phoneId;
+    }
+
+    public void setPhoneId(String phoneId) {
+        this.phoneId = phoneId;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public int getSceneType() {
+        return sceneType;
+    }
+
+    public void setSceneType(int sceneType) {
+        this.sceneType = sceneType;
+    }
+
+    public int getRecommend() {
+        return recommend;
+    }
+
+    public void setRecommend(int recommend) {
+        this.recommend = recommend;
+    }
+
+    public int getViewCount() {
+        return viewCount;
+    }
+
+    public void setViewCount(int viewCount) {
+        this.viewCount = viewCount;
+    }
+
+    public int getShootCount() {
+        return shootCount;
+    }
+
+    public void setShootCount(int shootCount) {
+        this.shootCount = shootCount;
+    }
+
+    public String getGps() {
+        return gps;
+    }
+
+    public void setGps(String gps) {
+        this.gps = gps;
+    }
+
+    public int getSceneScheme() {
+        return sceneScheme;
+    }
+
+    public void setSceneScheme(int sceneScheme) {
+        this.sceneScheme = sceneScheme;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getCameraId() {
+        return cameraId;
+    }
+
+    public void setCameraId(Long cameraId) {
+        this.cameraId = cameraId;
+    }
+
+    public BigInteger getSpace() {
+        return space;
+    }
+
+    public void setSpace(BigInteger space) {
+        this.space = space;
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+
+    public String getEcs() {
+        return ecs;
+    }
+
+    public void setEcs(String ecs) {
+        this.ecs = ecs;
+    }
+
+    public String getVideos() {
+        return videos;
+    }
+
+    public void setVideos(String videos) {
+        this.videos = videos;
+    }
+
+    public String getFilesName() {
+        return filesName;
+    }
+
+    public void setFilesName(String filesName) {
+        this.filesName = filesName;
+    }
+
+    public String getSceneLogo() {
+        return sceneLogo;
+    }
+
+    public void setSceneLogo(String sceneLogo) {
+        this.sceneLogo = sceneLogo;
+    }
+
+    public String getFirmwareVersion() {
+        return firmwareVersion;
+    }
+
+    public void setFirmwareVersion(String firmwareVersion) {
+        this.firmwareVersion = firmwareVersion;
+    }
+
+    public String getBuildType() {
+        return buildType;
+    }
+
+    public void setBuildType(String buildType) {
+        this.buildType = buildType;
+    }
+
+    public Integer getSceneSource() {
+        return sceneSource;
+    }
+
+    public void setSceneSource(Integer sceneSource) {
+        this.sceneSource = sceneSource;
+    }
+
+    public String getCooperationUserId() {
+        return cooperationUserId;
+    }
+
+    public void setCooperationUserId(String cooperationUserId) {
+        this.cooperationUserId = cooperationUserId;
+    }
+
+    public String getMqMsg() {
+        return mqMsg;
+    }
+
+    public void setMqMsg(String mqMsg) {
+        this.mqMsg = mqMsg;
+    }
+
+    public Long getHouseId() {
+        return houseId;
+    }
+
+    public void setHouseId(Long houseId) {
+        this.houseId = houseId;
+    }
+
+    public void setWorkNumber(String workNumber) {
+        this.workNumber = workNumber;
+    }
+
+    public String getWorkNumber() {
+        return workNumber;
+    }
+
+    public Integer getIsShow() {
+        return isShow;
+    }
+
+    public void setIsShow(Integer isShow) {
+        this.isShow = isShow;
+    }
+
+    public String getAppListPicUrl() {
+        return appListPicUrl;
+    }
+
+    public void setAppListPicUrl(String appListPicUrl) {
+        this.appListPicUrl = appListPicUrl;
+    }
+
+    public boolean getLived() {
+        return lived;
+    }
+
+    public void setLived(boolean lived) {
+        this.lived = lived;
+    }
+}

+ 58 - 0
platform-common/src/main/java/com/platform/entity/TbUser.java

@@ -0,0 +1,58 @@
+package com.platform.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class TbUser {
+    private Long id;
+
+    private String userName;
+
+    private String userPassword;
+
+    private String appid;
+
+    private String phone;
+
+    private String nickName;
+
+    private String memoName;
+
+    private String head;
+
+    private Integer type;
+
+    private Long companyId;
+
+    private Integer state;
+    private Integer gender;
+
+    private Date createTime;
+
+    private String createUser;
+
+    private Date updateTime;
+
+    private String updateUser;
+
+    private String message;
+
+    private String token;
+
+    private String fdkkUser;
+
+    private String fdkkPassword;
+
+    private String RoleName;
+    private List<Long> roleIdList;
+    private String companyName;
+    private Integer canShow;
+    private Long roleId;
+    private Integer isBind;
+    private String recStatus;
+
+    private Date companyExpirationTime;
+}

+ 0 - 34
platform-common/src/main/java/com/platform/enums/SysRoleEnum.java

@@ -1,34 +0,0 @@
-package com.platform.enums;
-
-public enum SysRoleEnum {
-    ADMIN(5L, "超级管理员"),
-    COMPONY_ADMIN(6L, "平台主持人"),
-    COMPONY_EMPLOYEE(8L, "公司员工"),
-    PLATFORM_STREAMER(9L, "平台主持人");
-
-    private Long code;
-    private String desc;
-
-    public static Long PLATFORM_STREAMER_CODE = 9L;
-
-    SysRoleEnum(Long code, String desc) {
-        this.code = code;
-        this.desc = desc;
-    }
-
-    public Long getCode() {
-        return code;
-    }
-
-    public void setCode(Long code) {
-        this.code = code;
-    }
-
-    public String getDesc() {
-        return desc;
-    }
-
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
-}

+ 0 - 20
platform-common/src/main/java/com/platform/log4j/GradeLogDailyRollingFileAppender.java

@@ -1,20 +0,0 @@
-package com.platform.log4j;
-
-import org.apache.log4j.DailyRollingFileAppender;
-import org.apache.log4j.Priority;
-
-/**
- * 名称:GradeLogDailyRollingFileAppender <br>
- * 描述:自定义日志文件追加类,使日志分级打印配置只判断是否相等,而不是使用上限<br>
- *
- * @author 李鹏军
- * @version 1.0
- * @since 1.0.0
- */
-public class GradeLogDailyRollingFileAppender extends DailyRollingFileAppender {
-    @Override
-    public boolean isAsSevereAsThreshold(Priority priority) {
-        //只判断是否相等,而不判断优先级
-        return this.getThreshold().equals(priority);
-    }
-}

+ 0 - 386
platform-common/src/main/java/com/platform/service/impl/ZhiHouseService.java

@@ -1,386 +0,0 @@
-package com.platform.service.impl;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.vos.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class ZhiHouseService {
-    private static Logger logger = LoggerFactory.getLogger(ZhiHouseService.class);
-
-    @Value("${scenePath}")
-    private String zhiHouseHost;
-
-    @Autowired
-    private RestTemplate restTemplate;
-
-    /**
-     * 登录指房宝
-     * @param username
-     * @param password
-     * @return
-     */
-    public ResponseEntity<String> login(String username, String password) {
-        ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
-        userLoginVo.setUserName(username);
-        userLoginVo.setUserPassword(password);
-        userLoginVo.setArea("1234");
-        String url = zhiHouseHost + "api/platform/login";
-        return restTemplate.postForEntity(url, userLoginVo, String.class);
-    }
-
-    public ReturnDTO generateSceneEditToken(String token, String userName, String sceneNum) {
-        if(ObjectUtils.isEmpty(token)){
-            throw new CommonBaseException(ResultCodeEnum.D101);
-        }
-        Map<String, String> param = new HashMap<>();
-        param.put("userName",userName);
-        param.put("sceneNum",sceneNum);
-        String url = zhiHouseHost + "api/platform/generateSceneEditToken";
-        HttpHeaders headers = new HttpHeaders();
-        headers.add("token", token);
-        HttpEntity<Object> formEntity = new HttpEntity<>(param, headers);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,formEntity,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100,"连接失败");
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-
-        return responseEntity.getBody();
-    }
-
-    /**
-     * 获取四维看看场景数据
-     * @param username
-     * @return
-     */
-    public ReturnDTO sync4dkkSceneData(String username) {
-        Map<String ,Object> params = new HashMap<>(1);
-        params.put("phone",username);
-        String url = zhiHouseHost + "api/platform/sync4dkkSceneData";
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url, params, ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        return responseEntity.getBody();
-    }
-
-    public JSONObject getSceneFromZhiHouse(RequestScene requestScene){
-        String url = zhiHouseHost + "scene/list";
-        if(org.apache.commons.lang3.StringUtils.isBlank(url )){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全,无法获取四维场景列表");
-        }
-        HttpHeaders headers = new HttpHeaders();
-        headers.add("token", requestScene.getToken());
-        HttpEntity<Object> formEntity = new HttpEntity<>(requestScene, headers);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,formEntity,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        //把信息封装为json
-        return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
-    }
-
-    public void bind4dkkUser(String fdkkUser, String fdkkPassword, String token) {
-        HttpHeaders headers = new HttpHeaders();
-        headers.add("token", token);
-        Map<String ,Object> params = new HashMap<>(1);
-        params.put("fdkkUser",fdkkUser);
-        params.put("fdkkPassword",fdkkPassword);
-        HttpEntity<Object> formEntity = new HttpEntity<>(params, headers);
-        String url = null;
-        if (ObjectUtils.isEmpty(fdkkUser) || ObjectUtils.isEmpty(fdkkPassword)) {
-            url = zhiHouseHost.concat("/user/unBind4dkkUser");
-        } else {
-            url = zhiHouseHost.concat("/user/bind4dkkUser");
-        }
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url, formEntity, ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-    }
-
-    public ReturnDTO wcLogin(String appId,String userName,Integer gender,String nickName,String avatar) {
-        String url = zhiHouseHost + "wcLogin";
-        if(org.apache.commons.lang3.StringUtils.isBlank(appId)){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全");
-        }
-        Map<String ,Object> params = new HashMap<>(1);
-        params.put("appid",appId);
-        params.put("userName",userName);
-        params.put("nickName",nickName);
-        params.put("gender",gender);
-        params.put("head",nickName);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100,"登录失败");
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-
-        return responseEntity.getBody();
-    }
-
-    public Object increaseViewCount(Integer sceneId) {
-        String url = zhiHouseHost + "/api/scene/updateViewCount?sceneId=" + sceneId;
-        if(ObjectUtils.isEmpty(sceneId)){
-            return 0;
-        }
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.getForEntity(url,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100,"登录失败");
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-
-        return responseEntity.getBody();
-    }
-
-    public JSONObject queryBySceneNum(String sceneNum,String token) {
-        RequestScene requestScene = new RequestScene();
-        requestScene.setNums("'"+sceneNum+"'");
-        requestScene.setUserId(-1L);
-        requestScene.setToken(token);
-        JSONObject mySceneJsonData = getSceneFromZhiHouse(requestScene);
-        List<Object> mySceneList = mySceneJsonData.getJSONArray("list");
-        if(CollectionUtils.isEmpty(mySceneList)){
-            return null;
-        }
-        return JSONObject.parseObject(JSONObject.toJSONString(mySceneList.get(0)));
-    }
-
-    public Object generateDefaultLiveRoom(String sceneNum,Boolean lived) {
-        String url = zhiHouseHost + "scene/generateDefaultLiveRoom";
-        logger.info("请求地址:{}",url);
-        Map<String ,Object> params = new HashMap<>(1);
-        params.put("sceneNum",sceneNum);
-        params.put("lived",lived);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100,"生成直播间失败");
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        logger.info("返回结果:{}",JSONObject.toJSONString(responseEntity.getBody().getMessage()));
-        return responseEntity.getBody().getMessage();
-    }
-
-
-    public List<TbUser> getSysUserListByDeptIds(Long deptId) {
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("deptId", deptId);
-        String url = zhiHouseHost + "api/shop/getUserByDeptId";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        List<TbUser> message = JSONArray.parseArray(JSONArray.toJSONString(responseEntity.getBody().getMessage()),TbUser.class);
-        return message;
-    }
-
-    public TbUser queryByUserMobile(String phone) {
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("phone", phone);
-        String url = zhiHouseHost + "api/shop/queryByUserMobile";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()),TbUser.class);
-    }
-
-    public TbUser getByUserId(Long userId) {
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("userId", userId);
-        String url = zhiHouseHost + "api/shop/getByUserId";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        TbUser tbUser =  JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()),TbUser.class);
-        return tbUser;
-    }
-
-    public List<Long> queryDeptIdListByUserId(Long userId) {
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("userId", userId);
-        String url = zhiHouseHost + "api/shop/queryCompanyIdListByUserId";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        List<Long> longs = (List) responseEntity.getBody().getMessage();
-        return longs;
-    }
-
-    public CurrentUserLoginVo getCurrentUser() {
-        Map<String, Object> mp = new HashMap<>();
-        String url = zhiHouseHost + "api/shop/getCurrentUser";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        CurrentUserLoginVo user = (CurrentUserLoginVo) responseEntity.getBody().getMessage();
-        return user;
-    }
-
-    public List<String> getAllPerms(Long userId) {
-        Map<String, Object> mp = new HashMap<>();
-        if(userId!=null){
-            mp.put("userId",userId);
-        }
-        String url = zhiHouseHost + "api/shop/getAllPerms";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        List<String> list = (List<String>) responseEntity.getBody().getMessage();
-        return list;
-    }
-
-    public Collection<JSONObject> queryRecomendsByType(Integer type){
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("type", type);
-        String url = zhiHouseHost + "recommend/selectWxByType";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        List<JSONObject> message = JSONArray.parseArray(JSONArray.toJSONString(responseEntity.getBody().getMessage()),JSONObject.class);
-        return message;
-    }
-
-    public JSONObject getSysUserListPageByDeptIdsAndUserName(Long deptId,Long page,Long limit, String username,String token) {
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("username", username);
-        mp.put("companyId", deptId);
-        mp.put("page", page);
-        mp.put("limit", limit);
-        HttpHeaders headers = new HttpHeaders();
-        headers.add("token", token);
-        String url = zhiHouseHost + "api/shop/queryAllUserPageByDeptIdAndUserName";
-        HttpEntity<Object> formEntity = new HttpEntity<>(mp, headers);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,formEntity,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        //把信息封装为json
-        return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
-    }
-
-    public List<String> getBindUserNameList(List<Long> userIds, String token) {
-
-        Map<String, Object> mp = new HashMap<>();
-        mp.put("userIds", userIds);
-        String url = zhiHouseHost + "api/shop/getBindUserNameList";
-        ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        //把信息封装为json
-
-        List<String> list = (List<String>) responseEntity.getBody().getMessage();
-        return list;
-    }
-
-    public JSONObject getCompanyId(Long companyId) {
-        if(companyId == null){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全,无法获取四维场景列表");
-        }
-        String url = zhiHouseHost + "company/getCompony";
-        Map<String ,Object> params = new HashMap<>(1);
-        params.put("id",companyId);
-        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
-        if(responseEntity.getStatusCode()!= HttpStatus.OK){
-            throw new CommonBaseException(ResultCodeEnum.D100);
-        }
-        if (responseEntity.getBody().getCode() != 200) {
-            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-        }
-        //把信息封装为json
-        return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
-    }
-
-    public Integer getCountRecommendByBrandIds(Integer[] ids) {
-        try {
-            if(ids == null || ids.length <=0){
-                throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全");
-            }
-            String url = zhiHouseHost + "recommend/getCountRecommendByBrandIds";
-            Map<String ,Object> params = new HashMap<>(1);
-            params.put("ids",ids);
-            ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
-            if(responseEntity.getStatusCode()!= HttpStatus.OK){
-                throw new CommonBaseException(ResultCodeEnum.D100);
-            }
-            if (responseEntity.getBody().getCode() != 200) {
-                throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
-            }
-            //把信息封装为json
-            return Integer.valueOf(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return null;
-    }
-}

+ 5 - 77
platform-common/src/main/java/com/platform/shiro/UserRealm.java

@@ -1,34 +1,13 @@
 package com.platform.shiro;
 
-import com.alibaba.fastjson.JSON;
-import com.auth0.jwt.JWT;
-import com.alibaba.fastjson.JSONObject;
-import com.platform.cache.J2CacheUtils;
 import com.platform.shiro.jwt.JwtToken;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.utils.Constant;
-import com.platform.utils.JwtUtil;
-import com.platform.utils.LettuceRedisClientUtils;
-import com.platform.vos.CurrentUserLoginVo;
-import com.platform.vos.TbUser;
-import io.jsonwebtoken.Claims;
 import lombok.extern.slf4j.Slf4j;
-import net.oschina.j2cache.redis.RedisUtils;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.*;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
 import org.apache.shiro.authz.AuthorizationInfo;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
 import org.apache.shiro.realm.AuthorizingRealm;
-import org.apache.shiro.session.Session;
 import org.apache.shiro.subject.PrincipalCollection;
-import org.apache.shiro.subject.Subject;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ObjectUtils;
-
-import java.util.*;
 
 /**
  * 认证
@@ -39,9 +18,6 @@ import java.util.*;
 @Slf4j
 public class UserRealm extends AuthorizingRealm {
 
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
     @Override
     public boolean supports(AuthenticationToken token) {
         return token instanceof JwtToken;
@@ -53,28 +29,7 @@ public class UserRealm extends AuthorizingRealm {
      */
     @Override
     protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
-        TbUser user = (TbUser) principals.getPrimaryPrincipal();
-        Long userId = user.getId();
-        Set<String> permsSet = new HashSet<String>();
-        List<String> permsList;
-        //系统管理员,拥有最高权限
-        if (user.getRoleIdList().contains(1)) {
-            permsList = zhiHouseService.getAllPerms(null);
-        } else {
-            permsList = zhiHouseService.getAllPerms(userId);
-        }
-        //用户权限列表
-        if (permsList != null && permsList.size() != 0) {
-            for (String perms : permsList) {
-                if (StringUtils.isBlank(perms)) {
-                    continue;
-                }
-                permsSet.addAll(Arrays.asList(perms.trim().split(",")));
-            }
-        }
-        SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
-        info.setStringPermissions(permsSet);
-        return info;
+        return null;
     }
 
     /**
@@ -83,33 +38,6 @@ public class UserRealm extends AuthorizingRealm {
     @Override
     protected AuthenticationInfo doGetAuthenticationInfo(
             AuthenticationToken auth) throws AuthenticationException {
-        String token = (String) auth.getCredentials();
-        Claims claims = JwtUtil.parseJWT(token);
-        String userId = claims.get("id", String.class);
-        //查询用户信息
-        TbUser userEntity = zhiHouseService.getByUserId(Long.valueOf(userId));
-
-        //账号不存在
-        if (userEntity == null) {
-            throw new UnknownAccountException("账号或密码不正确");
-        }
-        CurrentUserLoginVo user = new CurrentUserLoginVo();
-        BeanUtils.copyProperties(userEntity, user);
-        // 把当前用户放入到session中
-        Subject subject = SecurityUtils.getSubject();
-        Session session = subject.getSession(true);
-        if (!ObjectUtils.isEmpty(user.getCompanyId())) {
-            // 获取用户所在企业信息
-            JSONObject componyInfo = zhiHouseService.getCompanyId(user.getCompanyId());
-            if(componyInfo !=null){
-                user.setCompanyName(componyInfo.getString("name"));
-                user.setCompanyId(componyInfo.getLong("id"));
-                user.setCompanyManagerPhoneNum(componyInfo.getString("phone"));
-                user.setCompanyExpirationDate(componyInfo.getDate("expirationTime"));
-            }
-        }
-        session.setAttribute(Constant.CURRENT_USER, user);
-        SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, token, getName());
-        return info;
+        return null;
     }
 }

+ 281 - 0
platform-common/src/main/java/com/platform/vos/ResponseScene.java

@@ -0,0 +1,281 @@
+package com.platform.vos;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+
+@Data
+public class ResponseScene implements Serializable {
+
+    private static final long serialVersionUID = 2454435822930272529L;
+
+    private Long id;
+
+    /**"场景缩略图*/
+    private String thumb;
+
+    /**"大场景的密钥*/
+    private String sceneKey;
+
+    /**"场景名称*/
+    private String sceneName;
+
+    /**"企业名称*/
+    private String companyName;
+
+    /**"场景描述*/
+    private String sceneDec;
+
+    /**"0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居*/
+    private int sceneType;
+
+    /**"场景封面图是否默认*/
+    private Byte thumbImg;
+
+    /**"版本*/
+    private int version;
+
+    /**"0表示默认,user表示自己上传*/
+    private String markerLogo;
+
+    /**"0表示默认,user表示自己上传*/
+    private String floorLogo;
+
+    /**"标记大小*/
+    private Integer floorLogoSize;
+
+    /**"表示初始点信息*/
+    private String entry;
+
+    /**"创建时间*/
+    private String createTime;
+
+    /**"拍摄数量*/
+    private int shootCount;
+
+    /**"0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示*/
+    private int status;
+
+    /**"模型贴图的风格*/
+    private int sceneIndex;
+
+    /**"背景音乐名称*/
+    private String hasBGM;
+
+    /**"方案:1是双目,2是转台,3是六目*/
+    private int cameraType;
+
+    /**"是否公开,0公开,1加密*/
+    private int isPublic;
+
+    /**"要gps定位*/
+    private String gps;
+
+    /**"相机的Mac地址*/
+    private String childName;
+
+    /**"用户名*/
+    private String userName;
+
+    /**"昵称*/
+    private String nickName;
+
+    /**"浏览次数*/
+    private int viewCount;
+
+    /**"场景的链接地址*/
+    private String webSite;
+
+    /**"原始的大场景数据*/
+    private String dataSource;
+
+    /**"0表示未付款,1表示付款了,-1表示欠费(八目场景指锁住),-2表示临时空间(八目场景)*/
+    private int payStatus;
+
+    /**"手机id*/
+    private String phoneId;
+
+    /**"大场景序号*/
+    private String num;
+
+    /**"1表示推荐,0表示正常*/
+    private int recommend;
+
+    /**"表示缩略图是否存在*/
+    private int thumbStatus;
+
+    /**"要上传的热点的id集合,用逗号隔开*/
+    private String hotsIds;
+
+    /**"大场景初始点的id*/
+    private String initialPointId;
+
+    /**"风格*/
+    private int style;
+
+    /**"方案:1是双目,2是转台,3是六目*/
+    private int sceneScheme;
+
+    /**"背景音乐名称*/
+    private String bgMusic;
+
+    /**"用户id*/
+    private Long userId;
+
+    /**"相机id*/
+    private Long cameraId;
+
+    /**"使用容量*/
+    private BigInteger space;
+
+    /**"创建日期时间戳*/
+    private Long createDate;
+
+    /**"分享的logo和生成二维码的logo*/
+    private String shareLogo;
+
+    /**"小地图浏览*/
+    private int mapVisi;
+
+    /**"自动导览*/
+    private int tourVisi;
+
+    /**"vr模式*/
+    private int vrVisi;
+    
+
+    /**
+     * 普通录屏文件地址
+     */
+    private String screencapVoiceSrc;
+
+    /**
+     * 录音文件地址
+     */
+    private String screencapVoiceSound;
+
+    /**
+     * 同步录音文件地址
+     */
+    private String screencapVoiceSoundsync;
+
+    /**
+     * 选择的类型,sound为screencapVoiceSound,file为screencapVoiceSrc
+     */
+    private String screencapVoiceType;
+
+    /**
+     * 录屏文件地址
+     */
+    private String playData;
+
+
+    /**
+     * 重新建模的版本
+     */
+    private int floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    private int floorPublishVer;
+
+    /**
+     * 录屏图片
+     */
+    private String screencapThumb;
+
+    /**
+     * cad平面图参数
+     */
+    private String cadInfo;
+
+    /**
+     * cad平面图参数
+     */
+    private String floorPlanPng;
+
+    /**
+     * 展示页面是否显示标尺
+     */
+    private int rulerVisi;
+
+    /**
+     * 展示页面cad图在平面图是否显示
+     */
+    private int cadImgVisi;
+
+    private int panoVisi;
+
+    private int m2dVisi;
+
+    private int m3dVisi;
+
+    private int measureVisi;
+
+    private String videos;
+
+    private String snCode;
+
+    private String overlay;
+
+    private Integer showLogoBottom;
+
+    private String recStatus;
+
+    private Integer needKey;
+
+    private String buildType;
+
+    private Integer imagesVersion;
+
+    private String bgMusicName;
+
+    /**
+     * 协作者用户id
+     */
+    private String cooperationUserId;
+
+    private String cooperationUserName;
+
+    private Integer sceneSource;
+
+    private boolean jumpScene;
+
+    /**
+     * 服务器的服务商
+     */
+    private String ecs;
+
+    /**
+     * 场景来源方式,为app提供,0相机,1用户,2协作者
+     */
+    private Integer sceneSourceType;
+
+    /**
+     * 随心装场景码
+     */
+    private String vrNum;
+
+    /**
+     * 旋转角度
+     */
+    private String floorPlanAngle;
+
+    private Integer isFolder;
+
+    private String videosUser;
+
+    private String phone;
+
+    //显示
+    private Integer isShow;
+
+    //app显示图片
+    private String appListPicUrl;
+
+    private Boolean lived;
+
+    private Long companyId;
+}

+ 1 - 0
platform-common/src/main/java/com/platform/vos/TbUser.java

@@ -29,6 +29,7 @@ public class TbUser implements Serializable {
     private Long companyId;
 
     private Integer state;
+    private Integer gender;
 
     private Date createTime;
 

+ 0 - 105
platform-shop/src/main/java/com/platform/controller/AdController.java

@@ -1,105 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.AdEntity;
-import com.platform.entity.Result;
-import com.platform.service.AdService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.Query;
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 09:37:35
- */
-@RestController
-@RequestMapping("ad")
-public class AdController {
-    @Autowired
-    private AdService adService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(PageUtilsPlus.page(adList,(long) total,(long) query.getLimit(),(long) query.getPage()));
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-
-    public Result info(@PathVariable("id") Integer id) {
-        AdEntity ad = adService.queryObject(id);
-
-        return Result.success( ad);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody AdEntity ad) {
-        adService.save(ad);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody AdEntity ad) {
-        adService.update(ad);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[] ids) {
-        adService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<AdEntity> list = adService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 101
platform-shop/src/main/java/com/platform/controller/AdPositionController.java

@@ -1,101 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.AdPositionEntity;
-import com.platform.entity.Result;
-import com.platform.service.AdPositionService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 12:02:42
- */
-@RestController
-@RequestMapping("adposition")
-public class AdPositionController {
-    @Autowired
-    private AdPositionService adPositionService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody 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 Result.success(PageUtilsPlus.page(adPositionList,(long)total,(long)query.getLimit(),(long)query.getPage()));
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info")
-    public Result info(@RequestParam("id") Integer id) {
-        AdPositionEntity adPosition = adPositionService.queryObject(id);
-
-        return Result.success(adPosition);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    public Result save(@RequestBody AdPositionEntity adPosition) {
-        adPositionService.save(adPosition);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    public Result update(@RequestBody AdPositionEntity adPosition) {
-        adPositionService.update(adPosition);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    public Result delete(@RequestBody Integer[] ids) {
-        adPositionService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<AdPositionEntity> list = adPositionService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 92
platform-shop/src/main/java/com/platform/controller/AddressController.java

@@ -1,92 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.AddressEntity;
-import com.platform.entity.Result;
-import com.platform.service.AddressService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-16 17:22:46
- */
-@RestController
-@RequestMapping("address")
-public class AddressController {
-    @Autowired
-    private AddressService addressService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(pageUtil);
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info")
-
-    public Result info(@RequestParam("id") Integer id) {
-        AddressEntity address = addressService.queryObject(id);
-
-        return Result.success( address);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody AddressEntity address) {
-        addressService.save(address);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody AddressEntity address) {
-        addressService.update(address);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[] ids) {
-        addressService.deleteBatch(ids);
-
-        return Result.success();
-    }
-}

+ 0 - 246
platform-shop/src/main/java/com/platform/controller/AppCensusController.java

@@ -1,246 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.*;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.service.custom.GoodsVisitHistoryService;
-import com.platform.service.custom.SceneCensusService;
-import com.platform.service.custom.TmBrandAdminService;
-import com.platform.service.impl.BrandServiceImpl;
-import com.platform.service.impl.UserServiceImpl;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author abnerhou
- * @date 2020/7/15 12:22
- * @desciption
- */
-@Slf4j
-@Api(tags = "小程序统计相关的接口")
-@Controller
-@RequestMapping("/app/census")
-public class AppCensusController {
-
-    @Autowired
-    private BrandServiceImpl brandService;
-
-    @Autowired
-    private SceneCensusService sceneCensusService;
-
-
-    @Autowired
-    private UserServiceImpl userService;
-
-
-    @Autowired
-    private GoodsVisitHistoryService goodsVisitHistoryService;
-
-    @Autowired
-    private TmBrandAdminService tmBrandAdminService;
-
-
-    @Value("${4dkankan.host}")
-    private String kankanHost;
-
-    @ApiOperation(value = "获取场景统计")
-    @GetMapping("/getSceneCensus")
-    @ResponseBody
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "guideId", value = "管理员ID", paramType = "query", required = true, dataType = "Integer"),
-            @ApiImplicitParam(name = "startDate", value = "日期-不能获取当天的,只能获取昨天以及昨天之前的", paramType = "query", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "size", value = "历史前多少天", paramType = "query", required = true, dataType = "Integer")
-    })
-    public Result getSceneCensus(@RequestParam(name = "guideId") Integer guideId,
-                                 @RequestParam(name = "brandId") Integer brandId,
-                                 String startDate,
-                                 Integer size) {
-        if (null == guideId || null == brandId) {
-            throw new CommonBaseException(ResultCodeEnum.D3001, "管理员ID或者店铺ID不能为空");
-        }
-        LocalDate stasticEndDate = null;
-        LocalDate stasticStartDate = null;
-        DateTimeFormatter localDateFormat  = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        int offset = 7;
-        if (null != size) {
-            offset = size;
-        }
-        if (StringUtils.isNotBlank(startDate)) {
-            stasticEndDate = LocalDate.parse(startDate, localDateFormat);
-        }
-        if (null == stasticEndDate) {
-            stasticEndDate = LocalDate.now().plusDays(-1);
-            log.info("接口没上送统计日期,默认获取当前的前一天日期:{}", stasticEndDate);
-        }
-        stasticStartDate = stasticEndDate.plusDays(0 - (offset - 1));
-        log.info("统计日期为:{} -- {}", stasticStartDate, stasticEndDate);
-
-        UserEntity guide = userService.queryObject(guideId);
-        if(null == guide){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "管理员不存在");
-        }
-
-       TmBrandAdmin brandAdmin = tmBrandAdminService.getByAdminIdAndBrandId(guideId , brandId);
-        if(null == brandAdmin){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "管理员未绑定商铺");
-        }
-        final LocalDate finalStasticEndDate = stasticEndDate;
-        final LocalDate finalStasticStartDate = stasticStartDate;
-        BrandEntity brandEntity = brandService.queryObject(brandAdmin.getBrandId());
-        TmSceneCensus tmSceneCensus = new TmSceneCensus();
-        if(null != brandEntity && !StringUtils.isBlank(brandEntity.getSceneNum())){
-            tmSceneCensus = sceneCensusService.getCensusBySceneNumForUpdate(brandEntity.getSceneNum(), finalStasticEndDate);
-            if (null != tmSceneCensus && StringUtils.isNoneBlank(tmSceneCensus.getPvHistory(),
-                    tmSceneCensus.getUvHistory(), tmSceneCensus.getHotVisitHistory(), tmSceneCensus.getTalkHistory())) {
-                //已经存在直接返回,不去调看看的接口
-                if(null != tmSceneCensus.getCensusSize() && tmSceneCensus.getCensusSize() == size){
-                    log.info("场景[{}]在统计日期:[{}]的统计范围[{}]已经存在,不再重新获取" , brandEntity.getSceneNum() , finalStasticEndDate , size);
-                    return Result.success(tmSceneCensus);
-                }
-
-            }
-            log.info("本地未存储数据,将要去四维看看获取统计数据");
-            Map<String, Object> pvUvMap = sceneCensusService.getPvUvHistoryFromKankan(finalStasticStartDate, finalStasticEndDate, brandEntity.getSceneNum());
-            List<Map<String, Object>> scenePvList = (List<Map<String, Object>>) pvUvMap.get("pv");
-            List<Map<String, Object>> sceneUvList = (List<Map<String, Object>>) pvUvMap.get("uv");
-            List<Map<String, Object>> hotVisitList = sceneCensusService.getHotHistoryFromKankan(finalStasticStartDate, finalStasticEndDate, brandEntity.getSceneNum());
-            long totalVisitTalk = goodsVisitHistoryService.countTotalBySceneNum(brandEntity.getSceneNum());
-            List<Map<String, Object>> talkHistory = goodsVisitHistoryService.getHistoryByRangeTwo(finalStasticStartDate, size, brandEntity.getSceneNum());
-            String talkHistoryStr = JSON.toJSONString(talkHistory);
-            if(CollectionUtils.isEmpty(scenePvList) || CollectionUtils.isEmpty(sceneUvList)
-                    || CollectionUtils.isEmpty(hotVisitList)){
-                log.info("店铺[{}]四维看看返回pv,uv,hot数据为空,跳过" , brandAdmin.getBrandId());
-                return Result.failure("四维看看返回pv,uv,hot数据为空");
-            }
-            if (null != tmSceneCensus) {
-                tmSceneCensus.setPvHistory(JSON.toJSONString(scenePvList));
-                tmSceneCensus.setUvHistory(JSON.toJSONString(sceneUvList));
-                tmSceneCensus.setHotVisitHistory(JSON.toJSONString(hotVisitList));
-                tmSceneCensus.setLastModifyDatetime(LocalDateTime.now());
-                if(null == tmSceneCensus.getTotalTalkNum()){
-                    tmSceneCensus.setTotalTalkNum(totalVisitTalk);
-                }
-                if(StringUtils.isBlank(tmSceneCensus.getTalkHistory())){
-                    tmSceneCensus.setTalkHistory(talkHistoryStr);
-                }
-                tmSceneCensus.setCensusSize(size);
-                //TODO:这里添加商品成交量、商品详情页PV的逻辑
-                int update = sceneCensusService.updateCensus(tmSceneCensus);
-                if (update != 1) {
-                    log.warn("更新场景统计的pv,uv,hot历史数据失败");
-                }
-            } else {
-                tmSceneCensus = new TmSceneCensus();
-                tmSceneCensus.setCompanyId(brandEntity.getId().toString());
-                tmSceneCensus.setCompanyName(brandEntity.getName());
-                tmSceneCensus.setSceneNum(brandEntity.getSceneNum());
-                tmSceneCensus.setCensusDate(finalStasticEndDate);
-                tmSceneCensus.setPvHistory(JSON.toJSONString(scenePvList));
-                if(!CollectionUtils.isEmpty(scenePvList)){
-                    long scenePvTotalNum = 0;
-                    for(int i = 0 ; i <scenePvList.size() ; i++){
-                        Map<String, Object> mp = scenePvList.get(i);
-                        if(!CollectionUtils.isEmpty(mp)){
-                            for(Map.Entry entry : mp.entrySet()){
-                                long num = null != entry.getValue() ? ((Integer) entry.getValue()).longValue() : 0;
-                                scenePvTotalNum += num;
-                            }
-                        }
-                    }
-                    tmSceneCensus.setPvTotalNum(scenePvTotalNum);
-                }
-                tmSceneCensus.setUvHistory(JSON.toJSONString(sceneUvList));
-                if(!CollectionUtils.isEmpty(sceneUvList)){
-                    long sceneUvTotalNum = 0;
-                    for(int i = 0 ; i <sceneUvList.size() ; i++){
-                        Map<String, Object> mp = sceneUvList.get(i);
-                        if(!CollectionUtils.isEmpty(mp)){
-                            for(Map.Entry entry : mp.entrySet()){
-                                long num = null != entry.getValue() ? ((Integer) entry.getValue()).longValue() : 0;
-                                sceneUvTotalNum += num;
-                            }
-                        }
-                    }
-                    tmSceneCensus.setUvTotalNum(sceneUvTotalNum);
-                }
-                //TODO:这里添加商品成交量、商品详情页PV的逻辑
-                tmSceneCensus.setHotVisitHistory(JSON.toJSONString(hotVisitList));
-                tmSceneCensus.setLastModifyDatetime(LocalDateTime.now());
-                tmSceneCensus.setCreateTime(LocalDateTime.now());
-                tmSceneCensus.setCensusSize(size);
-                tmSceneCensus.setTotalTalkNum(goodsVisitHistoryService.countTotalBySceneNum(brandEntity.getSceneNum()));
-                tmSceneCensus.setTalkHistory(talkHistoryStr);
-                int insert = sceneCensusService.addSceneCensus(tmSceneCensus);
-                if (insert != 1) {
-                    log.warn("新增场景统计失败");
-                }
-            }
-        }else{
-            log.info("店铺[{}]不存在或者店铺没有场景码,不返回起统计数据" , brandAdmin.getBrandId());
-        }
-
-        return Result.success(tmSceneCensus);
-    }
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "增加询盘数量")
-    @GetMapping("/addGoodsQueryNum")
-    @ResponseBody
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "goodsId", value = "展品ID", paramType = "query", required = true, dataType = "Integer"),
-            @ApiImplicitParam(name = "viewId", value = "观众ID", paramType = "query", required = true, dataType = "Integer"),
-            @ApiImplicitParam(name = "sceneNum", value = "场景码", paramType = "query", required = true, dataType = "String")
-    })
-    public Result addGoodsQueryNum(@RequestParam(name = "goodsId") Integer goodsId,
-                                   @RequestParam(name = "viewId") Integer viewId,
-                                   @RequestParam(name = "sceneNum") String sceneNum) {
-        if (!StringUtils.isNoneBlank(sceneNum)) {
-            throw new CommonBaseException(ResultCodeEnum.D3001);
-        }
-        BrandEntity brandEntity = brandService.queryByScene(sceneNum);
-        if (null == brandEntity) {
-            log.error("场景[{}]没有绑定公司", sceneNum);
-            throw new CommonBaseException(ResultCodeEnum.D101, "场景没有绑定公司");
-        }
-        LocalDate today = LocalDate.now();
-        //新增展品访问记录
-        UserEntity tmViewer = userService.queryObject(viewId);
-        String goodsIdStr = null != goodsId ? goodsId.toString() : "";
-        String viewIdStr = null != viewId ? viewId.toString() : "";
-        TmGoodsVisitHistory goodsVisitHistory  = new TmGoodsVisitHistory();
-        goodsVisitHistory.setVisiterId(viewIdStr);
-        goodsVisitHistory.setGoodsId(goodsIdStr);
-        goodsVisitHistory.setVisitDate(today);
-        if(null != tmViewer){
-            goodsVisitHistory.setVisiterGender(tmViewer.getGender());
-            goodsVisitHistory.setVisiterName(tmViewer.getNickname());
-            goodsVisitHistory.setVisterRegion(tmViewer.getCity());
-        }
-        goodsVisitHistory.setSceneNum(sceneNum);
-        goodsVisitHistoryService.addNewHistory(goodsVisitHistory);
-        return Result.success();
-    }
-
-}

+ 0 - 102
platform-shop/src/main/java/com/platform/controller/AttributeCategoryController.java

@@ -1,102 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.AttributeCategoryEntity;
-import com.platform.entity.Result;
-import com.platform.service.AttributeCategoryService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.Query;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jgroups.protocols.tom.TOA;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-17 16:13:27
- */
-@RestController
-@RequestMapping("attributecategory")
-public class AttributeCategoryController {
-    @Autowired
-    private AttributeCategoryService attributeCategoryService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody 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 Result.success(PageUtilsPlus.page(attributeCategoryList,(long)total, (long) query.getLimit(),(long)query.getPage()));
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    public Result info(@PathVariable("id") Integer id) {
-        AttributeCategoryEntity attributeCategory = attributeCategoryService.queryObject(id);
-
-        return Result.success( attributeCategory);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    public Result save(@RequestBody AttributeCategoryEntity attributeCategory) {
-        attributeCategoryService.save(attributeCategory);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    public Result update(@RequestBody AttributeCategoryEntity attributeCategory) {
-        attributeCategoryService.update(attributeCategory);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    public Result delete(@RequestBody Integer[] ids) {
-        attributeCategoryService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<AttributeCategoryEntity> list = attributeCategoryService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 106
platform-shop/src/main/java/com/platform/controller/AttributeController.java

@@ -1,106 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.AttributeEntity;
-import com.platform.entity.Result;
-import com.platform.service.AttributeService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-17 16:48:17
- */
-@RestController
-@RequestMapping("attribute")
-public class AttributeController {
-    @Autowired
-    private AttributeService attributeService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(PageUtilsPlus.page(attributeList,(long)total,(long)query.getLimit(),(long) query.getPage()));
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-
-    public Result info(@PathVariable("id") Integer id) {
-        AttributeEntity attribute = attributeService.queryObject(id);
-
-        return Result.success( attribute);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody AttributeEntity attribute) {
-        attributeService.save(attribute);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody AttributeEntity attribute) {
-        attributeService.update(attribute);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[] ids) {
-        attributeService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<AttributeEntity> list = attributeService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 562
platform-shop/src/main/java/com/platform/controller/BrandController.java

@@ -1,562 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.*;
-import com.platform.service.BrandService;
-import com.platform.service.GoodsService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.service.custom.TmBrandTypeService;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.utils.*;
-import com.platform.vo.BrandBindUserVo;
-import com.platform.vo.BrandRequestVo;
-import com.platform.vo.BrandRspVo;
-import com.platform.vos.CurrentUserLoginVo;
-import com.platform.vos.TbUser;
-import com.platform.xss.SQLFilter;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.bouncycastle.jcajce.provider.symmetric.DES;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static java.util.Comparator.comparing;
-import static java.util.stream.Collectors.collectingAndThen;
-import static java.util.stream.Collectors.toCollection;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 17:59:15
- */
-@Api(tags = "管理后台店铺操作相关接口")
-@RestController
-@RequestMapping("brand")
-@Slf4j
-public class BrandController extends AbstractController{
-    @Autowired
-    private BrandService brandService;
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    @Autowired
-    private GoodsService goodsService;
-
-
-    @Autowired
-    private TmBrandTypeService tmBrandTypeService;
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-    @Value("${scenePath}")
-    private String scenePath;
-
-    /**
-     * 用户绑定品牌
-     */
-    @ApiOperation(value = "用户绑定品牌")
-    @PostMapping("/bindUser")
-    public Result bindUser(@ApiParam(name = "BrandBindUserVo对象", value = "传入json格式", required = true)
-                          @RequestBody BrandRequestVo brandRequestVo) {
-        if(brandRequestVo == null || brandRequestVo.getBrandId() == null){
-            return Result.failure("brandId入参缺失");
-        }
-        brandService.bindUsers(brandRequestVo.getBrandId(),brandRequestVo.getBrandList());
-
-        return Result.success();
-    }
-
-
-
-
-    /**
-     * 查看列表
-     */
-    @GetMapping("/brandTypeList")
-    public Result brandTypeList() {
-        Map<String , Object> map = new HashMap<>();
-        map.put("list" , tmBrandTypeService.getAllList());
-        return Result.success(map);
-    }
-
-
-    /**
-     * 店铺绑定情况列表 Long pageNum , Long pageSize , String key , long deptId , Integer bindStatus
-     */
-    @ApiOperation(value = "店铺绑定情况列表")
-    @GetMapping("/brandBindList")
-    public Result brandBindList(@RequestParam(name = "page") long page,@RequestHeader String token,
-                           @RequestParam(name = "limit") long limit,String order,String sidx,
-                           String sceneName,String brandName,Integer type,Integer livestreamStatus) {
-        Long userId = null;
-        //如果不是超级管理员,则只能查询本部门及子部门数据
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)  ) {
-            // 公司员工只能看到已经绑定自身为主播的数据
-            if (roleIdList.contains(8L) || roleIdList.contains(9L) || roleIdList.contains(81L)) {
-                userId = getUserId();
-            }else{
-                if(ObjectUtils.isEmpty(getUser().getCompanyId())){
-                    return Result.failure("该账号未绑定公司!");
-                }
-            }
-        }
-        String orderBy = null;
-        if(!StringUtils.isEmpty(sidx) && !StringUtils.isEmpty(order)){
-            orderBy = SQLFilter.humpToLine(sidx) + " "+ order;
-        }
-        IPage<BrandEntity> resultPage = brandService.queryBrandBindList(page , limit , sceneName , brandName,
-                getDeptId() ,type,userId,livestreamStatus,orderBy);
-        if(null == resultPage){
-            return Result.failure("获取店铺绑定列表失败");
-        }
-        List<BrandRspVo> rspBrandList = resultPage.getRecords().parallelStream().map(brandEntity -> {
-            BrandRspVo brandRspVo = new BrandRspVo();
-            BeanUtils.copyProperties(brandEntity,brandRspVo);
-            List<SysUserBrand> brandBindUserIdList = mySysUserBrandService.getBrandBindUserIdList(brandEntity.getId());
-            List<Long> userIds = brandBindUserIdList.parallelStream().map(SysUserBrand::getUserId).collect(Collectors.toList());
-            if(userIds.size() >0){
-                List<String> nameList = zhiHouseService.getBindUserNameList(userIds,token);
-                if (!CollectionUtils.isEmpty(nameList)) {
-                    brandRspVo.setBindShowerNameList(nameList.stream().collect(Collectors.joining(";")));
-                }
-            }
-            JSONObject jsonObject = zhiHouseService.queryBySceneNum(brandEntity.getSceneNum(),token);
-            if(!ObjectUtils.isEmpty(jsonObject)){
-                brandRspVo.setSceneName(jsonObject.getString("sceneName"));
-                brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
-            }
-            return brandRspVo;
-        }).collect(Collectors.toList());
-        return Result.success(PageUtilsPlus.page(rspBrandList,resultPage));
-    }
-
-    /**
-     * 查看信息
-     */
-    @PostMapping("/info")
-    public Result info(@RequestBody BrandEntity brandEntity,@RequestHeader String token) {
-        if(ObjectUtils.isEmpty(brandEntity.getId())){
-            return Result.failure("参数有误!");
-        }
-        BrandEntity brand = brandService.queryObject(brandEntity.getId().intValue());
-        if(brand == null ){
-            throw new RRException("直播间为空!");
-        }
-        BrandRspVo brandRspVo = new BrandRspVo();
-        BeanUtils.copyProperties(brand,brandRspVo);
-        JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum(),token);
-        if(!ObjectUtils.isEmpty(jsonObject)){
-            brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
-            brandRspVo.setSceneName(jsonObject.getString("sceneName"));
-        }
-        return Result.success( brandRspVo);
-    }
-
-
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    @Transactional(rollbackFor = Exception.class)
-    public Result save(@RequestBody BrandEntity params,@RequestHeader String token) {
-        if(ObjectUtils.isEmpty(params.getSceneNum())){
-            return Result.failure("场景码为空!");
-        }
-        JSONObject jsonObject = zhiHouseService.queryBySceneNum(params.getSceneNum(),token);
-        if(ObjectUtils.isEmpty(jsonObject)){
-            return Result.failure("场景码错误!");
-        }
-
-        try {
-            // 判断直播间名称是否重复
-            Map<String,Object> paramsMap = new HashMap<>();
-            paramsMap.put("name",params.getName());
-            List<BrandEntity> entities = brandService.queryList(paramsMap);
-            if(!ObjectUtils.isEmpty(entities)){
-                return Result.failure("直播间名称重复!");
-            }
-            BrandEntity brand = brandService.queryByScene(params.getSceneNum());
-            if(!ObjectUtils.isEmpty(brand)){
-                return Result.failure("该场景已经绑定直播间!");
-            }
-            brand = new BrandEntity();
-            BeanUtils.copyProperties(params,brand);
-            brand.setCreateUserId(getUserId());
-            if (ObjectUtils.isEmpty(brand.getType())) {
-                brand.setType(0);
-            }
-            // 生成直播间地址
-            String liveRoomUrl = jsonObject.getString("webSite").replaceAll("smobile.html", "shop.html");
-            if(getCompanyId() == null && jsonObject.get("companyId") !=null  ){
-                brand.setCreateUserDeptId(jsonObject.getLong("companyId"));
-            }
-            brand.setLiveRoomUrl(liveRoomUrl);
-
-            brandService.save(brand,true);
-            //生成微信分享二维码
-            brandService.generalWxShareQrCode(brand , true);
-            brand.setToken(token);
-            brandService.sendDataToApi(brand);
-            zhiHouseService.generateDefaultLiveRoom(params.getSceneNum(),true);
-        } catch (BeansException e) {
-            e.printStackTrace();
-            return Result.failure(ObjectUtils.isEmpty(e.getMessage())?"该场景已经绑定直播间!":e.getMessage());
-        }
-        return Result.success("新增商铺成功",null);
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @PostMapping("/update")
-    @Transactional(rollbackFor = Exception.class)
-    public Result update(@RequestBody BrandEntity brand,@RequestHeader String token) {
-        if(ObjectUtils.isEmpty(brand.getId())){
-            return Result.failure("id 为空!");
-        }
-        BrandEntity oldDbBrand = brandService.queryObject(brand.getId().intValue());
-        if(ObjectUtils.isEmpty(oldDbBrand)){
-            log.error("获取数据失败:{}",brand.getId());
-            return Result.failure("获取数据失败!");
-        }
-        // 判断直播间名称是否重复
-        Map<String,Object> paramsMap = new HashMap<>();
-        paramsMap.put("name",brand.getName());
-        List<BrandEntity> entities = brandService.queryList(paramsMap);
-        if (!ObjectUtils.isEmpty(entities) && entities.get(0).getId().compareTo(brand.getId()) != 0) {
-            return Result.failure("场景名称重复!");
-        }
-        //上送的场景码和数据库的不一致,说明场景码数据有变更
-        if (!org.apache.commons.lang3.StringUtils.equals(brand.getSceneNum(), oldDbBrand.getSceneNum())
-                || org.apache.commons.lang3.StringUtils.isBlank(oldDbBrand.getShareWxQrCode())) {
-            //场景码有变更 将新场景的分享二维码更新
-            String wxShareQrCodeUrl = brandService.generalWxShareQrCode(brand, false);
-            brand.setShareWxQrCode(wxShareQrCodeUrl);
-            JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum(),token);
-            if(ObjectUtils.isEmpty(jsonObject)){
-                return Result.failure("场景码错误!");
-            }
-            // 生成直播间地址
-            String liveRoomUrl = jsonObject.getString("webSite").replaceAll("smobile.html", "shop.html");
-            brand.setLiveRoomUrl(liveRoomUrl);
-            if(getCompanyId() == null && jsonObject.get("companyId") !=null  ){
-                brand.setCreateUserDeptId(jsonObject.getLong("companyId"));
-            }
-        }
-
-        brand.setAppListPicUrl(brand.getAppListPicUrl());
-        brandService.update(brand);
-        brand.setToken(token);
-        brandService.sendDataToApi(brand);
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    @Transactional(rollbackFor = Exception.class)
-    public Result delete(@RequestBody Integer[] ids,@RequestHeader String token) {
-        //log.info("开始删除..........."+System.currentTimeMillis());
-        if(ObjectUtils.isEmpty(ids)){
-            return Result.success();
-        }
-        Map<String,Object> brandIds = new HashMap<>();
-        brandIds.put("idList",Arrays.asList(ids));
-        List<BrandEntity> entities = brandService.queryList(brandIds);
-        if(ObjectUtils.isEmpty(entities)){
-            return Result.success();
-        }
-
-        Integer recommendCount = zhiHouseService.getCountRecommendByBrandIds(ids);
-        if(recommendCount == null || recommendCount >0){
-           throw new RRException("直播间数据已被绑定,请先解除绑定!");
-        }
-
-        // 判断场景是否绑定商品,如果绑定商品,不允许删除;
-        Map<String, Object> params = new HashMap<>();
-        params.put("brandIdList", Arrays.asList(ids));
-        params.put("isDelete", 0);
-        List<GoodsEntity> goodsEntities = goodsService.queryList(params);
-        if (!ObjectUtils.isEmpty(goodsEntities)) {
-            return Result.failure("删除失败,先删除直播间绑定的商品后再重试!");
-        }
-        //获取数据,推送给api
-        Arrays.stream(ids).map(id-> brandService.queryObject(id)).forEach(entity->{
-            entity.setToken(token);
-            brandService.sendDataToApi(entity);
-        });
-
-        // 删除绑定关系
-        mySysUserBrandService.deleteByBrandIds(ids);
-
-
-        for (BrandEntity entity : entities) {
-            zhiHouseService.generateDefaultLiveRoom(entity.getSceneNum(),false);
-        }
-
-        brandService.deleteBatch(ids);
-       // log.info("结束删除..........."+System.currentTimeMillis());
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-        List<Long> roleIds = getUser().getRoleIdList();
-        if(!roleIds.contains(5) && !roleIds.contains(1)){
-            //通过部门ID过滤数据
-            if(null == getDeptId()){
-                return Result.success(new ArrayList<>());
-            }
-            params.put("deptIdList", getDeptId());
-            if(roleIds.contains(8L) || roleIds.contains(81L)){
-                params.put("createUserId",getUser().getId());
-            }
-        }
-        List<BrandEntity> list = brandService.queryList(params);
-        if(roleIds.contains(8L) || roleIds.contains(81L)){
-            List<BrandEntity> list2 = brandService.getBrandByUserId(getUser().getId());
-            list.addAll(list2);
-        }
-        List<BrandEntity> listAll = list.stream().collect(
-                Collectors.collectingAndThen(
-                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(BrandEntity::getId))), ArrayList::new)
-        );
-        return Result.success(listAll);
-    }
-
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAllHot")
-    public Result queryAllHot(@RequestBody Map<String, Object> params,@RequestHeader String token) throws Exception {
-        //查询列表数据
-        Query query = new Query(params);
-
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if(!roleIdList.contains(1L) && !roleIdList.contains(5L)){
-            params.put("idList", mySysUserBrandService.queryBrandIdList(getUserId()));
-        }
-        HttpRequestorUtil util = new HttpRequestorUtil();
-        List<BrandEntity> list = brandService.queryList(params);
-        String getResult = "";
-        JSONArray array = null;
-        JSONObject jsonObject = null;
-        List<Map> resultList = new ArrayList<>();
-        Map map = null;
-        //场景码
-        String sceneNum = "";
-        //场景名称
-        String sceneName = "";
-        //热点类型
-        String type = "";
-        //热点中多个商品数组
-        JSONArray pageArray = null;
-        JSONObject pageObject = null;
-
-        String scenePath = this.scenePath;
-        String sceneData = ResourceUtil.getConfigByName("sceneData");
-
-        for(BrandEntity entity : list){
-            BrandEntity brand = brandService.queryObject(entity.getId().intValue());
-            if(brand == null){
-                continue;
-            }
-            sceneNum = brand.getSceneNum();
-
-            JSONObject sceneEntity = zhiHouseService.queryBySceneNum(sceneNum,token);
-            if(!ObjectUtils.isEmpty(sceneEntity)){
-                sceneName = sceneEntity.getString("sceneName");
-            }
-            getResult = util.doGet(sceneData + "data/data" + sceneNum + "/hot.json");
-            if(StringUtils.isEmpty(getResult)){
-                continue;
-            }
-            array = JSONObject.parseArray(getResult);
-
-            for (int i = 0; i < array.size(); i++) {
-                map = new HashMap();
-                map.put("brandId", brand.getId());
-                map.put("brandName", brand.getName());
-                map.put("sceneName", sceneName);
-                map.put("sceneNum", sceneNum);
-
-                jsonObject = array.getJSONObject(i);
-                map.put("hotName", jsonObject.getString("label"));
-                map.put("sid", jsonObject.getString("sid"));
-
-                if(jsonObject.containsKey("media")){
-                    type = jsonObject.getString("media").replace("\"", "").replace("[", "").replace("]", "");
-                    if("photo".equals(type)){
-                        map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") +".jpg");
-                    }
-
-                    if("audio".equals(type)){
-                        map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") +".mp3");
-                    }
-
-                    if("video".equals(type)){
-                        map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") +".mp4");
-                    }
-                }
-
-                map.put("pageSid", "");
-                map.put("pageName", "");
-
-                //获取热点中卡夹的内容
-                pageArray = jsonObject.getJSONArray("pages");
-                if(pageArray != null && pageArray.size() > 0){
-                    for (int j = 0; j < pageArray.size(); j++) {
-                        //有卡夹,创建新的map添加到list
-                        map = new HashMap();
-                        map.put("brandName", brand.getName());
-                        map.put("sceneName", sceneName);
-                        map.put("sceneNum", sceneNum);
-                        map.put("hotName", jsonObject.getString("label"));
-                        map.put("sid", jsonObject.getString("sid"));
-
-                        pageObject = pageArray.getJSONObject(j);
-                        map.put("pageSid", pageObject.getString("sid"));
-                        map.put("pageName", pageObject.getString("label"));
-                        if(pageObject.containsKey("media")){
-                            type = pageObject.getString("media").replace("\"", "").replace("[", "").replace("]", "");
-                            if("photo".equals(type)){
-                                map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") + "_" + pageObject.getString("sid") +".jpg");
-                            }
-
-                            if("audio".equals(type)){
-                                map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") + "_" + pageObject.getString("sid") +".mp3");
-                            }
-
-                            if("video".equals(type)){
-                                map.put("hotData", sceneData + "images/images" + sceneNum + "/hot" + jsonObject.getString("sid") + "_" + pageObject.getString("sid") +".mp4");
-                            }
-                        }
-                        resultList.add(map);
-                    }
-                    continue;
-                }
-
-                resultList.add(map);
-            }
-
-        }
-
-        List<Map> page = PageUtils.startPage(resultList, query.getPage(), query.getLimit());
-        //分页后查询热点关联的商品,减少查询次数
-        GoodsEntity goodsEntity = null;
-        StringBuilder goodsNames = null;
-        StringBuilder goodsId = null;
-        String origin = ResourceUtil.getConfigByName("origin");
-        if(page != null){
-
-            for(Map mapData : page){
-                JSONObject post = new JSONObject();
-                post.put("hotId", mapData.get("sid"));
-                post.put("pageSid", mapData.get("pageSid"));
-                post.put("origin", origin);
-                String result = util.postJson(scenePath + "hot/shop/findGoodIdByHotId", post.toString(), "POST");
-                JSONObject object = JSON.parseObject(result);
-
-                mapData.put("goodsId", "");
-                mapData.put("goodsNames", "");
-                if(object.getIntValue("code") == 0){
-                    array = object.getJSONArray("data");
-                    if(array.size() > 0){
-                        goodsEntity = goodsService.queryObject(array.getJSONObject(0).getIntValue("goodId"));
-                        if(goodsEntity != null){
-                            mapData.put("goodsId", goodsEntity.getId());
-                            mapData.put("goodsNames", goodsEntity.getName());
-                        }
-                    }
-                }
-            }
-        }
-
-        PageUtils pageUtil = new PageUtils(page, resultList.size(), query.getLimit(), query.getPage());
-        return Result.success( pageUtil);
-    }
-
-    /**
-     * 保存热点与商品关联
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/saveGoodsHot")
-    public Result saveGoodsHot(@RequestBody Map<String, Object> params) throws Exception {
-        String scenePath = this.scenePath;
-        String origin = ResourceUtil.getConfigByName("origin");
-
-        HttpRequestorUtil util = new HttpRequestorUtil();
-
-        JSONObject post = new JSONObject();
-        post.put("hotId", params.get("sid"));
-        post.put("sceneNum", params.get("sceneNum"));
-        post.put("goodsIds", params.get("goodsIds"));
-        post.put("pageSid", params.get("pageSid"));
-        post.put("origin", origin);
-        String result = util.postJson(scenePath + "hot/shop/saveHotShop", post.toString(), "POST");
-        JSONObject object = JSON.parseObject(result);
-
-        if(object.getIntValue("code") == 0){
-            return Result.success();
-        }
-
-        return Result.failure("添加商品与热点关联失败");
-    }
-
-    /**
-     * 删除热点商品关联
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/deleteGoodsHot")
-    public Result deleteGoodsHot(@RequestBody Map<String, Object> params) throws Exception {
-        String scenePath = this.scenePath;
-        String origin = ResourceUtil.getConfigByName("origin");
-
-        HttpRequestorUtil util = new HttpRequestorUtil();
-
-        JSONObject post = new JSONObject();
-        post.put("hotId", params.get("sid"));
-        post.put("pageSid", params.get("pageSid"));
-        post.put("origin", origin);
-        String result = util.postJson(scenePath + "hot/shop/deleteGoodsHot", post.toString(), "POST");
-        JSONObject object = JSON.parseObject(result);
-
-        if(object.getIntValue("code") == 0){
-            return Result.success();
-        }
-        return Result.failure("删除热点商品关联失败");
-    }
-}

+ 0 - 100
platform-shop/src/main/java/com/platform/controller/CartController.java

@@ -1,100 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.CartEntity;
-import com.platform.service.CartService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * 
- * 
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:06
- */
-@RestController
-@RequestMapping("cart")
-public class CartController {
-	@Autowired
-	private CartService cartService;
-	
-	/**
-	 * 列表
-	 */
-	@RequestMapping("/list")
-	public Result list(@RequestBody Map<String, Object> params){
-		//查询列表数据
-        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 Result.success(pageUtil);
-	}
-	
-	
-	/**
-	 * 信息
-	 */
-	@RequestMapping("/info")
-	
-	public Result info(@RequestParam("id") Integer id){
-		CartEntity cart = cartService.queryObject(id);
-		
-		return Result.success( cart);
-	}
-	
-	/**
-	 * 保存
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/save")
-	
-	public Result save(@RequestBody CartEntity cart){
-		cartService.save(cart);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 修改
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/update")
-	
-	public Result update(@RequestBody CartEntity cart){
-		cartService.update(cart);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 删除
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/delete")
-	
-	public Result delete(@RequestBody Integer[] ids){
-		cartService.deleteBatch(ids);
-		
-		return Result.success();
-	}
-	
-}

+ 0 - 124
platform-shop/src/main/java/com/platform/controller/CategoryController.java

@@ -1,124 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.CategoryEntity;
-import com.platform.entity.Result;
-import com.platform.service.CategoryService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-import com.platform.utils.RRException;
-import com.platform.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.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-21 15:32:31
- */
-@RestController
-@RequestMapping("category")
-public class CategoryController {
-    @Autowired
-    private CategoryService categoryService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    public Result info(@PathVariable("id") Integer id) {
-        CategoryEntity category = categoryService.queryObject(id);
-
-        return Result.success( category);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    public Result save(@RequestBody CategoryEntity category) {
-        return categoryService.save(category);
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    public Result update(@RequestBody CategoryEntity category) {
-        return categoryService.update(category);
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    public Result delete(@RequestBody Integer[] ids) {
-        categoryService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-        List<CategoryEntity> list = categoryService.queryList(params);
-        return Result.success(list);
-    }
-
-    /**
-     * 查看信息(全部加载页面渲染太慢!)
-     */
-    @RequestMapping("/getAreaTree")
-    public Result getAreaTree() {
-        List<CategoryEntity> list = categoryService.queryList(new HashMap<String, Object>());
-        for (CategoryEntity sysRegionEntity : list) {
-            sysRegionEntity.setValue(sysRegionEntity.getId() + "");
-            sysRegionEntity.setLabel(sysRegionEntity.getName());
-        }
-        List<CategoryEntity> node = TreeUtils.factorTree(list);
-
-        return Result.success( node);
-    }
-
-    /**
-     * 查询
-     *
-     * @return
-     */
-    @RequestMapping("/getCategorySelect")
-    public Result getCategorySelect() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("parentId", "0");
-        List<CategoryEntity> list = categoryService.queryList(map);
-        return Result.success(list);
-    }
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/ChannelController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.ChannelEntity;
-import com.platform.entity.Result;
-import com.platform.service.ChannelService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-22 19:19:56
- */
-@RestController
-@RequestMapping("channel")
-public class ChannelController {
-    @Autowired
-    private ChannelService channelService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        ChannelEntity channel = channelService.queryObject(id);
-
-        return Result.success(channel);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody ChannelEntity channel) {
-        channelService.save(channel);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody ChannelEntity channel) {
-        channelService.update(channel);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        channelService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<ChannelEntity> list = channelService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 101
platform-shop/src/main/java/com/platform/controller/CollectController.java

@@ -1,101 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.CollectEntity;
-import com.platform.service.CollectService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * 
- * 
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:06
- */
-@RestController
-@RequestMapping("collect")
-public class CollectController {
-	@Autowired
-	private CollectService collectService;
-	
-	/**
-	 * 列表
-	 */
-	@RequestMapping("/list")
-
-	public Result list(@RequestBody Map<String, Object> params){
-		//查询列表数据
-        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 Result.success(pageUtil);
-	}
-	
-	
-	/**
-	 * 信息
-	 */
-	@RequestMapping("/info/{id}")
-
-	public Result info(@PathVariable("id") Integer id){
-		CollectEntity collect = collectService.queryObject(id);
-		
-		return Result.success(collect);
-	}
-	
-	/**
-	 * 保存
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/save")
-
-	public Result save(@RequestBody CollectEntity collect){
-		collectService.save(collect);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 修改
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/update")
-
-	public Result update(@RequestBody CollectEntity collect){
-		collectService.update(collect);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 删除
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/delete")
-
-	public Result delete(@RequestBody Integer[] ids){
-		collectService.deleteBatch(ids);
-		
-		return Result.success();
-	}
-	
-}

+ 0 - 120
platform-shop/src/main/java/com/platform/controller/CommentController.java

@@ -1,120 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.CommentEntity;
-import com.platform.entity.Result;
-import com.platform.service.CommentService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-28 17:03:40
- */
-@RestController
-@RequestMapping("comment")
-public class CommentController {
-    @Autowired
-    private CommentService commentService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody 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 Result.success( pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    public Result info(@PathVariable("id") Integer id) {
-        CommentEntity comment = commentService.queryObject(id);
-
-        return Result.success( comment);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    public Result save(@RequestBody CommentEntity comment) {
-        commentService.save(comment);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    public Result update(@RequestBody CommentEntity comment) {
-        commentService.update(comment);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    public Result delete(@RequestBody Integer[] ids) {
-        commentService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<CommentEntity> list = commentService.queryList(params);
-
-        return Result.success( list);
-    }
-
-    /**
-     * 修改状态
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/toggleStatus")
-    public Result toggleStatus(@RequestBody CommentEntity comment) {
-        commentService.toggleStatus(comment);
-
-        return Result.success();
-    }
-
-    /**
-     * 总计
-     */
-    @RequestMapping("/queryTotal")
-    public Result queryTotal(@RequestBody Map<String, Object> params) {
-        int sum = commentService.queryTotal(params);
-
-        return Result.success(sum);
-    }
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/CommentPictureController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.CommentPictureEntity;
-import com.platform.entity.Result;
-import com.platform.service.CommentPictureService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-29 14:45:55
- */
-@RestController
-@RequestMapping("commentpicture")
-public class CommentPictureController {
-    @Autowired
-    private CommentPictureService commentPictureService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-
-    public Result info(@PathVariable("id") Integer id) {
-        CommentPictureEntity commentPicture = commentPictureService.queryObject(id);
-
-        return Result.success( commentPicture);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody CommentPictureEntity commentPicture) {
-        commentPictureService.save(commentPicture);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody CommentPictureEntity commentPicture) {
-        commentPictureService.update(commentPicture);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[] ids) {
-        commentPictureService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<CommentPictureEntity> list = commentPictureService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 260
platform-shop/src/main/java/com/platform/controller/CouponController.java

@@ -1,260 +0,0 @@
-package com.platform.controller;
-
-import com.github.pagehelper.PageHelper;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.CouponEntity;
-import com.platform.entity.Result;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.service.CouponService;
-import com.platform.service.UserCouponService;
-import com.platform.utils.*;
-import com.platform.vo.CouponRequestVo;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
-
-/**
- * 优惠券Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 12:53:26
- */
-@RestController
-@RequestMapping("coupon")
-@Slf4j
-public class CouponController extends AbstractController{
-    @Autowired
-    private CouponService couponService;
-
-    @Autowired
-    private UserCouponService userCouponService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    @Transactional(rollbackFor = Exception.class)
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-        PageHelper.startPage(query.getPage(), query.getLimit());
-        Long userId = getUserId();
-        PageUtils pageUtil = new PageUtils(new ArrayList<>(), 0 , query.getLimit(), query.getPage());
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            //通过部门ID过滤数据
-            if(null == getDeptId()){
-                return Result.success(pageUtil);
-            }
-            query.put("deptIdList", getDeptId());
-        }
-        List<CouponEntity> couponList = couponService.queryList(query);
-        //更新优惠券的状态,TODO:这里如果优惠券比较多,发放的用户比较多,这里会很慢
-        if(!CollectionUtils.isEmpty(couponList)){
-            for(CouponEntity couponEntity : couponList){
-                checkCouponStatus(couponEntity , query.getLimit());
-            }
-        }
-        int total = couponService.queryTotal(query);
-        pageUtil = new PageUtils(couponList , total , query.getLimit(), query.getPage());
-
-        return Result.success( pageUtil);
-    }
-
-    @Transactional(rollbackFor = Exception.class)
-    public void checkCouponStatus(CouponEntity couponEntity , int limit){
-        if(null == couponEntity){
-            return;
-        }
-        //未生效->生效
-        if(couponEntity.getUseStartDate().before(new Date()) && couponEntity.getUseEndDate().after(new Date())){
-            if(couponEntity.getCouponStatus().compareTo(1) == 0){
-                couponEntity.setCouponStatus(2);
-                couponService.updateStatus(couponEntity.getId() , 2);
-                log.info("优惠券[{}]原为未生效,但当前时间已起始时间,更新优惠券状态为2");
-            }
-        }
-        // 生效中->过期
-        if(couponEntity.getUseEndDate().before(new Date())) {
-            //优惠券状态 1 未生效 2 生效中 3 已失效 4 停止发放
-            if(couponEntity.getCouponStatus().compareTo(2) == 0 || couponEntity.getCouponStatus().compareTo(1) == 0){
-                couponEntity.setCouponStatus(3);
-                couponService.updateStatus(couponEntity.getId() , 3);
-                log.info("优惠券[{}]原为未过期,但当前时间已过期,更新优惠券状态为3");
-                //这里更新用户优惠券使用状态 1. 可用 2. 已用 3. 过期 4、作废
-                //TODO:这里如果优惠券发放的人多了,每次获取的页数会比较大的时候,会很慢,需要转移到定时任务不停的去刷新
-                userCouponService.updateAllStatusByCouponId(couponEntity.getId() , 3 , limit);
-                log.info("优惠券[{}]原为未过期,但当前时间已过期,更新使用状态状态为3" , couponEntity.getId());
-            }
-        }
-
-    }
-
-    /**
-     * 查看优惠券使用明细列表
-     */
-    @RequestMapping("/useDetailList")
-    
-    public Result useDetailList(@RequestBody Map<String, Object> params) {
-        if(!params.containsKey("couponId")){
-            return Result.failure("缺失必要参数couponId");
-        }
-        //查询列表数据
-        Query query = new Query(params);
-        PageHelper.startPage(query.getPage(), query.getLimit());
-        List<CouponEntity> couponList = couponService.queryUseDetailList(query);
-        int total = couponService.queryUseDetailTotal(query);
-        PageUtils pageUtil = new PageUtils(couponList ,1, query.getLimit() , query.getPage());
-
-        return Result.success( pageUtil);
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        CouponEntity coupon = couponService.queryObject(id);
-
-        return Result.success(coupon);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody CouponEntity coupon) {
-
-        if(StringUtils.isBlank(coupon.getName())){
-            return Result.failure("优惠券名称不能为空");
-        }
-        if(null == coupon.getBrandId() || StringUtils.isBlank(coupon.getBrandName())){
-            return Result.failure("优惠券所属店铺ID或者名称不能为空");
-        }
-        if(null == coupon.getUseStartDate() || null == coupon.getUseEndDate()){
-            return Result.failure("优惠券有效起始日期不能为空");
-        }
-
-        Map<String , Object> param = new HashMap<>();
-        param.put("name", coupon.getName());
-        param.put("brandName", coupon.getBrandName());
-        List<CouponEntity> getList = couponService.queryList(param);
-        if(!CollectionUtils.isEmpty(getList)){
-            return Result.failure("该店铺下同名的优惠券已经存在");
-        }
-        Date currTime = new Date();
-        //优惠券状态 1 未生效 2 生效中 3 已失效 4 停止发放
-        if(null == coupon.getCouponStatus()){
-            if(coupon.getUseStartDate().after(currTime)){
-                coupon.setCouponStatus(1);
-            }else if(currTime.after(coupon.getUseStartDate()) && currTime.before(coupon.getUseEndDate())){
-                coupon.setCouponStatus(2);
-            }else if(currTime.after(coupon.getUseEndDate())){
-                coupon.setCouponStatus(3);
-            }else{
-                log.error("优惠券状态异常,当前日期:{},优惠券使用起始日期:{},优惠券使用截止日期:{}" , currTime,coupon.getUseStartDate() , coupon.getUseEndDate());
-            }
-        }
-        coupon.setEnable(1);
-        coupon.setCreateTime(LocalDateTime.now());
-        coupon.setUpdateTime(LocalDateTime.now());
-        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
-        String dateStr = dateTimeFormatter.format(LocalDateTime.now());
-        int ramNum = 100 + (int) (Math.random() * 900);
-        String couponSn = "HY" + dateStr + ramNum;
-        coupon.setCouponSn(couponSn);
-        int insert = couponService.save(coupon);
-        if(insert !=  1){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "新增优惠券失败");
-        }
-
-        return Result.success();
-    }
-
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @PostMapping("/update")
-    
-    public Result update(@RequestBody CouponEntity coupon) {
-        couponService.update(coupon);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改优惠券的状态
-     */
-    @CanUserUpdateRecord
-    @GetMapping("/updateStatus")
-    
-    public Result updateStatus(@RequestParam(name = "couponId") Integer couponId,
-                    @RequestParam(name = "status") Integer status) {
-        couponService.updateStatus(couponId , status);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改优惠券的状态
-     */
-    @CanUserUpdateRecord
-    @PostMapping("/deleteCoupons")
-    
-    @ResponseBody
-    public Result updateStatus(@RequestBody CouponRequestVo couponRequestVo) {
-
-        if(null != couponRequestVo && !CollectionUtils.isEmpty(couponRequestVo.getIdList())){
-           int deleteNum =  couponService.deleteCouponBatch(couponRequestVo.getIdList());
-           if(deleteNum != couponRequestVo.getIdList().size()){
-               log.error("删除的成功的数量跟上送的id数量不一致,回滚");
-               throw new CommonBaseException(ResultCodeEnum.D101 , "删除不完整");
-           }
-        }else{
-            return Result.failure("需要删除的id为空");
-        }
-
-        return Result.success();
-    }
-
-
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<CouponEntity> list = couponService.queryList(params);
-
-        return Result.success(list);
-    }
-
-    /**
-     * 按用户、商品下发优惠券
-     *
-     * @param params
-     * @return
-     */
-    
-    @RequestMapping(value = "publish", method = RequestMethod.POST)
-    public Result publish(@RequestBody Map<String, Object> params) {
-        return couponService.publish(params);
-    }
-}

+ 0 - 109
platform-shop/src/main/java/com/platform/controller/CouponGoodsController.java

@@ -1,109 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.CouponGoodsEntity;
-import com.platform.service.CouponGoodsService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-/**
- * 优惠券关联商品Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-29 21:50:17
- */
-@RestController
-@RequestMapping("coupongoods")
-public class CouponGoodsController {
-    @Autowired
-    private CouponGoodsService couponGoodsService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-
-    public Result info(@PathVariable("id") Integer id) {
-        CouponGoodsEntity couponGoods = couponGoodsService.queryObject(id);
-
-        return Result.success( couponGoods);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody CouponGoodsEntity couponGoods) {
-        couponGoodsService.save(couponGoods);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody CouponGoodsEntity couponGoods) {
-        couponGoodsService.update(couponGoods);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[]ids) {
-        couponGoodsService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<CouponGoodsEntity> list = couponGoodsService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 105
platform-shop/src/main/java/com/platform/controller/FeedbackController.java

@@ -1,105 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import com.platform.entity.FeedbackEntity;
-import com.platform.service.FeedbackService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-23 15:03:25
- */
-@RestController
-@RequestMapping("feedback")
-public class FeedbackController {
-    @Autowired
-    private FeedbackService feedbackService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success( pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{msgId}")
-
-    public Result info(@PathVariable("msgId") Integer msgId) {
-        FeedbackEntity feedback = feedbackService.queryObject(msgId);
-
-        return Result.success(feedback);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody FeedbackEntity feedback) {
-        feedbackService.save(feedback);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody FeedbackEntity feedback) {
-        feedbackService.update(feedback);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[]msgIds) {
-        feedbackService.deleteBatch(msgIds);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<FeedbackEntity> list = feedbackService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 99
platform-shop/src/main/java/com/platform/controller/FootprintController.java

@@ -1,99 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.FootprintEntity;
-import com.platform.service.FootprintService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:08
- */
-@RestController
-@RequestMapping("footprint")
-public class FootprintController {
-    @Autowired
-    private FootprintService footprintService;
-
-    /**
-     * 列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success( pageUtil);
-    }
-
-
-    /**
-     * 信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        FootprintEntity footprint = footprintService.queryObject(id);
-
-        return Result.success( footprint);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody FootprintEntity footprint) {
-        footprintService.save(footprint);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody FootprintEntity footprint) {
-        footprintService.update(footprint);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        footprintService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-}

+ 0 - 101
platform-shop/src/main/java/com/platform/controller/GoodsAttributeController.java

@@ -1,101 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.GoodsAttributeEntity;
-import com.platform.service.GoodsAttributeService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * 
- * 
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:08
- */
-@RestController
-@RequestMapping("goodsattribute")
-public class GoodsAttributeController {
-	@Autowired
-	private GoodsAttributeService goodsAttributeService;
-	
-	/**
-	 * 列表
-	 */
-	@RequestMapping("/list")
-
-	public Result list(@RequestBody 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 Result.success(pageUtil);
-	}
-	
-	
-	/**
-	 * 信息
-	 */
-	@RequestMapping("/info/{id}")
-
-	public Result info(@PathVariable("id") Integer id){
-		GoodsAttributeEntity goodsAttribute = goodsAttributeService.queryObject(id);
-		
-		return Result.success( goodsAttribute);
-	}
-	
-	/**
-	 * 保存
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/save")
-
-	public Result save(@RequestBody GoodsAttributeEntity goodsAttribute){
-		goodsAttributeService.save(goodsAttribute);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 修改
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/update")
-
-	public Result update(@RequestBody GoodsAttributeEntity goodsAttribute){
-		goodsAttributeService.update(goodsAttribute);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 删除
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/delete")
-
-	public Result delete(@RequestBody Integer[] ids){
-		goodsAttributeService.deleteBatch(ids);
-		
-		return Result.success();
-	}
-	
-}

+ 0 - 605
platform-shop/src/main/java/com/platform/controller/GoodsController.java

@@ -1,605 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.BrandEntity;
-import com.platform.entity.GoodsEntity;
-import com.platform.entity.GoodsGalleryEntity;
-import com.platform.entity.Result;
-import com.platform.service.BrandService;
-import com.platform.service.GoodsGalleryService;
-import com.platform.service.GoodsService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.utils.*;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-21 21:19:49
- */
-@RestController
-@RequestMapping("goods")
-@Slf4j
-public class GoodsController extends AbstractController{
-    @Autowired
-    private GoodsService goodsService;
-
-    @Autowired
-    private BrandService brandService;
-
-    @Autowired
-    private GoodsGalleryService goodsGalleryService;
-
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-
-    @Value("${api.host.query.url}")
-    private String apiHostQueryUrl;
-    @Value("${api.id}")
-    private String appId;
-
-    @Value("${api.secret}")
-    private String appSecret;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-        PageUtils pageUtil = new PageUtils(new ArrayList<>(), 0, query.getLimit(), query.getPage());
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            // 获取用户角色
-            HashMap<String, Object> brandQuery = new HashMap<>();
-            // 公司管理员能获取改公司下面所有的直播间的数据
-            if (roleIdList.contains(6L)) {
-                if (null == getDeptId()) {
-                    return Result.success(pageUtil);
-                }
-                brandQuery.put("deptIdList", getDeptId());
-            } else if (roleIdList.contains(8L) || roleIdList.contains(2L) || roleIdList.contains(81L)) {
-                // 公司员工只能获取当前绑定当前用户直播间的商品数据
-                List<Long> brandIds = mySysUserBrandService.queryBrandIdList(getUserId());
-                List<Long> brandIds2 =  brandService.queryIdByUser(getUserId());
-                brandIds.addAll(brandIds2);
-                if(ObjectUtils.isEmpty(brandIds)){
-                    return Result.success(pageUtil);
-                }
-                brandQuery.put("idList", brandIds);
-            }
-            List<BrandEntity> brandList = brandService.queryList(brandQuery);
-            if (CollectionUtils.isEmpty(brandList)) {
-                return Result.success( pageUtil);
-            } else {
-                query.put("brandIdList", brandList.stream().map(BrandEntity::getId).collect(Collectors.toList()));
-            }
-        }
-        query.put("isDelete", 0);
-        List<GoodsEntity> goodsList = goodsService.queryList(query);
-        int total = goodsService.queryTotal(query);
-
-        pageUtil = new PageUtils(goodsList, total, query.getLimit(), query.getPage());
-
-        return Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    public Result info(@PathVariable("id") Integer id) {
-        GoodsEntity goods = goodsService.queryObject(id);
-        return Result.success(goods);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    @Transactional(rollbackFor = Exception.class)
-    public Result save(@RequestBody GoodsEntity goods) {
-        if(goods.getName().length() > 15){
-            return Result.failure("商品名称名称不能超过15个字符");
-        }
-        if(StringUtils.isEmpty(goods.getBrandId())){
-            throw new RRException("直播间名称为空");
-        }
-        BrandEntity brand = brandService.queryObject(goods.getBrandId());
-        if(brand == null){
-            throw new RRException("直播间为空");
-        }
-        goodsService.save(goods);
-        //发送数据给api平台
-        sendDataToApi(goods);
-
-        return Result.success();
-    }
-
-    private Result sendDeleteDataToApi(GoodsEntity goods){
-        if(null == goods){
-            return Result.failure("商品信息为空,无法请求api平台");
-        }
-        Map<String, Object> reqData = new HashMap<>();
-        reqData.put("goodsId" , goods.getId());
-        reqData.put("goodsName" , goods.getName());
-        reqData.put("goodsIsOnSale" , goods.getIsOnSale());
-        reqData.put("goodsImageList" , getGoodsImageList(goods));
-        reqData.put("retailPriceLow" , goods.getRetailPrice());
-        reqData.put("retailPriceHigh" , goods.getRetailPrice());
-        reqData.put("retailPriceStr" , getGoodsRetailPrice(goods));
-        reqData.put("goodsDesc" , goods.getGoodsSimpleDesc());
-        reqData.put("goodsCategoryId" , goods.getCategoryId());
-        reqData.put("goodsCategoryName" , goods.getCategoryName());
-        reqData.put("goodsNumber" , goods.getGoodsNumber());
-        reqData.put("goodsAddTime" , goods.getAddTime());
-        reqData.put("goodsUpdateTime" , goods.getUpdateTime());
-        reqData.put("goodsPrimaryPicUrl" , goods.getPrimaryPicUrl());
-        reqData.put("goodsListPicUrl" , goods.getListPicUrl());
-        reqData.put("goodsIsHot" , goods.getIsHot());
-        reqData.put("goodsMarketPrice" , goods.getMarketPrice());
-        reqData.put("attributeCategoryName" , goods.getAttributeCategoryName());
-        reqData.put("brandId" , goods.getBrandId());
-        reqData.put("realShopUrl" , goods.getRealShopUrl());
-        reqData.put("origin" , ResourceUtil.getConfigByName("origin"));
-        reqData.put("enable" , 0);
-        BrandEntity brandEntity = brandService.queryObject(goods.getBrandId());
-        if(StringUtils.isEmpty(goods.getBrandName())){
-            if(null != brandEntity){
-                reqData.put("brandName" , brandEntity.getName());
-            }
-        }else{
-            reqData.put("brandName" , goods.getBrandName());
-        }
-
-        if(null != brandEntity && !StringUtils.isEmpty(brandEntity.getSceneNum())){
-            reqData.put("sceneNum" , brandEntity.getSceneNum());
-            reqData.put("appId" , appId);
-            log.info("获取到的api平台的app_id={}, app_secret={}" , appId , appSecret);
-            Long timeStamp = System.currentTimeMillis();
-            //token=app_id+app_secret+timestamp
-            String token = SHAUtils.getSHA256(appId + appSecret + timeStamp.toString());
-            Map<String , Object> sortMap = sortMapByKey(reqData);
-            String sortMapStr = JSONObject.toJSONString(sortMap);
-            log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
-            String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
-            String openApiurl = apiHostQueryUrl.concat("?appId=").concat(appId).concat("&sign=")
-                    .concat(sign).concat("&token=").concat(token).concat("&timeStamp=").concat(""+timeStamp);
-            log.info("请求链接:{}" ,openApiurl);
-            String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
-            log.info("api平台返回结果:{}" , apiResultStr);
-            return Result.success(apiResultStr);
-        }else{
-            log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
-            return Result.success();
-        }
-
-    }
-
-    private Result sendDataToApi(GoodsEntity goods){
-        if(null == goods){
-            return Result.failure("商品信息为空,无法请求api平台");
-        }
-        Map<String, Object> reqData = new HashMap<>();
-        reqData.put("goodsId" , goods.getId());
-        reqData.put("goodsName" , goods.getName());
-        reqData.put("goodsIsOnSale" , goods.getIsOnSale());
-        reqData.put("goodsImageList" , getGoodsImageList(goods));
-        reqData.put("retailPriceLow" , goods.getRetailPrice());
-        reqData.put("retailPriceHigh" , goods.getRetailPrice());
-        reqData.put("retailPriceStr" , getGoodsRetailPrice(goods));
-        reqData.put("goodsDesc" , goods.getGoodsSimpleDesc());
-        reqData.put("goodsCategoryId" , goods.getCategoryId());
-        reqData.put("goodsCategoryName" , goods.getCategoryName());
-        reqData.put("goodsNumber" , goods.getGoodsNumber());
-        reqData.put("goodsAddTime" , goods.getAddTime());
-        reqData.put("goodsUpdateTime" , goods.getUpdateTime());
-        reqData.put("goodsPrimaryPicUrl" , goods.getPrimaryPicUrl());
-        reqData.put("goodsListPicUrl" , goods.getListPicUrl());
-        reqData.put("goodsIsHot" , goods.getIsHot());
-        reqData.put("goodsMarketPrice" , goods.getMarketPrice());
-        reqData.put("attributeCategoryName" , goods.getAttributeCategoryName());
-        reqData.put("brandId" , goods.getBrandId());
-        reqData.put("realShopUrl" , goods.getRealShopUrl());
-        reqData.put("origin" , ResourceUtil.getConfigByName("origin"));
-        BrandEntity brandEntity = brandService.queryObject(goods.getBrandId());
-        if(StringUtils.isEmpty(goods.getBrandName())){
-           if(null != brandEntity){
-               reqData.put("brandName" , brandEntity.getName());
-           }
-        }else{
-            reqData.put("brandName" , goods.getBrandName());
-        }
-
-        if(null != brandEntity && !StringUtils.isEmpty(brandEntity.getSceneNum())){
-            reqData.put("sceneNum" , brandEntity.getSceneNum());
-            reqData.put("appId" , appId);
-
-            log.info("获取到的api平台的app_id={}, app_secret={}" , appId , appSecret);
-
-            Long timeStamp = System.currentTimeMillis();
-
-            //token=app_id+app_secret+timestamp
-            String token = SHAUtils.getSHA256(appId + appSecret + timeStamp.toString());
-
-            Map<String , Object> sortMap = sortMapByKey(reqData);
-            String sortMapStr = JSONObject.toJSONString(sortMap);
-            log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
-            String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
-            String openApiurl = apiHostQueryUrl .concat("?appId=").concat(appId).concat("&sign=")
-                    .concat(sign).concat("&token=").concat(token).concat("&timeStamp=").concat(""+timeStamp);
-            log.info("请求链接:{}" ,openApiurl);
-            String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
-            log.info("api平台返回结果:{}" , apiResultStr);
-            return Result.success(apiResultStr);
-        }else{
-            log.info("当前商品[{}]的品牌没有vr场景或者场景码为空,不需要上送api平台" , goods.getId());
-            return Result.success();
-        }
-
-    }
-
-
-    /**
-     *  根据map的key进行字典升序排序
-     * @param map
-     * @return map
-     */
-    private   Map<String, Object> sortMapByKey(Map<String, Object>map) {
-        Map<String, Object> treemap = new TreeMap<String, Object>(map);
-        List<Map.Entry<String, Object>> list = new ArrayList<Map.Entry<String, Object>>(treemap.entrySet());
-        Collections.sort(list, (o1, o2) -> org.apache.commons.lang3.StringUtils.compare(o1.getKey() , o2.getKey()));
-        return treemap;
-    }
-
-    private List<String> getGoodsImageList(GoodsEntity goodsEntity){
-        List<String> imageList = new ArrayList<>();
-        if(null == goodsEntity){
-            return imageList;
-        }
-        Map<String, Object> params = new HashMap<>();
-        params.put("goodsId", Integer.valueOf(goodsEntity.getId()));
-        List<GoodsGalleryEntity> list = goodsGalleryService.queryList(params);
-        if(!CollectionUtils.isEmpty(list)){
-            for(GoodsGalleryEntity galleryEntity : list){
-                imageList.add(galleryEntity.getImgUrl());
-            }
-        }
-        return imageList;
-    }
-
-    private String getGoodsRetailPrice(GoodsEntity goodsEntity){
-        if(null == goodsEntity){
-            return "";
-        }
-        Map<String, Object> params = new HashMap<>();
-        params.put("goodsId", Integer.valueOf(goodsEntity.getId()));
-        List<GoodsGalleryEntity> list = goodsGalleryService.queryList(params);
-
-        String retailPrice = "0";
-        if(goodsEntity.getRetailPrice() != null){
-            retailPrice = goodsEntity.getRetailPrice().toString();
-        }
-        if(goodsEntity.getProductList() != null && goodsEntity.getProductList().size() > 1){
-            BigDecimal bigPrice = goodsEntity.getProductList().get(0).getRetailPrice();
-            BigDecimal smallPrice = goodsEntity.getProductList().get(0).getRetailPrice();
-            for(int i = 1, len = goodsEntity.getProductList().size(); i < len; i ++){
-                if(null != bigPrice && bigPrice.compareTo(goodsEntity.getProductList().get(i).getRetailPrice()) < 0){
-                    bigPrice = goodsEntity.getProductList().get(i).getRetailPrice();
-                }
-
-                if(null != smallPrice && smallPrice.compareTo(goodsEntity.getProductList().get(i).getRetailPrice()) > 0){
-                    smallPrice = goodsEntity.getProductList().get(i).getRetailPrice();
-                }
-            }
-
-            retailPrice = (smallPrice == null? "0" : smallPrice.toString()) +
-                    "-" + (bigPrice == null? "0" : bigPrice.toString());
-        }
-        return retailPrice;
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    @Transactional(rollbackFor = Exception.class)
-    public Result update(@RequestBody GoodsEntity goods) {
-        if(goods.getName().length() > 15){
-            return Result.failure("商品名称名称不能超过15个字符");
-        }
-        if(null == goods.getUpdateUserId()){
-            return Result.failure("数据的更新者ID不能为空");
-        }
-        GoodsEntity goodsEntity = goodsService.queryObject(goods.getId());
-        if(null == goodsEntity){
-            return Result.failure("商品不存在");
-        }
-        if(StringUtils.isEmpty(goods.getBrandId())){
-            throw new RRException("直播间名称为空");
-        }
-        BrandEntity brand = brandService.queryObject(goods.getBrandId());
-        if(brand == null){
-            throw new RRException("直播间为空");
-        }
-        goodsService.update(goods);
-
-        //发送数据给api平台
-        sendDataToApi(goods);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    public Result delete(@RequestBody Integer[] ids) {
-        if(null != ids && ids.length > 0){
-            for(int i = 0 ;i<ids.length ; i++){
-                int id = ids[i];
-                GoodsEntity goodsEntity = goodsService.queryObject(id);
-                if(null != goodsEntity){
-                    //将删除信息更新到api
-                    sendDeleteDataToApi(goodsEntity);
-                }
-            }
-        }
-        goodsService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            params.put("brandIdList", mySysUserBrandService.queryBrandIdList(getUserId()));
-        }
-
-        params.put("isDelete", 0);
-        List<GoodsEntity> list = goodsService.queryList(params);
-
-        return Result.success( list);
-    }
-
-
-    /**
-     * 商品回收站
-     *
-     * @param params
-     * @return
-     */
-    @RequestMapping("/historyList")
-    public Result historyList(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-        PageUtils pageUtil = new PageUtils(new ArrayList<>(), 0, query.getLimit(), query.getPage());
-        query.put("isDelete", 1);
-        long userId = getUserId();
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            if(null == getDeptId()){
-                return Result.success( pageUtil);
-            }
-            query.put("deptIdList" , getDeptId());
-        }
-        List<GoodsEntity> goodsList = goodsService.queryList(query);
-        int total = goodsService.queryTotal(query);
-
-        pageUtil = new PageUtils(goodsList, total, query.getLimit(), query.getPage());
-
-        return Result.success( pageUtil);
-    }
-
-    /**
-     * 商品从回收站恢复
-     */
-    @RequestMapping("/back")
-    public Result back(@RequestBody Integer[] ids) {
-        goodsService.back(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 总计
-     */
-    @RequestMapping("/queryTotal")
-    public Result queryTotal(@RequestBody Map<String, Object> params) {
-
-        params.put("isDelete", 0);
-        int sum = goodsService.queryTotal(params);
-        return Result.success(sum);
-    }
-
-    /**
-     * 上架
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/enSale")
-    public Result enSale(@RequestBody String id) {
-        for(String ids : id.split(",")){
-            goodsService.enSale(Integer.parseInt(ids));
-            GoodsEntity entity = goodsService.queryObject(Integer.parseInt(ids));
-            sendDataToApi(entity);
-        }
-        return Result.success();
-    }
-
-    /**
-     * 下架
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/unSale")
-    public Result unSale(@RequestBody String id) {
-        for(String ids : id.split(",")){
-            goodsService.unSale(Integer.parseInt(ids));
-            GoodsEntity entity = goodsService.queryObject(Integer.parseInt(ids));
-            sendDataToApi(entity);
-        }
-
-        return Result.success();
-    }
-
-    /**
-     * 根据场景码过去商品分类列表
-     */
-    @GetMapping("/getGoods")
-    public Result getGoodsById(@RequestParam(name =  "goodsId") Integer goodsId) {
-        if(StringUtils.isEmpty(goodsId)){
-            return Result.failure("入参不完整,请检查入参");
-        }
-        GoodsEntity goodsEntity =  goodsService.queryObject(goodsId);
-        Map<String ,Object> resultMap = new HashMap<>();
-        resultMap.put("goods" , goodsEntity);
-        return Result.success(resultMap);
-    }
-
-    @GetMapping("/getGoodsDetail")
-    public Result getGoodsDetail(@RequestParam(name =  "goodsId") String goodsId,
-                            @RequestParam(name =  "brandId") String brandId,
-                            @RequestParam(name =  "sceneNum") String sceneNum) {
-        if(StringUtils.isEmpty(goodsId)){
-            return Result.failure("入参不完整,请检查入参");
-        }
-
-        List resultList = new ArrayList();
-        Map<String ,Object> result = new HashMap<>();
-
-        if(!StringUtils.isEmpty(brandId) && !StringUtils.isEmpty(sceneNum)){
-            Integer brand = brandService.queryIdByScene("?m=" + sceneNum);
-            if(null == brand || !brandId.equals(brand.toString()) ){
-                return Result.success(result);
-            }
-        }
-
-        String[] ids = goodsId.split(",");
-        for(String id : ids){
-            GoodsEntity goodsEntity =  goodsService.queryObject(Integer.valueOf(id));
-            if(goodsEntity == null){
-                return Result.failure("商品不存在");
-            }
-
-            Map<String, Object> params = new HashMap<>();
-            params.put("goodsId", Integer.valueOf(id));
-            List<GoodsGalleryEntity> list = goodsGalleryService.queryList(params);
-
-            String retailPrice = "0";
-            if(goodsEntity.getRetailPrice() != null){
-                retailPrice = goodsEntity.getRetailPrice().toString();
-            }
-            if(goodsEntity.getProductList() != null && goodsEntity.getProductList().size() > 1){
-                BigDecimal bigPrice = goodsEntity.getProductList().get(0).getRetailPrice();
-                BigDecimal smallPrice = goodsEntity.getProductList().get(0).getRetailPrice();
-                for(int i = 1, len = goodsEntity.getProductList().size(); i < len; i ++){
-                    if(bigPrice.compareTo(goodsEntity.getProductList().get(i).getRetailPrice()) < 0){
-                        bigPrice = goodsEntity.getProductList().get(i).getRetailPrice();
-                    }
-
-                    if(smallPrice.compareTo(goodsEntity.getProductList().get(i).getRetailPrice()) > 0){
-                        smallPrice = goodsEntity.getProductList().get(i).getRetailPrice();
-                    }
-                }
-
-                retailPrice = (smallPrice == null? "0" : smallPrice.toString()) +
-                        "-" + (bigPrice == null? "0" : bigPrice.toString());
-            }
-
-            //获取图片列表
-            List<String> imageList = new ArrayList<>();
-            imageList.add(goodsEntity.getPrimaryPicUrl());
-
-            if(list != null && list.size() > 0){
-                for(GoodsGalleryEntity galleryEntity : list){
-                    imageList.add(galleryEntity.getImgUrl());
-                }
-            }
-
-            Map<String ,Object> resultMap = new HashMap<>();
-            resultMap.put("id", goodsEntity.getId());
-            resultMap.put("name", goodsEntity.getName());
-            resultMap.put("desc", goodsEntity.getGoodsSimpleDesc());
-            resultMap.put("isOnSale", goodsEntity.getIsOnSale());
-            resultMap.put("imageList", imageList);
-            resultMap.put("retailPrice", retailPrice);
-
-            resultList.add(resultMap);
-            result.put("goods", resultList);
-        }
-
-
-        return Result.success(result);
-    }
-
-    /**
-     * 根据场景码过去商品分类列表
-     */
-    @GetMapping("/getCategoryListByScene")
-    public Result getGoodsListByScene(@RequestParam(name =  "sceneNum") String sceneNum) {
-        if(StringUtils.isEmpty(sceneNum)){
-            return Result.failure("入参不完整,请检查入参");
-        }
-        Integer brandId = brandService.queryIdByScene("?m=" + sceneNum);
-        if(null == brandId){
-            return Result.failure("当前场景码获取不到brandId");
-        }
-        QueryWrapper<GoodsEntity> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("brand_id" , brandId);
-        List<Map<String,Object>> categoryList = goodsService.queryGoodsCategory(queryWrapper);
-        Map<String ,Object> resultMap = new HashMap<>();
-        resultMap.put("list" , categoryList);
-        return Result.success(resultMap);
-    }
-
-    /**
-     * 根据场景码查询商品列表
-     */
-    @GetMapping("/getGoodsListByScene")
-    public Result getGoodsListByScene(@RequestParam(name =  "sceneNum") String sceneNum,
-                                 @RequestParam(name =  "categoryId") Integer categoryId,
-                                 @RequestParam(name =  "goodsName") String goodsName,
-                                 @RequestParam(name =  "pageNum") Long pageNum,
-                                 @RequestParam(name =  "pageSize") Long pageSize) {
-        if(StringUtils.isEmpty(sceneNum) || null == pageNum || null == pageSize){
-            return Result.failure("入参不完整,请检查入参");
-        }
-        Integer brandId = brandService.queryIdByScene("?m=" + sceneNum);
-        if(null == brandId){
-            return Result.failure("当前场景码获取不到brandId");
-        }
-        IPage<Map<String,Object>> page = new Page<>(pageNum , pageSize);
-        IPage<Map<String,Object>> resultPage = goodsService.queryListTwoWithoutFilter(page , brandId , categoryId , goodsName);
-        if(null == resultPage){
-            return Result.failure("当前场景码获取不到商品列表");
-        }
-        return Result.success(PageUtils.assembleResult(resultPage.getTotal() , resultPage.getPages() ,
-                     resultPage.getCurrent(), pageSize , resultPage.getRecords()));
-    }
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/GoodsGalleryController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.GoodsGalleryEntity;
-import com.platform.entity.Result;
-import com.platform.service.GoodsGalleryService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-23 14:41:43
- */
-@RestController
-@RequestMapping("goodsgallery")
-public class GoodsGalleryController {
-    @Autowired
-    private GoodsGalleryService goodsGalleryService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        GoodsGalleryEntity goodsGallery = goodsGalleryService.queryObject(id);
-
-        return Result.success( goodsGallery);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody GoodsGalleryEntity goodsGallery) {
-        goodsGalleryService.save(goodsGallery);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody GoodsGalleryEntity goodsGallery) {
-        goodsGalleryService.update(goodsGallery);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        goodsGalleryService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<GoodsGalleryEntity> list = goodsGalleryService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/GoodsIssueController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.GoodsIssueEntity;
-import com.platform.entity.Result;
-import com.platform.service.GoodsIssueService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-23 14:12:34
- */
-@RestController
-@RequestMapping("goodsissue")
-public class GoodsIssueController {
-    @Autowired
-    private GoodsIssueService goodsIssueService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        GoodsIssueEntity goodsIssue = goodsIssueService.queryObject(id);
-
-        return Result.success(goodsIssue);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody GoodsIssueEntity goodsIssue) {
-        goodsIssueService.save(goodsIssue);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody GoodsIssueEntity goodsIssue) {
-        goodsIssueService.update(goodsIssue);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        goodsIssueService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<GoodsIssueEntity> list = goodsIssueService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 136
platform-shop/src/main/java/com/platform/controller/GoodsSpecificationController.java

@@ -1,136 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.GoodsSpecificationEntity;
-import com.platform.entity.ProductEntity;
-import com.platform.entity.Result;
-import com.platform.service.GoodsSpecificationService;
-import com.platform.service.ProductService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.utils.Constant;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 商品对应规格表值表Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-31 11:15:55
- */
-@RestController
-@RequestMapping("goodsspecification")
-public class GoodsSpecificationController extends AbstractController{
-    @Autowired
-    private GoodsSpecificationService goodsSpecificationService;
-
-    @Autowired
-    private ProductService productService;
-
-
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-
-        Long userId = getUserId();
-        logger.info("系统用户id: {}", userId);
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            query.put("brandIdList", mySysUserBrandService.queryBrandIdList(userId));
-        }
-
-        List<GoodsSpecificationEntity> goodsSpecificationList = goodsSpecificationService.queryList(query);
-        int total = goodsSpecificationService.queryTotal(query);
-
-        PageUtils pageUtil = new PageUtils(goodsSpecificationList, total, query.getLimit(), query.getPage());
-
-        return Result.success( pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        GoodsSpecificationEntity goodsSpecification = goodsSpecificationService.queryObject(id);
-
-        return Result.success( goodsSpecification);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody GoodsSpecificationEntity goodsSpecification) {
-        goodsSpecificationService.save(goodsSpecification);
-
-        ProductEntity entity = new ProductEntity();
-        entity.setGoodsId(goodsSpecification.getGoodsId());
-        ProductEntity productEntity = productService.queryObjectByGoodsId(entity);
-        if(productEntity != null ){
-            if(!StringUtils.isEmpty(productEntity.getGoodsSpecificationIds())){
-                productEntity.setGoodsSpecificationIds(productEntity.getGoodsSpecificationIds() + "_" + goodsSpecification.getId());
-            }else {
-                productEntity.setGoodsSpecificationIds(String.valueOf(goodsSpecification.getId()));
-            }
-            productService.update(productEntity);
-        }
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody GoodsSpecificationEntity goodsSpecification) {
-        goodsSpecificationService.update(goodsSpecification);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[]ids) {
-        goodsSpecificationService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<GoodsSpecificationEntity> list = goodsSpecificationService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 111
platform-shop/src/main/java/com/platform/controller/HelpIssueController.java

@@ -1,111 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.HelpIssueEntity;
-import com.platform.entity.Result;
-import com.platform.service.HelpIssueService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2018-11-07 10:09:54
- */
-@Controller
-@RequestMapping("helpissue")
-public class HelpIssueController {
-    @Autowired
-    private HelpIssueService helpIssueService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    @ResponseBody
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    @ResponseBody
-    public Result info(@PathVariable("id") Integer id) {
-        HelpIssueEntity helpIssue = helpIssueService.queryObject(id);
-
-        return Result.success(helpIssue);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    @ResponseBody
-    public Result save(@RequestBody HelpIssueEntity helpIssue) {
-        helpIssueService.save(helpIssue);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    @ResponseBody
-    public Result update(@RequestBody HelpIssueEntity helpIssue) {
-        helpIssueService.update(helpIssue);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    @ResponseBody
-    public Result delete(@RequestBody Integer[] ids) {
-        helpIssueService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    @ResponseBody
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<HelpIssueEntity> list = helpIssueService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 110
platform-shop/src/main/java/com/platform/controller/HelpTypeController.java

@@ -1,110 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.HelpTypeEntity;
-import com.platform.entity.Result;
-import com.platform.service.HelpTypeService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2018-11-07 10:09:54
- */
-@Controller
-@RequestMapping("helptype")
-public class HelpTypeController {
-    @Autowired
-    private HelpTypeService helpTypeService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    @ResponseBody
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-
-        List<HelpTypeEntity> helpTypeList = helpTypeService.queryList(query);
-        int total = helpTypeService.queryTotal(query);
-
-        return Result.success(PageUtilsPlus.page(helpTypeList,(long)total,(long)query.getLimit(),(long)query.getPage()));
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info")
-    
-    @ResponseBody
-    public Result info(@RequestParam("id") Integer id) {
-        HelpTypeEntity helpType = helpTypeService.queryObject(id);
-
-        return Result.success( helpType);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    @ResponseBody
-    public Result save(@RequestBody HelpTypeEntity helpType) {
-        helpTypeService.save(helpType);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    @ResponseBody
-    public Result update(@RequestBody HelpTypeEntity helpType) {
-        helpTypeService.update(helpType);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    @ResponseBody
-    public Result delete(@RequestBody Integer[]ids) {
-        helpTypeService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    @ResponseBody
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<HelpTypeEntity> list = helpTypeService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 107
platform-shop/src/main/java/com/platform/controller/KeywordsController.java

@@ -1,107 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.KeywordsEntity;
-import com.platform.service.KeywordsService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-/**
- * 热闹关键词表Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-25 21:23:41
- */
-@RestController
-@RequestMapping("keywords")
-public class KeywordsController {
-    @Autowired
-    private KeywordsService keywordsService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info")
-    public Result info(@RequestParam("id") Integer id) {
-        KeywordsEntity keywords = keywordsService.queryObject(id);
-
-        return Result.success(keywords);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-
-    public Result save(@RequestBody KeywordsEntity keywords) {
-        keywordsService.save(keywords);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-
-    public Result update(@RequestBody KeywordsEntity keywords) {
-        keywordsService.update(keywords);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-
-    public Result delete(@RequestBody Integer[]ids) {
-        keywordsService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<KeywordsEntity> list = keywordsService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 448
platform-shop/src/main/java/com/platform/controller/OrderController.java

@@ -1,448 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.constant.ConstantExcel;
-import com.platform.entity.*;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.oss.OSSFactory;
-import com.platform.service.BrandService;
-import com.platform.service.OrderGoodsService;
-import com.platform.service.OrderService;
-import com.platform.service.OrderShippingService;
-import com.platform.utils.*;
-import com.platform.utils.excel.ExcelUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-
-/**
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:09
- */
-@RestController
-@RequestMapping("order")
-@Slf4j
-public class OrderController extends AbstractController {
-    @Autowired
-    private OrderService orderService;
-
-    @Autowired
-    private OrderGoodsService orderGoodsService;
-
-
-    @Autowired
-    private OrderShippingService orderShippingService;
-
-    @Autowired
-    private BrandService brandService;
-
-    /**
-     * 列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        // 查询列表数据
-        Query query = new Query(params);
-        PageUtils pageUtil = new PageUtils(new ArrayList<>(), 0, query.getLimit(), query.getPage());
-        ;
-
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            if (null == getDeptId()) {
-                return Result.success(pageUtil);
-            }
-            Query brandQuery = new Query(params);
-            brandQuery.put("deptIdList", getDeptId());
-            List<BrandEntity> brandList = brandService.queryList(brandQuery);
-            if (!CollectionUtils.isEmpty(brandList)) {
-                List<Integer> brandIdList = new ArrayList<>();
-                for (BrandEntity brandEntity : brandList) {
-                    brandIdList.add(brandEntity.getId().intValue());
-                }
-                query.put("brandIdList", brandIdList);
-               // params.put("brandIdList", brandIdList);
-            } else {
-                return Result.success(pageUtil);
-            }
-        }
-
-        List<OrderEntity> orderList = orderService.queryList(query);
-        for (OrderEntity orderEntity : orderList) {
-            if (orderEntity.getShippingStatus() == null) {
-                orderEntity.setShippingStatus(0);
-            }
-            orderEntity.setNewId(orderEntity.getId() + "" + orderEntity.getBrandId());
-        }
-       // List<OrderEntity> orderListTotal = orderService.queryList(params);
-
-        pageUtil = new PageUtils(orderList, orderList.size(), query.getLimit(), query.getPage());
-
-        return Result.success(pageUtil);
-    }
-
-
-    /**
-     * 信息
-     */
-    @RequestMapping("/info")
-    
-    public Result info(@RequestParam("id") Integer id, @RequestParam("brandId") Integer brandId) {
-
-        OrderEntity order = orderService.queryObject(id);
-
-        if (order != null) {
-            order.setBrandId(brandId);
-            Map map = new HashMap();
-            map.put("orderId", order.getId());
-            map.put("brandId", brandId + "");
-            order.setGoodsList(orderGoodsService.queryList(map));
-
-            BrandEntity brandEntity = brandService.queryObject(brandId);
-            order.setBrandName(brandEntity.getName());
-
-            List<OrderShippingEntity> list = orderShippingService.queryList(map);
-            if (list != null && list.size() > 0) {
-                order.setShippingId(list.get(0).getShippingId());
-                order.setShippingNo(list.get(0).getShippingNo());
-                order.setShippingName(list.get(0).getShippingName());
-                order.setShippingStatus(list.get(0).getShippingStatus());
-                order.setActualPrice(list.get(0).getTotalPrice());
-                order.setOrderPrice(list.get(0).getTotalPrice());
-                order.setGoodsPrice(list.get(0).getTotalPrice().subtract(list.get(0).getFreightPrice()));
-                order.setFreightPrice(list.get(0).getFreightPrice().intValue());
-
-                if (!StringUtils.isEmpty(list.get(0).getShippingNo())) {
-                    JSONObject result = new JSONObject();
-                    try {
-                        String msg = LogisticsUtil.getDetail(order.getShippingNo(), null, "/kdi");
-                        result = JSONObject.parseObject(msg);
-                        //status 0:正常查询 201:快递单号错误 203:快递公司不存在 204:快递公司识别失败 205:没有信息 207:该单号被限制,错误单号 */
-                        String status = result.getString("status");
-                        JSONObject data = new JSONObject();
-                        if ("201".equals(status)) {
-                            data.put("result", "快递单号错误");
-                            order.setLogistics(data);
-                        } else if ("203".equals(status)) {
-                            data.put("result", "快递公司不存在");
-                            order.setLogistics(data);
-                        } else if ("204".equals(status)) {
-                            data.put("result", "快递公司识别失败");
-                            order.setLogistics(data);
-                        } else if ("205".equals(status)) {
-                            data.put("result", "快递单号没有信息");
-                            order.setLogistics(data);
-                        } else if ("206".equals(status)) {
-                            data.put("result", "该单号被限制,错误单号");
-                            order.setLogistics(data);
-                        } else {
-                            data = result.getJSONObject("result");
-                            order.setLogistics(data);
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-
-                }
-            }
-        }
-        return Result.success(order);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody OrderEntity order) {
-        orderService.save(order);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody OrderEntity order) {
-        orderService.update(order);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        orderService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<OrderEntity> list = orderService.queryList(params);
-
-        return Result.success(list);
-    }
-
-    /**
-     * 总计
-     */
-    @RequestMapping("/queryTotal")
-    public Result queryTotal(@RequestBody Map<String, Object> params) {
-        int sum = orderService.queryTotal(params);
-
-        return Result.success( sum);
-    }
-
-    /**
-     * 确定收货
-     *
-     * @return
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/confirm")
-    
-    public Result confirm(@RequestBody OrderEntity order) {
-        orderService.confirm(order.getId(), order.getBrandId());
-
-        return Result.success();
-    }
-
-    /**
-     * 发货
-     *
-     * @param order
-     * @return
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/sendGoods")
-    
-    public Result sendGoods(@RequestBody OrderEntity order) {
-        if (StringUtils.isEmpty(order.getShippingNo()) || StringUtils.isEmpty(order.getShippingId())) {
-            return Result.failure("快递公司和快递单号不能为空");
-        }
-        orderService.sendGoods(order);
-
-        return Result.success();
-    }
-
-    /**
-     * 导出订单数据
-     */
-    @PostMapping("/export")
-    @ResponseBody
-    public Result export(@RequestBody Map<String, Object> params, HttpServletResponse response, HttpServletRequest request) {
-
-        if(null == params){
-            throw new CommonBaseException(ResultCodeEnum.D101 , "缺失参数");
-        }
-        String orderSnListStr = (String) params.get("orderSnList");
-        if(StringUtils.isEmpty(orderSnListStr)){
-            return Result.failure("订单号为空");
-        }
-        List<String> orderSnList = Arrays.asList(orderSnListStr.split(","));
-
-        params.remove("orderSnList");
-        params.put("orderSnList" , orderSnList);
-        // 查询列表数据
-        List<OrderEntity> orderList = orderService.queryList(params);
-        List<OrderGoodsEntity> orderGoodsList = new ArrayList<>();
-        List<OrderShippingEntity> shippingList = null;
-        //导出的数据
-        Map<String, String> item = null;
-        List<Map<String , String>> dataList = new ArrayList<>();
-        int num = 1;
-        if (!CollectionUtils.isEmpty(orderList)) {
-            for (OrderEntity orderEntity : orderList) {
-                if (orderEntity.getBrandId() != null) {
-                    Map<String , Object> goodsMap = new HashMap<String, Object>();
-                    goodsMap.put("orderId", orderEntity.getId());
-                    goodsMap.put("brandId", orderEntity.getBrandId() + "");
-                    orderGoodsList = orderGoodsService.queryList(goodsMap);
-                    if(CollectionUtils.isEmpty(orderGoodsList)){
-                        continue;
-                    }
-                    item = fillExcel(orderEntity , orderGoodsList , num , goodsMap);
-                    dataList.add(item);
-                    num++;
-                } else {
-                    Map<String , Object> goodsMap = new HashMap<String, Object>();
-                    goodsMap.put("orderId", orderEntity.getId());
-                    orderGoodsList = orderGoodsService.queryList(goodsMap);
-                    if(CollectionUtils.isEmpty(orderGoodsList)){
-                        continue;
-                    }
-                    item = fillExcel(orderEntity , orderGoodsList , num , goodsMap);
-                    dataList.add(item);
-                    num++;
-                }
-
-            }
-        }
-
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String dateStr = "订单数据-" + dateFormat.format(new Date()) + "_" + System.currentTimeMillis();
-        String fileName = dateStr + ".xls";
-        String localExcelFullPath = ResourceUtil.getConfigByName("filePath") + "excel/" + dateStr + ".xls";
-        String ossExcelFullPath = ResourceUtil.getConfigByName("oss.excel.file.path")  + dateStr + ".xls";
-        File file = new File(localExcelFullPath);
-        if (!file.getParentFile().exists()) {
-            file.getParentFile().mkdirs();
-        }
-
-
-        ExcelUtil.writeExcel(dataList, ConstantExcel.ORDEREXCELCOLENNAME.length, localExcelFullPath, 1);
-
-        //上传oss,然后返回链接
-        String url = "";
-        try {
-            url = OSSFactory.build().upload(new FileInputStream(file) , ossExcelFullPath);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        Map<String, Object> map = new HashMap<>();
-        map.put("url", url);
-
-        return Result.success(map);
-
-         /* response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
-      String agent = request.getHeader("User-Agent");
-        if (agent != null && (agent.contains("MSIE") || agent.contains("Trident"))) {
-            try {
-                fileName = URLEncoder.encode(fileName, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-        } else {
-            //非IE浏览器的处理:
-            try {
-                fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-        }
-        response.setContentType(request.getServletContext().getMimeType(fileName));
-        response.setContentLength((int) file.length());
-        output(response, file);*/
-    }
-
-    private Map<String ,String> fillExcel(OrderEntity orderEntity , List<OrderGoodsEntity> orderGoodsList , int num , Map<String , Object> goodsMap){
-        Map<String , String> item = new HashMap<>();
-        String goodsNameAll = "";
-        String orderDetail = "";
-        int goodsAllNum = 0;
-        if(!CollectionUtils.isEmpty(orderGoodsList)){
-            for (OrderGoodsEntity orderGoodsEntity : orderGoodsList){
-                if(!StringUtils.isEmpty(orderGoodsEntity.getGoodsName())){
-                    goodsNameAll += orderGoodsEntity.getGoodsName() + ",";
-                }
-                if(num != orderGoodsEntity.getNumber()){
-                    goodsAllNum += orderGoodsEntity.getNumber();
-                }
-                orderDetail += orderGoodsEntity.getGoodsName() + "  " + orderGoodsEntity.getRetailPrice() + "*" + orderGoodsEntity.getNumber() + "; ";
-            }
-            if(goodsNameAll.length() > 0){
-                goodsNameAll = goodsNameAll.substring(0 , goodsNameAll.length() - 1);
-            }
-        }
-
-        //0 序号
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[0], String.valueOf(num));
-        //1 订单号
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[1], orderEntity.getOrderSn());
-        //2 店铺名称
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[2], orderEntity.getBrandName());
-        //3 会员昵称
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[3], orderEntity.getUserName());
-        //4 商品名称
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[4], goodsNameAll);
-        //5 商品总数
-
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[5], String.valueOf(goodsAllNum));
-        //6 订单类型
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[6], ConstantExcel.getOrderType(orderEntity.getOrderType()));
-        //7 订单状态
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[7], ConstantExcel.getOrderStatus(orderEntity.getOrderStatus()));
-        List<OrderShippingEntity> shippingList = orderShippingService.queryList(goodsMap);
-        if (!CollectionUtils.isEmpty(shippingList)) {
-            //8 发货状态
-            item.put(ConstantExcel.ORDEREXCELCOLENNAME[8], ConstantExcel.getOrderShippingStatus(shippingList.get(0).getShippingStatus()));
-            //10 快递公司
-            item.put(ConstantExcel.ORDEREXCELCOLENNAME[10], shippingList.get(0).getShippingName());
-            //11 快递单号
-            item.put(ConstantExcel.ORDEREXCELCOLENNAME[11], shippingList.get(0).getShippingNo());
-        }
-        // 9 付款状态
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[9], ConstantExcel.getOrderPayStatus(orderEntity.getPayStatus()));
-        //12 订单原价
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[12], orderEntity.getOrderPrice().toString());
-
-        //13 实际支付金额
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[13], orderEntity.getActualPrice().toString());
-
-        //14 运费
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[14], orderEntity.getFreightPrice().toString());
-        //15 下单时间
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[15], DateUtils.format(orderEntity.getAddTime(), DateUtils.DATE_TIME_PATTERN));
-        //16 收货人
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[16], orderEntity.getConsignee());
-        //17 收货地址
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[17], orderEntity.getProvince() + " " +
-                orderEntity.getCity() + " " + orderEntity.getDistrict() + " " + orderEntity.getAddress());
-        //18 联系电话
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[18], orderEntity.getMobile());
-
-        //10 订单详情
-        item.put(ConstantExcel.ORDEREXCELCOLENNAME[19], orderDetail);
-        return item;
-    }
-
-    private static void output(HttpServletResponse resp, File file) {
-        OutputStream os = null;
-        BufferedInputStream bis = null;
-        byte[] buff = new byte[1024];
-        try {
-            os = resp.getOutputStream();
-            bis = new BufferedInputStream(new FileInputStream(file));
-            int i = 0;
-            while ((i = bis.read(buff)) != -1) {
-                os.write(buff, 0, i);
-                os.flush();
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                bis.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-}

+ 0 - 111
platform-shop/src/main/java/com/platform/controller/OrderGoodsController.java

@@ -1,111 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.OrderGoodsEntity;
-import com.platform.service.OrderGoodsService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- *
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:09
- */
-@RestController
-@RequestMapping("ordergoods")
-public class OrderGoodsController {
-	@Autowired
-	private OrderGoodsService orderGoodsService;
-
-	/**
-	 * 列表
-	 */
-	@RequestMapping("/list")
-	
-	public Result list(@RequestBody 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 Result.success(pageUtil);
-	}
-
-
-	/**
-	 * 信息
-	 */
-	@RequestMapping("/info/{id}")
-	
-	public Result info(@PathVariable("id") Integer id){
-		OrderGoodsEntity orderGoods = orderGoodsService.queryObject(id);
-
-		return Result.success(orderGoods);
-	}
-
-	/**
-	 * 保存
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/save")
-	
-	public Result save(@RequestBody OrderGoodsEntity orderGoods){
-		orderGoodsService.save(orderGoods);
-
-		return Result.success();
-	}
-
-	/**
-	 * 修改
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/update")
-	
-	public Result update(@RequestBody OrderGoodsEntity orderGoods){
-		orderGoodsService.update(orderGoods);
-
-		return Result.success();
-	}
-
-	/**
-	 * 删除
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/delete")
-	
-	public Result delete(@RequestBody Integer[] ids){
-		orderGoodsService.deleteBatch(ids);
-
-		return Result.success();
-	}
-
-	/**
-	 * 查看所有列表
-	 */
-	@RequestMapping("/queryAll")
-	public Result queryAll(@RequestBody Map<String, Object> params) {
-
-		List<OrderGoodsEntity> list = orderGoodsService.queryList(params);
-
-		return Result.success(list);
-	}
-}

+ 0 - 134
platform-shop/src/main/java/com/platform/controller/ProductController.java

@@ -1,134 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.ProductEntity;
-import com.platform.entity.Result;
-import com.platform.service.ProductService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.utils.Constant;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-30 14:31:21
- */
-@RestController
-@RequestMapping("product")
-public class ProductController extends AbstractController{
-    @Autowired
-    private ProductService productService;
-
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-
-        List<Long> roleIdList = getUser().getRoleIdList();
-        if (!roleIdList.contains(1L) && !roleIdList.contains(5L)) {
-            query.put("brandIdList", mySysUserBrandService.queryBrandIdList(getUserId()));
-        }
-
-        List<ProductEntity> productList = productService.queryList(query);
-        int total = productService.queryTotal(query);
-
-        PageUtils pageUtil = new PageUtils(productList, total, query.getLimit(), query.getPage());
-
-        return Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        ProductEntity product = productService.queryObject(id);
-
-        return Result.success( product);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody ProductEntity product) {
-        productService.save(product);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody ProductEntity product) {
-        productService.update(product);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        productService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     *
-     * @param params
-     * @return
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<ProductEntity> list = productService.queryList(params);
-
-        return Result.success( list);
-    }
-
-    /**
-     * 根据goodsId查询商品
-     *
-     * @param goodsId
-     * @return
-     */
-    @RequestMapping("/queryByGoodsId/{goodsId}")
-    public Result queryByGoodsId(@PathVariable("goodsId") String goodsId) {
-        Map<String, Object> params = new HashMap<>();
-        params.put("goodsId", goodsId);
-        List<ProductEntity> list = productService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 149
platform-shop/src/main/java/com/platform/controller/RecommendController.java

@@ -1,149 +0,0 @@
-package com.platform.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.entity.BrandEntity;
-import com.platform.entity.RecommendEntity;
-import com.platform.entity.Result;
-import com.platform.service.BrandService;
-import com.platform.service.RecommendService;
-import com.platform.utils.CommonDataUtils;
-
-import com.platform.vo.RecommendEntityVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * Created by Hb_zzZ on 2018/12/7.
- */
-@Slf4j
-@Controller
-@RequestMapping("/recommend")
-public class RecommendController extends AbstractController{
-
-    @Autowired
-    private RecommendService service;
-
-    @Autowired
-    private BrandService brandService;
-
-    @PostMapping("/save")
-    @ResponseBody
-    public Result save(@RequestBody RecommendEntity bo){
-        Result dto;
-        if(bo == null || StringUtils.isEmpty(bo.getTitle()) || StringUtils.isEmpty(bo.getImage())
-                || bo.getConnectId() == null || bo.getOrderNum() == null){
-            dto = Result.failure("参数不能为空");
-            log.info("参数不能为空");
-            return dto;
-        }
-        bo.setCreateUserId(getUserId());
-        bo.setUpdateUserId(getUserId());
-        int n = service.save(bo);
-        if(n <= 0){
-            dto = Result.failure("新增推荐位失败");
-            log.info("新增推荐位失败");
-            return dto;
-        }
-
-        dto = Result.success("新增推荐位成功",null);
-        return dto;
-    }
-
-    @RequestMapping("/selectById")
-    @ResponseBody
-    public Result selectById(@RequestBody RecommendEntity bo){
-        if(bo == null || bo.getId() == null){
-            log.info("参数不能为空");
-            return Result.failure("参数不能为空");
-        }
-        RecommendEntity entity = service.selectById(bo.getId());
-        RecommendEntityVo vo = new RecommendEntityVo();
-        BeanUtils.copyProperties(entity,vo);
-        BrandEntity sceneEntity = brandService.queryObject(entity.getConnectId().intValue());
-        if(!ObjectUtils.isEmpty(sceneEntity)){
-            vo.setSceneName(sceneEntity.getName());
-            vo.setSceneUrl(sceneEntity.getLiveRoomUrl());
-        }
-        return Result.success( vo);
-    }
-
-    @PostMapping("/selectByType")
-    @ResponseBody
-    public Result selectByType(@RequestBody RecommendEntityVo bo){
-        if(ObjectUtils.isEmpty(bo.getPageNum())){
-            bo.setPageNum(1L);
-        }
-        if(ObjectUtils.isEmpty(bo.getLimit())){
-            bo.setLimit(10L);
-        }
-        //管理后台根据type返回相应数据
-        IPage<RecommendEntity> resultPage = service.selectByType(bo);
-        List<RecommendEntityVo> entityVos = resultPage.getRecords().parallelStream().map(entity -> {
-            RecommendEntityVo vo = new RecommendEntityVo();
-            BeanUtils.copyProperties(entity,vo);
-            BrandEntity sceneEntity = brandService.queryObject(entity.getConnectId().intValue());
-            if(!ObjectUtils.isEmpty(sceneEntity)){
-                vo.setSceneName(sceneEntity.getName());
-                vo.setSceneUrl(sceneEntity.getLiveRoomUrl());
-            }
-            return vo;
-        }).collect(Collectors.toList());
-        return Result.success(CommonDataUtils.assembleResult(resultPage.getTotal() , resultPage.getPages() ,
-                resultPage.getCurrent() , entityVos));
-    }
-
-    @PostMapping("/update")
-    @ResponseBody
-    public Result update(@RequestBody RecommendEntity bo){
-        Result dto;
-        if(bo == null || bo.getId() == null  || StringUtils.isEmpty(bo.getTitle())
-                || StringUtils.isEmpty(bo.getImage()) || bo.getConnectId() == null
-                || bo.getOrderNum() == null){
-            dto = Result.failure("参数不能为空");
-            log.info("参数不能为空");
-            return dto;
-        }
-        bo.setUpdateUserId(getUserId());
-        int n = service.update(bo);
-        if(n <= 0){
-            dto = Result.failure("修改推荐位失败");
-            log.info("修改推荐位失败");
-            return dto;
-        }
-
-        dto = Result.success("修改推荐位成功",null);
-        return dto;
-    }
-
-    @PostMapping("/delete")
-    @ResponseBody
-    public Result delete(@RequestBody RecommendEntity bo){
-        Result dto;
-        if(bo == null || bo.getId() == null){
-            dto = Result.failure("参数不能为空");
-            log.info("参数不能为空");
-            return dto;
-        }
-        bo.setUpdateUserId(getUserId());
-        int n = service.delete(bo.getId());
-        if(n <= 0){
-            dto = Result.failure("删除推荐位失败");
-            log.info("删除推荐位失败");
-            return dto;
-        }
-
-        dto = Result.success("删除推荐位成功",null);
-        return dto;
-    }
-}

+ 0 - 101
platform-shop/src/main/java/com/platform/controller/RelatedGoodsController.java

@@ -1,101 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.RelatedGoodsEntity;
-import com.platform.service.RelatedGoodsService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * 
- * 
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:09
- */
-@RestController
-@RequestMapping("relatedgoods")
-public class RelatedGoodsController {
-	@Autowired
-	private RelatedGoodsService relatedGoodsService;
-	
-	/**
-	 * 列表
-	 */
-	@RequestMapping("/list")
-	
-	public Result list(@RequestBody 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 Result.success(pageUtil);
-	}
-	
-	
-	/**
-	 * 信息
-	 */
-	@RequestMapping("/info/{id}")
-	
-	public Result info(@PathVariable("id") Integer id){
-		RelatedGoodsEntity relatedGoods = relatedGoodsService.queryObject(id);
-		
-		return Result.success(relatedGoods);
-	}
-	
-	/**
-	 * 保存
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/save")
-	
-	public Result save(@RequestBody RelatedGoodsEntity relatedGoods){
-		relatedGoodsService.save(relatedGoods);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 修改
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/update")
-	
-	public Result update(@RequestBody RelatedGoodsEntity relatedGoods){
-		relatedGoodsService.update(relatedGoods);
-		
-		return Result.success();
-	}
-	
-	/**
-	 * 删除
-	 */
-	@CanUserUpdateRecord
-	@RequestMapping("/delete")
-	
-	public Result delete(@RequestBody Integer[] ids){
-		relatedGoodsService.deleteBatch(ids);
-		
-		return Result.success();
-	}
-	
-}

+ 0 - 67
platform-shop/src/main/java/com/platform/controller/SceneController.java

@@ -1,67 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.platform.entity.BrandEntity;
-import com.platform.entity.Result;
-import com.platform.entity.SceneEntity;
-import com.platform.service.BrandService;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.vos.RequestScene;
-import io.swagger.annotations.Api;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 17:59:15
- */
-@Api(tags = "管理后台店铺操作相关接口")
-@RestController
-@RequestMapping("scene")
-@Slf4j
-public class SceneController extends AbstractController{
-
-    @Autowired
-    private BrandService brandService;
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    /**
-     * 删除
-     */
-    @PostMapping("/generateDefaultLiveRoom")
-    public Result generateDefaultLiveRoom(@RequestBody RequestScene requestScene,@RequestHeader String token) {
-        try {
-            String sceneNum = requestScene.getSceneNum();
-            if (ObjectUtils.isEmpty(sceneNum)) {
-                return Result.failure("参数有误!");
-            }
-
-            BrandEntity brand = brandService.queryByScene(sceneNum);
-            if (!ObjectUtils.isEmpty(brand)) {
-                zhiHouseService.generateDefaultLiveRoom(sceneNum,true);
-                return Result.failure("直播间已存在!");
-            }
-
-            Object result = zhiHouseService.generateDefaultLiveRoom(sceneNum,true);
-
-            SceneEntity sceneEntity = JSONObject.parseObject(JSONObject.toJSONString(result),SceneEntity.class);
-            sceneEntity.setToken(token);
-            BrandEntity brandEntity = brandService.generateDefaultLiveRoom(sceneEntity);
-            if(ObjectUtils.isEmpty(brandEntity)){
-                return Result.failure("场景获取失败!");
-            }
-            brandService.bindUser(getUserId(),brandEntity.getId().intValue(),0);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return Result.failure(ObjectUtils.isEmpty(e.getMessage()) ? "生成直播间失败!" : e.getMessage());
-        }
-        return Result.success("生成直播间成功,请前往直播间查看。",null);
-    }
-}

+ 0 - 100
platform-shop/src/main/java/com/platform/controller/SearchHistoryController.java

@@ -1,100 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.SearchHistoryEntity;
-import com.platform.service.SearchHistoryService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-
-/**
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:10
- */
-@RestController
-@RequestMapping("searchhistory")
-public class SearchHistoryController {
-    @Autowired
-    private SearchHistoryService searchHistoryService;
-
-    /**
-     * 列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        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 Result.success( pageUtil);
-    }
-
-
-    /**
-     * 信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        SearchHistoryEntity searchHistory = searchHistoryService.queryObject(id);
-
-        return Result.success(searchHistory);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody SearchHistoryEntity searchHistory) {
-
-        searchHistoryService.save(searchHistory);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody SearchHistoryEntity searchHistory) {
-        searchHistoryService.update(searchHistory);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        searchHistoryService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/ShippingController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.ShippingEntity;
-import com.platform.service.ShippingService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-09-04 21:42:24
- */
-@RestController
-@RequestMapping("shipping")
-public class ShippingController {
-    @Autowired
-    private ShippingService shippingService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        ShippingEntity shipping = shippingService.queryObject(id);
-
-        return Result.success(shipping);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody ShippingEntity shipping) {
-        shippingService.save(shipping);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody ShippingEntity shipping) {
-        shippingService.update(shipping);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        shippingService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<ShippingEntity> list = shippingService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 118
platform-shop/src/main/java/com/platform/controller/SpecificationController.java

@@ -1,118 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.GoodsSpecificationEntity;
-import com.platform.entity.Result;
-import com.platform.entity.SpecificationEntity;
-import com.platform.service.GoodsSpecificationService;
-import com.platform.service.SpecificationService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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;
-
-
-/**
- * 规格表
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-13 10:41:10
- */
-@RestController
-@RequestMapping("/specification")
-public class SpecificationController {
-    @Autowired
-    private SpecificationService specificationService;
-
-    @Autowired
-    private GoodsSpecificationService goodsSpecificationService;
-
-    /**
-     * 列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success( pageUtil);
-    }
-
-
-    /**
-     * 信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        SpecificationEntity specification = specificationService.queryObject(id);
-
-        return Result.success( specification);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody SpecificationEntity specification) {
-        specificationService.save(specification);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody SpecificationEntity specification) {
-        specificationService.update(specification);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        Map<String, Object> map = new HashMap<>();
-        for(Integer id : ids){
-            map.put("specificationId", id);
-            List<GoodsSpecificationEntity> list = goodsSpecificationService.queryList(map);
-            if(list != null && list.size() > 0){
-                return Result.failure("该属性已绑定商品!");
-            }
-        }
-        specificationService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<SpecificationEntity> list = specificationService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 77
platform-shop/src/main/java/com/platform/controller/SysUserController.java

@@ -1,77 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.platform.MysqlTest;
-import com.platform.entity.BrandEntity;
-import com.platform.entity.Result;
-import com.platform.entity.SysUserBrand;
-import com.platform.service.BrandService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.RRException;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 系统用户
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年10月31日 上午10:40:10
- */
-@RestController
-@RequestMapping("/sys/user")
-@Slf4j
-public class SysUserController extends AbstractController {
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-    @Autowired
-    private BrandService brandService;
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    /**
-     * 店铺绑定的用户列表
-     */
-    @PostMapping("/bindList")
-    public Result userBindList( @RequestHeader String token ,@RequestBody JSONObject param) {
-        // 查询用户信息
-        if(param.get("brandId") == null){
-            throw new RRException("缺少必要参数");
-        }
-        BrandEntity brandEntity = brandService.queryObject(param.getInteger("brandId"));
-        if(brandEntity == null){
-            throw new RRException("直播间为空");
-        }
-        if(brandEntity.getCreateUserDeptId() == null){
-            throw new RRException("直播归属公司为空");
-        }
-        JSONObject result = zhiHouseService.getSysUserListPageByDeptIdsAndUserName(brandEntity.getCreateUserDeptId(),
-                param.getLong("page"),param.getLong("limit"), param.getString("username"),token);
-        List<Object> users = result.getJSONArray("list");
-        if(!ObjectUtils.isEmpty(users)){
-            users = users.stream().map(object -> {
-                JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(object));
-                // 查找直播间数据
-                SysUserBrand userBrand = mySysUserBrandService.getUserBrandById(user.getLong("id"), param.getInteger("brandId"));
-                if (!ObjectUtils.isEmpty(userBrand)){
-                    user.put("isBind", 1);
-                    user.put("canShow", userBrand.getCanShow());
-                }
-                return user;
-            }).collect(Collectors.toList());
-        }
-        // 处理场景数据
-        PageUtilsPlus pageResult = PageUtilsPlus.page(users, result.getLong("totalCount"), param.getLong("limit"), param.getLong("page"));
-        return Result.success(pageResult);
-    }
-}

+ 0 - 224
platform-shop/src/main/java/com/platform/controller/TmLiveRoomController.java

@@ -1,224 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.TmLiveRoomInfo;
-import com.platform.entity.WxLiveRoomRequestVo;
-import com.platform.enums.LiveRoomStatusEnum;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.service.custom.LiveRoomInfoService;
-import com.platform.utils.*;
-import io.swagger.annotations.*;
-import lombok.extern.slf4j.Slf4j;
-import net.coobird.thumbnailator.Thumbnails;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * @author abnerhou
- * @date 2020/9/14 9:44
- * @desciption
- */
-@Api(tags = "管理后台直播间相关接口")
-@RestController
-@RequestMapping("/liveRoom")
-@Slf4j
-public class TmLiveRoomController extends AbstractController{
-
-    @Value("${file-backup-path}")
-    private String imageLocalBackupPath;
-
-
-
-    @Autowired
-    LiveRoomInfoService liveRoomInfoService;
-
-    @Autowired
-    OssCheckPointUploadUtil ossCheckPointUploadUtil;
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "新增直播间")
-    @PostMapping(value = "/add")
-    
-    @ResponseBody
-    public Object addNewLiveRoom(@ApiParam(name = "TmLiveRoomInfo对象", value = "传入json格式", required = true) @RequestBody TmLiveRoomInfo tmLiveRoomInfo) {
-
-        if(null == tmLiveRoomInfo){
-            return Result.failure("入参缺失");
-        }
-
-        if(null == tmLiveRoomInfo.getCreateUserId() || null == tmLiveRoomInfo.getCreateUserDeptId()){
-            return Result.failure("缺失创建者信息");
-        }
-
-        if(!StringUtils.isNoneBlank(tmLiveRoomInfo.getName() , tmLiveRoomInfo.getAnchorName())){
-            return Result.failure("直播间名称或者主播名称不能为空");
-        }
-        if(null == tmLiveRoomInfo.getStartTime() || null == tmLiveRoomInfo.getEndTime()){
-            return Result.failure("直播起始时间不能为空");
-        }
-
-        log.info("开始时间:{}" , tmLiveRoomInfo.getStartTime());
-        log.info("结束时间:{}" , tmLiveRoomInfo.getEndTime());
-        WxLiveRoomRequestVo wxLiveRoomRequestVo = new WxLiveRoomRequestVo();
-        BeanUtils.copyProperties(tmLiveRoomInfo , wxLiveRoomRequestVo);
-        log.info("上送给微信创建直播间的数据为:{}" , JSON.toJSONString(wxLiveRoomRequestVo));
-        JSONObject wxLiveRoomRspVo = WxOpUtils.creatLiveRoom(wxLiveRoomRequestVo ,  ResourceUtil.getConfigByName("wx.appId") ,
-                ResourceUtil.getConfigByName("wx.secret"));
-        if(null == wxLiveRoomRspVo){
-            log.error("解析微信返回值失败,调用微信创建直播间失败");
-            return Result.failure("解析微信返回值失败");
-        }
-        log.info("微信返回报文为:{}" , wxLiveRoomRspVo.toJSONString());
-        Integer errcode = wxLiveRoomRspVo.getInteger("errcode");
-        if(null == errcode || 0 != errcode){
-            log.error("调用微信创建直播间失败");
-            return wxLiveRoomRspVo.toJSONString();
-        }
-        log.info("调用调用微信创建直播间成功");
-        Integer roomId = wxLiveRoomRspVo.getInteger("roomId");
-        tmLiveRoomInfo.setRoomId(roomId.longValue());
-        tmLiveRoomInfo.setLiveStatus(LiveRoomStatusEnum.NOT_START.getStatus());
-        int insert = liveRoomInfoService.addNew(tmLiveRoomInfo);
-        if(insert != 1){
-            log.error("新增微信直播间记录失败");
-        }
-        return wxLiveRoomRspVo;
-     }
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "上传照片")
-    @PostMapping(value = "/uploadImage")
-    @ResponseBody
-    public Object uploadImage(@RequestParam("file") CommonsMultipartFile file){
-        if (null == file) {
-            throw new CommonBaseException(ResultCodeEnum.D3001);
-        }
-        String fileName = file.getOriginalFilename();
-        String prefix = fileName.substring(fileName.lastIndexOf(".") + 1);
-        //保存本地照片
-        String newFileName = getRandomName(prefix);
-        String imageLocalPath = ResourceUtil.getConfigByName("file-backup-path") + newFileName;
-        log.info("照片本地缓存路径:{}" , imageLocalPath);
-        File newFile = new File(imageLocalPath);
-        long size = file.getSize();
-        if(size > 500000L){
-            //在这里将图片压缩
-            try {
-                Thumbnails.of(file.getInputStream()).scale(1f).outputQuality(0.2f).toFile(imageLocalPath);
-            } catch (IOException e) {
-                e.printStackTrace();
-                return Result.failure("压缩照片失败");
-            }
-            newFile = new File(imageLocalPath);
-            if(null == newFile){
-                log.error("压缩照片[{}]失败" , file.getOriginalFilename());
-                return "";
-            }
-
-        }else{
-            log.info("照片大小小于500kb,不压缩");
-            try {
-                file.transferTo(newFile);
-            } catch (IOException e) {
-                log.info("本地缓存照片出现异常:{}" , e);
-                return Result.failure("本地缓存照片出现异常");
-            }
-        }
-        String mediaId = WxOpUtils.uploadMedia("image" , newFile ,  ResourceUtil.getConfigByName("wx.appId"),
-                ResourceUtil.getConfigByName("wx.secret"));
-        log.info("微信返回:{}" , mediaId);
-
-
-        String ossPath =  ResourceUtil.getConfigByName("oss.image.file.path") + newFileName;
-        log.info("生成的照片上传oss的路径:{}" , ossPath);
-        ossCheckPointUploadUtil.upload2(imageLocalPath, ossPath);
-        String imageTotalOssUrl = ResourceUtil.getConfigByName("oss.query.url") + ossPath;
-        Map<String ,Object> mp = new HashMap<>();
-        mp.put("mediaId" , mediaId);
-        mp.put("ossUrl" , imageTotalOssUrl);
-        return Result.success(mp);
-    }
-
-    /**
-     * 文件路径
-     *
-     * @param prefix 前缀
-     * @return 返回上传路径
-     */
-    public String getRandomName(String prefix) {
-        //生成uuid
-        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
-        //文件路径
-        return DateUtils.format(new Date(), "yyyyMMddHHmmssS") + uuid.substring(0, 5) + "." + prefix;
-
-    }
-
-    @ApiOperation(value = "获取直播间列表")
-    @GetMapping(value = "/getRoomList")
-    
-    @ResponseBody
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "limit", value = "每页大小", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "name", value = "搜索关键字名称", paramType = "query", required = true, dataType = "String")
-    })
-    public Object getLiveRoomList(String name , @RequestParam(name = "page") long page ,
-                                  @RequestParam(name = "limit") long limit){
-
-        IPage<TmLiveRoomInfo> resultPage = new Page<>();
-        if(null == getUserId() || null == getDeptId()){
-            return Result.failure("缺失用户信息");
-        }
-        resultPage  = liveRoomInfoService.getOrQuery(name, page , limit , getUserId() , getCompanyId(),getUser());
-        if(resultPage != null){
-           return CommonDataUtils.toResponsObject(0,"" , CommonDataUtils.assembleResultCustom(resultPage.getTotal() , resultPage.getPages() ,
-                    resultPage.getCurrent() ,limit , resultPage.getRecords()));
-        }
-
-        return Result.success();
-    }
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "更新直播间数据-主要是删除,enable=0即为删除")
-    @PostMapping(value = "/update")
-    
-    @ResponseBody
-    public Object updateRoomInfo(@ApiParam(name = "TmLiveRoomInfo对象", value = "传入json格式", required = true)
-                                     @RequestBody TmLiveRoomInfo tmLiveRoomInfo){
-
-        if(null == tmLiveRoomInfo){
-            return Result.failure("入参缺失");
-        }
-        if(null == tmLiveRoomInfo.getUpdateUserId()){
-            return Result.failure("更新者信息缺失");
-        }
-        if(StringUtils.isBlank(tmLiveRoomInfo.getLiveId())){
-            return Result.failure("liveId缺失");
-        }
-        int update = liveRoomInfoService.updateLiveRoom(tmLiveRoomInfo);
-        if(update != 1){
-            log.error("直播间liveId=[{}]更新失败" , tmLiveRoomInfo.getLiveId());
-            return Result.failure("更新失败");
-        }
-        return Result.success();
-    }
-    
-}

+ 0 - 108
platform-shop/src/main/java/com/platform/controller/TmSlideShowController.java

@@ -1,108 +0,0 @@
-package com.platform.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.TmSlideShow;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.service.custom.TmSlideShowService;
-import com.platform.utils.CommonDataUtils;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @author abnerhou
- * @date 2020/9/10 16:30
- * @desciption
- */
-@Api(tags = "轮播图管理后台相关接口")
-@RestController
-@RequestMapping("/slideShow")
-@Slf4j
-public class TmSlideShowController {
-
-    @Autowired
-    private TmSlideShowService tmSlideShowService;
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "录入新的轮播图")
-    @PostMapping(value = "/add")
-    @ResponseBody
-    public Result addNewSlideShow(@ApiParam(name = "TmSlideShow对象", value = "传入json格式", required = true) @RequestBody TmSlideShow tmSlideShow){
-
-        if(null == tmSlideShow || !StringUtils.isNoneBlank(tmSlideShow.getTitle() , tmSlideShow.getCoverImage())){
-            throw new CommonBaseException(ResultCodeEnum.D3004, "标题或者封面照片不能为空");
-        }
-        TmSlideShow dbSlideShow = tmSlideShowService.getSlideShowByTitle(tmSlideShow.getTitle());
-        if(null != dbSlideShow){
-            log.info("轮播图[{}]已经存在,无需重复添加" , tmSlideShow.getTitle());
-            throw new CommonBaseException(ResultCodeEnum.D101, "轮播图已经存在,无需新增");
-        }
-        int insert = tmSlideShowService.insertSlideShow(tmSlideShow);
-        if(insert != 1){
-            log.error("新增轮播图[{}]失败" , tmSlideShow.getTitle());
-            throw new CommonBaseException(ResultCodeEnum.D101, "新增轮播图失败");
-        }
-        return Result.success();
-    }
-    @ApiOperation(value = "获取轮播图列表,支持查询标题")
-    @GetMapping(value = "/getAndQuery")
-    @ResponseBody
-    public Object getAndQuerySlideShow(String name,
-                                       @RequestParam(name = "page") long page,
-                                       @RequestParam(name = "limit") long limit){
-
-        IPage<TmSlideShow> resultPage = tmSlideShowService.getSlideShowByPage(name , page , limit);
-        if(null == resultPage){
-            log.error("查询轮播图失败");
-            throw new CommonBaseException(ResultCodeEnum.D101 , "查询轮播图失败");
-        }
-
-        return    CommonDataUtils.toResponsObject(0,"" , CommonDataUtils.assembleResultCustom(resultPage.getTotal() , resultPage.getPages() ,
-                resultPage.getCurrent() ,limit , resultPage.getRecords()));
-    }
-
-
-    @ApiOperation(value = "根据ID获取轮播图")
-    @GetMapping(value = "/getById")
-    @ResponseBody
-    public Object getSlideShowById(@RequestParam(name = "slideId") String slideId){
-        if(StringUtils.isBlank(slideId)){
-            log.error("轮播图ID不能为空");
-            throw new CommonBaseException(ResultCodeEnum.D3001 , "轮播图ID不能为空");
-        }
-        TmSlideShow tmSlideShow = tmSlideShowService.getSlideShowById(slideId);
-        return CommonDataUtils.toResponsObject(0 , "" , tmSlideShow);
-    }
-
-    @CanUserUpdateRecord
-    @ApiOperation(value = "更新轮播图")
-    @PostMapping(value = "/update")
-    @ResponseBody
-    public Object updateSlideShow( @ApiParam(name = "TmSlideShow对象", value = "传入json格式", required = true) @RequestBody TmSlideShow tmSlideShow) {
-
-        if(null == tmSlideShow || StringUtils.isBlank(tmSlideShow.getSlideId())){
-            log.error("轮播图id不能为空");
-            throw new CommonBaseException(ResultCodeEnum.D3004 , "轮播图id不能为空");
-        }
-        TmSlideShow dbSlideShow = tmSlideShowService.getSlideShowById(tmSlideShow.getSlideId());
-        if(null == dbSlideShow){
-            log.error("轮播图[{}]不存在" , tmSlideShow.getSlideId());
-            throw new CommonBaseException(ResultCodeEnum.D101 , "轮播图不存在");
-        }
-        int update = tmSlideShowService.updateSlideShow(tmSlideShow);
-        if(update != 1){
-            log.info("跟新轮播图[{}]失败" , tmSlideShow.getSlideId());
-            throw new CommonBaseException(ResultCodeEnum.D101 , "轮播图更新失败");
-        }
-        return Result.success();
-    }
-
-}

+ 0 - 67
platform-shop/src/main/java/com/platform/controller/TokenController.java

@@ -1,67 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.platform.entity.Result;
-import com.platform.enums.ResultCodeEnum;
-import com.platform.exception.CommonBaseException;
-import com.platform.service.impl.FdkkService;
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.utils.Base64Converter;
-import com.platform.vos.CurrentUserLoginVo;
-import com.platform.vos.ReturnDTO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Map;
-
-@RestController
-@RequestMapping("token")
-public class TokenController extends AbstractController{
-
-    protected Logger log = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private FdkkService fdkkService;
-
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-
-    @PostMapping("/renewToken")
-    @ResponseBody
-    public Result renewToken(@RequestBody Map<String,String> param) {
-        String sceneNum = param.get("sceneNum");
-        String sceneUrl = param.get("sceneUrl");
-        String userName = param.get("userName");
-        if(ObjectUtils.isEmpty(userName) || ObjectUtils.isEmpty(sceneNum) || ObjectUtils.isEmpty(sceneUrl)){
-            throw new CommonBaseException(ResultCodeEnum.D101,"参数有误!");
-        }
-        // 判断场景为四维看看或者指房宝
-        if(sceneUrl.contains("www.4dkankan.com") || sceneUrl.contains("test.4dkankan.com")){
-            CurrentUserLoginVo user = getUser();
-            if(ObjectUtils.isEmpty(user.getFdkkUser())){
-                throw new CommonBaseException(500, "请绑定四维看看账号!");
-            }
-            String password = Base64Converter.decode(Base64Converter.subText(user.getFdkkPassword()));
-            ResponseEntity<String> responseEntity = fdkkService.login(user.getFdkkUser(), password);
-            if(responseEntity.getStatusCode()!= HttpStatus.OK){
-                throw new CommonBaseException(500,"请求失败");
-            }
-            JSONObject result = JSONObject.parseObject(responseEntity.getBody());
-            if (result.getInteger("code") != 0) {
-                throw new CommonBaseException(ResultCodeEnum.D101, "四维看看账号密码有误,请重新绑定");
-            }
-            return Result.success("操作成功",result.getJSONObject("data").getString("token"));
-        }
-
-        // 生成token
-        ReturnDTO result = zhiHouseService.generateSceneEditToken(param.get("token"),userName,sceneNum);
-        return Result.success(result.getMessage());
-    }
-}

+ 0 - 104
platform-shop/src/main/java/com/platform/controller/TopicCategoryController.java

@@ -1,104 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.TopicCategoryEntity;
-import com.platform.service.TopicCategoryService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-20 15:41:56
- */
-@RestController
-@RequestMapping("topiccategory")
-public class TopicCategoryController {
-    @Autowired
-    private TopicCategoryService topicCategoryService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        TopicCategoryEntity topicCategory = topicCategoryService.queryObject(id);
-
-        return Result.success(topicCategory);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody TopicCategoryEntity topicCategory) {
-        topicCategoryService.save(topicCategory);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody TopicCategoryEntity topicCategory) {
-        topicCategoryService.update(topicCategory);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        topicCategoryService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<TopicCategoryEntity> list = topicCategoryService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 109
platform-shop/src/main/java/com/platform/controller/TopicController.java

@@ -1,109 +0,0 @@
-package com.platform.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.platform.entity.TopicEntity;
-import com.platform.service.TopicService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-20 14:10:08
- */
-@RestController
-@RequestMapping("topic")
-public class TopicController {
-    @Autowired
-    private TopicService topicService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        TopicEntity topic = topicService.queryObject(id);
-
-        return Result.success(topic);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody TopicEntity topic) {
-        topicService.save(topic);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody TopicEntity topic) {
-        topicService.update(topic);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        topicService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<TopicEntity> list = topicService.queryList(params);
-
-        return Result.success( list);
-    }
-}

+ 0 - 178
platform-shop/src/main/java/com/platform/controller/UserController.java

@@ -1,178 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.UserEntity;
-import com.platform.service.UserService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-import com.platform.utils.excel.ExcelExport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.CollectionUtils;
-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;
-import java.util.stream.Collectors;
-
-/**
- * Controller
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-16 15:02:28
- */
-@Api(tags = "管理后台用户信息接口")
-@RestController
-@RequestMapping("user")
-@Slf4j
-public class UserController {
-    @Autowired
-    private UserService userService;
-
-    /**
-     * 查看列表
-     */
-    @ApiOperation(value = "获取用户列表,支持通过微信昵称或者用户名称查询,支持分页")
-    @RequestMapping("/list")
-    
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "username", value = "用户名称", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "nickname", value = "用户微信昵称", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "limit", value = "每页大小", paramType = "query", required = true, dataType = "Long"),
-    })
-    public Result list(@RequestBody Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-
-        List<UserEntity> userList = userService.queryList(query);
-        int total = userService.queryTotal(query);
-
-        if(!CollectionUtils.isEmpty(userList)){
-            for(UserEntity user : userList){
-                if(null != user && null != user.getId()){
-                    List<String> brandNames = userService.getBindBrands(user.getId());
-                    if(CollectionUtils.isEmpty(brandNames)){
-                        continue;
-                    }
-                    user.setBindBrandName(brandNames.stream().filter(name -> name != null).collect(Collectors.joining(",")));
-                }
-            }
-        }
-
-        PageUtils pageUtil = new PageUtils(userList, total, query.getLimit(), query.getPage());
-
-        return Result.success( pageUtil);
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        UserEntity user = userService.queryObject(id);
-
-        return Result.success(user);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody UserEntity user) {
-        userService.save(user);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody UserEntity user) {
-        userService.update(user);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        userService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<UserEntity> userList = userService.queryList(params);
-
-        return Result.success( userList);
-    }
-
-    /**
-     * 总计
-     */
-    @RequestMapping("/queryTotal")
-    public Result queryTotal(@RequestBody Map<String, Object> params) {
-        int sum = userService.queryTotal(params);
-
-        return Result.success(sum);
-    }
-
-    /**
-     * 导出会员
-     */
-    @RequestMapping("/export")
-//    
-    public Result export(@RequestBody 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("GENDER", userEntity.getGender() == 1 ? "男" : (userEntity.getGender() == 2 ? "女" : "未知"));
-                map.put("LEVEL_NAME", userEntity.getLevelName());
-                map.put("USERNAME", userEntity.getUsername());
-                map.put("MOBILE", userEntity.getMobile());
-                list.add(map);
-            }
-        }
-
-        ee.addSheetByMap("会员", list, header);
-        ee.export(response);
-        return Result.success();
-    }
-}

+ 0 - 123
platform-shop/src/main/java/com/platform/controller/UserCouponController.java

@@ -1,123 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.UserCouponEntity;
-import com.platform.service.UserCouponService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-19 15:40:33
- */
-@RestController
-@RequestMapping("usercoupon")
-public class UserCouponController {
-    @Autowired
-    private UserCouponService userCouponService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success(pageUtil);
-    }
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        UserCouponEntity userCoupon = userCouponService.queryObject(id);
-
-        return Result.success(userCoupon);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody UserCouponEntity userCoupon) {
-        userCouponService.save(userCoupon);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody UserCouponEntity userCoupon) {
-        userCouponService.update(userCoupon);
-
-        return Result.success();
-    }
-
-
-    /**
-     * 作废用户优惠券
-     */
-    @CanUserUpdateRecord
-    @GetMapping("/cancelUserCoupon")
-    
-    public Result cancelUserCoupon(@RequestParam(name = "couponId") Integer couponId ,
-                              @RequestParam(name = "userId") Long userId) {
-        if(null == couponId || null == userId){
-            return Result.failure("优惠券ID或者用户Id不能为空");
-        }
-        int update = userCouponService.cancelUserCoupon(couponId , userId);
-        if(update != 1){
-            Result.failure("作废失败");
-        }
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        userCouponService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查看所有列表
-     */
-    @RequestMapping("/queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-
-        List<UserCouponEntity> list = userCouponService.queryList(params);
-
-        return Result.success(list);
-    }
-}

+ 0 - 105
platform-shop/src/main/java/com/platform/controller/UserLevelController.java

@@ -1,105 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.CanUserUpdateRecord;
-import com.platform.entity.Result;
-import com.platform.entity.UserLevelEntity;
-import com.platform.service.UserLevelService;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-
-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 lipengjun
- * @email 939961241@qq.com
- * @date 2017-08-16 16:52:22
- */
-@RestController
-@RequestMapping("userlevel")
-public class UserLevelController {
-    @Autowired
-    private UserLevelService userLevelService;
-
-    /**
-     * 查看列表
-     */
-    @RequestMapping("/list")
-    
-    public Result list(@RequestBody 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 Result.success( pageUtil);
-    }
-
-
-    /**
-     * 查看信息
-     */
-    @RequestMapping("/info/{id}")
-    
-    public Result info(@PathVariable("id") Integer id) {
-        UserLevelEntity userLevel = userLevelService.queryObject(id);
-
-        return Result.success(userLevel);
-    }
-
-    /**
-     * 保存
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/save")
-    
-    public Result save(@RequestBody UserLevelEntity userLevel) {
-        userLevelService.save(userLevel);
-
-        return Result.success();
-    }
-
-    /**
-     * 修改
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/update")
-    
-    public Result update(@RequestBody UserLevelEntity userLevel) {
-        userLevelService.update(userLevel);
-
-        return Result.success();
-    }
-
-    /**
-     * 删除
-     */
-    @CanUserUpdateRecord
-    @RequestMapping("/delete")
-    
-    public Result delete(@RequestBody Integer[] ids) {
-        userLevelService.deleteBatch(ids);
-
-        return Result.success();
-    }
-
-    /**
-     * 查询所有数据
-     *
-     * @return
-     */
-    @RequestMapping("queryAll")
-    public Result queryAll(@RequestBody Map<String, Object> params) {
-        List<UserLevelEntity> userLevelList = userLevelService.queryList(params);
-        return Result.success(userLevelList);
-    }
-}

+ 0 - 108
platform-shop/src/main/java/com/platform/controller/ZfbController.java

@@ -1,108 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.platform.entity.BrandEntity;
-import com.platform.entity.Result;
-import com.platform.entity.SysUserBrand;
-import com.platform.service.BrandService;
-import com.platform.service.custom.MySysUserBrandService;
-import com.platform.service.impl.ZhiHouseService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-@RestController
-@RequestMapping("/zfb")
-public class ZfbController {
-
-    @Autowired
-    private MySysUserBrandService mySysUserBrandService;
-
-    @Autowired
-    private BrandService brandService;
-
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    @PostMapping("/deleteStaff")
-    public Result deleteStaff(@RequestBody JSONObject param) {
-        Long userId = param.getLong("userId");
-        Long toUserId = param.getLong("toUserId");
-        String toUserPone = param.getString("toUserPone");
-        // 获取直播间绑定信息
-        List<Long> bindUsers = mySysUserBrandService.queryBrandIdList(userId);
-        if (!ObjectUtils.isEmpty(bindUsers)) {
-            Set<Long> newBinds = new HashSet<>();
-            List<Long> bindIds = mySysUserBrandService.queryBrandIdList(toUserId);
-            if(!ObjectUtils.isEmpty(bindIds) ){
-                for (Long bindUser : bindUsers) {
-                    if( bindIds.contains(bindUser)){
-                        newBinds.add(bindUser);
-                    }
-                }
-            }
-            mySysUserBrandService.reBindUser(userId,toUserId,toUserPone,newBinds);
-        }
-        return Result.success();
-    }
-    @PostMapping("/getCanShow")
-    public Result getCanShow(@RequestBody JSONObject param) {
-        Object userIds = param.get("userIds");
-        List<Integer> jsonArray = (List<Integer>) userIds;
-        Integer brandId = (Integer) param.get("brandId");
-        HashMap<Long,Integer> resultMap = new HashMap<>();
-        for (Integer userId : jsonArray) {
-            SysUserBrand userBrand = mySysUserBrandService.getUserBrandById(Long.valueOf(userId), brandId);
-            if(userBrand!=null){
-                resultMap.put(userBrand.getUserId(),userBrand.getCanShow());
-            }
-        }
-        return Result.success(resultMap);
-    }
-    @PostMapping("/queryBrandBySceneNums")
-    public Result queryBrandBySceneNums(@RequestBody JSONObject param) {
-        Object nums = param.get("nums");
-        List<String> jsonArray = (List<String>) nums;
-
-        HashMap<String,Integer> resultMap = new HashMap<>();
-        for (String sceneNum : jsonArray) {
-            BrandEntity brand = brandService.queryByScene(sceneNum);
-            Integer lived = 0;
-            if(brand != null){
-                lived = 1;
-            }
-            resultMap.put(sceneNum,lived);
-        }
-        return Result.success(resultMap);
-    }
-
-    @PostMapping("/queryBrandByUserId")
-    public Result queryBrandByUserId(@RequestBody JSONObject param) {
-        Long  userId = param.getLong("userId");
-        if(userId == null){
-            return Result.failure("用户id为空");
-        }
-        List<Long> longs = mySysUserBrandService.queryBrandIdList(userId);
-        return  Result.success(longs.size());
-    }
-
-    @PostMapping("/deleteBrandUser")
-    public Result deleteBrandUser(@RequestBody JSONObject param) {
-        Long  userId = param.getLong("userId");
-        if(userId == null){
-            return Result.failure("用户id为空");
-        }
-        mySysUserBrandService.deleteByUserId(userId);
-        return  Result.success();
-    }
-
-
-
-}

+ 0 - 4
platform-shop/src/main/java/com/platform/service/BrandService.java

@@ -98,10 +98,6 @@ public interface BrandService {
 
     String generalWxShareQrCode(BrandEntity brand , boolean needUpdate);
 
-    Result sendDataToApi(BrandEntity brandEntity);
-
-    BrandEntity generateDefaultLiveRoom(SceneEntity requestScene);
-
     void bindUsers(Integer brandId,List<BrandBindUserVo> brandBindUserVoList);
 
     void bindUser(Long userId,Integer brandId,Integer canShow);

+ 8 - 143
platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java

@@ -1,13 +1,13 @@
 package com.platform.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.platform.dao.BrandDao;
-import com.platform.entity.*;
+import com.platform.entity.BrandEntity;
+import com.platform.entity.Result;
+import com.platform.entity.SceneEntity;
+import com.platform.entity.SysUserBrand;
 import com.platform.service.BrandService;
 import com.platform.service.custom.MySysUserBrandService;
 import com.platform.service.custom.TmBrandTypeService;
@@ -19,16 +19,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.client.RestTemplate;
 
 import java.io.File;
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -46,9 +47,6 @@ public class BrandServiceImpl implements BrandService {
     private BrandDao brandDao;
 
     @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    @Autowired
     private ControllerUtils controllerUtils;
 
     @Autowired
@@ -234,139 +232,6 @@ public class BrandServiceImpl implements BrandService {
         }
         return imageTotalOssUrl;
     }
-
-    public Result sendDataToApi(BrandEntity brandEntity){
-        if(null == brandEntity){
-            return Result.failure("商家信息为空,无法请求api平台");
-        }
-        Map<String, Object> reqData = new HashMap<>();
-        reqData.put("brandId" , brandEntity.getId());
-        reqData.put("brandName" , brandEntity.getName());
-        reqData.put("simpleDesc" , brandEntity.getSimpleDesc());
-        reqData.put("sortOrder" , brandEntity.getSortOrder());
-        reqData.put("isShow" , brandEntity.getLivestreamStatus());
-        reqData.put("type" , brandEntity.getType());
-        if(null != brandEntity.getType()){
-            TmBrandType tmBrandType = tmBrandTypeService.getByBrandType(brandEntity.getType());
-            if(null != tmBrandType){
-                reqData.put("typeName" , tmBrandType.getName());
-            }
-        }
-        reqData.put("sceneNum" , brandEntity.getSceneNum());
-        if(org.apache.commons.lang3.StringUtils.isNotBlank(brandEntity.getSceneNum())){
-            String videoData =  getSceneVideoData(brandEntity.getSceneNum());
-            log.info("指房宝返回的video data={}" , videoData);
-            reqData.put("sceneVideoData" , videoData);
-            JSONObject jsonObject = zhiHouseService.queryBySceneNum(brandEntity.getSceneNum(),brandEntity.getToken());
-            if(!ObjectUtils.isEmpty(jsonObject)){
-                reqData.put("scenenName" , jsonObject.getString("sceneName"));
-            }
-        }
-
-        reqData.put("shareWxQrCode" , brandEntity.getShareWxQrCode());
-        reqData.put("address" , brandEntity.getAddress());
-        reqData.put("picList" , brandEntity.getPicList());
-        reqData.put("longitude" , brandEntity.getLongitude());
-        reqData.put("latitude" , brandEntity.getLatitude());
-        reqData.put("introduceVideo" , brandEntity.getIntroduceVideo());
-        reqData.put("introduceVideoCover" , brandEntity.getIntroduceVideoCover());
-        reqData.put("imageCover" , brandEntity.getAppListPicUrl());
-        reqData.put("appId" , appId);
-        reqData.put("origin" , ResourceUtil.getConfigByName("origin"));
-        log.info("获取到的api平台的app_id={}, app_secret={}" , appId , appSecret);
-
-        Long timeStamp = System.currentTimeMillis();
-
-        //token=app_id+app_secret+timestamp
-        String token = SHAUtils.getSHA256(appId + appSecret + timeStamp.toString());
-
-        Map<String , Object> sortMap = controllerUtils.sortMapByKey(reqData);
-        String sortMapStr = JSONObject.toJSONString(sortMap);
-        log.info("待加密的数据={}" ,sortMapStr + appSecret + timeStamp);
-        String sign  = SHAUtils.getSHA256(sortMapStr + appSecret + timeStamp);
-
-        String openApiurl = apiHostQueryUrl + "/api/shop/formatBrand?" + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
-        log.info("请求openApi的url={}", openApiurl);
-        String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
-        log.info("api平台返回结果:{}" , apiResultStr);
-        return Result.success(apiResultStr);
-
-    }
-
-    private String getSceneVideoData(String sceneNum){
-        if(org.apache.commons.lang3.StringUtils.isBlank(sceneNum)){
-            return null;
-        }
-        String url = scenePath + "api/scene/getInfo?num=" + sceneNum;
-        log.info("请求的url为:{}" ,url);
-        JSONObject resObj = null;
-        try{
-            ResponseEntity<String> resultString = restTemplate.getForEntity(url,String.class);
-            log.info("指房宝返回场景详情:{}" , JSON.toJSONString(resultString.getBody()));
-            resObj = JSON.parseObject(resultString.getBody() , JSONObject.class);
-        }catch (Exception e){
-            e.printStackTrace();
-            return null;
-        }
-        if(ObjectUtils.isEmpty(resObj)){
-            return "";
-        }
-        int code = resObj.getInteger("code");
-        if(code != 0){
-            log.error("调用指房宝失败");
-            return "";
-        }
-        JSONObject data = resObj.getJSONObject("data");
-        if(null == data){
-            log.error("指房宝返回数据格式异常");
-            return "";
-        }
-        JSONObject videos = data.getJSONObject("videos");
-        if(null == videos){
-            log.info("指房宝返回videos为空");
-        }else{
-            JSONArray dataArray = videos.getJSONArray("data");
-            if(null != dataArray){
-                return dataArray.toJSONString();
-            }else{
-                log.error("指房宝返回videos中的data数组为空");
-            }
-        }
-        return "";
-    }
-
-    @Override
-    public BrandEntity generateDefaultLiveRoom(SceneEntity sceneEntity) {
-        BrandEntity brandEntity = new BrandEntity();
-        brandEntity.setName(sceneEntity.getName());
-        brandEntity.setSimpleDesc(sceneEntity.getName());
-        brandEntity.setSceneNum(sceneEntity.getSceneNum());
-        brandEntity.setType(0);
-        brandEntity.setAppListPicUrl(sceneEntity.getAppListPicUrl());
-        brandEntity.setLivestreamStatus(0);
-
-        CurrentUserLoginVo userEntity = ShiroUtils.getUserEntity();
-        brandEntity.setContractPhone(userEntity.getPhone());
-        brandEntity.setPicList(sceneEntity.getAppListPicUrl());
-        brandEntity.setCreateUserId(userEntity.getId());
-        brandEntity.setSortOrder(100);
-        if(StringUtils.isNotBlank(sceneEntity.getCompanyId())){
-            brandEntity.setCreateUserDeptId(Long.valueOf(sceneEntity.getCompanyId()));
-        }
-        brandEntity.setAddress("浙江省,杭州市,萧山区 山阴路688号恒隆广场B座1217");
-        brandEntity.setLongitude(new BigDecimal(120.262421));
-        brandEntity.setLatitude(new BigDecimal(30.178317));
-        String liveRoomUrl = sceneEntity.getSceneUrl().replaceAll("smobile.html", "shop.html");
-        brandEntity.setLiveRoomUrl(liveRoomUrl);
-
-        save(brandEntity,false);
-        //生成微信分享二维码
-        generalWxShareQrCode(brandEntity , true);
-        brandEntity.setToken(sceneEntity.getToken());
-        sendDataToApi(brandEntity);
-
-        return brandEntity;
-    }
 //{brandId: 1, canShow: 0, type: -1, userId: "1"}
     public void bindUsers(Integer brandId,List<BrandBindUserVo> brandBindUserVoList) {
         List<Long> userIdList = new ArrayList<>();

+ 0 - 45
platform-shop/src/main/java/com/platform/task/TestTask.java

@@ -1,45 +0,0 @@
-package com.platform.task;
-
-import com.platform.service.impl.ZhiHouseService;
-import com.platform.vos.TbUser;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * 测试定时任务(演示Demo,可删除)
- * <p>
- * testTask为spring bean的名称
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @gitee https://gitee.com/fuyang_lipengjun/platform
- * @date 2016年11月30日 下午1:34:24
- */
-@Component("testTask")
-public class TestTask {
-    private Logger logger = LoggerFactory.getLogger(getClass());
-
-    @Autowired
-    private ZhiHouseService zhiHouseService;
-
-    public void test(String params) {
-        logger.info("我是带参数的test方法,正在被执行,参数为:" + params);
-
-        try {
-            Thread.sleep(1000L);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        TbUser user = zhiHouseService.getByUserId(1L);
-        System.out.println(ToStringBuilder.reflectionToString(user));
-
-    }
-
-    public void test2() {
-        logger.info("我是不带参数的test2方法,正在被执行");
-    }
-}