Browse Source

常规课后台管理

huan.wang@yueguanjia.com 5 năm trước cách đây
mục cha
commit
61c401763c
21 tập tin đã thay đổi với 279 bổ sung107 xóa
  1. 5 5
      pom.xml
  2. 37 37
      src/main/java/com/ygj/yuemum/YueMumApplication.java
  3. 15 13
      src/main/java/com/ygj/yuemum/controller/college/CollegeCurriculumCoreController.java
  4. 1 1
      src/main/java/com/ygj/yuemum/controller/college/CollegeTestController.java
  5. 3 1
      src/main/java/com/ygj/yuemum/dao/college/CollegeCurriculumCoreDao.java
  6. 1 1
      src/main/java/com/ygj/yuemum/dao/college/CollegeTestDao.java
  7. 2 1
      src/main/java/com/ygj/yuemum/dao/college/CollegeUserLevelDao.java
  8. 1 0
      src/main/java/com/ygj/yuemum/dao/global/PackagesDao.java
  9. 30 12
      src/main/java/com/ygj/yuemum/domain/college/CollegeCurriculumCore.java
  10. 9 0
      src/main/java/com/ygj/yuemum/domain/college/CollegePresentScholarships.java
  11. 9 0
      src/main/java/com/ygj/yuemum/domain/college/CollegeUserLevel.java
  12. 31 10
      src/main/java/com/ygj/yuemum/service/college/CollegeCurriculumCoreService.java
  13. 3 6
      src/main/java/com/ygj/yuemum/service/college/CollegeTestService.java
  14. 5 0
      src/main/java/com/ygj/yuemum/service/college/CollegeUserLevelService.java
  15. 33 3
      src/main/java/com/ygj/yuemum/service/college/CollegeUserPointsService.java
  16. 6 1
      src/main/java/com/ygj/yuemum/service/global/PackagesService.java
  17. 5 11
      src/main/java/com/ygj/yuemum/service/maternitymatron/JlServiceUserService.java
  18. 52 5
      src/main/resources/mybatis/mapper/college/CollegeCurriculumCoreMapper.xml
  19. 10 0
      src/main/resources/mybatis/mapper/college/CollegePresentScholarshipsMapper.xml
  20. 11 0
      src/main/resources/mybatis/mapper/college/CollegeUserLevelMapper.xml
  21. 10 0
      src/main/resources/mybatis/mapper/global/PackagesMapper.xml

+ 5 - 5
pom.xml

@@ -71,11 +71,11 @@
             <version>2.8.2</version>
         </dependency>
         <!--启动-->
-<!--        <dependency>-->
-<!--        <groupId>org.springframework.boot</groupId>-->
-<!--        <artifactId>spring-boot-starter-tomcat</artifactId>-->
-<!--        <scope>provided</scope>-->
-<!--        </dependency>-->
+        <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-tomcat</artifactId>
+        <scope>provided</scope>
+        </dependency>
 
 
         <dependency>

+ 37 - 37
src/main/java/com/ygj/yuemum/YueMumApplication.java

@@ -17,44 +17,12 @@ import java.util.Properties;
 @SpringBootApplication
 @MapperScan("com.ygj.yuemum.dao")
 @EnableScheduling
-public class YueMumApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(YueMumApplication.class, args);
-    }
-
-    @Bean
-    public PageHelper pageHelper() {
-        PageHelper pageHelper = new PageHelper();
-        Properties properties = new Properties();
-        properties.setProperty("offsetAsPageNum", "true");
-        properties.setProperty("rowBoundsWithCount", "true");
-        properties.setProperty("reasonable", "true");
-        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
-        pageHelper.setProperties(properties);
-        return pageHelper;
-    }
-    @Bean
-    public MultipartConfigElement multipartConfigElement() {
-        MultipartConfigFactory factory = new MultipartConfigFactory();
-        //  单个数据大小
-        factory.setMaxFileSize("50240KB");
-        /// 总上传数据大小
-        factory.setMaxRequestSize("50240KB");
-        return factory.createMultipartConfig();
-    }
-}
-//public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
-//
-//    @Override
-//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
-//
-//        return application.sources(YueMumApplication.class);
-//    }
+//public class YueMumApplication {
 //
 //    public static void main(String[] args) {
 //        SpringApplication.run(YueMumApplication.class, args);
 //    }
+//
 //    @Bean
 //    public PageHelper pageHelper() {
 //        PageHelper pageHelper = new PageHelper();
@@ -70,9 +38,41 @@ public class YueMumApplication {
 //    public MultipartConfigElement multipartConfigElement() {
 //        MultipartConfigFactory factory = new MultipartConfigFactory();
 //        //  单个数据大小
-//        factory.setMaxFileSize("10240KB");
+//        factory.setMaxFileSize("50240KB");
 //        /// 总上传数据大小
-//        factory.setMaxRequestSize("10240KB");
+//        factory.setMaxRequestSize("50240KB");
 //        return factory.createMultipartConfig();
 //    }
-//}
+//}
+public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
+
+        return application.sources(YueMumApplication.class);
+    }
+
+    public static void main(String[] args) {
+        SpringApplication.run(YueMumApplication.class, args);
+    }
+    @Bean
+    public PageHelper pageHelper() {
+        PageHelper pageHelper = new PageHelper();
+        Properties properties = new Properties();
+        properties.setProperty("offsetAsPageNum", "true");
+        properties.setProperty("rowBoundsWithCount", "true");
+        properties.setProperty("reasonable", "true");
+        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
+        pageHelper.setProperties(properties);
+        return pageHelper;
+    }
+    @Bean
+    public MultipartConfigElement multipartConfigElement() {
+        MultipartConfigFactory factory = new MultipartConfigFactory();
+        //  单个数据大小
+        factory.setMaxFileSize("10240KB");
+        /// 总上传数据大小
+        factory.setMaxRequestSize("10240KB");
+        return factory.createMultipartConfig();
+    }
+}

+ 15 - 13
src/main/java/com/ygj/yuemum/controller/college/CollegeCurriculumCoreController.java

@@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.LinkedHashMap;
-import java.util.List;
+import java.util.Map;
 
 @RestController
 public class CollegeCurriculumCoreController {
@@ -18,9 +18,11 @@ public class CollegeCurriculumCoreController {
     @Autowired
     private CollegeCurriculumCoreService collegeCurriculumCoreService;
 
-    @GetMapping("/getCollegeCurriculumCores")
-    public List<CollegeCurriculumCore> getCollegeCurriculumCores() {
-        return collegeCurriculumCoreService.getCollegeCurriculumCores();
+    @PostMapping("/getCollegeCurriculumCores")
+    public String getCollegeCurriculumCores(@ModelAttribute CollegeCurriculumCore collegeCurriculumCore) {
+        Map<String, Object> collegeCurriculumCores = collegeCurriculumCoreService.getCollegeCurriculumCores(collegeCurriculumCore);
+        String jso = JSONObject.toJSONString(collegeCurriculumCores);
+        return jso;
     }
 
     @GetMapping("/getCollegeCurriculumCore")
@@ -52,15 +54,15 @@ public class CollegeCurriculumCoreController {
 
 
     @PostMapping("/college/queryCoreDetail")
-    public String queryCoreDetail(@RequestParam("openid") String openid,@RequestParam("collegeId") Integer id) {
-        LinkedHashMap<String, Object> orderTemps = collegeCurriculumCoreService.queryCoreDetail(openid,id);
+    public String queryCoreDetail(@RequestParam("openid") String openid, @RequestParam("collegeId") Integer id) {
+        LinkedHashMap<String, Object> orderTemps = collegeCurriculumCoreService.queryCoreDetail(openid, id);
         String jso = JSONObject.toJSONString(orderTemps, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue);
         return jso;
     }
 
 
     @PostMapping("/college/queryUserLearningCoreDetail")
-    public String queryUserLearningCoreDetail(@RequestParam("openid") String openid,@RequestParam("id") Integer id) {
+    public String queryUserLearningCoreDetail(@RequestParam("openid") String openid, @RequestParam("id") Integer id) {
         CollegeCurriculumQuery collegeCurriculumQuery = new CollegeCurriculumQuery();
         collegeCurriculumQuery.setId(id);
         collegeCurriculumQuery.setOpenid(openid);
@@ -70,18 +72,18 @@ public class CollegeCurriculumCoreController {
     }
 
     @PostMapping("/college/corePositive")
-    public int corePositive(@RequestParam("openid") String openid,@RequestParam("c_code") String c_code) {
-        return collegeCurriculumCoreService.corePositive(openid,c_code);
+    public int corePositive(@RequestParam("openid") String openid, @RequestParam("c_code") String c_code) {
+        return collegeCurriculumCoreService.corePositive(openid, c_code);
     }
 
     @PostMapping("/college/coreLearningFinish")
-    public int coreLearningFinish(@RequestParam("openid") String openid,@RequestParam("c_code") String c_code) {
-        return collegeCurriculumCoreService.coreLearningFinish(openid,c_code);
+    public int coreLearningFinish(@RequestParam("openid") String openid, @RequestParam("c_code") String c_code) {
+        return collegeCurriculumCoreService.coreLearningFinish(openid, c_code);
     }
 
     @PostMapping("/college/coreLearningUpdate")
-    public int coreLearningUpdate(@RequestParam("openid") String openid,@RequestParam("c_code") String c_code,@RequestParam("rate") String rate) {
-        return collegeCurriculumCoreService.coreLearningUpdate(openid,c_code,rate);
+    public int coreLearningUpdate(@RequestParam("openid") String openid, @RequestParam("c_code") String c_code, @RequestParam("rate") String rate) {
+        return collegeCurriculumCoreService.coreLearningUpdate(openid, c_code, rate);
     }
 
 

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

@@ -23,7 +23,7 @@ public class CollegeTestController {
     }
 
     @GetMapping("/getCollegeTest")
-    public List<CollegeTest> getCollegeTest(@RequestParam("id") Integer id) {
+    public CollegeTest getCollegeTest(@RequestParam("id") Integer id) {
         return collegeTestService.getCollegeTest(id);
     }
 

+ 3 - 1
src/main/java/com/ygj/yuemum/dao/college/CollegeCurriculumCoreDao.java

@@ -12,8 +12,10 @@ import java.util.List;
 @Repository
 public interface CollegeCurriculumCoreDao {
 
-    List<CollegeCurriculumCore> getAll();
+    List<CollegeCurriculumCore> getAll(CollegeCurriculumCore collegeCurriculumCore);
     CollegeCurriculumCore selectByPrimaryKey(Integer id);
+    CollegeCurriculumCore getCoreSeq();
+    int checkRep(CollegeCurriculumCore collegeCurriculumCore);
     int deleteByPrimaryKey(Integer id);
     int insertSelective(CollegeCurriculumCore record);
     int updateByPrimaryKeySelective(CollegeCurriculumCore record);

+ 1 - 1
src/main/java/com/ygj/yuemum/dao/college/CollegeTestDao.java

@@ -10,7 +10,7 @@ public interface CollegeTestDao {
 
     List<CollegeTest> getAll();
 
-    List<CollegeTest> selectByPrimaryKey(Integer id);
+    CollegeTest selectByPrimaryKey(Integer id);
 
     int deleteByPrimaryKey(Integer id);
 

+ 2 - 1
src/main/java/com/ygj/yuemum/dao/college/CollegeUserLevelDao.java

@@ -6,4 +6,5 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface CollegeUserLevelDao {
     CollegeUserLevel getUserLevel(Integer credit);
-}
+    CollegeUserLevel getUserLevelDesc(Integer credit);
+}

+ 1 - 0
src/main/java/com/ygj/yuemum/dao/global/PackagesDao.java

@@ -16,4 +16,5 @@ public interface PackagesDao {
     Packages getPackageDetail(String p_code);
     String getPackageCRMCode(String p_code);
     Packages getBizID(String p_code);
+    List<Packages> getPackageListsDefault(String p_branches);
 }

+ 30 - 12
src/main/java/com/ygj/yuemum/domain/college/CollegeCurriculumCore.java

@@ -9,9 +9,9 @@ public class CollegeCurriculumCore {
     private String c_name;
     private String c_type;
     private Integer c_step;
-    private Integer isvideo;
+    private boolean isvideo;
     private String video_href;
-    private Integer istest;
+    private boolean istest;
     private Integer testid;
     private Integer credit;
     private String video_length;
@@ -30,9 +30,27 @@ public class CollegeCurriculumCore {
     private String openid;
     private String scholarships;
     private Integer isbooking;
+    private String create_at;
+    private String create_user;
     private Integer page;
     private Integer limit;
 
+    public String getCreate_at() {
+        return create_at;
+    }
+
+    public void setCreate_at(String create_at) {
+        this.create_at = create_at;
+    }
+
+    public String getCreate_user() {
+        return create_user;
+    }
+
+    public void setCreate_user(String create_user) {
+        this.create_user = create_user;
+    }
+
     public String getScholarships() {
         return scholarships;
     }
@@ -145,14 +163,6 @@ public class CollegeCurriculumCore {
         this.c_step = c_step;
     }
 
-    public Integer getIsvideo() {
-        return isvideo;
-    }
-
-    public void setIsvideo(Integer isvideo) {
-        this.isvideo = isvideo;
-    }
-
     public String getVideo_href() {
         return video_href;
     }
@@ -161,11 +171,19 @@ public class CollegeCurriculumCore {
         this.video_href = video_href;
     }
 
-    public Integer getIstest() {
+    public boolean isIsvideo() {
+        return isvideo;
+    }
+
+    public void setIsvideo(boolean isvideo) {
+        this.isvideo = isvideo;
+    }
+
+    public boolean isIstest() {
         return istest;
     }
 
-    public void setIstest(Integer istest) {
+    public void setIstest(boolean istest) {
         this.istest = istest;
     }
 

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/college/CollegePresentScholarships.java

@@ -6,6 +6,7 @@ public class CollegePresentScholarships {
     private String name;
     private Integer level;
     private Integer type;
+    private String desc;
     private Integer coupon_id;
     private Integer scholarships;
     private String list_img_href;
@@ -16,6 +17,14 @@ public class CollegePresentScholarships {
     private Integer page;
     private Integer limit;
 
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
     public String getRedeem_img_href() {
         return redeem_img_href;
     }

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/college/CollegeUserLevel.java

@@ -3,9 +3,18 @@ package com.ygj.yuemum.domain.college;
 public class CollegeUserLevel {
     private Integer id;
     private Integer level;
+    private String desc;
     private Integer start;
     private Integer end;
 
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
     public Integer getId() {
         return id;
     }

+ 31 - 10
src/main/java/com/ygj/yuemum/service/college/CollegeCurriculumCoreService.java

@@ -1,5 +1,7 @@
 package com.ygj.yuemum.service.college;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.ygj.yuemum.component.Constant;
 import com.ygj.yuemum.dao.college.CollegeCurriculumCoreDao;
 import com.ygj.yuemum.domain.college.*;
@@ -11,9 +13,7 @@ import org.springframework.stereotype.Service;
 
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class CollegeCurriculumCoreService {
@@ -32,9 +32,15 @@ public class CollegeCurriculumCoreService {
     @Autowired
     private CollegeScholarshipsDetailService collegeScholarshipsDetailService;
 
-    public List<CollegeCurriculumCore> getCollegeCurriculumCores() {
-        List<CollegeCurriculumCore> collegeCurriculumCores = collegeCurriculumCoreDao.getAll();
-        return collegeCurriculumCores;
+    public Map<String, Object> getCollegeCurriculumCores(CollegeCurriculumCore collegeCurriculumCore) {
+        PageHelper.startPage(collegeCurriculumCore.getPage(), collegeCurriculumCore.getLimit());
+        List<CollegeCurriculumCore> collegeCurriculumCores = collegeCurriculumCoreDao.getAll(collegeCurriculumCore);
+        PageInfo<CollegeCurriculumCore> pageInfo = new PageInfo<CollegeCurriculumCore>(collegeCurriculumCores);
+        long count = pageInfo.getTotal(); //获取总记录数
+        Map<String, Object> tableData = new HashMap<>();
+        tableData.put("items", collegeCurriculumCores);
+        tableData.put("total", count);
+        return tableData;
     }
 
     public CollegeCurriculumCore getCollegeCurriculumCore(Integer id) {
@@ -43,6 +49,21 @@ public class CollegeCurriculumCoreService {
     }
 
     public int addCollegeCurriculumCore(CollegeCurriculumCore collegeCurriculumCore) {
+        int check =  collegeCurriculumCoreDao.checkRep(collegeCurriculumCore);
+        if (check > 1) {
+            return 0;
+        }
+        CollegeCurriculumCore collegeCurriculumCoreMax = collegeCurriculumCoreDao.getCoreSeq();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        collegeCurriculumCore.setSys_type("YueSuo");
+        collegeCurriculumCore.setCreate_at(sdf.format(new Date()));
+        if (collegeCurriculumCoreMax != null) {
+            collegeCurriculumCore.setC_code("C"+(collegeCurriculumCoreMax.getId()+1));
+            collegeCurriculumCore.setC_seq(collegeCurriculumCoreMax.getC_seq()+1);
+        } else {
+            collegeCurriculumCore.setC_code("C1");
+            collegeCurriculumCore.setC_seq(1);
+        }
         return collegeCurriculumCoreDao.insertSelective(collegeCurriculumCore);
     }
 
@@ -93,7 +114,7 @@ public class CollegeCurriculumCoreService {
                             collegeScholarshipsDetailQuery.setCollege_type("core");
                             collegeScholarshipsDetailQuery.setCollege_id(collegeCurriculumCore.getId());
                             CollegeScholarshipsDetail collegeScholarshipsDetail = collegeScholarshipsDetailService.queryCollegeScholarships(collegeScholarshipsDetailQuery);
-                            if(collegeScholarshipsDetail != null) {
+                            if (collegeScholarshipsDetail != null) {
                                 collegeCurriculumCore.setScholarships(String.valueOf(collegeScholarshipsDetail.getScholarships()));
                             } else {
                                 collegeCurriculumCore.setScholarships("0-100");
@@ -127,7 +148,7 @@ public class CollegeCurriculumCoreService {
                             collegeScholarshipsDetailQuery.setCollege_type("core");
                             collegeScholarshipsDetailQuery.setCollege_id(collegeCurriculumCore.getId());
                             CollegeScholarshipsDetail collegeScholarshipsDetail = collegeScholarshipsDetailService.queryCollegeScholarships(collegeScholarshipsDetailQuery);
-                            if(collegeScholarshipsDetail != null) {
+                            if (collegeScholarshipsDetail != null) {
                                 collegeCurriculumCore.setScholarships(String.valueOf(collegeScholarshipsDetail.getScholarships()));
                             } else {
                                 collegeCurriculumCore.setScholarships("0-100");
@@ -173,7 +194,7 @@ public class CollegeCurriculumCoreService {
                             collegeScholarshipsDetailQuery.setCollege_type("core");
                             collegeScholarshipsDetailQuery.setCollege_id(collegeCurriculumCore.getId());
                             CollegeScholarshipsDetail collegeScholarshipsDetail = collegeScholarshipsDetailService.queryCollegeScholarships(collegeScholarshipsDetailQuery);
-                            if(collegeScholarshipsDetail != null) {
+                            if (collegeScholarshipsDetail != null) {
                                 collegeCurriculumCore.setScholarships(String.valueOf(collegeScholarshipsDetail.getScholarships()));
                             } else {
                                 collegeCurriculumCore.setScholarships("0-100");
@@ -223,7 +244,7 @@ public class CollegeCurriculumCoreService {
                 collegeScholarshipsDetailQuery.setCollege_type("core");
                 collegeScholarshipsDetailQuery.setCollege_id(collegeCurriculumQuery.getId());
                 CollegeScholarshipsDetail collegeScholarshipsDetail = collegeScholarshipsDetailService.queryCollegeScholarships(collegeScholarshipsDetailQuery);
-                if(collegeScholarshipsDetail != null) {
+                if (collegeScholarshipsDetail != null) {
                     list.put("collegeScholarships", String.valueOf(collegeScholarshipsDetail.getScholarships()));
                 } else {
                     list.put("collegeScholarships", "0-100");

+ 3 - 6
src/main/java/com/ygj/yuemum/service/college/CollegeTestService.java

@@ -6,10 +6,7 @@ import com.ygj.yuemum.domain.college.CollegeTestDetail;
 import com.ygj.yuemum.domain.college.CollegeTestResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import sun.awt.geom.AreaOp;
 
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -28,9 +25,9 @@ public class CollegeTestService {
         return collegeTests;
     }
 
-    public List<CollegeTest> getCollegeTest(Integer id) {
-        List<CollegeTest> collegeTests = collegeTestDao.selectByPrimaryKey(id);
-        return collegeTests;
+    public CollegeTest getCollegeTest(Integer id) {
+        CollegeTest collegeTest  = collegeTestDao.selectByPrimaryKey(id);
+        return collegeTest;
     }
 
     public int addCollegeTest(CollegeTest collegeTest) {

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

@@ -17,5 +17,10 @@ public class CollegeUserLevelService {
         return collegeUserLevel;
     }
 
+    public CollegeUserLevel getUserLevelDesc(Integer credit) {
+        CollegeUserLevel collegeUserLevel = collegeUserLevelDao.getUserLevelDesc(credit);
+        return collegeUserLevel;
+    }
+
 
 }

+ 33 - 3
src/main/java/com/ygj/yuemum/service/college/CollegeUserPointsService.java

@@ -170,6 +170,8 @@ public class CollegeUserPointsService {
                         tableData.put("credit", collegeUserPoints.getCredit_total());
                         point_available = collegeUserPoints.getCredit_total();
                     }
+                    //查询奖学金
+                    tableData.put("scholarships", collegeUserPoints.getScholarships_available());
                     //礼品领取情况
                     List<CollegePresentCredit> collegePresentCredits = collegePresentCreditService.queryUserReceived(openid);
                     for (CollegePresentCredit collegePresentCredit : collegePresentCredits) {
@@ -429,7 +431,21 @@ public class CollegeUserPointsService {
         List<Object> presentInfoTemp = new LinkedList<>();
         WXUser wxUser = wxUserService.getWXUser(openid);
         CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
-        CollegeUserLevel collegeUserLevel = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
+        CollegeUserLevel collegeUserLevel = new CollegeUserLevel();
+        if(collegeUserPoints == null) {
+            //新增用户
+            CollegeUserPoints collegeUserPointsNew = new CollegeUserPoints();
+            collegeUserPointsNew.setOpenid(openid);
+            collegeUserPointsNew.setCredit_available(0);
+            collegeUserPointsNew.setCredit_total(0);
+            collegeUserPointsNew.setScholarships_available(0);
+            collegeUserPointsNew.setScholarships_total(0);
+            collegeUserPointsDao.insertSelective(collegeUserPointsNew);
+            collegeUserLevel = collegeUserLevelService.getUserLevel(0);
+            collegeUserPoints = collegeUserPointsNew;
+        } else {
+            collegeUserLevel = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
+        }
         int level = 0;
         if (collegeUserLevel != null) {
             level = collegeUserLevel.getLevel();
@@ -442,15 +458,16 @@ public class CollegeUserPointsService {
         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());
             if (collegePresentScholarship.getLevel() > level) {
-                presents.put("redeem ", false);
+                presents.put("redeem", false);
             } else {
-                presents.put("redeem ", true);
+                presents.put("redeem", true);
             }
             presentInfoTemp.add(presents);
         }
@@ -471,15 +488,28 @@ public class CollegeUserPointsService {
         LinkedHashMap<String, Object> returnInfo = new LinkedHashMap<>();
         CollegePresentScholarships collegePresentScholarships = collegePresentScholarshipsService.getCollegePresentScholarship(presentId);
         CollegeUserPoints collegeUserPoints = collegeUserPointsDao.queryOneUserPoints(openid);
+        CollegeUserLevel collegeUserLevelTemp = collegeUserLevelService.getUserLevel(collegeUserPoints.getCredit_available());
+        int level = 0;
+        if (collegeUserLevelTemp != null) {
+            level = collegeUserLevelTemp.getLevel();
+        }
         if(collegeUserPoints == null || collegePresentScholarships == null) {
             returnInfo.put("error", "未找到信息");
         } else {
+            CollegeUserLevel collegeUserLevel = collegeUserLevelService.getUserLevelDesc(collegePresentScholarships.getLevel());
             returnInfo.put("level",collegePresentScholarships.getLevel());
+            returnInfo.put("levelDesc",collegeUserLevel.getDesc());
+            returnInfo.put("presentDesc",collegePresentScholarships.getDesc());
             returnInfo.put("presentType",collegePresentScholarships.getType());
             returnInfo.put("presentName",collegePresentScholarships.getName());
             returnInfo.put("presentRedeemImg",collegePresentScholarships.getRedeem_img_href());
             returnInfo.put("presentScholarships",collegePresentScholarships.getScholarships());
             returnInfo.put("userScholarships",collegeUserPoints.getScholarships_available());
+            if (collegePresentScholarships.getLevel() > level) {
+                returnInfo.put("redeem", false);
+            } else {
+                returnInfo.put("redeem", true);
+            }
             if(collegePresentScholarships.getType() == 2) {
                 List<WXMktInfo> wxMktInfo = wxMktInfoService.getMktInfos(null);
                 returnInfo.put("mktInfo",wxMktInfo);

+ 6 - 1
src/main/java/com/ygj/yuemum/service/global/PackagesService.java

@@ -25,7 +25,12 @@ public class PackagesService {
         return packagesDao.getPackageShowname();
     }
     public List<Packages> getPackageLists(String p_branches) {
-        return packagesDao.getPackageLists(p_branches);
+        List<Packages> packages = packagesDao.getPackageListsDefault(p_branches);
+        if(packages.size() ==0) {
+            return packagesDao.getPackageLists("310100");
+        }else {
+            return packagesDao.getPackageLists(p_branches);
+        }
     }
     public Packages getPackageDetail(String p_code) {
         return packagesDao.getPackageDetail(p_code);

+ 5 - 11
src/main/java/com/ygj/yuemum/service/maternitymatron/JlServiceUserService.java

@@ -25,10 +25,6 @@ public class JlServiceUserService {
     @Autowired
     private JlServiceUserDao jlServiceUserDao;
     @Autowired
-    private JlServiceUserInfoService jlServiceUserInfoService;
-    @Autowired
-    private JlStoreXService jlStoreXService;
-    @Autowired
     private MmStockDao mmStockDao;
     @Autowired
     private WXMMUserSearchService wxmmUserSearchService;
@@ -36,7 +32,7 @@ public class JlServiceUserService {
     private WXMMUserSearchDetailService wxmmUserSearchDetailService;
 
 
-    public List<JlServiceUser> queryUserMMSearch(WXMMUserSearch wxmmUserSearch,QueryServiceUserStock queryServiceUserStock) {
+    public List<JlServiceUser> queryUserMMSearch(WXMMUserSearch wxmmUserSearch, QueryServiceUserStock queryServiceUserStock) {
         try {
             //保存查询条件 ID没有保存
             int id = wxmmUserSearchService.getWXMMUserSearchId();
@@ -47,9 +43,7 @@ public class JlServiceUserService {
                 wxmmUserSearchDetailService.insertWXMMUserSearch(wxmmUserSearchDetail);
             }
             //查询月嫂
-
             return jlServiceUserDao.queryUserMMSearch(queryServiceUserStock);
-
         } catch (Exception ex) {
             ex.printStackTrace();
             return null;
@@ -70,7 +64,7 @@ public class JlServiceUserService {
     public Map<String, Object> getMMList(int page, int limit) {
         PageHelper.startPage(page, limit);
         List<JlServiceUser> mmlists = jlServiceUserDao.getMMList();
-        PageInfo<JlServiceUser> pageInfo = new PageInfo<JlServiceUser>(mmlists);
+        PageInfo<JlServiceUser> pageInfo = new PageInfo<>(mmlists);
         long count = pageInfo.getTotal(); //获取总记录数
         Map<String, Object> tableData = new HashMap<>();
         tableData.put("items", mmlists);
@@ -81,7 +75,7 @@ public class JlServiceUserService {
     public Map<String, Object> queryMMList(QueryServiceUser queryServiceUser) {
         PageHelper.startPage(queryServiceUser.getPage(), queryServiceUser.getLimit());
         List<QueryServiceUser> mmlists = jlServiceUserDao.queryMMList(queryServiceUser);
-        PageInfo<QueryServiceUser> pageInfo = new PageInfo<QueryServiceUser>(mmlists);
+        PageInfo<QueryServiceUser> pageInfo = new PageInfo<>(mmlists);
         long count = pageInfo.getTotal(); //获取总记录数
         Map<String, Object> tableData = new HashMap<>();
         tableData.put("items", mmlists);
@@ -92,7 +86,7 @@ public class JlServiceUserService {
     public Map<String, Object> queryServiceUserStock(int page, int limit) {
         PageHelper.startPage(page, limit);
         List<JlServiceUser> mmlists = jlServiceUserDao.queryServiceUserStock();
-        PageInfo<JlServiceUser> pageInfo = new PageInfo<JlServiceUser>(mmlists);
+        PageInfo<JlServiceUser> pageInfo = new PageInfo<>(mmlists);
         long count = pageInfo.getTotal(); //获取总记录数
         Map<String, Object> tableData = new HashMap<>();
         tableData.put("items", mmlists);
@@ -131,7 +125,7 @@ public class JlServiceUserService {
             Date startDate = sdf.parse(sDate);
             Date endDate = sdf.parse(eDate);
             Calendar cal = Calendar.getInstance();
-            List<Date> lDate = new ArrayList<Date>();
+            List<Date> lDate = new ArrayList<>();
             lDate.add(startDate);
             cal.setTime(startDate);
             while (true) {

+ 52 - 5
src/main/resources/mybatis/mapper/college/CollegeCurriculumCoreMapper.xml

@@ -27,15 +27,27 @@
         <result column="positive" property="positive" jdbcType="INTEGER"/>
         <result column="negative" property="negative" jdbcType="INTEGER"/>
         <result column="isbooking" property="isbooking" jdbcType="INTEGER"/>
+        <result column="create_at" property="create_at" jdbcType="VARCHAR"/>
+        <result column="create_user" property="create_user" jdbcType="VARCHAR"/>
+
     </resultMap>
     <!--获取所有数据-->
 
-    <select id="getAll" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
+    <select id="getAll" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumQuery">
         select
         *
         from college_curriculum_core
         where sys_type = 'YueSuo'
-        order by id desc
+        <if test="c_name != null and c_name != ''">
+            and c_name like "%"#{c_name,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="c_type != null and c_type != ''">
+            and c_type = #{c_type,jdbcType=VARCHAR}
+        </if>
+        <if test="c_step != null and c_step != ''">
+            and c_step = #{c_step,jdbcType=INTEGER}
+        </if>
+        order by c_type desc, c_seq asc,id asc
     </select>
 
 
@@ -230,7 +242,13 @@
                 negative,
             </if>
             <if test="isbooking != null">
-                isbooking
+                isbooking,
+            </if>
+            <if test="create_at != null">
+                create_at,
+            </if>
+            <if test="create_user != null">
+                create_user
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -301,7 +319,13 @@
                 #{negative,jdbcType=INTEGER},
             </if>
             <if test="isbooking != null">
-                #{isbooking,jdbcType=INTEGER}
+                #{isbooking,jdbcType=INTEGER},
+            </if>
+            <if test="create_at != null">
+                #{create_at,jdbcType=VARCHAR},
+            </if>
+            <if test="create_user != null">
+                #{create_user,jdbcType=VARCHAR}
             </if>
         </trim>
     </insert>
@@ -396,7 +420,13 @@
                 negative = #{negative,jdbcType=INTEGER},
             </if>
             <if test="isbooking != null">
-                isbooking = #{isbooking,jdbcType=INTEGER}
+                isbooking = #{isbooking,jdbcType=INTEGER},
+            </if>
+            <if test="create_at != null">
+                create_at = #{create_at,jdbcType=VARCHAR},
+            </if>
+            <if test="create_user != null">
+                create_user = #{create_user,jdbcType=VARCHAR}
             </if>
         </set>
         where id = #{id,jdbcType=INTEGER}
@@ -458,5 +488,22 @@
         order by id desc
     </select>
 
+    <select id="getCoreSeq" resultType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
+        select
+        *
+        from college_curriculum_core
+        where sys_type = 'YueSuo'
+        order by id desc limit 1
+    </select>
+
+    <select id="checkRep" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.college.CollegeCurriculumCore">
+        select
+        count(1)
+        from college_curriculum_core
+        where sys_type = 'YueSuo'
+        and c_type = #{c_type,jdbcType=VARCHAR}
+        and c_step = #{c_step,jdbcType=INTEGER}
+    </select>
+
 
 </mapper>

+ 10 - 0
src/main/resources/mybatis/mapper/college/CollegePresentScholarshipsMapper.xml

@@ -7,6 +7,7 @@
         <result column="name" property="name" jdbcType="VARCHAR"/>
         <result column="level" property="level" jdbcType="INTEGER"/>
         <result column="type" property="type" jdbcType="INTEGER"/>
+        <result column="desc" property="desc" jdbcType="VARCHAR"/>
         <result column="coupon_id" property="coupon_id" jdbcType="INTEGER"/>
         <result column="scholarships" property="scholarships" jdbcType="INTEGER"/>
         <result column="list_img_href" property="list_img_href" jdbcType="VARCHAR"/>
@@ -49,6 +50,9 @@
             <if test="type != null">
                 `type`,
             </if>
+            <if test="desc != null">
+                `desc`,
+            </if>
             <if test="coupon_id != null">
                 coupon_id,
             </if>
@@ -81,6 +85,9 @@
             <if test="type != null">
                 #{type,jdbcType=INTEGER},
             </if>
+            <if test="desc != null">
+                #{desc,jdbcType=VARCHAR},
+            </if>
             <if test="coupon_id != null">
                 #{coupon_id,jdbcType=INTEGER},
             </if>
@@ -117,6 +124,9 @@
             <if test="type != null">
                 `type` = #{type,jdbcType=INTEGER},
             </if>
+            <if test="desc != null">
+                `desc` = #{desc,jdbcType=VARCHAR},
+            </if>
             <if test="coupon_id != null">
                 coupon_id = #{coupon_id,jdbcType=INTEGER},
             </if>

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

@@ -5,11 +5,22 @@
     <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.college.CollegeUserLevel">
         <id column="id" property="id" jdbcType="INTEGER"/>
         <result column="level" property="level" jdbcType="INTEGER"/>
+        <result column="desc" property="desc" jdbcType="VARCHAR"/>
         <result column="start" property="start" jdbcType="INTEGER"/>
         <result column="end" property="end" jdbcType="INTEGER"/>
     </resultMap>
     <!--获取所有数据-->
 
+    <select id="getUserLevelDesc" resultType="com.ygj.yuemum.domain.college.CollegeUserLevel"  parameterType="java.lang.Integer">
+        SELECT
+            *
+        FROM
+            college_user_level
+        WHERE
+             `level` = #{level,jdbcType=INTEGER}
+    </select>
+
+
     <select id="getUserLevel" resultType="com.ygj.yuemum.domain.college.CollegeUserLevel"  parameterType="java.lang.Integer">
         SELECT
             *

+ 10 - 0
src/main/resources/mybatis/mapper/global/PackagesMapper.xml

@@ -60,6 +60,16 @@
         order by p_seq asc
     </select>
 
+    <select id="getPackageListsDefault" resultType="com.ygj.yuemum.domain.global.Packages" parameterType="java.lang.String">
+        SELECT
+            *
+        FROM
+            packages
+        WHERE
+            p_show = '1'
+        AND p_branches = #{p_branches,jdbcType=VARCHAR}
+    </select>
+
     <select id="getPackageDetail" resultType="com.ygj.yuemum.domain.global.Packages"  parameterType="java.lang.String" >
         select p_name,p_days,p_amount,p_detailimg,p_detaildesc
         from packages