소스 검색

积分商城图片

jk-GitHub-coder 4 년 전
부모
커밋
b81e1c1528

+ 24 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/IntegralShoppingMallController.java

@@ -48,6 +48,27 @@ public class IntegralShoppingMallController {
     private WxPushUtil wxPushUtil;
     @Resource
     private IntegralRuleService integralRuleService;
+    @Resource
+    private IntegralShopPicService integralShopPicService;
+
+    //获取积分活动信息图片
+    @RequestMapping(value = "/getIntegralShopPicInfoList", method = RequestMethod.GET)
+    @ResponseBody
+    public String getIntegralShopPicInfoList(@RequestParam Integer stationId){
+        Gson gson =new Gson();
+        //返回结果集
+        ResultData resultData = null;
+        if(stationId !=null){
+            IntegralShopPic integralShopPic = new IntegralShopPic();
+            integralShopPic.setStationId(stationId);
+            List<IntegralShopPic> integralShopPicList = integralShopPicService.getIntegralShopPicList(integralShopPic);
+            resultData=ResultData.success(integralShopPicList);
+        }else {
+            resultData=ResultData.error(CodeMsg.REQUEST_FAIL);
+        }
+        return gson.toJson(resultData);
+    }
+
 
     //获取油站积分商品信息
     @RequestMapping(value = "/getIntegralWaresInfoList", method = RequestMethod.GET)
@@ -72,6 +93,7 @@ public class IntegralShoppingMallController {
     @ResponseBody
     @Transactional
     public String insertIntegralOrder(@RequestBody IntegralOrder request){
+        logger.info("生成订单所传递参数:"+ request.toString());
         Gson gson =new Gson();
         //返回结果集
         ResultData resultData = null;
@@ -160,6 +182,7 @@ public class IntegralShoppingMallController {
             //用户已消费积分累积
             BigDecimal consumptionPoints = new BigDecimal(customerPointsInfo.getConsumptionPoints()).add(multiply);
             customerPoints.setConsumptionPoints(Integer.valueOf(consumptionPoints.toString()));
+            logger.info("用户积分: "+ consumptionPoints.toString());
             customerPointsService.updateCustomerPointsInfo(customerPoints);
         }
 
@@ -168,6 +191,7 @@ public class IntegralShoppingMallController {
         if(integralWaresInfoList !=null && integralWaresInfoList.size() ==1){
             integralWares.setWaresOutCount(integralWaresInfoList.get(0).getWaresOutCount()+1);
             integralWares.setWaresCount(integralWaresInfoList.get(0).getWaresCount()-1);
+            logger.info("商品已售数量: "+ integralWares.toString());
             integralWaresService.updateIntegralWaresInfo(integralWares);
         }
 

+ 11 - 0
YijiaRestful/src/main/java/com/platform/yijia/dao/IntegralShopPicMapper.java

@@ -0,0 +1,11 @@
+package com.platform.yijia.dao;
+
+import com.platform.yijia.pojo.IntegralShopPic;
+
+import java.util.List;
+
+public interface IntegralShopPicMapper {
+
+    //获取油站积分商城图片
+    List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic);
+}

+ 19 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/IntegralShopPic.java

@@ -0,0 +1,19 @@
+package com.platform.yijia.pojo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/***
+ * 积分商城图片
+ */
+@Data
+public class IntegralShopPic {
+    private Integer id;                 //'商品主键id',
+    private String imgName;           //'图片名称',
+    private String imgUrl;              //'图片地址',
+    private String imgStatus;            //'图片状态',
+    private Integer stationId;          //'油站ID',
+    private String stationName;         //油站名称
+}

+ 13 - 0
YijiaRestful/src/main/java/com/platform/yijia/service/IntegralShopPicService.java

@@ -0,0 +1,13 @@
+package com.platform.yijia.service;
+
+
+import com.platform.yijia.pojo.IntegralShopPic;
+
+import java.util.List;
+
+public interface IntegralShopPicService {
+
+    //获取油站积分商城图片
+    List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic);
+
+}

+ 23 - 0
YijiaRestful/src/main/java/com/platform/yijia/service/impl/IntegralShopPicServiceImpl.java

@@ -0,0 +1,23 @@
+package com.platform.yijia.service.impl;
+import com.platform.yijia.dao.IntegralShopPicMapper;
+import com.platform.yijia.dao.IntegralWaresMapper;
+import com.platform.yijia.pojo.IntegralShopPic;
+import com.platform.yijia.pojo.IntegralWares;
+import com.platform.yijia.service.IntegralShopPicService;
+import com.platform.yijia.service.IntegralWaresService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service("integralShopPicService")
+public class IntegralShopPicServiceImpl implements IntegralShopPicService {
+    @Resource
+    private IntegralShopPicMapper integralShopPicMapper;
+
+    //获取油站积分商城图片
+    @Override
+    public List<IntegralShopPic> getIntegralShopPicList(IntegralShopPic integralShopPic) {
+        return integralShopPicMapper.getIntegralShopPicList(integralShopPic);
+    }
+}

+ 34 - 0
YijiaRestful/src/main/resources/mapper/IntegralShopPicMapper.xml

@@ -0,0 +1,34 @@
+<?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.yijia.dao.IntegralShopPicMapper">
+  <!--积分规则返回结果-->
+  <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.IntegralShopPic">
+      <id     column="id"                     jdbcType="INTEGER" property="id" />
+      <result column="img_name"               jdbcType="VARCHAR" property="imgName" />
+      <result column="img_url"                jdbcType="VARCHAR" property="imgUrl" />
+      <result column="img_status"             jdbcType="VARCHAR" property="imgStatus" />
+      <result column="station_id"             jdbcType="INTEGER" property="stationId" />
+      <result column="station_name"           jdbcType="VARCHAR" property="stationName" />
+  </resultMap>
+
+  <!--查询油站积分商城图片信息-->
+  <select id="getIntegralShopPicList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralShopPic">
+    SELECT
+        id,
+        img_name,
+        img_url,
+        img_status,
+        station_id,
+        station_name
+    FROM
+        integral_shop_pic
+    <where>
+         img_status = "1"
+      <if test="stationId !=null and stationId !=''">
+         AND station_id = #{stationId}
+      </if>
+    </where>
+  </select>
+
+
+</mapper>