mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.0版本
This commit is contained in:
@@ -26,6 +26,11 @@
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>common-datafilter</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- knife4j 接口文档框架 -->
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CourseTransStatsVO对象。
|
||||
* CourseTransStatsVO视图对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("CourseTransStatsVO实体对象")
|
||||
@ApiModel("CourseTransStatsVO视图对象")
|
||||
@Data
|
||||
public class CourseTransStatsVo {
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionStatsVO对象。
|
||||
* StudentActionStatsVO视图对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentActionStatsVO实体对象")
|
||||
@ApiModel("StudentActionStatsVO视图对象")
|
||||
@Data
|
||||
public class StudentActionStatsVo {
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* StudentActionTransVO对象。
|
||||
* StudentActionTransVO视图对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@ApiModel("StudentActionTransVO实体对象")
|
||||
@ApiModel("StudentActionTransVO视图对象")
|
||||
@Data
|
||||
public class StudentActionTransVo {
|
||||
|
||||
|
||||
@@ -65,26 +65,40 @@
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="module" module-name="common-datafilter" />
|
||||
<orderEntry type="module" module-name="common-redis" />
|
||||
<orderEntry type="library" name="Maven: org.redisson:redisson:3.15.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.cache:cache-api:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.16.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex.rxjava3:rxjava:3.0.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling-river:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.1.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.1.6" level="project" />
|
||||
<orderEntry type="module" module-name="common-swagger" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.8" level="project" />
|
||||
@@ -151,11 +165,7 @@
|
||||
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-server-default:1.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-common-default:1.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-cluster-client-default:1.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-sentinel-datasource:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.csp:sentinel-datasource-nacos:1.8.0" level="project" />
|
||||
@@ -218,7 +228,7 @@
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
<artifactId>course-class-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>upms-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orange.demo</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import tk.mybatis.spring.annotation.MapperScan;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
||||
@@ -104,8 +104,7 @@ public class CourseTransStatsController extends BaseController<CourseTransStats,
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
CourseTransStats courseTransStats =
|
||||
courseTransStatsService.getByIdWithRelation(statsId, MyRelationParam.full());
|
||||
CourseTransStats courseTransStats = courseTransStatsService.getByIdWithRelation(statsId, MyRelationParam.full());
|
||||
if (courseTransStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ public class StudentActionStatsController extends BaseController<StudentActionSt
|
||||
if (MyCommonUtil.existBlankArgument(statsId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
StudentActionStats studentActionStats =
|
||||
studentActionStatsService.getByIdWithRelation(statsId, MyRelationParam.full());
|
||||
StudentActionStats studentActionStats = studentActionStatsService.getByIdWithRelation(statsId, MyRelationParam.full());
|
||||
if (studentActionStats == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.orange.demo.statsservice.controller;
|
||||
|
||||
import com.orange.demo.common.log.annotation.OperationLog;
|
||||
import com.orange.demo.common.log.model.constant.SysOperationLogType;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.statsservice.service.*;
|
||||
@@ -11,14 +13,12 @@ import com.orange.demo.common.core.constant.*;
|
||||
import com.orange.demo.common.core.base.controller.BaseController;
|
||||
import com.orange.demo.common.core.base.service.IBaseService;
|
||||
import com.orange.demo.common.core.annotation.MyRequestBody;
|
||||
import com.orange.demo.common.core.validator.UpdateGroup;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.groups.Default;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -51,9 +51,10 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
"studentActionTransDto.transId",
|
||||
"studentActionTransDto.createTimeStart",
|
||||
"studentActionTransDto.createTimeEnd"})
|
||||
@OperationLog(type = SysOperationLogType.ADD)
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto);
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, false);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
@@ -77,9 +78,10 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
@ApiOperationSupport(ignoreParameters = {
|
||||
"StudentActionTransDto.createTimeStart",
|
||||
"StudentActionTransDto.createTimeEnd"})
|
||||
@OperationLog(type = SysOperationLogType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody StudentActionTransDto studentActionTransDto) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, Default.class, UpdateGroup.class);
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(studentActionTransDto, true);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
@@ -108,6 +110,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
* @param transId 删除对象主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@OperationLog(type = SysOperationLogType.DELETE)
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult<Void> delete(@MyRequestBody Long transId) {
|
||||
String errorMessage;
|
||||
@@ -162,8 +165,7 @@ public class StudentActionTransController extends BaseController<StudentActionTr
|
||||
if (MyCommonUtil.existBlankArgument(transId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
StudentActionTrans studentActionTrans =
|
||||
studentActionTransService.getByIdWithRelation(transId, MyRelationParam.full());
|
||||
StudentActionTrans studentActionTrans = studentActionTransService.getByIdWithRelation(transId, MyRelationParam.full());
|
||||
if (studentActionTrans == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,13 @@ import java.util.*;
|
||||
*/
|
||||
public interface CourseTransStatsMapper extends BaseDaoMapper<CourseTransStats> {
|
||||
|
||||
/**
|
||||
* 批量插入对象列表。
|
||||
*
|
||||
* @param courseTransStatsList 新增对象列表。
|
||||
*/
|
||||
void insertList(List<CourseTransStats> courseTransStatsList);
|
||||
|
||||
/**
|
||||
* 获取分组计算后的数据对象列表。
|
||||
*
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.orange.demo.statsservice.dao;
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.statsservice.model.Grade;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
@@ -10,4 +12,11 @@ import com.orange.demo.statsservice.model.Grade;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface GradeMapper extends BaseDaoMapper<Grade> {
|
||||
|
||||
/**
|
||||
* 批量插入对象列表。
|
||||
*
|
||||
* @param gradeList 新增对象列表。
|
||||
*/
|
||||
void insertList(List<Grade> gradeList);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.orange.demo.statsservice.dao;
|
||||
|
||||
import com.orange.demo.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orange.demo.statsservice.model.SchoolInfo;
|
||||
|
||||
/**
|
||||
* 数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SchoolInfoMapper extends BaseDaoMapper<SchoolInfo> {
|
||||
}
|
||||
@@ -14,6 +14,13 @@ import java.util.*;
|
||||
*/
|
||||
public interface StudentActionStatsMapper extends BaseDaoMapper<StudentActionStats> {
|
||||
|
||||
/**
|
||||
* 批量插入对象列表。
|
||||
*
|
||||
* @param studentActionStatsList 新增对象列表。
|
||||
*/
|
||||
void insertList(List<StudentActionStats> studentActionStatsList);
|
||||
|
||||
/**
|
||||
* 获取分组计算后的数据对象列表。
|
||||
*
|
||||
|
||||
@@ -14,6 +14,13 @@ import java.util.*;
|
||||
*/
|
||||
public interface StudentActionTransMapper extends BaseDaoMapper<StudentActionTrans> {
|
||||
|
||||
/**
|
||||
* 批量插入对象列表。
|
||||
*
|
||||
* @param studentActionTransList 新增对象列表。
|
||||
*/
|
||||
void insertList(List<StudentActionTrans> studentActionTransList);
|
||||
|
||||
/**
|
||||
* 获取过滤后的对象列表。
|
||||
*
|
||||
|
||||
@@ -14,6 +14,33 @@
|
||||
<result column="student_flower_count" jdbcType="INTEGER" property="studentFlowerCount"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO zz_course_trans_stats
|
||||
(stats_id,
|
||||
stats_date,
|
||||
subject_id,
|
||||
grade_id,
|
||||
grade_name,
|
||||
course_id,
|
||||
course_name,
|
||||
student_attend_count,
|
||||
student_flower_amount,
|
||||
student_flower_count)
|
||||
VALUES
|
||||
<foreach collection="list" index="index" item="item" separator="," >
|
||||
(#{item.statsId},
|
||||
#{item.statsDate},
|
||||
#{item.subjectId},
|
||||
#{item.gradeId},
|
||||
#{item.gradeName},
|
||||
#{item.courseId},
|
||||
#{item.courseName},
|
||||
#{item.studentAttendCount},
|
||||
#{item.studentFlowerAmount},
|
||||
#{item.studentFlowerCount})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
|
||||
@@ -6,4 +6,17 @@
|
||||
<result column="grade_name" jdbcType="VARCHAR" property="gradeName"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO zz_grade
|
||||
(grade_id,
|
||||
grade_name,
|
||||
status)
|
||||
VALUES
|
||||
<foreach collection="list" index="index" item="item" separator="," >
|
||||
(#{item.gradeId},
|
||||
#{item.gradeName},
|
||||
#{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.orange.demo.statsservice.dao.SchoolInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orange.demo.statsservice.model.SchoolInfo">
|
||||
<id column="school_id" jdbcType="BIGINT" property="schoolId"/>
|
||||
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
|
||||
<result column="province_id" jdbcType="BIGINT" property="provinceId"/>
|
||||
<result column="city_id" jdbcType="BIGINT" property="cityId"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -25,6 +25,55 @@
|
||||
<result column="do_exercise_correct_count" jdbcType="INTEGER" property="doExerciseCorrectCount"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO zz_student_action_stats
|
||||
(stats_id,
|
||||
stats_date,
|
||||
stats_month,
|
||||
grade_id,
|
||||
province_id,
|
||||
city_id,
|
||||
buy_course_amount,
|
||||
buy_course_count,
|
||||
buy_video_amount,
|
||||
buy_video_count,
|
||||
buy_paper_amount,
|
||||
buy_paper_count,
|
||||
buy_flower_amount,
|
||||
buy_flower_count,
|
||||
recharge_coin_amount,
|
||||
recharge_coin_count,
|
||||
do_course_count,
|
||||
watch_video_count,
|
||||
watch_video_total_second,
|
||||
do_exercise_count,
|
||||
do_exercise_correct_count)
|
||||
VALUES
|
||||
<foreach collection="list" index="index" item="item" separator="," >
|
||||
(#{item.statsId},
|
||||
#{item.statsDate},
|
||||
#{item.statsMonth},
|
||||
#{item.gradeId},
|
||||
#{item.provinceId},
|
||||
#{item.cityId},
|
||||
#{item.buyCourseAmount},
|
||||
#{item.buyCourseCount},
|
||||
#{item.buyVideoAmount},
|
||||
#{item.buyVideoCount},
|
||||
#{item.buyPaperAmount},
|
||||
#{item.buyPaperCount},
|
||||
#{item.buyFlowerAmount},
|
||||
#{item.buyFlowerCount},
|
||||
#{item.rechargeCoinAmount},
|
||||
#{item.rechargeCoinCount},
|
||||
#{item.doCourseCount},
|
||||
#{item.watchVideoCount},
|
||||
#{item.watchVideoTotalSecond},
|
||||
#{item.doExerciseCount},
|
||||
#{item.doExerciseCorrectCount})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
|
||||
@@ -19,6 +19,43 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO zz_student_action_trans
|
||||
(trans_id,
|
||||
student_id,
|
||||
student_name,
|
||||
school_id,
|
||||
grade_id,
|
||||
action_type,
|
||||
device_type,
|
||||
watch_video_seconds,
|
||||
flower_count,
|
||||
paper_count,
|
||||
video_count,
|
||||
course_count,
|
||||
coin_count,
|
||||
exercise_correct_flag,
|
||||
create_time)
|
||||
VALUES
|
||||
<foreach collection="list" index="index" item="item" separator="," >
|
||||
(#{item.transId},
|
||||
#{item.studentId},
|
||||
#{item.studentName},
|
||||
#{item.schoolId},
|
||||
#{item.gradeId},
|
||||
#{item.actionType},
|
||||
#{item.deviceType},
|
||||
#{item.watchVideoSeconds},
|
||||
#{item.flowerCount},
|
||||
#{item.paperCount},
|
||||
#{item.videoCount},
|
||||
#{item.courseCount},
|
||||
#{item.coinCount},
|
||||
#{item.exerciseCorrectFlag},
|
||||
#{item.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
|
||||
<sql id="filterRef">
|
||||
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orange.demo.statsapi.vo.CourseTransStatsVo;
|
||||
import com.orange.demo.courseclassapi.vo.CourseVo;
|
||||
import com.orange.demo.courseclassapi.client.CourseClient;
|
||||
@@ -12,7 +13,6 @@ import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -24,81 +24,79 @@ import java.util.Map;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_course_trans_stats")
|
||||
@TableName(value = "zz_course_trans_stats")
|
||||
public class CourseTransStats {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "stats_id")
|
||||
@TableId(value = "stats_id", type = IdType.AUTO)
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@Column(name = "stats_date")
|
||||
@TableField(value = "stats_date")
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 科目Id。
|
||||
*/
|
||||
@Column(name = "subject_id")
|
||||
@TableField(value = "subject_id")
|
||||
private Integer subjectId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@Column(name = "grade_id")
|
||||
@TableField(value = "grade_id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@Column(name = "grade_name")
|
||||
@TableField(value = "grade_name")
|
||||
private String gradeName;
|
||||
|
||||
/**
|
||||
* 课程Id。
|
||||
*/
|
||||
@Column(name = "course_id")
|
||||
@TableField(value = "course_id")
|
||||
private Long courseId;
|
||||
|
||||
/**
|
||||
* 课程名称。
|
||||
*/
|
||||
@Column(name = "course_name")
|
||||
@TableField(value = "course_name")
|
||||
private String courseName;
|
||||
|
||||
/**
|
||||
* 学生上课次数。
|
||||
*/
|
||||
@Column(name = "student_attend_count")
|
||||
@TableField(value = "student_attend_count")
|
||||
private Integer studentAttendCount;
|
||||
|
||||
/**
|
||||
* 学生献花数量。
|
||||
*/
|
||||
@Column(name = "student_flower_amount")
|
||||
@TableField(value = "student_flower_amount")
|
||||
private Integer studentFlowerAmount;
|
||||
|
||||
/**
|
||||
* 学生献花次数。
|
||||
*/
|
||||
@Column(name = "student_flower_count")
|
||||
@TableField(value = "student_flower_count")
|
||||
private Integer studentFlowerCount;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤起始值(>=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String statsDateStart;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤结束值(<=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String statsDateEnd;
|
||||
|
||||
@RelationDict(
|
||||
@@ -107,7 +105,7 @@ public class CourseTransStats {
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@RelationDict(
|
||||
@@ -116,13 +114,13 @@ public class CourseTransStats {
|
||||
slaveModelClass = CourseVo.class,
|
||||
slaveIdField = "courseId",
|
||||
slaveNameField = "courseName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> courseIdDictMap;
|
||||
|
||||
@RelationConstDict(
|
||||
masterIdField = "subjectId",
|
||||
constantDictClass = Subject.class)
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> subjectIdDictMap;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.orange.demo.common.core.annotation.DeletedFlagColumn;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* Grade实体对象。
|
||||
@@ -11,26 +10,24 @@ import javax.persistence.*;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_grade")
|
||||
@TableName(value = "zz_grade")
|
||||
public class Grade {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "grade_id")
|
||||
@TableId(value = "grade_id", type = IdType.AUTO)
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 年级名称。
|
||||
*/
|
||||
@Column(name = "grade_name")
|
||||
@TableField(value = "grade_name")
|
||||
private String gradeName;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@DeletedFlagColumn
|
||||
@TableLogic
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import lombok.Data;
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* SchoolInfo实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_school_info")
|
||||
public class SchoolInfo {
|
||||
|
||||
/**
|
||||
* 学校Id。
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "school_id")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 学校名称。
|
||||
*/
|
||||
@Column(name = "school_name")
|
||||
private String schoolName;
|
||||
|
||||
/**
|
||||
* 所在省Id。
|
||||
*/
|
||||
@Column(name = "province_id")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 所在城市Id。
|
||||
*/
|
||||
@Column(name = "city_id")
|
||||
private Long cityId;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orange.demo.statsapi.vo.StudentActionStatsVo;
|
||||
import com.orange.demo.courseclassapi.vo.AreaCodeVo;
|
||||
import com.orange.demo.courseclassapi.vo.GradeVo;
|
||||
@@ -10,7 +11,6 @@ import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -22,146 +22,145 @@ import java.util.Map;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_student_action_stats")
|
||||
@TableName(value = "zz_student_action_stats")
|
||||
public class StudentActionStats {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "stats_id")
|
||||
@TableId(value = "stats_id")
|
||||
private Long statsId;
|
||||
|
||||
/**
|
||||
* 统计日期。
|
||||
*/
|
||||
@Column(name = "stats_date")
|
||||
@TableField(value = "stats_date")
|
||||
private Date statsDate;
|
||||
|
||||
/**
|
||||
* 统计小时。
|
||||
*/
|
||||
@Column(name = "stats_month")
|
||||
@TableField(value = "stats_month")
|
||||
private Date statsMonth;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@Column(name = "grade_id")
|
||||
@TableField(value = "grade_id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 学生所在省Id。
|
||||
*/
|
||||
@Column(name = "province_id")
|
||||
@TableField(value = "province_id")
|
||||
private Long provinceId;
|
||||
|
||||
/**
|
||||
* 学生所在城市Id。
|
||||
*/
|
||||
@Column(name = "city_id")
|
||||
@TableField(value = "city_id")
|
||||
private Long cityId;
|
||||
|
||||
/**
|
||||
* 购课学币数量。
|
||||
*/
|
||||
@Column(name = "buy_course_amount")
|
||||
@TableField(value = "buy_course_amount")
|
||||
private Integer buyCourseAmount;
|
||||
|
||||
/**
|
||||
* 购买课程次数。
|
||||
*/
|
||||
@Column(name = "buy_course_count")
|
||||
@TableField(value = "buy_course_count")
|
||||
private Integer buyCourseCount;
|
||||
|
||||
/**
|
||||
* 购买视频学币数量。
|
||||
*/
|
||||
@Column(name = "buy_video_amount")
|
||||
@TableField(value = "buy_video_amount")
|
||||
private Integer buyVideoAmount;
|
||||
|
||||
/**
|
||||
* 购买视频次数。
|
||||
*/
|
||||
@Column(name = "buy_video_count")
|
||||
@TableField(value = "buy_video_count")
|
||||
private Integer buyVideoCount;
|
||||
|
||||
/**
|
||||
* 购买作业学币数量。
|
||||
*/
|
||||
@Column(name = "buy_paper_amount")
|
||||
@TableField(value = "buy_paper_amount")
|
||||
private Integer buyPaperAmount;
|
||||
|
||||
/**
|
||||
* 购买作业次数。
|
||||
*/
|
||||
@Column(name = "buy_paper_count")
|
||||
@TableField(value = "buy_paper_count")
|
||||
private Integer buyPaperCount;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@Column(name = "buy_flower_amount")
|
||||
@TableField(value = "buy_flower_amount")
|
||||
private Integer buyFlowerAmount;
|
||||
|
||||
/**
|
||||
* 购买献花次数。
|
||||
*/
|
||||
@Column(name = "buy_flower_count")
|
||||
@TableField(value = "buy_flower_count")
|
||||
private Integer buyFlowerCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@Column(name = "recharge_coin_amount")
|
||||
@TableField(value = "recharge_coin_amount")
|
||||
private Integer rechargeCoinAmount;
|
||||
|
||||
/**
|
||||
* 充值学币次数。
|
||||
*/
|
||||
@Column(name = "recharge_coin_count")
|
||||
@TableField(value = "recharge_coin_count")
|
||||
private Integer rechargeCoinCount;
|
||||
|
||||
/**
|
||||
* 线下课程上课次数。
|
||||
*/
|
||||
@Column(name = "do_course_count")
|
||||
@TableField(value = "do_course_count")
|
||||
private Integer doCourseCount;
|
||||
|
||||
/**
|
||||
* 观看视频次数。
|
||||
*/
|
||||
@Column(name = "watch_video_count")
|
||||
@TableField(value = "watch_video_count")
|
||||
private Integer watchVideoCount;
|
||||
|
||||
/**
|
||||
* 购买献花消费学币数量。
|
||||
*/
|
||||
@Column(name = "watch_video_total_second")
|
||||
@TableField(value = "watch_video_total_second")
|
||||
private Integer watchVideoTotalSecond;
|
||||
|
||||
/**
|
||||
* 做题数量。
|
||||
*/
|
||||
@Column(name = "do_exercise_count")
|
||||
@TableField(value = "do_exercise_count")
|
||||
private Integer doExerciseCount;
|
||||
|
||||
/**
|
||||
* 做题正确的数量。
|
||||
*/
|
||||
@Column(name = "do_exercise_correct_count")
|
||||
@TableField(value = "do_exercise_correct_count")
|
||||
private Integer doExerciseCorrectCount;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤起始值(>=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String statsDateStart;
|
||||
|
||||
/**
|
||||
* statsDate 范围过滤结束值(<=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String statsDateEnd;
|
||||
|
||||
@RelationDict(
|
||||
@@ -170,7 +169,7 @@ public class StudentActionStats {
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@RelationDict(
|
||||
@@ -179,7 +178,7 @@ public class StudentActionStats {
|
||||
slaveModelClass = AreaCodeVo.class,
|
||||
slaveIdField = "areaId",
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> provinceIdDictMap;
|
||||
|
||||
@RelationDict(
|
||||
@@ -188,7 +187,7 @@ public class StudentActionStats {
|
||||
slaveModelClass = AreaCodeVo.class,
|
||||
slaveIdField = "areaId",
|
||||
slaveNameField = "areaName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> cityIdDictMap;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.orange.demo.statsservice.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orange.demo.statsapi.vo.StudentActionTransVo;
|
||||
import com.orange.demo.courseclassapi.client.SchoolInfoClient;
|
||||
import com.orange.demo.courseclassapi.vo.SchoolInfoVo;
|
||||
import com.orange.demo.upmsapi.client.SysDeptClient;
|
||||
import com.orange.demo.upmsapi.vo.SysDeptVo;
|
||||
import com.orange.demo.courseclassapi.vo.GradeVo;
|
||||
import com.orange.demo.courseclassapi.client.GradeClient;
|
||||
import com.orange.demo.application.common.constant.StudentActionType;
|
||||
@@ -13,7 +14,6 @@ import com.orange.demo.common.core.base.mapper.BaseModelMapper;
|
||||
import lombok.Data;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import javax.persistence.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -25,119 +25,118 @@ import java.util.Map;
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "zz_student_action_trans")
|
||||
@TableName(value = "zz_student_action_trans")
|
||||
public class StudentActionTrans {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "trans_id")
|
||||
@TableId(value = "trans_id")
|
||||
private Long transId;
|
||||
|
||||
/**
|
||||
* 学生Id。
|
||||
*/
|
||||
@Column(name = "student_id")
|
||||
@TableField(value = "student_id")
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生名称。
|
||||
*/
|
||||
@Column(name = "student_name")
|
||||
@TableField(value = "student_name")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学生校区。
|
||||
*/
|
||||
@Column(name = "school_id")
|
||||
@TableField(value = "school_id")
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 年级Id。
|
||||
*/
|
||||
@Column(name = "grade_id")
|
||||
@TableField(value = "grade_id")
|
||||
private Integer gradeId;
|
||||
|
||||
/**
|
||||
* 行为类型(0: 充值 1: 购课 2: 上课签到 3: 上课签退 4: 看视频课 5: 做作业 6: 刷题 7: 献花)。
|
||||
*/
|
||||
@Column(name = "action_type")
|
||||
@TableField(value = "action_type")
|
||||
private Integer actionType;
|
||||
|
||||
/**
|
||||
* 设备类型(0: iOS 1: Android 2: PC)。
|
||||
*/
|
||||
@Column(name = "device_type")
|
||||
@TableField(value = "device_type")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* 看视频秒数。
|
||||
*/
|
||||
@Column(name = "watch_video_seconds")
|
||||
@TableField(value = "watch_video_seconds")
|
||||
private Integer watchVideoSeconds;
|
||||
|
||||
/**
|
||||
* 购买献花数量。
|
||||
*/
|
||||
@Column(name = "flower_count")
|
||||
@TableField(value = "flower_count")
|
||||
private Integer flowerCount;
|
||||
|
||||
/**
|
||||
* 购买作业数量。
|
||||
*/
|
||||
@Column(name = "paper_count")
|
||||
@TableField(value = "paper_count")
|
||||
private Integer paperCount;
|
||||
|
||||
/**
|
||||
* 购买视频数量。
|
||||
*/
|
||||
@Column(name = "video_count")
|
||||
@TableField(value = "video_count")
|
||||
private Integer videoCount;
|
||||
|
||||
/**
|
||||
* 购买课程数量。
|
||||
*/
|
||||
@Column(name = "course_count")
|
||||
@TableField(value = "course_count")
|
||||
private Integer courseCount;
|
||||
|
||||
/**
|
||||
* 充值学币数量。
|
||||
*/
|
||||
@Column(name = "coin_count")
|
||||
@TableField(value = "coin_count")
|
||||
private Integer coinCount;
|
||||
|
||||
/**
|
||||
* 做题是否正确标记。
|
||||
*/
|
||||
@Column(name = "exercise_correct_flag")
|
||||
@TableField(value = "exercise_correct_flag")
|
||||
private Integer exerciseCorrectFlag;
|
||||
|
||||
/**
|
||||
* 发生时间。
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤起始值(>=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String createTimeStart;
|
||||
|
||||
/**
|
||||
* createTime 范围过滤结束值(<=)。
|
||||
*/
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private String createTimeEnd;
|
||||
|
||||
@RelationDict(
|
||||
masterIdField = "schoolId",
|
||||
slaveClientClass = SchoolInfoClient.class,
|
||||
slaveModelClass = SchoolInfoVo.class,
|
||||
slaveIdField = "schoolId",
|
||||
slaveNameField = "schoolName")
|
||||
@Transient
|
||||
slaveClientClass = SysDeptClient.class,
|
||||
slaveModelClass = SysDeptVo.class,
|
||||
slaveIdField = "deptId",
|
||||
slaveNameField = "deptName")
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> schoolIdDictMap;
|
||||
|
||||
@RelationDict(
|
||||
@@ -146,19 +145,19 @@ public class StudentActionTrans {
|
||||
slaveModelClass = GradeVo.class,
|
||||
slaveIdField = "gradeId",
|
||||
slaveNameField = "gradeName")
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> gradeIdDictMap;
|
||||
|
||||
@RelationConstDict(
|
||||
masterIdField = "actionType",
|
||||
constantDictClass = StudentActionType.class)
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> actionTypeDictMap;
|
||||
|
||||
@RelationConstDict(
|
||||
masterIdField = "deviceType",
|
||||
constantDictClass = DeviceType.class)
|
||||
@Transient
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> deviceTypeDictMap;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -22,6 +22,13 @@ public interface StudentActionTransService extends IBaseService<StudentActionTra
|
||||
*/
|
||||
StudentActionTrans saveNew(StudentActionTrans studentActionTrans);
|
||||
|
||||
/**
|
||||
* 利用数据库的insertList语法,批量插入对象列表。
|
||||
*
|
||||
* @param studentActionTransList 新增对象列表。
|
||||
*/
|
||||
void saveNewBatch(List<StudentActionTrans> studentActionTransList);
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.orange.demo.statsservice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.orange.demo.statsservice.service.*;
|
||||
import com.orange.demo.statsservice.dao.*;
|
||||
import com.orange.demo.statsservice.model.*;
|
||||
import com.orange.demo.upmsapi.client.*;
|
||||
import com.orange.demo.courseclassapi.client.*;
|
||||
import com.orange.demo.common.core.util.*;
|
||||
import com.orange.demo.common.core.object.MyRelationParam;
|
||||
@@ -32,7 +35,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
@Autowired
|
||||
private StudentActionTransMapper studentActionTransMapper;
|
||||
@Autowired
|
||||
private SchoolInfoClient schoolInfoClient;
|
||||
private SysDeptClient sysDeptClient;
|
||||
@Autowired
|
||||
private GradeClient gradeClient;
|
||||
@Autowired
|
||||
@@ -57,12 +60,24 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public StudentActionTrans saveNew(StudentActionTrans studentActionTrans) {
|
||||
studentActionTrans.setTransId(idGenerator.nextLongId());
|
||||
studentActionTrans.setCreateTime(new Date());
|
||||
studentActionTransMapper.insert(studentActionTrans);
|
||||
studentActionTransMapper.insert(this.buildDefaultValue(studentActionTrans));
|
||||
return studentActionTrans;
|
||||
}
|
||||
|
||||
/**
|
||||
* 利用数据库的insertList语法,批量插入对象列表。
|
||||
*
|
||||
* @param studentActionTransList 新增对象列表。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveNewBatch(List<StudentActionTrans> studentActionTransList) {
|
||||
if (CollUtil.isNotEmpty(studentActionTransList)) {
|
||||
studentActionTransList.forEach(this::buildDefaultValue);
|
||||
studentActionTransMapper.insertList(studentActionTransList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
@@ -75,7 +90,8 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
public boolean update(StudentActionTrans studentActionTrans, StudentActionTrans originalStudentActionTrans) {
|
||||
studentActionTrans.setCreateTime(originalStudentActionTrans.getCreateTime());
|
||||
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
|
||||
return studentActionTransMapper.updateByPrimaryKey(studentActionTrans) == 1;
|
||||
UpdateWrapper<StudentActionTrans> uw = this.createUpdateQueryForNullValue(studentActionTrans, studentActionTrans.getTransId());
|
||||
return studentActionTransMapper.update(studentActionTrans, uw) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,8 +103,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean remove(Long transId) {
|
||||
// 这里先删除主数据
|
||||
return this.removeById(transId);
|
||||
return studentActionTransMapper.deleteById(transId) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,7 +192,7 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
|
||||
if (this.needToVerify(studentActionTrans, originalStudentActionTrans, StudentActionTrans::getSchoolId)) {
|
||||
ResponseResult<Boolean> responseResult =
|
||||
schoolInfoClient.existId(studentActionTrans.getSchoolId());
|
||||
sysDeptClient.existId(studentActionTrans.getSchoolId());
|
||||
if (this.hasErrorOfVerifyRemoteRelatedData(responseResult)) {
|
||||
return CallResult.error(String.format(errorMessageFormat, "学生校区"));
|
||||
}
|
||||
@@ -191,4 +206,10 @@ public class StudentActionTransServiceImpl extends BaseService<StudentActionTran
|
||||
}
|
||||
return CallResult.ok();
|
||||
}
|
||||
|
||||
private StudentActionTrans buildDefaultValue(StudentActionTrans studentActionTrans) {
|
||||
studentActionTrans.setTransId(idGenerator.nextLongId());
|
||||
studentActionTrans.setCreateTime(new Date());
|
||||
return studentActionTrans;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,26 +64,23 @@
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="module" module-name="common-datafilter" />
|
||||
<orderEntry type="module" module-name="common-swagger" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-micro-spring-boot-starter:2.0.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.8" level="project" />
|
||||
@@ -103,7 +100,12 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.10.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webmvc:2.10.5" level="project" />
|
||||
<orderEntry type="module" module-name="course-class-api" />
|
||||
<orderEntry type="library" name="Maven: com.orange.demo:common-log:1.0.0" level="project" />
|
||||
<orderEntry type="module" module-name="upms-api" />
|
||||
<orderEntry type="module" module-name="common-log" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.kafka:spring-kafka:2.5.12.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="module" module-name="common-redis" />
|
||||
<orderEntry type="library" name="Maven: org.redisson:redisson:3.15.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
|
||||
Reference in New Issue
Block a user