فهرست منبع

扫码获取轮胎奖励信息接口初次提交

shanxin 5 سال پیش
والد
کامیت
43ba91b097
29فایلهای تغییر یافته به همراه717 افزوده شده و 198 حذف شده
  1. 35 1
      sailun-allsteel-admin-rest/src/main/java/io/platform/homepage/web/controller/rest/ConfigArticleRestController.java
  2. 0 1
      sailun-allsteel-admin-rest/src/main/java/io/platform/homepage/web/controller/rest/ConfigBrandRestController.java
  3. 3 1
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/controller/HomePageController.java
  4. 81 0
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/controller/StoreScanController.java
  5. 0 16
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/CommonQuery.java
  6. 0 43
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/RewardQuery.java
  7. 0 46
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/ScanRecordQuery.java
  8. 48 0
      sailun-allsteel-app-rest/src/main/java/io/platform/app/web/remote/StoreScanRemote.java
  9. 5 0
      sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/activity/dto/ActivityMaterialDto.java
  10. 84 77
      sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/homepage/dto/ConfigArticleDto.java
  11. 10 0
      sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/scan/service/client/api/ScanRecordServiceClient.java
  12. 6 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/pom.xml
  13. 15 1
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/entity/ConfigArticle.java
  14. 2 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/mapper/ConfigArticleMapper.java
  15. 7 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/service/ConfigArticleService.java
  16. 14 2
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/service/client/impl/ConfigArticleServiceClientImpl.java
  17. 4 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/biz/mapper/ScanRecordMapper.java
  18. 66 5
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/biz/service/ScanRecordService.java
  19. 18 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/service/client/impl/ScanRecordServiceClientImpl.java
  20. 40 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/activity/ActivityMaterialMapper.xml
  21. 8 1
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/hompage/ConfigArticleMapper.xml
  22. 12 0
      sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/scan/ScanRecordMapper.xml
  23. 23 0
      sailun-allsteel-common/src/main/java/io/platform/base/common/exception/BaseExceptionHeader.java
  24. 7 1
      sailun-allsteel-common/src/main/java/io/platform/base/common/exception/RRException.java
  25. 39 0
      sailun-allsteel-common/src/main/java/io/platform/base/constant/enums/AGENT_AGREE_STATUS_ENUMS.java
  26. 39 0
      sailun-allsteel-common/src/main/java/io/platform/base/constant/enums/B2B_AGREE_STATUS_ENUMS.java
  27. 49 0
      sailun-allsteel-common/src/main/java/io/platform/base/dto/StoreScanDTO.java
  28. 102 0
      sailun-allsteel-common/src/main/java/io/platform/base/dto/TyreMsgDTO.java
  29. 0 3
      sailun-allsteel-sys-provider/sailun-allsteel-sys-service/src/main/java/io/platform/sys/service/client/impl/MetaProvinceServiceClientImpl.java

+ 35 - 1
sailun-allsteel-admin-rest/src/main/java/io/platform/homepage/web/controller/rest/ConfigArticleRestController.java

@@ -2,6 +2,8 @@
 package io.platform.homepage.web.controller.rest;
 
 
+import io.platform.base.common.utils.FtpUtils;
+import io.platform.base.common.utils.ShiroUtils;
 import io.platform.homepage.dto.ConfigArticleDto;
 import io.platform.homepage.web.remote.ConfigArticleServiceRemote;
 import org.springframework.web.bind.annotation.*;
@@ -15,7 +17,10 @@ import io.platform.base.common.validator.ValidatorUtils;
 
 import io.platform.base.common.annotation.SysLog;
 import io.platform.base.common.utils.ExecuteResult;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -26,6 +31,10 @@ public class ConfigArticleRestController extends AbstractController {
 
     @Autowired
 	private ConfigArticleServiceRemote configArticleServiceRemote;
+
+
+	@Autowired
+	private FtpUtils ftpUtils;
 	
 	/**
 	 * 所有列表
@@ -63,7 +72,7 @@ public class ConfigArticleRestController extends AbstractController {
 	@RequiresPermissions("appconfig:configArticle:save")
 	public R save(@RequestBody ConfigArticleDto configArticleDto){
         ValidatorUtils.validateEntity(configArticleDto);
-        ExecuteResult<String> result= configArticleServiceRemote.save(configArticleDto);
+		ExecuteResult<String> result= configArticleServiceRemote.save(configArticleDto);
         if(result.isSuccess()){
             return R.ok(result.getSuccessMessage());
         }else{
@@ -102,4 +111,29 @@ public class ConfigArticleRestController extends AbstractController {
         }
 	}
 
+
+
+
+
+	/**
+	 * 文件上传
+	 * @return
+	 */
+	@RequestMapping("/uploadFile")
+	public R uploadFile(@RequestParam("file") MultipartFile file) {
+		String fileName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
+		String url = null;
+		try {
+			url = ftpUtils.defaultUpload(null, fileName, (FileInputStream) file.getInputStream());
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return R.ok().put("data",url);
+	}
+
+
+
+
+
+
 }

+ 0 - 1
sailun-allsteel-admin-rest/src/main/java/io/platform/homepage/web/controller/rest/ConfigBrandRestController.java

@@ -118,7 +118,6 @@ public class ConfigBrandRestController extends AbstractController {
 	 */
 	@RequestMapping("/uploadFile")
 	public R uploadFile(@RequestParam("file") MultipartFile file) {
-		file.getOriginalFilename();
 		String fileName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
 		String url = null;
 		try {

+ 3 - 1
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/controller/HomePageController.java

@@ -2,6 +2,7 @@ package io.platform.app.web.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.platform.app.web.remote.HomePageRemote;
+import io.platform.base.common.constant.enums.LV_ENUNS;
 import io.platform.base.common.exception.RRException;
 import io.platform.base.common.utils.R;
 import io.platform.base.dto.ArticleDTO;
@@ -10,7 +11,6 @@ import io.platform.base.dto.StoreBannerDTO;
 import io.platform.base.dto.StoreStockQuery;
 import io.platform.base.vo.StoreBrandVO;
 import io.platform.config.annotation.FuncLogAnno;
-import io.platform.store.dto.StoreAgentBrandLvLogDto;
 import io.platform.store.dto.StoreStockDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -73,6 +73,8 @@ public class HomePageController {
         if (null == noticeDTO.getContentType()) {
             throw new RRException("展示位置不能为空");
         }
+
+
         return R.ok().put("list",homePageRemote.getNoticeList(noticeDTO));
     }
 

+ 81 - 0
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/controller/StoreScanController.java

@@ -0,0 +1,81 @@
+package io.platform.app.web.controller;
+
+import io.platform.app.web.remote.StoreScanRemote;
+import io.platform.base.common.exception.RRException;
+import io.platform.base.common.utils.ExecuteResult;
+import io.platform.base.common.utils.R;
+import io.platform.base.dto.StoreScanDTO;
+import io.platform.base.dto.TyreMsgDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * TODO
+ * 门店扫码出入库controller
+ *
+ * @author shanxin
+ * @version 1.0
+ * @date 2020/11/9 11:30
+ */
+@RestController
+@RequestMapping("/storeScan")
+@Api(tags = "门店扫码入库相关内容")
+public class StoreScanController {
+
+
+
+    @Autowired
+    private StoreScanRemote storeScanRemote;
+
+
+    /**
+     * 门店扫码获取轮胎对应的奖励
+     * @param storeScanDTO
+     * @return
+     */
+    @RequestMapping("/getTyreReword")
+    @ApiOperation("门店扫码获取轮胎对应的奖励接口")
+    public R getTyreReword (@RequestBody StoreScanDTO storeScanDTO) {
+        if (null == storeScanDTO.getStoreId()) {
+            throw new RRException("门店ID不能为空");
+        }
+        if (null == storeScanDTO.getUserId()) {
+            throw new RRException("用户ID不能为空");
+        }
+        if (null == storeScanDTO.getMaterialList() || storeScanDTO.getMaterialList().size() < 1) {
+            throw new RRException("物料不能为空");
+        }
+        List<TyreMsgDTO> answer = this.storeScanRemote.getTyreReword(storeScanDTO);
+        return R.ok().put("data",answer);
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 0 - 16
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/CommonQuery.java

@@ -1,16 +0,0 @@
-package io.platform.app.web.query;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-
-@Data
-public class CommonQuery {
-
-    /**
-     * 门店Id
-     */
-    private Long storeId;
-}

+ 0 - 43
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/RewardQuery.java

@@ -1,43 +0,0 @@
-package io.platform.app.web.query;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-
-@Data
-public class RewardQuery {
-    /**
-     * 门店Id
-     */
-    private Long storeId;
-    /**
-     * 品牌cade
-     */
-    private String brandCode;
-
-    /**
-     * 开始日期
-     */
-    private String beginDate;
-
-    /**
-     * 结束日期
-     */
-    private String endDate;
-
-
-    /**
-     * 搜索条件
-     */
-    private String content;
-    /**
-     * 当前页
-     */
-    private Long current;
-    /**
-     * 页数
-     */
-    private Long size;
-
-}

+ 0 - 46
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/query/ScanRecordQuery.java

@@ -1,46 +0,0 @@
-package io.platform.app.web.query;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-
-@Data
-public class ScanRecordQuery {
-
-    /**
-     * 门店Id
-     */
-    private Long storeId;
-    /**
-     * 品牌cade
-     */
-    private String brandCode;
-
-    /**
-     * 开始日期
-     */
-    private String beginDate;
-    /**
-     * 结束日期
-     */
-    private String endDate;
-
-    /**
-     * 搜索条件
-     */
-    private String content;
-
-    /**
-     * 1入库2出库
-     */
-    private Integer scanType;
-    /**
-     * 当前页
-     */
-    private Long current;
-    /**
-     * 页数
-     */
-    private Long size;
-}

+ 48 - 0
sailun-allsteel-app-rest/src/main/java/io/platform/app/web/remote/StoreScanRemote.java

@@ -0,0 +1,48 @@
+package io.platform.app.web.remote;
+
+import com.alibaba.dubbo.config.annotation.Reference;
+import io.platform.activity.service.client.api.ActivityMatchServiceClient;
+import io.platform.base.common.utils.ExecuteResult;
+import io.platform.base.dto.StoreScanDTO;
+import io.platform.base.dto.TyreMsgDTO;
+import io.platform.scan.service.client.api.ScanRecordServiceClient;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author shanxin
+ * @version 1.0
+ * @date 2020/11/9 14:02
+ */
+
+@Service("storeScanRemote")
+public class StoreScanRemote {
+
+
+    @Reference(check = false)
+    private ScanRecordServiceClient scanRecordServiceClient;
+
+
+    /**
+     * 门店获取奖励
+     * @param storeScanDTO
+     * @return
+     */
+    public List<TyreMsgDTO> getTyreReword(StoreScanDTO storeScanDTO) {
+        return this.scanRecordServiceClient.getTyreReword(storeScanDTO);
+    }
+
+
+
+
+
+
+
+
+
+
+
+}

+ 5 - 0
sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/activity/dto/ActivityMaterialDto.java

@@ -29,4 +29,9 @@ private static final long serialVersionUID = 5454155825314635342L;
     private java.util.Date createTime;
     //columns END
 
+    /**
+     * 活动名称
+     */
+    private String activityName;
+
 }

+ 84 - 77
sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/homepage/dto/ConfigArticleDto.java

@@ -7,82 +7,89 @@ public class ConfigArticleDto  implements java.io.Serializable{
 private static final long serialVersionUID = 5454155825314635342L;
 
 
-/**
- * 文章Id       db_column: MAIN_ID
- */
-private Long mainId;
-/**
- * 标题       db_column: TITLE
- */
-private String title;
-/**
- * 副标题       db_column: VICE_TITLE
- */
-private String viceTitle;
-/**
- * 关键词       db_column: KEYWORDS
- */
-private String keywords;
-/**
- * 作者       db_column: AUTHOR
- */
-private String author;
-/**
- * 简介       db_column: SUMMARYS
- */
-private String summarys;
-/**
- * 图片       db_column: IMAGE_PATH
- */
-private String imagePath;
-/**
- * 是否系统文章       db_column: IS_SYS
- */
-private String isSys;
-/**
- * 是否外链       db_column: IS_OUTERLINK
- */
-private String isOuterlink;
-/**
- * url       db_column: URL
- */
-private String url;
-/**
- * 附件地址       db_column: FILE_URL
- */
-private String fileUrl;
-/**
- * 发布时间       db_column: PUB_TIME
- */
-private String pubTime;
-/**
- * 状态(0禁用/1启用)       db_column: NSTATUS
- */
-private Long nstatus;
-/**
- * 排序       db_column: ORDER_INDEX
- */
-private Long orderIndex;
-/**
- * 备注       db_column: DESCRIPTION
- */
-private String description;
-/**
- * 显示类型(0车主/1门店/2经销商)       db_column: DISPLAY_TYPE
- */
-private String displayType;
-/**
- * 文章类别       db_column: TYPE_ID
- */
-private String typeId;
-/**
- * contentDetail       db_column: CONTENT_DETAIL
- */
-private String contentDetail;
-/**
- * 创建时间       db_column: CREATE_TIME
- */
-private java.util.Date createTime;
-//columns END
+    /**
+     * 文章Id       db_column: MAIN_ID
+     */
+    private Long mainId;
+    /**
+     * 标题       db_column: TITLE
+     */
+    private String title;
+    /**
+     * 副标题       db_column: VICE_TITLE
+     */
+    private String viceTitle;
+    /**
+     * 关键词       db_column: KEYWORDS
+     */
+    private String keywords;
+    /**
+     * 作者       db_column: AUTHOR
+     */
+    private String author;
+    /**
+     * 简介       db_column: SUMMARYS
+     */
+    private String summarys;
+    /**
+     * 图片       db_column: IMAGE_PATH
+     */
+    private String imagePath;
+    /**
+     * 是否系统文章       db_column: IS_SYS
+     */
+    private String isSys;
+    /**
+     * 是否外链       db_column: IS_OUTERLINK
+     */
+    private String isOuterlink;
+    /**
+     * url       db_column: URL
+     */
+    private String url;
+    /**
+     * 附件地址       db_column: FILE_URL
+     */
+    private String fileUrl;
+    /**
+     * 发布时间       db_column: PUB_TIME
+     */
+    private String pubTime;
+    /**
+     * 状态(0禁用/1启用)       db_column: NSTATUS
+     */
+    private Long nstatus;
+    /**
+     * 排序       db_column: ORDER_INDEX
+     */
+    private Long orderIndex;
+    /**
+     * 备注       db_column: DESCRIPTION
+     */
+    private String description;
+    /**
+     * 显示类型(0车主/1门店/2经销商)       db_column: DISPLAY_TYPE
+     */
+    private String displayType;
+    /**
+     * 文章类别       db_column: TYPE_ID
+     */
+    private String typeId;
+    /**
+     * contentDetail       db_column: CONTENT_DETAIL
+     */
+    private String contentDetail;
+    /**
+     * 创建时间       db_column: CREATE_TIME
+     */
+    private java.util.Date createTime;
+    //columns END
+
+
+    /**
+     * 是否默认显示   FLAG_DEFAULT
+     */
+    private Integer flagDefault;
+
 
 }

+ 10 - 0
sailun-allsteel-bus-provider/saillun-allsteel-bus-api/src/main/java/io/platform/scan/service/client/api/ScanRecordServiceClient.java

@@ -2,6 +2,9 @@
 package io.platform.scan.service.client.api;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.platform.base.common.exception.RRException;
+import io.platform.base.dto.StoreScanDTO;
+import io.platform.base.dto.TyreMsgDTO;
 import io.platform.scan.dto.ScanRecordDto;
 
 import java.util.List;
@@ -45,4 +48,11 @@ public interface ScanRecordServiceClient{
          */
         Page<ScanRecordDto>getPage(Page<ScanRecordDto>page,ScanRecordDto scanRecordDto);
 
+
+        /**
+         * 门店扫码获取奖励信息
+         * @param storeScanDTO
+         * @return
+         */
+        List<TyreMsgDTO> getTyreReword (StoreScanDTO storeScanDTO) throws RRException;
 }

+ 6 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/pom.xml

@@ -140,6 +140,12 @@
             <artifactId>pagehelper-spring-boot-starter</artifactId>
             <version>1.2.5</version>
         </dependency>
+        <!--分布式锁-->
+        <dependency>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson</artifactId>
+            <version>3.11.1</version>
+        </dependency>
     </dependencies>
 
 

+ 15 - 1
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/entity/ConfigArticle.java

@@ -18,9 +18,14 @@ public class ConfigArticle extends Model<ConfigArticle>  implements Serializable
     /**
      * 文章Id       db_column: MAIN_ID
      */
-    @TableField("MAIN_ID")
+    @TableId(value="MAIN_ID", type = IdType.INPUT)
     private Long mainId;
 
+    @Override
+    protected Serializable pkVal() {
+        return this.mainId;
+    }
+
     /**
      * 标题       db_column: TITLE
      */
@@ -130,4 +135,13 @@ public class ConfigArticle extends Model<ConfigArticle>  implements Serializable
     private java.util.Date createTime;
 //columns END
 
+
+    /**
+     * 是否默认显示   FLAG_DEFAULT
+     */
+    @TableField("FLAG_DEFAULT")
+    private Integer flagDefault;
+
+
+
 }

+ 2 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/mapper/ConfigArticleMapper.java

@@ -3,6 +3,7 @@ package io.platform.homepage.biz.mapper;
 import io.platform.base.common.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import io.platform.homepage.biz.entity.ConfigArticle;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
@@ -11,4 +12,5 @@ import io.platform.homepage.biz.entity.ConfigArticle;
 @Mapper
 public interface ConfigArticleMapper extends BaseMapper<ConfigArticle>{
 
+    void setArticleNotDefault(@Param("displayType") String displayType);
 }

+ 7 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/biz/service/ConfigArticleService.java

@@ -18,4 +18,11 @@ public class ConfigArticleService extends ServiceImpl<ConfigArticleMapper,Config
         return baseMapper.selectByMap(map);
     }
 
+    /**
+     * 设置文章状态
+     * @param displayType
+     */
+    public void setArticleNotDefault(String displayType) {
+        this.baseMapper.setArticleNotDefault(displayType);
+    }
 }

+ 14 - 2
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/homepage/service/client/impl/ConfigArticleServiceClientImpl.java

@@ -3,7 +3,9 @@ package io.platform.homepage.service.client.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.dubbo.config.annotation.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
 import io.platform.base.common.BaseServiceClient;
@@ -22,6 +24,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -63,6 +66,11 @@ public class ConfigArticleServiceClientImpl extends BaseServiceClient<ConfigArti
         try{
             ConfigArticle configArticle = new ConfigArticle();
             revert(configArticleDto,configArticle);
+            configArticle.setCreateTime(new Date());
+            // 设置默认
+            if ( 1 == configArticleDto.getFlagDefault().intValue()) {
+                this.configArticleService.setArticleNotDefault(configArticleDto.getDisplayType());
+            }
             boolean flag = configArticleService.save(configArticle);
             if(!flag){
                 result.addErrorMessage("保存失败。");
@@ -81,6 +89,10 @@ public class ConfigArticleServiceClientImpl extends BaseServiceClient<ConfigArti
         try{
             ConfigArticle configArticle = new ConfigArticle();
             revert(configArticleDto,configArticle);
+            // 设置默认
+            if ( 1 == configArticleDto.getFlagDefault().intValue()) {
+                this.configArticleService.setArticleNotDefault(configArticleDto.getDisplayType());
+            }
             boolean flag = configArticleService.updateById(configArticle);
             if(!flag){
                 result.addErrorMessage("更新失败。");
@@ -129,9 +141,9 @@ public class ConfigArticleServiceClientImpl extends BaseServiceClient<ConfigArti
     public Page<ConfigArticleDto> getPage(Page<ConfigArticleDto> pageDto,ConfigArticleDto configArticleDto) {
         Page<ConfigArticle> page = new Page<>(pageDto.getCurrent(),pageDto.getSize());
 
-        page.setAsc(pageDto.ascs());
+        /*page.setAsc(pageDto.ascs());
         page.setDesc(pageDto.descs());
-        page.condition().putAll(pageDto.condition());
+        page.condition().putAll(pageDto.condition());*/
 
         ConfigArticle configArticle = new ConfigArticle();
         revert(configArticleDto,configArticle);

+ 4 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/biz/mapper/ScanRecordMapper.java

@@ -1,6 +1,7 @@
 package io.platform.scan.biz.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.platform.activity.biz.entity.Activity;
 import io.platform.base.common.BaseMapper;
 import io.platform.scan.dto.ScanRecordDto;
 import io.platform.scan.dto.ScanRecordListDto;
@@ -20,4 +21,7 @@ import java.util.List;
 public interface ScanRecordMapper extends BaseMapper<ScanRecord>{
 
 
+    Activity getTyreReword(@Param("province") String province,
+                           @Param("lvCount") String lvCount,
+                           @Param("matnr") String matnr);
 }

+ 66 - 5
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/biz/service/ScanRecordService.java

@@ -1,18 +1,26 @@
 
 package io.platform.scan.biz.service;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import io.platform.activity.biz.entity.Activity;
+import io.platform.base.common.exception.RRException;
+
+import io.platform.base.constant.enums.B2B_AGREE_STATUS_ENUMS;
+import io.platform.base.dto.StoreScanDTO;
+import io.platform.base.dto.TyreMsgDTO;
 import io.platform.scan.biz.mapper.ScanRecordMapper;
 import io.platform.scan.biz.entity.ScanRecord;
 
-import io.platform.scan.dto.ScanRecordDto;
-import io.platform.scan.dto.ScanRecordListDto;
-import io.platform.scan.dto.TireInfo;
-import io.platform.scan.dto.TireModelDto;
+
+import io.platform.store.biz.entity.StoreAgentBrandLv;
+import io.platform.store.biz.entity.StoreBasicInfo;
+import io.platform.store.biz.service.StoreAgentBrandLvService;
+import io.platform.store.biz.service.StoreBasicInfoService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
 import java.util.Map;
 
@@ -23,6 +31,59 @@ public class ScanRecordService extends ServiceImpl<ScanRecordMapper,ScanRecord>{
     public List<ScanRecord> selectByMap(Map<String, Object> map) {
         return baseMapper.selectByMap(map);
     }
+    
+    
+    // 门店主体信息
+    @Resource
+    private StoreBasicInfoService storeBasicInfoServices;
+    
+
+    // 门店-经销商-签约品牌-等级
+    @Resource
+    private StoreAgentBrandLvService storeAgentBrandLvService;
+
+
+    /**
+     * 门店扫码时 获取轮胎对应的奖励
+     * 1.非门店签约品牌  0
+     * 2.根据门店签约级别 + 门店所在省份 + 物料编号
+     * 3.根据物料匹配规则在筛选
+     * 4.最终确定轮胎奖励金额
+     * @param storeScanDTO
+     * @return
+     */
+    public List<TyreMsgDTO> getTyreReword(StoreScanDTO storeScanDTO) {
+        List<TyreMsgDTO> materialList = storeScanDTO.getMaterialList();
+        StoreBasicInfo storeInfo = storeBasicInfoServices.getById(storeScanDTO.getStoreId());
+        if (null == storeInfo) {
+            throw new RRException("门店信息异常");
+        }
+        for (TyreMsgDTO tyreMsgDTO : materialList) {
+            QueryWrapper<StoreAgentBrandLv> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("STORE_ID",storeScanDTO.getStoreId())
+                    .eq("BLOCK_STATUS",0)   // 门店冻结状态为未冻结
+                    .eq("B2B_STATUS", B2B_AGREE_STATUS_ENUMS.A1.getCode())   // 经销商审核状态为通过
+                    .eq("BRAND_CODE",tyreMsgDTO.getBrand());   // 轮胎品牌
+            StoreAgentBrandLv storeBrandLv = storeAgentBrandLvService.getOne(queryWrapper, true);
+            // 扫码轮胎为签约轮胎
+            if (null != storeBrandLv) {
+                Activity activity =  this.baseMapper.getTyreReword(storeInfo.getProvince(),storeBrandLv.getLvCount(),tyreMsgDTO.getMatnr());
+                if (null == activity) {
+                    tyreMsgDTO.setRewardMoney(0L);
+                } else {
+                    tyreMsgDTO.setRewardMoney(activity.getStoreBonus());
+                }
+            } else {
+                tyreMsgDTO.setRewardMoney(0L);
+            }
+        }
+        return materialList;
+    }
+
+
+
+
+
 
 
 }

+ 18 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/java/io/platform/scan/service/client/impl/ScanRecordServiceClientImpl.java

@@ -6,8 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
 import io.platform.base.common.BaseServiceClient;
+import io.platform.base.common.exception.RRException;
 import io.platform.base.common.utils.ExecuteResult;
 
+import io.platform.base.dto.StoreScanDTO;
+import io.platform.base.dto.TyreMsgDTO;
 import io.platform.scan.biz.entity.ScanRecord;
 import io.platform.scan.biz.service.ScanRecordService;
 import io.platform.scan.dto.ScanRecordDto;
@@ -146,4 +149,19 @@ public class ScanRecordServiceClientImpl extends BaseServiceClient<ScanRecord,Sc
     }
 
 
+    /**
+     * 门店扫码获取奖励
+     * @param storeScanDTO
+     * @return
+     */
+    @Override
+    public List<TyreMsgDTO> getTyreReword(StoreScanDTO storeScanDTO)  {
+        return this.scanRecordService.getTyreReword(storeScanDTO);
+    }
+
+
+
+
+
+
 }

+ 40 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/activity/ActivityMaterialMapper.xml

@@ -4,8 +4,48 @@
 <mapper namespace="io.platform.activity.biz.mapper.ActivityMaterialMapper">
 
 
+    <!-- 查询活动物料 -->
+    <select id="selectActivityList" parameterType="io.platform.activity.dto.ActivityMaterialDto" resultType="io.platform.activity.dto.ActivityMaterialDto">
+        SELECT
+            mat.*,
+            act.ACTIVITY_NAME as activityName
+        FROM
+            APP_ACTIVITY_MATERIAL mat
+            LEFT JOIN APP_ACTIVITY act ON mat.ACTIVITY_ID = act.MAIN_ID
+        <where>
+            <if test="null != activityMaterialDto.activityId and '' != activityMaterialDto.activityId">
+                and  mat.ACTIVITY_ID = #{activityMaterialDto.activityId}
+            </if>
+            <if test="null != activityMaterialDto.matnr and '' != activityMaterialDto.matnr">
+                and mat.MATNR = #{activityMaterialDto.matnr}
+            </if>
+            <if test="null != activityMaterialDto.matnrName and ''!= activityMaterialDto.matnrName">
+                and mat.MATNR_NAME = #{activityMaterialDto.matnrName}
+            </if>
+        </where>
+    </select>
 
 
+    <!-- 查询活动物料条数 -->
+    <select id="selectActivityCount" parameterType="io.platform.activity.dto.ActivityMaterialDto" resultType="Long">
+        SELECT
+            count(*)
+        FROM
+            APP_ACTIVITY_MATERIAL mat
+            LEFT JOIN APP_ACTIVITY act ON mat.ACTIVITY_ID = act.MAIN_ID
+        <where>
+            <if test="null != activityMaterialDto.activityId and '' != activityMaterialDto.activityId">
+                and  mat.ACTIVITY_ID = #{activityMaterialDto.activityId}
+            </if>
+            <if test="null != activityMaterialDto.matnr and '' != activityMaterialDto.matnr">
+                and mat.MATNR = #{activityMaterialDto.matnr}
+            </if>
+            <if test="null != activityMaterialDto.matnrName and ''!= activityMaterialDto.matnrName">
+                and mat.MATNR_NAME = #{activityMaterialDto.matnrName}
+            </if>
+        </where>
+    </select>
+
 
 
 </mapper>

+ 8 - 1
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/hompage/ConfigArticleMapper.xml

@@ -3,6 +3,13 @@
 
 <mapper namespace="io.platform.homepage.biz.mapper.ConfigArticleMapper">
 
-
+    <update id="setArticleNotDefault" parameterType="string">
+        UPDATE APP_CONFIG_ARTICLE
+        SET FLAG_DEFAULT = 0
+        WHERE
+            FLAG_DEFAULT = 1
+        AND
+            DISPLAY_TYPE = #{displayType}
+    </update>
 
 </mapper>

+ 12 - 0
sailun-allsteel-bus-provider/sailun-allsteel-bus-service/src/main/resources/mybatis/scan/ScanRecordMapper.xml

@@ -3,5 +3,17 @@
 
 <mapper namespace="io.platform.scan.biz.mapper.ScanRecordMapper">
 
+    <select id="getTyreReword" parameterType="object" resultType="io.platform.activity.biz.entity.Activity">
+        SELECT
+            act.*
+        FROM
+            APP_ACTIVITY act
+            LEFT JOIN APP_ACTIVITY_MATERIAL mat ON act.MAIN_ID = mat.ACTIVITY_ID
+            LEFT JOIN APP_ACTIVITY_AREA area ON act.MAIN_ID = area.ACTIVITY_ID
+        WHERE
+            act.NUM_TASK = #{lvCount}
+            AND mat.MATNR = #{matnr}
+            AND area.PROVINCE_NAME = #{province}
+    </select>
 
 </mapper>

+ 23 - 0
sailun-allsteel-common/src/main/java/io/platform/base/common/exception/BaseExceptionHeader.java

@@ -0,0 +1,23 @@
+package io.platform.base.common.exception;
+
+
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class BaseExceptionHeader {
+
+    @ExceptionHandler(RRException.class)
+    @ResponseBody
+    public Map<String, Object> handleHttpException(RRException e){
+        Map<String, Object> map = new HashMap<>();
+        map.put("code", e.getCode());
+        map.put("message", e.getMessage());
+        return map;
+    }
+
+
+}

+ 7 - 1
sailun-allsteel-common/src/main/java/io/platform/base/common/exception/RRException.java

@@ -1,5 +1,7 @@
 package io.platform.base.common.exception;
 
+import java.io.Serializable;
+
 /**
  * 自定义异常
  * 
@@ -7,7 +9,9 @@ package io.platform.base.common.exception;
  * @email sunlightcs@gmail.com
  * @date 2016年10月27日 下午10:11:27
  */
-public class RRException extends RuntimeException {
+public class RRException extends RuntimeException implements Serializable {
+
+
 	private static final long serialVersionUID = 1L;
 	
     private String msg;
@@ -35,6 +39,8 @@ public class RRException extends RuntimeException {
 		this.code = code;
 	}
 
+
+
 	public String getMsg() {
 		return msg;
 	}

+ 39 - 0
sailun-allsteel-common/src/main/java/io/platform/base/constant/enums/AGENT_AGREE_STATUS_ENUMS.java

@@ -0,0 +1,39 @@
+package io.platform.base.constant.enums;
+
+/**
+ * 经销商审核门店状态  枚举类
+ */
+public enum AGENT_AGREE_STATUS_ENUMS {
+
+    A0(0,"未审核"),
+    A1(1,"审核通过"),
+    A2(2,"审核未通过");
+
+
+
+    private Integer code; // 状态码(数据库存)
+
+    private String msg;  // 状态信息
+
+    AGENT_AGREE_STATUS_ENUMS(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 39 - 0
sailun-allsteel-common/src/main/java/io/platform/base/constant/enums/B2B_AGREE_STATUS_ENUMS.java

@@ -0,0 +1,39 @@
+package io.platform.base.constant.enums;
+
+/**
+ * b2b审核门店状态  枚举类
+ */
+public enum B2B_AGREE_STATUS_ENUMS  {
+
+    A0(0,"未审核"),
+    A1(1,"审核通过"),
+    A2(2,"审核未通过");
+
+
+
+    private Integer code; // 状态码(数据库存)
+
+    private String msg;  // 状态信息
+
+    B2B_AGREE_STATUS_ENUMS(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 49 - 0
sailun-allsteel-common/src/main/java/io/platform/base/dto/StoreScanDTO.java

@@ -0,0 +1,49 @@
+package io.platform.base.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * TODO
+ * 门店扫码入库---请求实体
+ *
+ * @author shanxin
+ * @version 1.0
+ * @date 2020/11/9 13:31
+ */
+@Data
+public class StoreScanDTO implements Serializable {
+
+
+    private static final long serialVersionUID = 5454155825314635342L;
+
+
+    /**
+     * 门店ID
+     */
+    private Long storeId;
+
+    /**
+     * 用户ID
+     */
+    private String userId;
+
+
+
+    /**
+     * 请求物料集合
+     */
+    private List<TyreMsgDTO> materialList;
+
+
+
+
+
+
+
+
+
+
+}

+ 102 - 0
sailun-allsteel-common/src/main/java/io/platform/base/dto/TyreMsgDTO.java

@@ -0,0 +1,102 @@
+package io.platform.base.dto;
+
+import lombok.Data;
+
+/**
+ * TODO
+ * 轮胎信息DTO
+ *
+ * @author shanxin
+ * @version 1.0
+ * @date 2020/11/9 13:23
+ */
+@Data
+public class TyreMsgDTO implements java.io.Serializable{
+
+
+
+
+    private static final long serialVersionUID = 5454155825314635342L;
+
+
+
+    /**
+     * 是否正规
+     */
+    private Long isRegular;
+
+
+    /**
+     * 出场时间
+     */
+    private String shippedDate;
+
+    /**
+     * 经销商
+     */
+    private String soldToPartyKunnr;
+
+
+    /**
+     * 品牌
+     */
+    private String brand;
+
+
+    /**
+     * 规格
+     */
+    private String specs;
+
+
+    /**
+     * 花纹
+     */
+    private String pattern;
+
+
+    /**
+     * 物料编号
+     */
+    private String matnr;
+
+
+    /**
+     * 物料描述
+     */
+    private String maktx;
+
+
+    /**
+     * 轮胎直径
+     */
+    private String diameter;
+
+
+    /**
+     * 轮胎号
+     */
+    private String tireNumber;
+
+
+    /**
+     * 扫码方式
+     */
+    private Long scanWay;
+
+
+    /**
+     * 奖励金额
+     */
+    private Long rewardMoney;
+
+
+
+
+
+
+
+
+
+
+}

+ 0 - 3
sailun-allsteel-sys-provider/sailun-allsteel-sys-service/src/main/java/io/platform/sys/service/client/impl/MetaProvinceServiceClientImpl.java

@@ -127,9 +127,6 @@ public class MetaProvinceServiceClientImpl extends BaseServiceClient<MetaProvinc
     public Page<MetaProvinceDto> getPage(Page<MetaProvinceDto> pageDto,MetaProvinceDto metaProvinceDto) {
         Page<MetaProvince> page = new Page<>(pageDto.getCurrent(),pageDto.getSize());
 
-        page.setAsc(pageDto.ascs());
-        page.setDesc(pageDto.descs());
-        page.condition().putAll(pageDto.condition());
 
         MetaProvince metaProvince = new MetaProvince();
         revert(metaProvinceDto,metaProvince);