增加妇幼生殖VIP
This commit is contained in:
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.transaction.Transactional;
|
import jakarta.transaction.Transactional;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -214,9 +215,9 @@ public class UserVipController {
|
|||||||
ll.add(Arrays.asList(9));
|
ll.add(Arrays.asList(9));
|
||||||
ll.add(Arrays.asList(5));
|
ll.add(Arrays.asList(5));
|
||||||
ll.add(Arrays.asList(6));
|
ll.add(Arrays.asList(6));
|
||||||
|
ll.add(Arrays.asList(10));
|
||||||
ll.add(Arrays.asList(2));
|
ll.add(Arrays.asList(2));
|
||||||
ll.add(Arrays.asList(7,8));
|
ll.add(Arrays.asList(7,8));
|
||||||
ll.add(Arrays.asList(10));
|
|
||||||
}
|
}
|
||||||
List<Map<String,Object>> resList = new ArrayList<>();
|
List<Map<String,Object>> resList = new ArrayList<>();
|
||||||
for (List l : ll) {
|
for (List l : ll) {
|
||||||
@@ -325,6 +326,7 @@ public class UserVipController {
|
|||||||
ll.add(Arrays.asList(9));
|
ll.add(Arrays.asList(9));
|
||||||
ll.add(Arrays.asList(5));
|
ll.add(Arrays.asList(5));
|
||||||
ll.add(Arrays.asList(6));
|
ll.add(Arrays.asList(6));
|
||||||
|
ll.add(Arrays.asList(10));
|
||||||
ll.add(Arrays.asList(2));
|
ll.add(Arrays.asList(2));
|
||||||
ll.add(Arrays.asList(7,8));
|
ll.add(Arrays.asList(7,8));
|
||||||
List<Map<String,Object>> resList = new ArrayList<>();
|
List<Map<String,Object>> resList = new ArrayList<>();
|
||||||
@@ -359,7 +361,22 @@ public class UserVipController {
|
|||||||
@RequestMapping("/ownCourseCatalogueByVip")
|
@RequestMapping("/ownCourseCatalogueByVip")
|
||||||
public R ownCourseCatalogueByVip(@RequestBody Map<String,Object> params) {
|
public R ownCourseCatalogueByVip(@RequestBody Map<String,Object> params) {
|
||||||
UserVip userVip = userVipService.ownCourseCatalogueByVip(Integer.parseInt(params.get("courseId").toString()));
|
UserVip userVip = userVipService.ownCourseCatalogueByVip(Integer.parseInt(params.get("courseId").toString()));
|
||||||
return R.ok().put("userVip", userVip);
|
Map<String,Object> userVipInfo = new HashMap<>();
|
||||||
|
if(userVip!=null){
|
||||||
|
userVipInfo.put("id",userVip.getId());
|
||||||
|
userVipInfo.put("userId",userVip.getUserId());
|
||||||
|
userVipInfo.put("type",userVip.getType());
|
||||||
|
userVipInfo.put("startTime",userVip.getStartTime());
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
userVipInfo.put("endTime",sdf.format(userVip.getEndTime()));
|
||||||
|
userVipInfo.put("state",userVip.getState());
|
||||||
|
userVipInfo.put("delFlag",userVip.getDelFlag());
|
||||||
|
userVipInfo.put("user",userVip.getUser());
|
||||||
|
userVipInfo.put("userVipLogs",userVip.getUserVipLogs());
|
||||||
|
}else{
|
||||||
|
userVipInfo = null;
|
||||||
|
}
|
||||||
|
return R.ok().put("userVip", userVipInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//当前课程属于什么会员
|
//当前课程属于什么会员
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseMedicine;
|
||||||
|
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||||
|
|
||||||
|
public interface CourseMedicineService extends IService<CourseMedicine> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.peanut.modules.common.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.common.dao.CourseMedicineDao;
|
||||||
|
import com.peanut.modules.common.dao.CourseToMedicineDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseMedicine;
|
||||||
|
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||||
|
import com.peanut.modules.common.service.CourseMedicineService;
|
||||||
|
import com.peanut.modules.common.service.CourseToMedicineService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonCourseMedicineService")
|
||||||
|
public class CourseMedicineServiceImpl extends ServiceImpl<CourseMedicineDao, CourseMedicine> implements CourseMedicineService {
|
||||||
|
}
|
||||||
@@ -55,6 +55,8 @@ public class TrainingClassServiceImpl extends ServiceImpl<TrainingClassDao, Trai
|
|||||||
identity = "心理学vip";
|
identity = "心理学vip";
|
||||||
}else if ("9".equals(vipType)) {
|
}else if ("9".equals(vipType)) {
|
||||||
identity = "中西汇通vip";
|
identity = "中西汇通vip";
|
||||||
|
}else if ("10".equals(vipType)) {
|
||||||
|
identity = "妇幼生殖vip";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean is4569SVip(int uid) {
|
public boolean is4569SVip(int uid) {
|
||||||
if (isVipByType(4,uid)&&isVipByType(9,uid)&&isVipByType(5,uid)&&isVipByType(6,uid)){
|
if (isVipByType(4,uid)&&isVipByType(9,uid)&&isVipByType(5,uid)&&isVipByType(6,uid)&&isVipByType(10,uid)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -139,6 +139,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
|
|||||||
List<UserVip> userVipList = userVipDao.selectList(new LambdaQueryWrapper<UserVip>()
|
List<UserVip> userVipList = userVipDao.selectList(new LambdaQueryWrapper<UserVip>()
|
||||||
.eq(UserVip::getUserId, u==null?ShiroUtils.getUId():u.getId())
|
.eq(UserVip::getUserId, u==null?ShiroUtils.getUId():u.getId())
|
||||||
.eq(UserVip::getState,0));
|
.eq(UserVip::getState,0));
|
||||||
|
|
||||||
for (UserVip userVip : userVipList) {
|
for (UserVip userVip : userVipList) {
|
||||||
if (userVip.getType()==4||userVip.getType()==9||userVip.getType()==5||userVip.getType()==6||userVip.getType()==10) {
|
if (userVip.getType()==4||userVip.getType()==9||userVip.getType()==5||userVip.getType()==6||userVip.getType()==10) {
|
||||||
List<CourseToMedicine> list = courseToMedicalDao.selectList(new LambdaQueryWrapper<CourseToMedicine>()
|
List<CourseToMedicine> list = courseToMedicalDao.selectList(new LambdaQueryWrapper<CourseToMedicine>()
|
||||||
@@ -151,6 +152,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipDao, UserVip> impleme
|
|||||||
(cm.getId()==2&&userVip.getType()==5)||//针灸学
|
(cm.getId()==2&&userVip.getType()==5)||//针灸学
|
||||||
(cm.getId()==109&&userVip.getType()==10)||//妇幼生殖
|
(cm.getId()==109&&userVip.getType()==10)||//妇幼生殖
|
||||||
(cm.getId()==5&&userVip.getType()==6)){//肿瘤学
|
(cm.getId()==5&&userVip.getType()==6)){//肿瘤学
|
||||||
|
|
||||||
return userVip;
|
return userVip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ import java.io.IOException;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -602,17 +600,7 @@ public class StatisticsController {
|
|||||||
//导出vip记录明细
|
//导出vip记录明细
|
||||||
@RequestMapping("/exportUserVipLogInfo")
|
@RequestMapping("/exportUserVipLogInfo")
|
||||||
public void exportUserVipLogInfo(HttpServletResponse response, @RequestBody Map<String,Object> params){
|
public void exportUserVipLogInfo(HttpServletResponse response, @RequestBody Map<String,Object> params){
|
||||||
String dateStr = params.get("date").toString();
|
List<Map<String,Object>> maps = userVipLogService.getUserVipLogInfo(params.get("date").toString());
|
||||||
List<Map<String,Object>> maps = userVipLogService.getUserVipLogInfo(dateStr);
|
|
||||||
|
|
||||||
/* DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
||||||
LocalDate date = LocalDate.parse(params.get("date").toString(), fmt);
|
|
||||||
String date_last_date = date.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
|
||||||
|
|
||||||
List<Map<String,Object>> refundMaps = userVipLogService.getUserVipRefundInfo(date_last_date,dateStr);*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
XSSFWorkbook wb = new XSSFWorkbook();
|
XSSFWorkbook wb = new XSSFWorkbook();
|
||||||
//创建一张表
|
//创建一张表
|
||||||
Sheet sheet = wb.createSheet("vip记录明细");
|
Sheet sheet = wb.createSheet("vip记录明细");
|
||||||
@@ -638,14 +626,6 @@ public class StatisticsController {
|
|||||||
titleRow.createCell(17).setCellValue("已摊销金额");
|
titleRow.createCell(17).setCellValue("已摊销金额");
|
||||||
titleRow.createCell(18).setCellValue("当月摊销金额");
|
titleRow.createCell(18).setCellValue("当月摊销金额");
|
||||||
titleRow.createCell(19).setCellValue("剩余摊销金额");
|
titleRow.createCell(19).setCellValue("剩余摊销金额");
|
||||||
// for (Map<String,Object> map:refundMaps){
|
|
||||||
// Map<String,Object> newMap = new HashMap<>();
|
|
||||||
// newMap.put("name",map.get("name").toString());
|
|
||||||
// newMap.put("tel",map.get("tel").toString());
|
|
||||||
// newMap.put("type",map.get("type").toString());
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
//序号,默认为1
|
//序号,默认为1
|
||||||
int cell = 1;
|
int cell = 1;
|
||||||
//遍历
|
//遍历
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -221,8 +222,12 @@ public class UserCourseBuyServiceImpl extends ServiceImpl<UserCourseBuyDao, User
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CellType cellTypeEnum = cell.getCellTypeEnum();
|
CellType cellTypeEnum = cell.getCellTypeEnum();
|
||||||
// if(cellTypeEnum==CellType.NUMERIC){
|
String phone = cell.toString().trim();
|
||||||
String phone = cell.toString();
|
if(cellTypeEnum==CellType.NUMERIC){
|
||||||
|
BigInteger bigInteger = BigInteger.valueOf((long) cell.getNumericCellValue());
|
||||||
|
phone = bigInteger.toString();
|
||||||
|
}
|
||||||
|
|
||||||
MyUserEntity myUserEntity = userDao.selectOne(new LambdaQueryWrapper<MyUserEntity>().select(MyUserEntity::getId,MyUserEntity::getName,MyUserEntity::getTel).eq(MyUserEntity::getTel, phone));
|
MyUserEntity myUserEntity = userDao.selectOne(new LambdaQueryWrapper<MyUserEntity>().select(MyUserEntity::getId,MyUserEntity::getName,MyUserEntity::getTel).eq(MyUserEntity::getTel, phone));
|
||||||
if(myUserEntity!=null){
|
if(myUserEntity!=null){
|
||||||
has.add(myUserEntity);
|
has.add(myUserEntity);
|
||||||
@@ -232,7 +237,6 @@ public class UserCourseBuyServiceImpl extends ServiceImpl<UserCourseBuyDao, User
|
|||||||
stringStringHashMap.put("phone",phone);
|
stringStringHashMap.put("phone",phone);
|
||||||
nohas.add(stringStringHashMap);
|
nohas.add(stringStringHashMap);
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
stringArrayListMap.put("has",has);
|
stringArrayListMap.put("has",has);
|
||||||
stringArrayListMap.put("no",nohas);
|
stringArrayListMap.put("no",nohas);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.peanut.modules.sociology.service.impl;
|
package com.peanut.modules.sociology.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
@@ -10,9 +11,12 @@ import com.peanut.common.utils.ShiroUtils;
|
|||||||
import com.peanut.modules.book.service.ShopProductService;
|
import com.peanut.modules.book.service.ShopProductService;
|
||||||
import com.peanut.modules.common.dao.*;
|
import com.peanut.modules.common.dao.*;
|
||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
|
import com.peanut.modules.common.service.CourseMedicineService;
|
||||||
|
import com.peanut.modules.common.service.CourseToMedicineService;
|
||||||
import com.peanut.modules.common.service.MyUserService;
|
import com.peanut.modules.common.service.MyUserService;
|
||||||
import com.peanut.modules.common.service.UserVipService;
|
import com.peanut.modules.common.service.UserVipService;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
|
import com.peanut.modules.master.service.CourseMedicalService;
|
||||||
import com.peanut.modules.sociology.service.CourseService;
|
import com.peanut.modules.sociology.service.CourseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -52,6 +56,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
private UserVipDao userVipDao;
|
private UserVipDao userVipDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCourseBuyLogDao userCourseBuyLogDao;
|
private UserCourseBuyLogDao userCourseBuyLogDao;
|
||||||
|
@Autowired
|
||||||
|
private CourseToMedicineService courseToMedicineService;
|
||||||
|
@Autowired
|
||||||
|
private CourseMedicineService courseMedicineService;
|
||||||
|
|
||||||
|
|
||||||
//根据标签获取课程列表
|
//根据标签获取课程列表
|
||||||
@@ -117,7 +125,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||||
return courseEntityPage;
|
return courseEntityPage;
|
||||||
}
|
}
|
||||||
|
public CourseMedicine getCourseMedicinePid(int medicineId){
|
||||||
|
CourseMedicine courseMedicine = courseMedicineService.getById(medicineId);
|
||||||
|
if(courseMedicine.getPid()==0){
|
||||||
|
return courseMedicine;
|
||||||
|
}else{
|
||||||
|
return getCourseMedicinePid(courseMedicine.getPid());
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getCourseDetail(Integer id) {
|
public Map<String, Object> getCourseDetail(Integer id) {
|
||||||
Map<String, Object> flag = new HashMap<>();
|
Map<String, Object> flag = new HashMap<>();
|
||||||
@@ -163,6 +178,26 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QueryWrapper<CourseToMedicine> courseToMedicineWrapper = new QueryWrapper<CourseToMedicine>();
|
||||||
|
courseToMedicineWrapper.eq("course_id",course.getId());
|
||||||
|
List<CourseToMedicine> courseToMedicineList = courseToMedicineService.list(courseToMedicineWrapper);
|
||||||
|
String content = course.getContent();
|
||||||
|
List<Integer> medicinePids = new ArrayList<>();
|
||||||
|
for (CourseToMedicine courseToMedicine:courseToMedicineList){
|
||||||
|
CourseMedicine courseMedicine = getCourseMedicinePid(courseToMedicine.getMedicalId());
|
||||||
|
if(medicinePids.contains(courseMedicine.getId())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(courseMedicine!=null && courseMedicine.getId()==1){
|
||||||
|
content = content+"<img src=\"https://ehh-public-01.oss-cn-beijing.aliyuncs.com/image/zhong-yi-xue-ke-cheng-biao.jpg\"/>";
|
||||||
|
}else if(courseMedicine!=null && courseMedicine.getId()==74){
|
||||||
|
content = content+"<img src=\"https://ehh-public-01.oss-cn-beijing.aliyuncs.com/image/hui-tong-ke-cheng-biao.jpg\"/>";
|
||||||
|
}
|
||||||
|
if(courseMedicine!=null){
|
||||||
|
medicinePids.add(courseMedicine.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
course.setContent(content);
|
||||||
flag.put("course",course);
|
flag.put("course",course);
|
||||||
//课程关联商品
|
//课程关联商品
|
||||||
if (StringUtils.isNotEmpty(course.getRelationProductIds())){
|
if (StringUtils.isNotEmpty(course.getRelationProductIds())){
|
||||||
|
|||||||
Reference in New Issue
Block a user