...
 
Commits (12)
......@@ -73,11 +73,12 @@
<artifactId>weixin-java-miniapp</artifactId>
</dependency>
<!--千帆 智能对话-->
<!--文心一言-->
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
<version>4.12.0</version>
</dependency>
<!-- <dependency>-->
......
......@@ -4,14 +4,18 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.mall.domain.Bo.MallSchoolExcelBo;
import com.ruoyi.mall.domain.Bo.MallTestSchoolRecordBo;
import com.ruoyi.mall.domain.MallSchool;
import com.ruoyi.mall.service.IMallSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -109,5 +113,16 @@ public class MallSchoolController extends BaseController
return mallSchoolService.submitSchoolUser(mallSchool);
}
/**
* 导入学校录取数据列表
*/
@Log(title = "导入学校录取数据列表", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<MallSchoolExcelBo> util = new ExcelUtil<MallSchoolExcelBo>(MallSchoolExcelBo.class);
List<MallSchoolExcelBo> list = util.importExcel(file.getInputStream());
return AjaxResult.success(mallSchoolService.importTestSchoolRecord(list, updateSupport));
}
}
......@@ -6,30 +6,22 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.mall.domain.*;
import com.ruoyi.mall.domain.Bo.CheckOutReportBo;
import com.ruoyi.mall.domain.Bo.CheckingOutParamBo;
import com.ruoyi.mall.domain.MallMemberUser;
import com.ruoyi.mall.domain.MemberReportIntelligence;
import com.ruoyi.mall.domain.ReportDraft;
import com.ruoyi.mall.domain.ReportIntelligence;
import com.ruoyi.mall.domain.Vo.*;
import com.ruoyi.mall.mapper.MallAcceptPlanMapper;
import com.ruoyi.mall.mapper.MallAcceptRateSettingMapper;
import com.ruoyi.mall.mapper.MallMemberUserMapper;
import com.ruoyi.mall.mapper.MallSchoolTagMapper;
import com.ruoyi.mall.service.*;
import com.ruoyi.mall.service.impl.MallCountMethodServiceImpl;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**志愿填报 自主选择*/
......@@ -136,7 +128,7 @@ public class ApiCheckingOutController {
new Thread(new Runnable() {
@Override
public void run() {
mallMemberUserService.updateRate(mallMemberUser.getId(), mallMemberUser.getCultureScore(), mallMemberUser.getMajorScore());
mallMemberUserService.updateRate(mallMemberUser.getId(), mallMemberUser.getCultureScore(), mallMemberUser.getMajorScore(), mallMemberUser.getSubjectType());
}
}).start();
}
......
......@@ -506,8 +506,8 @@ public class ApiMemberController {
if (params.containsKey("userId") && StringUtils.isNotBlank(params.get("userId").toString())) {
long userId = Long.parseLong(params.get("userId").toString());
MallMemberUser mallMemberUser = memberUserService.selectMallMemberUserById(userId);
if (mallMemberUser != null && mallMemberUser.getIndexUserId() != 0 && mallMemberUser.getIndexUserId() != null) {
MallMemberUser topUser = memberUserService.selectMallMemberUserById(mallMemberUser.getIndexUserId());
if (mallMemberUser != null && (mallMemberUser.getIntroUser() != null && mallMemberUser.getIntroUser() != 0) || (mallMemberUser.getIndexUserId() != null && mallMemberUser.getIndexUserId() > 0)) {
MallMemberUser topUser = memberUserService.selectMallMemberUserById(mallMemberUser.getIntroUser() != null ? mallMemberUser.getIntroUser() : mallMemberUser.getIndexUserId());
if (topUser != null && topUser.getIndexPrice().compareTo(new BigDecimal(0)) > 0) {
userPrice = String.valueOf(topUser.getIndexPrice());
}
......
......@@ -7,9 +7,9 @@ spring:
# 主库数据源
master:
# 本地数据源
# url: jdbc:mysql://rm-hp3340490n5mw72tcto.mysql.huhehaote.rds.aliyuncs.com:3306/yikaozhiyuan_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
# username: yikaozhiyuan
# password: KxappNYy7dQUzuterEncvBt@Pf
# url: jdbc:mysql://localhost:3306/yikaozhiyuan_20250623?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
# username: root
# password: 123456
# 正式数据源
url: jdbc:mysql://bj-cynosdbmysql-grp-oppabofo.sql.tencentcdb.com:29687/yikaozhiyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
......
......@@ -142,3 +142,7 @@ qiNiu:
secretKey: tWJjsaYPBBACuyw8CfaF9h2BRUziuje_zwrz4GyE
bucketName: xiaoniu666666
baseUrl: https://image.xnszz.com/
baidu:
appId: 3c3927bd-2722-41eb-8363-7539177f4914
appKey: bce-v3/ALTAK-ZqT2bHLCdP4vVlnMk0d0s/67e7275c383eb772c85bffb939158f19e112f49f
\ No newline at end of file
......@@ -52,7 +52,7 @@ public class ImgUpload {
if (StringUtils.isBlank(path)) {
path = "IMG";
}
return auth.uploadToken(bucketname, null, 3600, new StringMap().put("saveKey", path + "$(etag)$(ext)"));
return auth.uploadToken(bucketname, null, 3600, new StringMap().put("saveKey", "$(etag)$(ext)" + path));
}
public String upload(byte[] data, String fileType) throws IOException {
......
......@@ -178,35 +178,35 @@ public class RandomUtil extends Random {
super(seed);
}
public int[] nextInt(int n, int size) {
if (size > n) {
size = n;
}
Set set = new LinkedHashSet();
for (int i = 0; i < size; i++) {
while (true) {
Integer value = new Integer(nextInt(n));
if (!set.contains(value)) {
set.add(value);
break;
}
}
}
int[] array = new int[set.size()];
Iterator itr = set.iterator();
for (int i = 0; i < array.length; i++) {
array[i] = ((Integer)itr.next()).intValue();
}
return array;
}
// public int[] nextInt(int n, int size) {
// if (size > n) {
// size = n;
// }
//
// Set set = new LinkedHashSet();
//
// for (int i = 0; i < size; i++) {
// while (true) {
// Integer value = new Integer(nextInt(n));
//
// if (!set.contains(value)) {
// set.add(value);
//
// break;
// }
// }
// }
//
// int[] array = new int[set.size()];
//
// Iterator itr = set.iterator();
//
// for (int i = 0; i < array.length; i++) {
// array[i] = (Integer) itr.next();
// }
//
// return array;
// }
public void randomize(char[] array) {
int length = array.length;
......
package com.ruoyi.common.weixin.utils;
import cn.hutool.core.util.IdUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.redis.RedisCache;
......@@ -13,7 +14,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.BufferedInputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
......@@ -140,13 +140,13 @@ public class WeiXinUtils {
* @return 图片链接
*/
public String getQRCode(Long memberUserId, String key){
String qrCodeUrl = "";
String resultUrl = "";
try {
//获取token
String accessToken = this.getAccessToken();
String codeUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token="+ accessToken;
String path = weiXinConfig.getWxPath()+memberUserId;
//post参数
String path = weiXinConfig.getWxPath()+memberUserId;
JSONObject jsonObject = new JSONObject();
jsonObject.put("path", path);
Map<String, Object> lineColor = new HashMap<>();
......@@ -172,14 +172,54 @@ public class WeiXinUtils {
//获取数据
BufferedInputStream bis = new BufferedInputStream(httpUrlConnection.getInputStream());
//文件上传,返回小程序码url
qrCodeUrl = new ImgUpload().streamUpload(bis, key);
resultUrl = new ImgUpload().streamUpload(bis, IdUtil.getSnowflakeNextIdStr()+"_"+key);
} catch (Exception e) {
e.printStackTrace();
}
return qrCodeUrl;
return resultUrl;
}
// public String getQRCode(Long memberUserId, String key){
// String qrCodeUrl = "";
// try {
// //获取token
// String accessToken = this.getAccessToken();
// String codeUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+ accessToken;
// String path = weiXinConfig.getWxPath()+memberUserId;
// //post参数
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("path", path);
// Map<String, Object> lineColor = new HashMap<>();
// lineColor.put("r", 4);
// lineColor.put("g", 157);
// lineColor.put("b", 150);
// jsonObject.put("line_color", lineColor);
// String env_version = "release";// 正式版为 "release",体验版为 "trial",开发版为 "develop"
// jsonObject.put("env_version", env_version);
// String params = jsonObject.toString();
//
// URL url = new URL(codeUrl);
// HttpURLConnection httpUrlConnection = (HttpURLConnection) url.openConnection();
// // 提交模式
// httpUrlConnection.setRequestMethod("POST");
// // 发送POST请求必须设置如下两行
// httpUrlConnection.setDoOutput(true);
// httpUrlConnection.setDoInput(true);
// // 获取URLConnection对象对应的输出流
// PrintWriter printWriter = new PrintWriter(httpUrlConnection.getOutputStream());
// printWriter.write(params);
// printWriter.flush();
// //获取数据
// BufferedInputStream bis = new BufferedInputStream(httpUrlConnection.getInputStream());
// //文件上传,返回小程序码url
// qrCodeUrl = new ImgUpload().streamUpload(bis, key);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// return qrCodeUrl;
// }
/**
* 获取不限制的小程序码
*
......
......@@ -22,7 +22,13 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
package com.ruoyi.mall.domain.Bo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Arrays;
/**
* 学校对象 mall_school
*
* @author lsm
* @date 2023-10-18
*/
public class MallSchoolExcelBo
{
private static final long serialVersionUID = 1L;
@Excel(name = "批次")
private String batchName;
@Excel(name = "院校代码")
private String schoolNumber;
@Excel(name = "院校名称")
private String schoolName;
@Excel(name = "专业")
private String majorName;
@Excel(name = "一级专业分类")
private String majorName1;
@Excel(name = "二级专业分类")
private String majorName2;
@Excel(name = "招生计划人数")
private String acceptNum;
@Excel(name = "录取原则")
private String ruleStr;
@Excel(name = "参考分")
private String reference;
@Excel(name = "录取最低分")
private String acceptLowest;
@Excel(name = "录取前提")
private String acceptPremise;
@Excel(name = "年份")
private String acceptYear;
@Excel(name = "文化分数线")
private String cultureLowest;
@Excel(name = "联考分数线")
private String majorLowest;
@Excel(name = "学科",readConverterExp = "0=文科,1=理科")
private String subjectType;
@Excel(name = "学费")
private String schoolPrice;
public String getBatchName() {
return batchName;
}
public void setBatchName(String batchName) {
this.batchName = batchName;
}
public String getSchoolNumber() {
return schoolNumber;
}
public void setSchoolNumber(String schoolNumber) {
this.schoolNumber = schoolNumber;
}
public String getSchoolName() {
return schoolName;
}
public void setSchoolName(String schoolName) {
this.schoolName = schoolName;
}
public String getMajorName() {
return majorName;
}
public void setMajorName(String majorName) {
this.majorName = majorName;
}
public String getMajorName1() {
return majorName1;
}
public void setMajorName1(String majorName1) {
this.majorName1 = majorName1;
}
public String getMajorName2() {
return majorName2;
}
public void setMajorName2(String majorName2) {
this.majorName2 = majorName2;
}
public String getAcceptNum() {
return acceptNum;
}
public void setAcceptNum(String acceptNum) {
this.acceptNum = acceptNum;
}
public String getRuleStr() {
return ruleStr;
}
public void setRuleStr(String ruleStr) {
this.ruleStr = ruleStr;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getAcceptLowest() {
return acceptLowest;
}
public void setAcceptLowest(String acceptLowest) {
this.acceptLowest = acceptLowest;
}
public String getAcceptPremise() {
return acceptPremise;
}
public void setAcceptPremise(String acceptPremise) {
this.acceptPremise = acceptPremise;
}
public String getAcceptYear() {
return acceptYear;
}
public void setAcceptYear(String acceptYear) {
this.acceptYear = acceptYear;
}
public String getCultureLowest() {
return cultureLowest;
}
public void setCultureLowest(String cultureLowest) {
this.cultureLowest = cultureLowest;
}
public String getMajorLowest() {
return majorLowest;
}
public void setMajorLowest(String majorLowest) {
this.majorLowest = majorLowest;
}
public String getSubjectType() {
return subjectType;
}
public void setSubjectType(String subjectType) {
this.subjectType = subjectType;
}
public String getSchoolPrice() {
return schoolPrice;
}
public void setSchoolPrice(String schoolPrice) {
this.schoolPrice = schoolPrice;
}
@Override
public String toString() {
return "MallSchoolExcelBo{" +
"batchName='" + batchName + '\'' +
", schoolNumber='" + schoolNumber + '\'' +
", schoolName='" + schoolName + '\'' +
", majorName='" + majorName + '\'' +
", majorName1='" + majorName1 + '\'' +
", majorName2='" + majorName2 + '\'' +
", acceptNum='" + acceptNum + '\'' +
", ruleStr='" + ruleStr + '\'' +
", reference='" + reference + '\'' +
", acceptLowest='" + acceptLowest + '\'' +
", acceptPremise='" + acceptPremise + '\'' +
", acceptYear='" + acceptYear + '\'' +
", cultureLowest='" + cultureLowest + '\'' +
", majorLowest='" + majorLowest + '\'' +
", subjectType='" + subjectType + '\'' +
", schoolPrice='" + schoolPrice + '\'' +
'}';
}
}
package com.ruoyi.mall.domain.Bo;
import com.ruoyi.common.annotation.Excel;
import sun.awt.image.PixelConverter;
import java.io.Serializable;
import java.math.BigDecimal;
......
......@@ -21,11 +21,9 @@ public class SchoolMajorLinkBO {
@Excel(name = "专业名称")
private String majorName;
@Excel(name="批次")
@Excel(name = "批次")
private String batchName;
@Excel(name = "专业一级分类")
private String parentMajorClass;
......@@ -40,14 +38,6 @@ public class SchoolMajorLinkBO {
this.linkId = linkId;
}
public String getBatchName() {
return batchName;
}
public void setBatchName(String batchName) {
this.batchName = batchName;
}
public String getSchoolName() {
return schoolName;
}
......@@ -64,6 +54,14 @@ public class SchoolMajorLinkBO {
this.majorName = majorName;
}
public String getBatchName() {
return batchName;
}
public void setBatchName(String batchName) {
this.batchName = batchName;
}
public String getParentMajorClass() {
return parentMajorClass;
}
......
......@@ -30,9 +30,15 @@ public class ZhuankeBO implements Serializable {
@Excel(name = "录取原则")
private String ruleStr;
@Excel(name = "23年录取最低分")
@Excel(name="参考分")
private BigDecimal reference;
@Excel(name = "录取最低分")
private BigDecimal acceptLowest;
@Excel(name = "年份")
private String acceptYear;
@Excel(name = "学科")
private String subjectType;
......@@ -88,12 +94,12 @@ public class ZhuankeBO implements Serializable {
this.ruleStr = ruleStr;
}
public String getSubjectType() {
return subjectType;
public BigDecimal getReference() {
return reference;
}
public void setSubjectType(String subjectType) {
this.subjectType = subjectType;
public void setReference(BigDecimal reference) {
this.reference = reference;
}
public BigDecimal getAcceptLowest() {
......@@ -104,6 +110,22 @@ public class ZhuankeBO implements Serializable {
this.acceptLowest = acceptLowest;
}
public String getAcceptYear() {
return acceptYear;
}
public void setAcceptYear(String acceptYear) {
this.acceptYear = acceptYear;
}
public String getSubjectType() {
return subjectType;
}
public void setSubjectType(String subjectType) {
this.subjectType = subjectType;
}
public BigDecimal getPrice() {
return price;
}
......
package com.ruoyi.mall.domain.Chat;
import lombok.Data;
/**
* 请求体 用于请求百度千帆
*/
public class BaiduAppRequest {
private String app_id;
private String query;
private boolean stream;
private String conversation_id;
public BaiduAppRequest(String app_id, String query, String conversation_id) {
this.app_id = app_id;
this.query = query;
this.conversation_id = conversation_id;
}
public String getApp_id() {
return app_id;
}
public void setApp_id(String app_id) {
this.app_id = app_id;
}
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
public boolean isStream() {
return stream;
}
public void setStream(boolean stream) {
this.stream = stream;
}
public String getConversation_id() {
return conversation_id;
}
public void setConversation_id(String conversation_id) {
this.conversation_id = conversation_id;
}
@Override
public String toString() {
return "BaiduAppRequest{" +
"app_id='" + app_id + '\'' +
", query='" + query + '\'' +
", stream=" + stream +
", conversation_id='" + conversation_id + '\'' +
'}';
}
}
package com.ruoyi.mall.domain.Chat;
import lombok.Data;
import java.util.List;
/**
* 响应体 接收消息用
*/
public class BaiduAppResponse {
private String request_id;
private String date;
private String answer;
private String conversation_id;
private String message_id;
private Boolean is_completion;
private List<Object> content;
public String getRequest_id() {
return request_id;
}
public void setRequest_id(String request_id) {
this.request_id = request_id;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getConversation_id() {
return conversation_id;
}
public void setConversation_id(String conversation_id) {
this.conversation_id = conversation_id;
}
public String getMessage_id() {
return message_id;
}
public void setMessage_id(String message_id) {
this.message_id = message_id;
}
public Boolean getIs_completion() {
return is_completion;
}
public void setIs_completion(Boolean is_completion) {
this.is_completion = is_completion;
}
public List<Object> getContent() {
return content;
}
public void setContent(List<Object> content) {
this.content = content;
}
@Override
public String toString() {
return "BaiduAppResponse{" +
"request_id='" + request_id + '\'' +
", date='" + date + '\'' +
", answer='" + answer + '\'' +
", conversation_id='" + conversation_id + '\'' +
", message_id='" + message_id + '\'' +
", is_completion=" + is_completion +
", content=" + content +
'}';
}
}
......@@ -21,7 +21,7 @@ public class MallSchool extends BaseEntity
private static final long serialVersionUID = 1L;
/** 学校主键ID */
@Excel(name = "学校主键ID")
// @Excel(name = "学校主键ID")
private Long schoolId;
/** 学校名 */
......@@ -47,6 +47,13 @@ public class MallSchool extends BaseEntity
@Excel(name = "学校编号")
private String schoolNumber;
/** 办学层次id */
private Long configLevelId;
/** 办学层次 */
@Excel(name = "办学层次")
private String configLevelName;
/** 学校类型ID */
// @Excel(name = "学校类型ID")
private Long configTypeId;
......@@ -56,7 +63,7 @@ public class MallSchool extends BaseEntity
private String configTypeName;
/** 办学机构:0-公办,1-民办,3-中外合作办学,4其他 */
// @Excel(name = "办学机构:0-公办,1-民办,3-中外合作办学,4其他")
@Excel(name = "办学机构", readConverterExp = "0=公办,1=民办,3=中外合作办学,4=其他")
private String schoolInstitution;
/** 主管部门(教育部、各地市) */
......@@ -186,11 +193,6 @@ public class MallSchool extends BaseEntity
/** 批次id数组 */
private Long[] batchList;
/** 办学层次id */
private Long configLevelId;
/** 办学层次 */
private String configLevelName;
/** 推荐度id */
private Long suggestId;
......
......@@ -13,6 +13,9 @@ public class SchoolMajorAcceptRecordVO implements Serializable {
/** 专业录取数据id */
private Long schoolAcceptId;
/** 专业代码 */
private String majorCode;
/** 专业名称 */
private String majorName;
......@@ -49,54 +52,6 @@ public class SchoolMajorAcceptRecordVO implements Serializable {
/** 录取率 */
private String acceptRate;
public String getAcceptRate() {
return acceptRate;
}
public void setAcceptRate(String acceptRate) {
this.acceptRate = acceptRate;
}
public Long getLinkId() {
return linkId;
}
public void setLinkId(Long linkId) {
this.linkId = linkId;
}
public Long getSchoolId() {
return schoolId;
}
public void setSchoolId(Long schoolId) {
this.schoolId = schoolId;
}
public BigDecimal getReference() {
return reference;
}
public void setReference(BigDecimal reference) {
this.reference = reference;
}
public Integer getIsReference() {
return isReference;
}
public void setIsReference(Integer isReference) {
this.isReference = isReference;
}
public String getMajorGroup() {
return majorGroup;
}
public void setMajorGroup(String majorGroup) {
this.majorGroup = majorGroup;
}
public Long getSchoolAcceptId() {
return schoolAcceptId;
}
......@@ -105,6 +60,14 @@ public class SchoolMajorAcceptRecordVO implements Serializable {
this.schoolAcceptId = schoolAcceptId;
}
public String getMajorCode() {
return majorCode;
}
public void setMajorCode(String majorCode) {
this.majorCode = majorCode;
}
public String getMajorName() {
return majorName;
}
......@@ -153,16 +116,71 @@ public class SchoolMajorAcceptRecordVO implements Serializable {
this.acceptRuleStr = acceptRuleStr;
}
public String getMajorGroup() {
return majorGroup;
}
public void setMajorGroup(String majorGroup) {
this.majorGroup = majorGroup;
}
public BigDecimal getReference() {
return reference;
}
public void setReference(BigDecimal reference) {
this.reference = reference;
}
public Integer getIsReference() {
return isReference;
}
public void setIsReference(Integer isReference) {
this.isReference = isReference;
}
public Long getSchoolId() {
return schoolId;
}
public void setSchoolId(Long schoolId) {
this.schoolId = schoolId;
}
public Long getLinkId() {
return linkId;
}
public void setLinkId(Long linkId) {
this.linkId = linkId;
}
public String getAcceptRate() {
return acceptRate;
}
public void setAcceptRate(String acceptRate) {
this.acceptRate = acceptRate;
}
@Override
public String toString() {
return "SchoolMajorAcceptRecordVO{" +
"schoolAcceptId=" + schoolAcceptId +
", majorCode='" + majorCode + '\'' +
", majorName='" + majorName + '\'' +
", acceptNum=" + acceptNum +
", acceptLowest=" + acceptLowest +
", acceptYear='" + acceptYear + '\'' +
", acceptRuleId=" + acceptRuleId +
", acceptRuleStr='" + acceptRuleStr + '\'' +
", majorGroup='" + majorGroup + '\'' +
", reference=" + reference +
", isReference=" + isReference +
", schoolId=" + schoolId +
", linkId=" + linkId +
", acceptRate='" + acceptRate + '\'' +
'}';
}
}
......@@ -48,7 +48,7 @@ public interface MallAcceptPlanMapper
public String selectMaxYear();
public MallAcceptPlan selectPlan(@Param("schoolId")Long schoolId,
public List<MallAcceptPlan> selectPlan(@Param("schoolId")Long schoolId,
@Param("batchId")Long batchId,
@Param("planYear")String planYear,
@Param("subjectType")Integer subjectType,
......@@ -159,4 +159,5 @@ public interface MallAcceptPlanMapper
* @return
*/
public int batchUpdate(@Param("list")List<MallAcceptPlan> list);
public int insertByList(@Param("list")List<MallAcceptPlan> list);
}
......@@ -30,6 +30,13 @@ public interface MallAcceptRuleMapper
*/
public MallAcceptRule selectMallAcceptRuleByAcceptRuleStr(@Param("ruleStr")String ruleStr);
/**
* 录取字符串查询
* @param ruleStr 字符串
* @return
*/
public List<MallAcceptRule> selectMallAcceptRuleByAcceptRuleStr2(@Param("ruleStr")String ruleStr);
/**
* 录取原则
* @return
......
......@@ -32,7 +32,7 @@ public interface MallSchoolAcceptMapper
* @return
*/
public MallSchoolAccept selectBySchoolIdAndLinkId(@Param("schoolId")Long schoolId,
public List<MallSchoolAccept> selectBySchoolIdAndLinkId(@Param("schoolId")Long schoolId,
@Param("batchId")Long batchId,
@Param("linkId")Long linkId,
@Param("acceptYear")String acceptYear,
......@@ -77,6 +77,7 @@ public interface MallSchoolAcceptMapper
* @return 结果
*/
public int deleteMallSchoolAcceptBySchoolAcceptIds(Long[] schoolAcceptIds);
public int insertByList(List<MallSchoolAccept> schoolAcceptIds);
/**
* 专业查询近三年录取记录
......
......@@ -23,6 +23,7 @@ public interface MallSchoolLevelMapper
public MallSchoolLevel selectMallSchoolLevelBySchoolId(@Param("schoolId") Long schoolId);
public List<MallSchoolLevel> selectMallSchoolLevelBySchoolIds(@Param("schoolId") List<Long> schoolIds);
/**
* 查询学校办学层次列表
......
......@@ -160,6 +160,7 @@ public interface MallSchoolMapper
/**志愿自主选择 获取学校信息*/
List<SchoolMajorVO> schoolListInfoForReport(@Param("sIds") List<Long> sIds);
public List<MallSchool> selectAllSchoolNames(@Param("schoolNames")List<String> schoolNames);
/**
* 志愿自主选择 ,分页查询
......@@ -320,6 +321,7 @@ public interface MallSchoolMapper
*/
public List<Long> selectAllSchoolIds(@Param("batchId")Long batchId);
/**
* 招生稳定学校
* @param batchId
......
......@@ -57,7 +57,7 @@ public interface IMallMemberUserService
public int deleteMallMemberUserByIds(Long[] ids);
public void updateRate(Long userId, Integer cultureScore, Integer majorScore);
public void updateRate(Long userId, Integer cultureScore, Integer majorScore, String subjectType);
/**
* 删除用户会员信息
......
......@@ -4,6 +4,7 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.domain.Bo.CheckingOutParamBo;
import com.ruoyi.mall.domain.Bo.MallSchoolExcelBo;
import com.ruoyi.mall.domain.Bo.MatchSchoolBO;
import com.ruoyi.mall.domain.MallSchool;
import com.ruoyi.mall.domain.MallSchoolBatchLink;
......@@ -342,4 +343,6 @@ public interface IMallSchoolService
*/
public MallSchool selectMallSchoolBySysUserId(Long sysUserId);
String importTestSchoolRecord(List<MallSchoolExcelBo> list, boolean updateSupport);
}
package com.ruoyi.mall.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.domain.BusinessBulletin;
import com.ruoyi.mall.domain.Vo.BusinessBulletinResponse;
import com.ruoyi.mall.domain.Vo.BusinessBulletinVo;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.BusinessBulletinMapper;
import com.ruoyi.mall.domain.BusinessBulletin;
import com.ruoyi.mall.service.IBusinessBulletinService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 公告Service业务层处理
*
*
* @author ruoyi
* @date 2023-10-25
*/
@Service
public class BusinessBulletinServiceImpl implements IBusinessBulletinService
public class BusinessBulletinServiceImpl implements IBusinessBulletinService
{
@Resource
private BusinessBulletinMapper businessBulletinMapper;
......@@ -57,7 +53,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
}
/**
* 查询公告
*
*
* @param bulletinId 公告主键
* @return 公告
*/
......@@ -69,7 +65,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
/**
* 查询公告列表
*
*
* @param businessBulletin 公告
* @return 公告
*/
......@@ -81,7 +77,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
/**
* 新增公告
*
*
* @param businessBulletin 公告
* @return 结果
*/
......@@ -94,7 +90,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
/**
* 修改公告
*
*
* @param businessBulletin 公告
* @return 结果
*/
......@@ -107,7 +103,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
/**
* 批量删除公告
*
*
* @param bulletinIds 需要删除的公告主键
* @return 结果
*/
......@@ -119,7 +115,7 @@ public class BusinessBulletinServiceImpl implements IBusinessBulletinService
/**
* 删除公告信息
*
*
* @param bulletinId 公告主键
* @return 结果
*/
......
......@@ -740,14 +740,32 @@ public class CheckingOutServiceImpl implements CheckingOutService {
r.put("rateType", -2);
}
}else{
// 本科
mallSchoolAccept = mallSchoolAcceptMapper.selectMinReferenceBySchoolId(s.getSchoolId(), bo.getBatchId(), subjectType);
if(ObjectUtils.isNotEmpty(mallSchoolAccept)){
r = mallCountMethodService.getAcceptRateForReport(mallSchoolAccept.getReference(), mallSchoolAccept.getAcceptRuleId(), cultureScore, majorScore);
}else{
}else {
r.put("acceptRate", 0);
r.put("rateType", -2);
}
// boolean flag = false;
// // 选科:0-文科,1-理科
// if (subjectType.equals("0") && cultureScore >= 331 && majorScore >= 193) {
// flag = true;
// }else if (subjectType.equals("1") && cultureScore >= 328 && majorScore >= 193){
// flag = true;
// }
// 本科
// mallSchoolAccept = mallSchoolAcceptMapper.selectMinReferenceBySchoolId(s.getSchoolId(), bo.getBatchId(), subjectType);
// if(flag && ObjectUtils.isNotEmpty(mallSchoolAccept)){
// r = mallCountMethodService.getAcceptRateForReport(mallSchoolAccept.getReference(), mallSchoolAccept.getAcceptRuleId(), cultureScore, majorScore);
// }else {
// r.put("acceptRate", 0);
// r.put("rateType", -2);
// }
}
......
package com.ruoyi.mall.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.mall.domain.ContrastRecord;
import com.ruoyi.mall.domain.Vo.ContrastRecordVo;
import com.ruoyi.mall.mapper.MallSchoolTagMapper;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.ContrastRecordMapper;
import com.ruoyi.mall.domain.ContrastRecord;
import com.ruoyi.mall.mapper.MallSchoolTagMapper;
import com.ruoyi.mall.service.IContrastRecordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 添加对比记录Service业务层处理
*
*
* @author ruoyi
* @date 2023-10-27
*/
@Service
public class ContrastRecordServiceImpl implements IContrastRecordService
public class ContrastRecordServiceImpl implements IContrastRecordService
{
@Resource
private ContrastRecordMapper contrastRecordMapper;
......@@ -29,7 +27,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
private MallSchoolTagMapper mallSchoolTagMapper;
/**
* 查询添加对比记录
*
*
* @param recordId 添加对比记录主键
* @return 添加对比记录
*/
......@@ -41,7 +39,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
/**
* 查询添加对比记录列表
*
*
* @param contrastRecord 添加对比记录
* @return 添加对比记录
*/
......@@ -72,7 +70,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
/**
* 新增添加对比记录
*
*
* @param contrastRecord 添加对比记录
* @return 结果
*/
......@@ -85,7 +83,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
/**
* 修改添加对比记录
*
*
* @param contrastRecord 添加对比记录
* @return 结果
*/
......@@ -98,7 +96,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
/**
* 批量删除添加对比记录
*
*
* @param recordIds 需要删除的添加对比记录主键
* @return 结果
*/
......@@ -110,7 +108,7 @@ public class ContrastRecordServiceImpl implements IContrastRecordService
/**
* 删除添加对比记录信息
*
*
* @param recordId 添加对比记录主键
* @return 结果
*/
......
package com.ruoyi.mall.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.mall.domain.*;
import com.ruoyi.mall.domain.Bo.CheckingOutParamBo;
import com.ruoyi.mall.domain.Bo.SchoolMajorLinkBO;
import com.ruoyi.mall.domain.*;
import com.ruoyi.mall.domain.Vo.MajorItemVo;
import com.ruoyi.mall.mapper.*;
import jdk.nashorn.internal.ir.IfNode;
import com.ruoyi.mall.service.IMallLinkMajorSchoolService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.service.IMallLinkMajorSchoolService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 专业与学校关联Service业务层处理
......
......@@ -141,7 +141,9 @@ public class MallMemberUserServiceImpl implements IMallMemberUserService
@Transactional(rollbackFor = Exception.class)
public int updateMallMemberUser(MallMemberUser mallMemberUser)
{
if (StringUtils.isNotBlank(mallMemberUser.getSubjectType()) && ObjectUtils.isNotEmpty(mallMemberUser.getCultureScore()) && ObjectUtils.isNotEmpty(mallMemberUser.getMajorScore())){
if (StringUtils.isNotBlank(mallMemberUser.getSubjectType())
&& null != mallMemberUser.getCultureScore()
&& null != mallMemberUser.getMajorScore()){
String newSubjectType = mallMemberUser.getSubjectType(); // 新学科
Integer newCultureScore = mallMemberUser.getCultureScore(); // 新文化分
Integer newMajorScore = mallMemberUser.getMajorScore(); // 新专业分
......@@ -161,7 +163,7 @@ public class MallMemberUserServiceImpl implements IMallMemberUserService
@Override
public void run() {
updateRate(mallMemberUser.getId(), newCultureScore, newMajorScore);
updateRate(mallMemberUser.getId(), newCultureScore, newMajorScore, newSubjectType);
}
}).start();
}
......@@ -174,7 +176,7 @@ public class MallMemberUserServiceImpl implements IMallMemberUserService
@Override
public void updateRate(Long userId, Integer cultureScore, Integer majorScore)
public void updateRate(Long userId, Integer cultureScore, Integer majorScore, String subjectType)
{
// 计算学生各种录取率下的成绩
List<MallAcceptRule> rules = acceptRuleMapper.selectNewAcceptRule();
......@@ -1046,15 +1048,15 @@ public class MallMemberUserServiceImpl implements IMallMemberUserService
sysUser.setPassword(SecurityUtils.encryptPassword(password));
sysUserMapper.updateUser(sysUser);
}
if (StringUtils.isBlank(memberUser.getIndexCode())) {
String qrCode = "";
// 小程序码
Long schoolId = memberUser.getId();
String key = schoolId + ".png";
qrCode = weiXinUtils.getSchoolQRCode(schoolId, key);
updateMemberUser.setIndexCode(qrCode);
}
/**
* 重新生成二维码
*/
String qrCode = "";
// 小程序码
Long userId = memberUser.getId();
String key = userId + ".png";
qrCode = weiXinUtils.getQRCode(userId, key);
updateMemberUser.setIndexCode(qrCode);
mallMemberUserMapper.updateMallMemberUserInfo(updateMemberUser);
return AjaxResult.success();
......
......@@ -456,7 +456,7 @@ public class MemberReportIntelligenceServiceImpl implements IMemberReportIntelli
int d = kbd.size();
//Collections.shuffle(jwt);
int remain = 35-finalCollect.size();
int remain = 64-finalCollect.size();
if(remain >= d){
finalCollect.addAll(kbd);
......@@ -549,7 +549,7 @@ public class MemberReportIntelligenceServiceImpl implements IMemberReportIntelli
}
}else{
if(c>=10){
finalCollect.addAll(targetList.subList(0,10));
finalCollect.addAll(targetList.subList(0,16));
}else{
finalCollect.addAll(targetList);
}
......
......@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectPlan" resultType="MallAcceptPlan">
<select id="selectPlan" resultType="com.ruoyi.mall.domain.MallAcceptPlan">
select accept_plan_id acceptPlanId,
school_id schoolId,
batch_id batchId,
......@@ -169,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and plan_year = #{planYear}
and subject_type = #{subjectType}
and link_id = #{linkId} and del_flag = '0'
order by create_at desc
</select>
<select id="selectSchoolPrice" parameterType="Long" resultType="MallAcceptPlan">
......@@ -411,4 +412,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<insert id="insertByList" >
INSERT INTO mall_accept_plan (
school_id,batch_id,plan_year,major_id,subject_type,accept_num,
school_price,accept_rule_id,little_score_limit,sort,
create_at,update_at,del_flag,link_id
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.schoolId},
#{item.batchId},
#{item.planYear},
#{item.majorId},
#{item.subjectType},
#{item.acceptNum},
#{item.schoolPrice},
#{item.acceptRuleId},
#{item.littleScoreLimit},
#{item.sort},
#{item.createAt},
#{item.updateAt},
#{item.delFlag},
#{item.linkId}
)
</foreach>
</insert>
</mapper>
......@@ -55,6 +55,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</select>
<select id="selectMallAcceptRuleByAcceptRuleStr2" resultMap="MallAcceptRuleResult">
<include refid="selectMallAcceptRuleVo"/>
where rule_str = #{ruleStr}
and del_flag = '0'
order by create_at desc
</select>
<select id="selectNewAcceptRule" resultMap="MallAcceptRuleResult">
<include refid="selectMallAcceptRuleVo"/>
where is_new = 1
......
......@@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ms.school_name schoolName,
mar.rule_str ruleStr,
mb.batch_name batchName,
ml.major_code majorCode,
ml.major_name majorName,
msa.subject_type subjectType,
msa.reference reference,
......@@ -97,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where school_accept_id = #{schoolAcceptId}
</select>
<select id="selectBySchoolIdAndLinkId" resultType="MallSchoolAccept">
<select id="selectBySchoolIdAndLinkId" resultType="com.ruoyi.mall.domain.MallSchoolAccept">
select msa.school_accept_id schoolAcceptId,
msa.school_id schoolId,
msa.major_id majorId,
......@@ -120,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and link_id = #{linkId}
and accept_year = #{acceptYear}
and subject_type = #{subjectType}
order by create_at desc
</select>
<insert id="insertMallSchoolAccept" parameterType="MallSchoolAccept" useGeneratedKeys="true" keyProperty="schoolAcceptId">
......@@ -159,6 +161,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkId != null ">#{linkId},</if>
</trim>
</insert>
<insert id="insertByList">
insert into mall_school_accept(
school_id,
major_id,
batch_id,
accept_num,
accept_lowest,
accept_year,
accept_rule_id,
send_rule_id,
create_at,
update_at,
del_flag,
subject_type,
reference,
is_reference,
link_id
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.schoolId},
#{item.majorId},
#{item.batchId},
#{item.acceptNum},
#{item.acceptLowest},
#{item.acceptYear},
#{item.acceptRuleId},
#{item.sendRuleId},
#{item.createAt},
#{item.updateAt},
#{item.delFlag},
#{item.subjectType},
#{item.reference},
#{item.isReference},
#{item.linkId},
)
</foreach>
</insert>
<update id="updateMallSchoolAccept" parameterType="MallSchoolAccept">
update mall_school_accept
......@@ -226,8 +266,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where del_flag = '0' and is_reference = 1
</select>
<select id="selectSchoolMajorRecordList" resultType="SchoolMajorAcceptRecordVO">
<select id="selectSchoolMajorRecordList" resultType="com.ruoyi.mall.domain.Vo.SchoolMajorAcceptRecordVO">
select msa.school_accept_id schoolAcceptId,
mlms.major_code majorCode,
mlms.major_name majorName,
msa.accept_num acceptNum,
msa.accept_lowest acceptLowest,
......
......@@ -284,7 +284,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
and subject_type = #{subjectType}
and accept_lowest is not null
and accept_year not in ('2024')
order by accept_year desc, accept_lowest asc limit 1000) temp
group by temp.acceptYear
order by temp.acceptYear desc
......
......@@ -78,6 +78,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</select>
<select id="selectMallSchoolLevelBySchoolIds" parameterType="string" resultType="MallSchoolLevel">
select msl.school_level_id schoolLevelId,
msl.school_id schoolId,
msl.config_level_id configLevelId,
msl.config_level_name configLevelName,
msl.sort sort,
msl.remarks remarks,
msl.create_at createAt,
msl.update_at updateAt,
msl.del_flag delFlag
from mall_school_level msl
where msl.school_id in
<foreach item="schoolId" collection="list" open="(" separator="," close=")">
#{schoolId}
</foreach>
and del_flag = '0'
</select>
<insert id="insertMallSchoolLevel" parameterType="MallSchoolLevel" useGeneratedKeys="true" keyProperty="schoolLevelId">
insert into mall_school_level
<trim prefix="(" suffix=")" suffixOverrides=",">
......