Jelajahi Sumber

学分规则设置 奖学金规则设置

huan.wang@yueguanjia.com 5 tahun lalu
induk
melakukan
161b22fd19

+ 1 - 1
src/main/java/com/ygj/yuemum/controller/college/CollegeCouponCreditController.java

@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 @RestController
-public class CollegeCouponCreditController {
+public class CollegePresentCreditController {
 
     @Autowired
     private CollegePresentCreditService collegePresentCreditService;

+ 0 - 22
src/main/java/com/ygj/yuemum/controller/college/CollegePresentCreditsController.java

@@ -1,22 +0,0 @@
-package com.ygj.yuemum.controller.college;
-
-
-import com.ygj.yuemum.domain.college.CollegePresentCredit;
-import com.ygj.yuemum.service.college.CollegePresentCreditService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@RestController
-public class CollegePresentCreditsController {
-
-    @Autowired
-    private CollegePresentCreditService collegePresentCreditService;
-
-    @GetMapping("/getCollegePresentCreditList")
-    public List<CollegePresentCredit> getCollegePresentCreditList() {
-        return collegePresentCreditService.getCollegePresentCredits();
-    }
-}

+ 24 - 0
src/main/java/com/ygj/yuemum/controller/college/CollegePresentScholarshipsController.java

@@ -0,0 +1,24 @@
+package com.ygj.yuemum.controller.college;
+
+
+import com.ygj.yuemum.domain.college.CollegePresentScholarships;
+import com.ygj.yuemum.service.college.CollegePresentScholarshipsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+public class CollegePresentScholarshipsController {
+
+    @Autowired
+    private CollegePresentScholarshipsService collegePresentScholarshipsService;
+
+    @GetMapping("/getCollegePresentScholarships")
+    public List<CollegePresentScholarships> getCollegePresentScholarships() {
+        return collegePresentScholarshipsService.getCollegePresentScholarships();
+    }
+
+
+}

+ 30 - 0
src/main/java/com/ygj/yuemum/controller/college/CollegeUserLevelController.java

@@ -0,0 +1,30 @@
+package com.ygj.yuemum.controller.college;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.ygj.yuemum.domain.college.CollegeTest;
+import com.ygj.yuemum.domain.college.CollegeUserLevel;
+import com.ygj.yuemum.service.college.CollegeTestService;
+import com.ygj.yuemum.service.college.CollegeUserLevelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+public class CollegeUserLevelController {
+
+    @Autowired
+    private CollegeUserLevelService collegeUserLevelService;
+
+    @GetMapping("/getUserLevels")
+    public List<CollegeUserLevel> getUserLevels() {
+        return collegeUserLevelService.getUserLevels();
+    }
+
+
+
+
+
+}

+ 9 - 0
src/main/java/com/ygj/yuemum/controller/college/CollegeUserPointsController.java

@@ -57,6 +57,15 @@ public class CollegeUserPointsController {
         return jso;
     }
 
+
+    @PostMapping("/college/queryRedeemIndexNoLogin") //++++++
+    public String queryRedeemIndexNoLogin() {
+        LinkedHashMap<String, Object> orderTemps = collegeUserPointsService.queryRedeemIndexNoLogin();
+        String jso = JSONObject.toJSONString(orderTemps, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue);
+        return jso;
+    }
+
+
     @PostMapping("/college/queryRedeem") //++++++
     public String queryRedeem(@RequestParam("presentId")Integer presentId) {
         LinkedHashMap<String, Object> orderTemps = collegeUserPointsService.queryRedeem(presentId);

+ 4 - 0
src/main/java/com/ygj/yuemum/controller/coupon/CouponCreateController.java

@@ -27,6 +27,10 @@ public class CouponCreateController {
     public List<CouponCreate> getAllCouponCreates() {
             return couponCreateService.getAll();
     }
+    @GetMapping("/queryCollegeCoupon")
+    public List<CouponCreate> queryCollegeCoupon() {
+        return couponCreateService.queryCollegeCoupon();
+    }
 
     @PostMapping("/addCouponCreate")
     public int add(@ModelAttribute CouponCreate couponCreate) {

+ 3 - 0
src/main/java/com/ygj/yuemum/dao/college/CollegeUserLevelDao.java

@@ -3,8 +3,11 @@ package com.ygj.yuemum.dao.college;
 import com.ygj.yuemum.domain.college.CollegeUserLevel;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Repository
 public interface CollegeUserLevelDao {
     CollegeUserLevel getUserLevel(Integer credit);
     CollegeUserLevel getUserLevelDesc(Integer credit);
+    List<CollegeUserLevel> getUserLevels();
 }

+ 1 - 1
src/main/java/com/ygj/yuemum/dao/coupon/CouponCreateDao.java

@@ -9,7 +9,7 @@ import java.util.List;
 public interface CouponCreateDao {
 
     List<CouponCreate> getAll();
-
+    List<CouponCreate> queryCollegeCoupon();
     int deleteByPrimaryKey(Integer id);
 
     int insertSelective(CouponCreate record);

+ 3 - 3
src/main/java/com/ygj/yuemum/domain/college/CollegePresentCredit.java

@@ -7,7 +7,7 @@ public class CollegePresentCredit {
     private Integer value;
     private String name;
     private Integer type;
-    private int coupon_cid;
+    private Integer coupon_cid;
     private String present_name;
     private Integer received;
     private Integer page;
@@ -69,11 +69,11 @@ public class CollegePresentCredit {
         this.type = type;
     }
 
-    public int getCoupon_cid() {
+    public Integer getCoupon_cid() {
         return coupon_cid;
     }
 
-    public void setCoupon_cid(int coupon_cid) {
+    public void setCoupon_cid(Integer coupon_cid) {
         this.coupon_cid = coupon_cid;
     }
 

+ 4 - 4
src/main/java/com/ygj/yuemum/service/college/CollegePresentCreditService.java

@@ -23,16 +23,16 @@ public class CollegePresentCreditService {
         return collegePresentCredit;
     }
 
-    public int addCollegePresentCredit(CollegePresentCredit collegeUserPoints) {
-        return collegePresentCreditDao.insertSelective(collegeUserPoints);
+    public int addCollegePresentCredit(CollegePresentCredit collegePresentCredit) {
+        return collegePresentCreditDao.insertSelective(collegePresentCredit);
     }
 
     public int deleteCollegePresentCredit(Integer id) {
         return collegePresentCreditDao.deleteByPrimaryKey(id);
     }
 
-    public int updateCollegePresentCredit(CollegePresentCredit collegeUserPoints) {
-        return collegePresentCreditDao.updateByPrimaryKeySelective(collegeUserPoints);
+    public int updateCollegePresentCredit(CollegePresentCredit collegePresentCredit) {
+        return collegePresentCreditDao.updateByPrimaryKeySelective(collegePresentCredit);
     }
 
     public List<CollegePresentCredit> queryUserReceived(String openid) {

+ 6 - 0
src/main/java/com/ygj/yuemum/service/college/CollegeUserLevelService.java

@@ -6,6 +6,8 @@ import org.omg.PortableInterceptor.INACTIVE;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class CollegeUserLevelService {
 
@@ -17,6 +19,10 @@ public class CollegeUserLevelService {
         return collegeUserLevel;
     }
 
+    public List<CollegeUserLevel> getUserLevels (){
+        return collegeUserLevelDao.getUserLevels();
+    }
+
     public CollegeUserLevel getUserLevelDesc(Integer credit) {
         CollegeUserLevel collegeUserLevel = collegeUserLevelDao.getUserLevelDesc(credit);
         return collegeUserLevel;

+ 21 - 0
src/main/java/com/ygj/yuemum/service/college/CollegeUserPointsService.java

@@ -481,6 +481,27 @@ public class CollegeUserPointsService {
         return returnInfo;
     }
 
+
+    public LinkedHashMap<String, Object> queryRedeemIndexNoLogin() {
+        LinkedHashMap<String, Object> returnInfo = new LinkedHashMap<>();
+        List<Object> presentInfoTemp = new LinkedList<>();
+        List<CollegePresentScholarships> collegePresentScholarships = collegePresentScholarshipsService.getCollegePresentScholarships();
+        for (CollegePresentScholarships collegePresentScholarship : collegePresentScholarships) {
+            LinkedHashMap<String, Object> presents = new LinkedHashMap<>();
+            //通过等级判断是否适合商品
+            presents.put("id",collegePresentScholarship.getId());
+            presents.put("name", collegePresentScholarship.getName());
+            presents.put("level", collegePresentScholarship.getLevel());
+            presents.put("scholarships", collegePresentScholarship.getScholarships());
+            presents.put("list_img_href", collegePresentScholarship.getList_img_href());
+            presents.put("count", collegePresentScholarship.getCount());
+            presentInfoTemp.add(presents);
+        }
+        returnInfo.put("presentInfo", presentInfoTemp);
+        return returnInfo;
+    }
+
+
     public LinkedHashMap<String, Object> queryRedeem(Integer presentId) {
         LinkedHashMap<String, Object> returnInfo = new LinkedHashMap<>();
         CollegePresentScholarships collegePresentScholarships = collegePresentScholarshipsService.getCollegePresentScholarship(presentId);

+ 4 - 0
src/main/java/com/ygj/yuemum/service/coupon/CouponCreateService.java

@@ -73,6 +73,10 @@ public class CouponCreateService {
         return 1;
     }
 
+    public List<CouponCreate> queryCollegeCoupon(){
+        return couponCreateDao.queryCollegeCoupon();
+    }
+
     public String couponIssue(int coupon_cid,String phone,String channel) {
         try {
             CouponCreate couponCreate = couponCreateDao.selectByPrimaryKey(coupon_cid);

+ 2 - 0
src/main/java/com/ygj/yuemum/shiro/ShiroConfig.java

@@ -169,6 +169,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/college/queryRedeemDetail", "anon");
         filterChainDefinitionMap.put("/college/userRedeem", "anon");
         filterChainDefinitionMap.put("/college/enableCollege", "anon");
+        filterChainDefinitionMap.put("/college/queryRedeemIndexNoLogin", "anon");
+
 //        //用户,需要角色权限 “user”
 //        filterChainDefinitionMap.put("/user/**", "roles[user]");
 //        //管理员,需要角色权限 “admin”

+ 9 - 0
src/main/resources/mybatis/mapper/college/CollegeUserLevelMapper.xml

@@ -21,6 +21,15 @@
     </select>
 
 
+    <select id="getUserLevels" resultType="com.ygj.yuemum.domain.college.CollegeUserLevel" >
+        SELECT
+            *
+        FROM
+            college_user_level
+        order by 1 desc
+    </select>
+
+
     <select id="getUserLevel" resultType="com.ygj.yuemum.domain.college.CollegeUserLevel"  parameterType="java.lang.Integer">
         SELECT
             *

+ 20 - 0
src/main/resources/mybatis/mapper/coupon/CouponCreateMapper.xml

@@ -48,6 +48,26 @@
     </select>
 
 
+    <select id="queryCollegeCoupon" resultMap="BaseResultMap" >
+        SELECT
+            id,
+            fgetcouponbatch(cb_code) cb_name,
+            cc_startdate,
+            cc_enddate,
+            cc_createdate,
+            cc_amount,
+            cc_quantity,
+            cc_status,
+            cb_type,
+            no_amount
+        FROM
+            coupon_create
+        where
+            cb_type = 1
+        order by id desc
+    </select>
+
+
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
         select
         <include refid="Base_Column_List" />

+ 3 - 12
src/main/resources/mybatis/mapper/wxmini/WXUserMapper.xml

@@ -68,10 +68,7 @@
                 xu_ydate,
             </if>
             <if test="xu_isauthorize != null" >
-                xu_isauthorize,
-            </if>
-            <if test="college_enable != null" >
-                college_enable
+                xu_isauthorize
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -109,10 +106,7 @@
                 #{xu_ydate,jdbcType=DATE},
             </if>
             <if test="xu_isauthorize != null" >
-                #{xu_isauthorize,jdbcType=INTEGER},
-            </if>
-            <if test="college_enable != null" >
-                #{college_enable,jdbcType=INTEGER}
+                #{xu_isauthorize,jdbcType=INTEGER}
             </if>
         </trim>
     </insert>
@@ -163,10 +157,7 @@
                 xu_content_type = #{xu_content_type,jdbcType=VARCHAR},
             </if>
             <if test="xu_content_date != null" >
-                xu_content_date = #{xu_content_date,jdbcType=DATE},
-            </if>
-            <if test="college_enable != null" >
-                college_enable = #{college_enable,jdbcType=INTEGER}
+                xu_content_date = #{xu_content_date,jdbcType=DATE}
             </if>
         </set>
         where xu_openid = #{xu_openid,jdbcType=VARCHAR}