feat: 东区缴费分支初始化
This commit is contained in:
@@ -1,84 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>edu-school</artifactId>
|
||||
<groupId>com.yida.data.school</groupId>
|
||||
<version>2.2-RELEASE</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>edu-school</artifactId>
|
||||
<groupId>com.yida.data.school</groupId>
|
||||
<version>2.2-RELEASE</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>edu-school-biz</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.school</groupId>
|
||||
<artifactId>edu-school-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.job</groupId>
|
||||
<artifactId>febs-server-job-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.device</groupId>
|
||||
<artifactId>edu-device-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.system</groupId>
|
||||
<artifactId>febs-server-system-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.user</groupId>
|
||||
<artifactId>edu-user-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.common</groupId>
|
||||
<artifactId>edu-common</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vdurmont</groupId>
|
||||
<artifactId>emoji-java</artifactId>
|
||||
<version>${emoji.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.websocket</groupId>
|
||||
<artifactId>edu-websocket-api</artifactId>
|
||||
<version>2.2-RELEASE</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.attendance</groupId>
|
||||
<artifactId>attendance-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<artifactId>edu-school-biz</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.school</groupId>
|
||||
<artifactId>edu-school-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.job</groupId>
|
||||
<artifactId>febs-server-job-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.device</groupId>
|
||||
<artifactId>edu-device-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.system</groupId>
|
||||
<artifactId>febs-server-system-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.user</groupId>
|
||||
<artifactId>edu-user-api</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.common</groupId>
|
||||
<artifactId>edu-common</artifactId>
|
||||
<version>${febs-cloud.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vdurmont</groupId>
|
||||
<artifactId>emoji-java</artifactId>
|
||||
<version>${emoji.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yida.data.websocket</groupId>
|
||||
<artifactId>edu-websocket-api</artifactId>
|
||||
<version>2.2-RELEASE</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputDirectory>../../../febs-jar</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<outputDirectory>../../../febs-jar</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+2
@@ -13,9 +13,11 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import cc.mrbird.febs.common.security.starter.annotation.EnableFebsCloudResourceServer;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringBootConfiguration
|
||||
@EnableAsync
|
||||
@EnableTransactionManagement
|
||||
@EnableFeignClients(basePackages = "com.yida.data")
|
||||
@SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)
|
||||
@EnableFebsCloudResourceServer
|
||||
|
||||
+1
-1
@@ -225,7 +225,7 @@ public class CoreExaminationPublishServiceImpl extends
|
||||
|
||||
private void pushScoreNotice(CoreExamination coreExamination, List<CoreExaminationStudent> studentList) {
|
||||
Dept school = commonService.getDept(coreExamination.getSchoolId());
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null, school.getDeptId());
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.SCORE_PARENT, null, school.getDeptId());
|
||||
List<Long> studentId = studentList.stream().map(x -> x.getCoreStudentId()).collect(Collectors.toList());
|
||||
String accessToken = null;
|
||||
EduYidaApp yidaApp = null;
|
||||
|
||||
-36
@@ -1,20 +1,10 @@
|
||||
package com.yida.data.school.facility.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.school.EduDormitory;
|
||||
import com.yida.data.common.core.entity.school.EduDormitoryMaster;
|
||||
import com.yida.data.common.core.entity.school.EduDormitoryRoom;
|
||||
import com.yida.data.school.dto.index.ListDormRoomDTO;
|
||||
import com.yida.data.school.facility.mapper.EduDormitoryRoomMapper;
|
||||
import com.yida.data.school.facility.service.EduDormitoryMasterService;
|
||||
import com.yida.data.school.facility.service.EduDormitoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -39,35 +29,9 @@ public class InEduDormitoryController {
|
||||
|
||||
private final EduDormitoryService eduDormitoryService;
|
||||
|
||||
private final EduDormitoryRoomMapper eduDormitoryRoomMapper;
|
||||
|
||||
private final EduDormitoryMasterService eduDormitoryMasterService;
|
||||
|
||||
@ApiOperation("获取宿舍楼")
|
||||
@GetMapping("/getDorm")
|
||||
ResultBean<EduDormitory> getDorm(@RequestParam("id") Long id) {
|
||||
return ResultBean.buildSuccess(eduDormitoryService.getDorm(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据学校ID获取宿舍楼List")
|
||||
@GetMapping("/getDormListBySchoolId")
|
||||
ResultBean<List<EduDormitory>> getDormListBySchoolId(@RequestParam("schoolId") Long schoolId) {
|
||||
List<EduDormitory> list = eduDormitoryService
|
||||
.list(Wrappers.lambdaQuery(new EduDormitory()).eq(EduDormitory::getSchoolId, schoolId));
|
||||
|
||||
list.forEach(eduDormitory -> {
|
||||
ListDormRoomDTO dto = new ListDormRoomDTO();
|
||||
dto.setDormIds(Collections.singletonList(eduDormitory.getId()));
|
||||
List<EduDormitoryRoom> eduDormitoryRooms = eduDormitoryRoomMapper.listDormRoom(dto);
|
||||
eduDormitory.setDormRoomList(eduDormitoryRooms);
|
||||
//宿管
|
||||
List<EduDormitoryMaster> masterList = eduDormitoryMasterService
|
||||
.list(Wrappers.lambdaQuery(new EduDormitoryMaster()).eq(EduDormitoryMaster::getSchoolId, schoolId)
|
||||
.eq(EduDormitoryMaster::getDormitoryId, eduDormitory.getId()));
|
||||
if (CollUtil.isNotEmpty(masterList)) {
|
||||
eduDormitory.setMasterIds(masterList.stream().map(EduDormitoryMaster::getMasterId).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
return ResultBean.buildSuccess(list);
|
||||
}
|
||||
}
|
||||
|
||||
-19
@@ -2,15 +2,9 @@ package com.yida.data.school.facility.controller;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.school.EduDormitoryRoom;
|
||||
import com.yida.data.school.dto.index.EditPersonNumDTO;
|
||||
import com.yida.data.school.dto.index.ListDormRoomDTO;
|
||||
import com.yida.data.school.facility.service.EduDormitoryRoomService;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -34,17 +28,4 @@ public class InEduDormitoryRoomController {
|
||||
ResultBean<EduDormitoryRoom> getDormRoomNoPermission(@RequestParam("id") Long id) {
|
||||
return ResultBean.buildSuccess(eduDormitoryRoomService.getDormRoom(id));
|
||||
}
|
||||
|
||||
@ApiOperation("寝室入住")
|
||||
@PostMapping("/editPersonNum")
|
||||
public ResultBean editPersonNumNoPermission(@RequestBody List<EditPersonNumDTO> dtos) {
|
||||
eduDormitoryRoomService.editPersonNum(dtos);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("查询寝室列表")
|
||||
@PostMapping("/listDormRoom")
|
||||
public ResultBean<List<EduDormitoryRoom>> listDormRoom(@RequestBody ListDormRoomDTO dto) {
|
||||
return ResultBean.buildSuccess(eduDormitoryRoomService.listDormRoom(dto));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -11,5 +11,7 @@ import com.yida.data.common.core.entity.school.EduDormitoryMaster;
|
||||
* @date 2022/8/22
|
||||
*/
|
||||
public interface EduDormitoryMasterService extends IService<EduDormitoryMaster> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -54,6 +54,4 @@ public interface EduDormitoryService extends IService<EduDormitory> {
|
||||
* @date 2022/7/15 14:31
|
||||
*/
|
||||
EduDormitory getDorm(Long id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+22
-25
@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
<EduDormitoryMapper, EduDormitory> implements EduDormitoryService {
|
||||
<EduDormitoryMapper, EduDormitory> implements EduDormitoryService {
|
||||
|
||||
private final EduDormitoryRoomMapper eduDormitoryRoomMapper;
|
||||
private final EduDormitoryMasterMapper eduDormitoryMasterMapper;
|
||||
@@ -62,15 +62,14 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
public IPage<DormInfoVO> listDormPage(PageDormDTO dto) {
|
||||
|
||||
if (Objects.nonNull(dto.getMasterId())) {
|
||||
List<EduDormitoryMaster> masterList = eduDormitoryMasterMapper
|
||||
.selectList(Wrappers.lambdaQuery(new EduDormitoryMaster())
|
||||
List<EduDormitoryMaster> masterList = eduDormitoryMasterMapper.selectList(Wrappers.lambdaQuery(new EduDormitoryMaster())
|
||||
.eq(EduDormitoryMaster::getMasterId, dto.getMasterId()).select(EduDormitoryMaster::getDormitoryId));
|
||||
if (CollUtil.isEmpty(masterList)) {
|
||||
return new Page<>();
|
||||
}
|
||||
dto.setDormIds(masterList.stream().map(EduDormitoryMaster::getDormitoryId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList()));
|
||||
.distinct()
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
IPage<DormInfoVO> dormPage = baseMapper.listDormPage(dto.toPage(), dto);
|
||||
// 查询宿管名称
|
||||
@@ -78,18 +77,18 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
// 查询宿管id集合
|
||||
for (DormInfoVO dormInfoVO : dormPage.getRecords()) {
|
||||
List<Long> masterIds = eduDormitoryMasterMapper.selectList(Wrappers.lambdaQuery(new EduDormitoryMaster())
|
||||
.eq(EduDormitoryMaster::getDormitoryId, dormInfoVO.getDormId())
|
||||
.select(EduDormitoryMaster::getMasterId)
|
||||
.eq(EduDormitoryMaster::getDormitoryId, dormInfoVO.getDormId())
|
||||
.select(EduDormitoryMaster::getMasterId)
|
||||
).stream().map(EduDormitoryMaster::getMasterId).collect(Collectors.toList());
|
||||
dormInfoVO.setMasterIds(masterIds);
|
||||
|
||||
List<EduStaff> staffList = CollUtil.isNotEmpty(masterIds)
|
||||
? remoteStaffService.listStaff(ListStaffDTO.builder().ids(masterIds).build()).getData()
|
||||
: Collections.emptyList();
|
||||
? remoteStaffService.listStaff(ListStaffDTO.builder().ids(masterIds).build()).getData()
|
||||
: Collections.emptyList();
|
||||
// 匹配宿管
|
||||
if (CollUtil.isNotEmpty(staffList)) {
|
||||
dormInfoVO.setMasterName(staffList.stream().map(EduStaff::getName)
|
||||
.collect(Collectors.joining(StringConstant.COMMA)));
|
||||
.collect(Collectors.joining(StringConstant.COMMA)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,8 +106,8 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<EduDormitory> condition = Wrappers.<EduDormitory>lambdaQuery()
|
||||
.eq(EduDormitory::getSchoolId, dorm.getSchoolId())
|
||||
.eq(EduDormitory::getName, dorm.getName());
|
||||
.eq(EduDormitory::getSchoolId, dorm.getSchoolId())
|
||||
.eq(EduDormitory::getName, dorm.getName());
|
||||
if (dorm.getId() != null) {
|
||||
condition.ne(EduDormitory::getId, dorm.getId());
|
||||
}
|
||||
@@ -116,14 +115,13 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
saveOrUpdate(dorm);
|
||||
|
||||
// 删除旧宿管数据
|
||||
eduDormitoryMasterMapper
|
||||
.delete(Wrappers.<EduDormitoryMaster>lambdaQuery().in(EduDormitoryMaster::getDormitoryId, dorm.getId()));
|
||||
eduDormitoryMasterMapper.delete(Wrappers.<EduDormitoryMaster>lambdaQuery().in(EduDormitoryMaster::getDormitoryId, dorm.getId()));
|
||||
dorm.getMasterIds().forEach(masterId -> {
|
||||
EduDormitoryMaster master = EduDormitoryMaster.builder()
|
||||
.dormitoryId(dorm.getId())
|
||||
.masterId(masterId)
|
||||
.schoolId(dorm.getSchoolId())
|
||||
.build();
|
||||
.dormitoryId(dorm.getId())
|
||||
.masterId(masterId)
|
||||
.schoolId(dorm.getSchoolId())
|
||||
.build();
|
||||
eduDormitoryMasterMapper.insert(master);
|
||||
});
|
||||
}
|
||||
@@ -131,7 +129,7 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
@Override
|
||||
public void delDormBatch(List<Long> ids) {
|
||||
List<EduDormitoryRoom> rooms = eduDormitoryRoomMapper.selectList(
|
||||
Wrappers.<EduDormitoryRoom>lambdaQuery().in(EduDormitoryRoom::getDormId, ids).select(EduDormitoryRoom::getId));
|
||||
Wrappers.<EduDormitoryRoom>lambdaQuery().in(EduDormitoryRoom::getDormId, ids).select(EduDormitoryRoom::getId));
|
||||
//删除寝室
|
||||
eduDormitoryRoomMapper.delete(Wrappers.<EduDormitoryRoom>lambdaQuery().in(EduDormitoryRoom::getDormId, ids));
|
||||
// 删除宿舍楼
|
||||
@@ -147,15 +145,14 @@ public class EduDormitoryServiceImpl extends ServiceImpl
|
||||
EduDormitory eduDormitory = getById(id);
|
||||
Optional.ofNullable(eduDormitory).ifPresent(dormitory -> {
|
||||
// 查询宿管信息
|
||||
List<EduDormitoryMaster> masterList = eduDormitoryMasterMapper
|
||||
.selectList(Wrappers.lambdaQuery(new EduDormitoryMaster())
|
||||
List<EduDormitoryMaster> masterList = eduDormitoryMasterMapper.selectList(Wrappers.lambdaQuery(new EduDormitoryMaster())
|
||||
.eq(EduDormitoryMaster::getDormitoryId, dormitory.getId()).select(EduDormitoryMaster::getMasterId));
|
||||
if (CollUtil.isNotEmpty(masterList)) {
|
||||
dormitory.setEduStaffList(
|
||||
remoteStaffService.listStaff(
|
||||
ListStaffDTO.builder().ids(masterList.stream().map(EduDormitoryMaster::getMasterId)
|
||||
.collect(Collectors.toList())).build())
|
||||
.getData());
|
||||
remoteStaffService.listStaff(
|
||||
ListStaffDTO.builder().ids(masterList.stream().map(EduDormitoryMaster::getMasterId)
|
||||
.collect(Collectors.toList())).build())
|
||||
.getData());
|
||||
}
|
||||
});
|
||||
return eduDormitory;
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class EduHealthStudentPhysicalExaminationGroupServiceImpl extends Service
|
||||
public void sendHealthNotice(Long groupId,Long schoolId) {
|
||||
List<Long> studentId = baseMapper.findStudentId(groupId);
|
||||
EduHealthStudentPhysicalExaminationGroup group = getById(groupId);
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
schoolId);
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
|
||||
|
||||
+2
-15
@@ -13,7 +13,6 @@ import com.yida.data.common.core.entity.school.EduSchoolHomeMicroPic;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeNews;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolManuscript;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.school.index.service.EduDeptHomeAppService;
|
||||
import com.yida.data.school.index.service.EduHomeFunctionService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeAnnouncementService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeAppService;
|
||||
@@ -64,15 +63,14 @@ public class EduSchoolHomeController {
|
||||
private final EduSchoolHomeMicroIndexService eduSchoolHomeMicroIndexService;
|
||||
private final EduSchoolHomeMicroPicService eduSchoolHomeMicroPicService;
|
||||
private final EduSchoolManuscriptService eduSchoolManuscriptService;
|
||||
private final EduDeptHomeAppService eduDeptHomeAppService;
|
||||
|
||||
@ApiOperation("主页信息查询")
|
||||
@GetMapping("/getHomeInfo")
|
||||
public ResultBean<HomeInfoVO> getHomeInfo(@ApiParam("学校id") Long schoolId, @RequestParam(required = false) Integer userType) {
|
||||
public ResultBean<HomeInfoVO> getHomeInfo(@ApiParam("学校id") Long schoolId) {
|
||||
if (schoolId == null) {
|
||||
schoolId = FebsUtil.getTopDeptId();
|
||||
}
|
||||
return ResultBean.buildSuccess(eduSchoolHomeCoverService.getHomeInfo(schoolId, userType));
|
||||
return ResultBean.buildSuccess(eduSchoolHomeCoverService.getHomeInfo(schoolId));
|
||||
}
|
||||
|
||||
@ApiOperation("更新轮播图(新增、编辑、删除)")
|
||||
@@ -204,15 +202,4 @@ public class EduSchoolHomeController {
|
||||
eduHomeFunctionService.updateFunction(functionData);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getWxPublicURLLink")
|
||||
@ApiOperation("获取微信小程序短链接")
|
||||
ResultBean<String> getWxPublicURLLink(
|
||||
@RequestParam @ApiParam(value = "学校ID", required = true) String schoolId,
|
||||
@RequestParam @ApiParam(value = "用户ID", required = true) Long userId,
|
||||
@RequestParam @ApiParam(value = "用户类型", required = true) Integer userType,
|
||||
@RequestParam @ApiParam(value = "系统内部小程序ID", required = true) Long localAppId) {
|
||||
return ResultBean.buildSuccess(eduDeptHomeAppService.getWxPublicURLLink(schoolId, userId, userType, localAppId));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-15
@@ -2,9 +2,7 @@ package com.yida.data.school.index.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.school.EduDeptHomeApp;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeMicroPic;
|
||||
import com.yida.data.school.index.service.EduDeptHomeAppService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeCoverService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeMicroIndexService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeMicroPicService;
|
||||
@@ -28,11 +26,9 @@ import lombok.RequiredArgsConstructor;
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class InEduSchoolHomeController {
|
||||
|
||||
private final EduSchoolHomeMicroIndexService eduSchoolHomeMicroIndexService;
|
||||
private final EduSchoolHomeMicroPicService eduSchoolHomeMicroPicService;
|
||||
private final EduSchoolHomeCoverService eduSchoolHomeCoverService;
|
||||
private final EduDeptHomeAppService eduDeptHomeAppService;
|
||||
|
||||
|
||||
@ApiOperation("查询校园概况")
|
||||
@@ -48,20 +44,13 @@ public class InEduSchoolHomeController {
|
||||
@GetMapping("/listPicByCol")
|
||||
public ResultBean<List<EduSchoolHomeMicroPic>> listPicByCol(@ApiParam("栏目id") Long colId) {
|
||||
return ResultBean.buildSuccess(eduSchoolHomeMicroPicService.list(Wrappers.lambdaQuery(new EduSchoolHomeMicroPic())
|
||||
.eq(EduSchoolHomeMicroPic::getColId, colId)
|
||||
.orderByAsc(EduSchoolHomeMicroPic::getSort)));
|
||||
.eq(EduSchoolHomeMicroPic::getColId, colId)
|
||||
.orderByAsc(EduSchoolHomeMicroPic::getSort)));
|
||||
}
|
||||
|
||||
@ApiOperation("主页信息查询")
|
||||
@GetMapping("/getHomeInfo")
|
||||
public ResultBean<HomeInfoVO> getHomeInfo(@ApiParam("学校id") Long schoolId, @RequestParam(required = false) Integer userType) {
|
||||
return ResultBean.buildSuccess(eduSchoolHomeCoverService.getHomeInfo(schoolId, userType));
|
||||
}
|
||||
|
||||
@ApiOperation("主页信息查询")
|
||||
@GetMapping("/getDeptAppList")
|
||||
public ResultBean<List<EduDeptHomeApp>> getDeptAppList(@RequestParam("schoolId") Long schoolId) {
|
||||
return ResultBean.buildSuccess(eduDeptHomeAppService.list(Wrappers.lambdaQuery(new EduDeptHomeApp())
|
||||
.eq(EduDeptHomeApp::getDeptId, schoolId)));
|
||||
public ResultBean<HomeInfoVO> getHomeInfo(@ApiParam("学校id") Long schoolId) {
|
||||
return ResultBean.buildSuccess(eduSchoolHomeCoverService.getHomeInfo(schoolId));
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -3,9 +3,7 @@ package com.yida.data.school.index.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeApp;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* Service接口
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeCover;
|
||||
import com.yida.data.school.vo.index.HomeInfoVO;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,7 +14,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface EduSchoolHomeCoverService extends IService<EduSchoolHomeCover> {
|
||||
|
||||
HomeInfoVO getHomeInfo(Long schoolId, Integer userType);
|
||||
HomeInfoVO getHomeInfo(Long schoolId);
|
||||
|
||||
/**
|
||||
* 更新轮播图
|
||||
|
||||
-3
@@ -1,11 +1,9 @@
|
||||
package com.yida.data.school.index.service.impl;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeApp;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeAppShow;
|
||||
import com.yida.data.common.core.entity.user.EduStaffDept;
|
||||
@@ -41,7 +39,6 @@ public class EduSchoolHomeAppServiceImpl extends ServiceImpl
|
||||
private final RemoteDeptService remoteDeptService;
|
||||
private final RemoteUserDeptService remoteUserDeptService;
|
||||
private final EduSchoolMatterService eduSchoolMatterService;
|
||||
private final RedisService redisService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
+68
-101
@@ -1,15 +1,10 @@
|
||||
package com.yida.data.school.index.service.impl;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.home.EduHomeFunction;
|
||||
import com.yida.data.common.core.entity.notice.EduNoticeSchool;
|
||||
import com.yida.data.common.core.entity.school.EduDeptHomeApp;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeAnnouncement;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeCover;
|
||||
import com.yida.data.common.core.entity.school.EduSchoolHomeMicro;
|
||||
@@ -18,13 +13,11 @@ import com.yida.data.common.core.entity.school.EduSchoolManuscript;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduYidaApp;
|
||||
import com.yida.data.common.core.entity.system.enums.DeptTypeEnum;
|
||||
import com.yida.data.common.core.enums.EnableStatusEnum;
|
||||
import com.yida.data.common.core.utils.AppUtil;
|
||||
import com.yida.data.common.service.CommonService;
|
||||
import com.yida.data.school.index.mapper.EduSchoolHomeAppMapper;
|
||||
import com.yida.data.school.index.mapper.EduSchoolHomeCoverMapper;
|
||||
import com.yida.data.school.index.mapper.EduSchoolHomeNewsMapper;
|
||||
import com.yida.data.school.index.service.EduDeptHomeAppService;
|
||||
import com.yida.data.school.index.service.EduHomeFunctionService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeAnnouncementService;
|
||||
import com.yida.data.school.index.service.EduSchoolHomeCoverService;
|
||||
@@ -55,112 +48,89 @@ public class EduSchoolHomeCoverServiceImpl extends ServiceImpl
|
||||
private final EduSchoolMatterService eduSchoolMatterService;
|
||||
private final EduSchoolHomeMicroService eduSchoolHomeMicroService;
|
||||
private final EduSchoolHomeAnnouncementService eduSchoolHomeAnnouncementService;
|
||||
private final EduDeptHomeAppService eduDeptHomeAppService;
|
||||
|
||||
private final EduNoticeSchoolMapper eduNoticeSchoolMapper;
|
||||
private final EduSchoolHomeAppMapper eduSchoolHomeAppMapper;
|
||||
private final EduSchoolHomeNewsMapper eduSchoolHomeNewsMapper;
|
||||
private final EduSchoolManuscriptMapper eduSchoolManuscriptMapper;
|
||||
|
||||
private final CommonService commonService;
|
||||
private final RedisService redisService;
|
||||
|
||||
@Override
|
||||
public HomeInfoVO getHomeInfo(Long schoolId, Integer userType) {
|
||||
public HomeInfoVO getHomeInfo(Long schoolId) {
|
||||
Dept dept = commonService.getDept(schoolId);
|
||||
HomeInfoVO homeInfoVO = new HomeInfoVO();
|
||||
//缓存主页信息
|
||||
if (redisService.hHasKey(CachePrefixConstant.SCHOOL_HOME_INFO, schoolId + "" + userType)) {
|
||||
homeInfoVO = (HomeInfoVO) redisService
|
||||
.hget(CachePrefixConstant.SCHOOL_HOME_INFO, schoolId + "" + userType);
|
||||
} else {
|
||||
Dept dept = commonService.getDept(schoolId);
|
||||
homeInfoVO.setDeptType(dept.getDeptType());
|
||||
homeInfoVO.setCoverList(list(Wrappers.lambdaQuery(new EduSchoolHomeCover())
|
||||
.eq(EduSchoolHomeCover::getSchoolId, schoolId)));
|
||||
if (dept.getDeptType().equals(DeptTypeEnum.SCHOOL_TYPE.getValue())) {
|
||||
homeInfoVO.setParentAppList(eduSchoolHomeAppMapper.listApp(schoolId, 0, null, null));
|
||||
homeInfoVO.setTeacherAppList(eduSchoolHomeAppMapper.listApp(schoolId, 1, null, null));
|
||||
// 查询公告区
|
||||
EduSchoolHomeAnnouncement announcement =
|
||||
eduSchoolHomeAnnouncementService.getOne(Wrappers.lambdaQuery(new EduSchoolHomeAnnouncement())
|
||||
.eq(EduSchoolHomeAnnouncement::getSchoolId, schoolId));
|
||||
// 无公告进行保存操作
|
||||
if (announcement == null) {
|
||||
announcement = new EduSchoolHomeAnnouncement();
|
||||
announcement.setSchoolId(schoolId);
|
||||
announcement.setName("公示公告");
|
||||
eduSchoolHomeAnnouncementService.saveAnnouncement(announcement);
|
||||
}
|
||||
// 设置了置顶公告则进行查询
|
||||
if (announcement.getTopAnnouncementId() != null) {
|
||||
EduNoticeSchool topNotice = eduNoticeSchoolMapper.selectById(announcement.getTopAnnouncementId());
|
||||
if (topNotice != null) {
|
||||
announcement.setTopAnnouncementPubDate(topNotice.getSendDate());
|
||||
announcement.setTopAnnouncement(topNotice);
|
||||
}
|
||||
}
|
||||
// 查询公告区公告
|
||||
LambdaQueryWrapper<EduNoticeSchool> condition = Wrappers.lambdaQuery(new EduNoticeSchool())
|
||||
.eq(EduNoticeSchool::getSchoolId, schoolId)
|
||||
.eq(EduNoticeSchool::getIsPublic, 1)
|
||||
.orderByDesc(EduNoticeSchool::getSendDate)
|
||||
.last(announcement.getTopAnnouncementId() == null ? "limit 3" : "limit 2");
|
||||
if (announcement.getTopAnnouncementId() != null) {
|
||||
condition.ne(EduNoticeSchool::getId, announcement.getTopAnnouncementId());
|
||||
}
|
||||
announcement.setManuscriptList(eduNoticeSchoolMapper.selectList(condition));
|
||||
homeInfoVO.setAnnouncement(announcement);
|
||||
// 微官网区
|
||||
EduSchoolHomeMicro microInfo = eduSchoolHomeMicroService.getInfo(schoolId);
|
||||
if (microInfo == null) {
|
||||
eduSchoolHomeMicroService.initMicro(schoolId);
|
||||
microInfo = eduSchoolHomeMicroService.getInfo(schoolId);
|
||||
}
|
||||
homeInfoVO.setMicro(microInfo);
|
||||
// 查询新闻区
|
||||
EduSchoolHomeNews news = eduSchoolHomeNewsMapper.selectOne(Wrappers.lambdaQuery(new EduSchoolHomeNews())
|
||||
.eq(EduSchoolHomeNews::getSchoolId, schoolId));
|
||||
if (news == null) {
|
||||
news = new EduSchoolHomeNews();
|
||||
news.setSchoolId(schoolId);
|
||||
news.setName("学校新闻");
|
||||
eduSchoolHomeNewsMapper.insert(news);
|
||||
}
|
||||
homeInfoVO.setNews(news);
|
||||
if (homeInfoVO.getNews().getTopNewsId() != null) {
|
||||
EduSchoolManuscript topNews = eduSchoolManuscriptMapper.getInfo(homeInfoVO.getNews().getTopNewsId());
|
||||
homeInfoVO.getNews().setTopNews(topNews);
|
||||
homeInfoVO.setDeptType(dept.getDeptType());
|
||||
homeInfoVO.setCoverList(list(Wrappers.lambdaQuery(new EduSchoolHomeCover())
|
||||
.eq(EduSchoolHomeCover::getSchoolId, schoolId)));
|
||||
if (dept.getDeptType().equals(DeptTypeEnum.SCHOOL_TYPE.getValue())) {
|
||||
homeInfoVO.setParentAppList(eduSchoolHomeAppMapper.listApp(schoolId, 0, null, null));
|
||||
homeInfoVO.setTeacherAppList(eduSchoolHomeAppMapper.listApp(schoolId, 1, null, null));
|
||||
// 查询公告区
|
||||
EduSchoolHomeAnnouncement announcement =
|
||||
eduSchoolHomeAnnouncementService.getOne(Wrappers.lambdaQuery(new EduSchoolHomeAnnouncement())
|
||||
.eq(EduSchoolHomeAnnouncement::getSchoolId, schoolId));
|
||||
// 无公告进行保存操作
|
||||
if (announcement == null) {
|
||||
announcement = new EduSchoolHomeAnnouncement();
|
||||
announcement.setSchoolId(schoolId);
|
||||
announcement.setName("公示公告");
|
||||
eduSchoolHomeAnnouncementService.saveAnnouncement(announcement);
|
||||
}
|
||||
// 设置了置顶公告则进行查询
|
||||
if (announcement.getTopAnnouncementId() != null) {
|
||||
EduNoticeSchool topNotice = eduNoticeSchoolMapper.selectById(announcement.getTopAnnouncementId());
|
||||
if (topNotice != null) {
|
||||
announcement.setTopAnnouncementPubDate(topNotice.getSendDate());
|
||||
announcement.setTopAnnouncement(topNotice);
|
||||
}
|
||||
}
|
||||
// 查询功能区
|
||||
EduHomeFunction function = eduHomeFunctionService
|
||||
.getOne(Wrappers.<EduHomeFunction>lambdaQuery().eq(EduHomeFunction::getDeptId, schoolId));
|
||||
if (function == null) {
|
||||
function = new EduHomeFunction();
|
||||
function.setDeptId(schoolId);
|
||||
function.setSearchSchool(0);
|
||||
function.setMatchSchool(0);
|
||||
function.setEnrolSign(0);
|
||||
function.setEnrolQa(0);
|
||||
eduHomeFunctionService.save(function);
|
||||
// 查询公告区公告
|
||||
LambdaQueryWrapper<EduNoticeSchool> condition = Wrappers.lambdaQuery(new EduNoticeSchool())
|
||||
.eq(EduNoticeSchool::getSchoolId, schoolId)
|
||||
.eq(EduNoticeSchool::getIsPublic, 1)
|
||||
.orderByDesc(EduNoticeSchool::getSendDate)
|
||||
.last(announcement.getTopAnnouncementId() == null ? "limit 3" : "limit 2");
|
||||
if (announcement.getTopAnnouncementId() != null) {
|
||||
condition.ne(EduNoticeSchool::getId, announcement.getTopAnnouncementId());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(userType)) {
|
||||
List<EduDeptHomeApp> list = eduDeptHomeAppService.list(Wrappers.<EduDeptHomeApp>lambdaQuery()
|
||||
.eq(EduDeptHomeApp::getDeptId, schoolId)
|
||||
.eq(EduDeptHomeApp::getUserType, userType)
|
||||
.eq(EduDeptHomeApp::getEnableStatus, EnableStatusEnum.ENABLE_STATUS.getStatus())
|
||||
.orderByAsc(EduDeptHomeApp::getSort));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
homeInfoVO.setEduDeptHomeAppList(list);
|
||||
}
|
||||
|
||||
announcement.setManuscriptList(eduNoticeSchoolMapper.selectList(condition));
|
||||
homeInfoVO.setAnnouncement(announcement);
|
||||
// 微官网区
|
||||
EduSchoolHomeMicro microInfo = eduSchoolHomeMicroService.getInfo(schoolId);
|
||||
if (microInfo == null) {
|
||||
eduSchoolHomeMicroService.initMicro(schoolId);
|
||||
microInfo = eduSchoolHomeMicroService.getInfo(schoolId);
|
||||
}
|
||||
homeInfoVO.setFunction(function);
|
||||
|
||||
if (ObjectUtil.isNotNull(homeInfoVO)) {
|
||||
redisService.hset(CachePrefixConstant.SCHOOL_HOME_INFO, schoolId + "" + userType, homeInfoVO);
|
||||
homeInfoVO.setMicro(microInfo);
|
||||
// 查询新闻区
|
||||
EduSchoolHomeNews news = eduSchoolHomeNewsMapper.selectOne(Wrappers.lambdaQuery(new EduSchoolHomeNews())
|
||||
.eq(EduSchoolHomeNews::getSchoolId, schoolId));
|
||||
if (news == null) {
|
||||
news = new EduSchoolHomeNews();
|
||||
news.setSchoolId(schoolId);
|
||||
news.setName("学校新闻");
|
||||
eduSchoolHomeNewsMapper.insert(news);
|
||||
}
|
||||
homeInfoVO.setNews(news);
|
||||
if (homeInfoVO.getNews().getTopNewsId() != null) {
|
||||
EduSchoolManuscript topNews = eduSchoolManuscriptMapper.getInfo(homeInfoVO.getNews().getTopNewsId());
|
||||
homeInfoVO.getNews().setTopNews(topNews);
|
||||
}
|
||||
}
|
||||
// 查询功能区
|
||||
EduHomeFunction function = eduHomeFunctionService
|
||||
.getOne(Wrappers.<EduHomeFunction>lambdaQuery().eq(EduHomeFunction::getDeptId, schoolId));
|
||||
if (function == null) {
|
||||
function = new EduHomeFunction();
|
||||
function.setDeptId(schoolId);
|
||||
function.setSearchSchool(0);
|
||||
function.setMatchSchool(0);
|
||||
function.setEnrolSign(0);
|
||||
function.setEnrolQa(0);
|
||||
eduHomeFunctionService.save(function);
|
||||
}
|
||||
homeInfoVO.setFunction(function);
|
||||
return homeInfoVO;
|
||||
}
|
||||
|
||||
@@ -187,8 +157,5 @@ public class EduSchoolHomeCoverServiceImpl extends ServiceImpl
|
||||
EduYidaApp yidaApp = commonService.getYidaApp(schoolId);
|
||||
AppUtil.bannerUpdate(school.getYidaAppColId(), urlList, sortList, yidaApp);
|
||||
}
|
||||
|
||||
redisService.del(CachePrefixConstant.SCHOOL_HOME_INFO, schoolId + "" + 0);
|
||||
redisService.del(CachePrefixConstant.SCHOOL_HOME_INFO, schoolId + "" + 1);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -135,7 +135,7 @@ public class EduLeaveRequestServiceImpl extends ServiceImpl
|
||||
//发送企业微信通知
|
||||
if (school.getSchoolType().contains("0")) {
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SELECT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.TEACHER_LEAVE_REQUEST, null,
|
||||
staff.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
|
||||
@@ -246,7 +246,7 @@ public class EduLeaveRequestServiceImpl extends ServiceImpl
|
||||
//通知企业微信对应家长
|
||||
Dept dept = commonService.getDept(schoolId);
|
||||
if (dept.getSchoolType().contains("0")) {
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SELECT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.TEACHER_LEAVE_REQUEST, null,
|
||||
schoolId);
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
List<Long> list = new ArrayList<>();
|
||||
|
||||
+10
-11
@@ -1,25 +1,21 @@
|
||||
package com.yida.data.school.letter.controller;
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxConfig;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxReplyPerson;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.dto.letterbox.LetterBoxConfigDTO;
|
||||
import com.yida.data.school.letter.service.EduLetterBoxConfigService;
|
||||
import com.yida.data.school.letter.service.EduLetterBoxReplyPersonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ccl
|
||||
@@ -37,6 +33,7 @@ public class EduLetterBoxConfigController {
|
||||
|
||||
@ApiOperation("滚动图列表")
|
||||
@GetMapping("/findBannerList")
|
||||
@ControllerLog(operation = "撤回")
|
||||
public ResultBean<List<EduLetterBoxConfig>> findBannerList() {
|
||||
|
||||
return ResultBean.buildSuccess(configService.findBannerList(FebsUtil.getCurrentUser().getDeptId()));
|
||||
@@ -44,14 +41,16 @@ public class EduLetterBoxConfigController {
|
||||
|
||||
@ApiOperation("滚动图列表")
|
||||
@GetMapping("/findConfig")
|
||||
@ControllerLog(operation = "撤回")
|
||||
public ResultBean<LetterBoxConfigDTO> findConfig() {
|
||||
|
||||
return ResultBean.buildSuccess(configService.findConfig(FebsUtil.getCurrentUser().getDeptId()));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增或修改配置")
|
||||
@PostMapping("/saveOrUpdateConfig")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "新增或修改配置", type = OperationLogTypeEnum.SAVE)
|
||||
@ControllerLog(operation = "撤回")
|
||||
public ResultBean saveOrUpdateConfig(@RequestBody LetterBoxConfigDTO config) {
|
||||
replyPersonService.saveOrUpdateConfig(config,FebsUtil.getCurrentUser().getDeptId());
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
+23
-27
@@ -9,16 +9,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBox;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxReply;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.common.core.vo.NameValueVO;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.dto.letterbox.LetterBoxDTO;
|
||||
import com.yida.data.school.letter.mapper.EduLetterBoxMapper;
|
||||
import com.yida.data.school.letter.service.EduLetterBoxService;
|
||||
@@ -50,7 +47,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
@RefreshScope
|
||||
@RequiredArgsConstructor
|
||||
public class EduLetterBoxController {
|
||||
|
||||
private final EduLetterBoxService eduLetterBoxService;
|
||||
private final EduLetterBoxMapper eduLetterBoxMapper;
|
||||
|
||||
@@ -65,13 +61,14 @@ public class EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("分页查询信箱列表")
|
||||
@GetMapping("/findLetterPageList")
|
||||
@ControllerLog(operation = "分页查询信箱列表")
|
||||
public ResultBean<IPage<EduLetterBox>> findLetterPageList(@ApiParam("问题名称") @RequestParam(required = false) String title,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("信件类型") @RequestParam(required = false) String contentType,
|
||||
@ApiParam("手机号") @RequestParam(required = false) String appPhone,
|
||||
@ApiParam("是否已回复0=否,1是") @RequestParam Integer reply,
|
||||
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@ApiParam("数量") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("信件类型") @RequestParam(required = false) String contentType,
|
||||
@ApiParam("手机号") @RequestParam(required = false) String appPhone,
|
||||
@ApiParam("是否已回复0=否,1是") @RequestParam Integer reply,
|
||||
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@ApiParam("数量") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
//查询分页数据
|
||||
Page page = new Page();
|
||||
page.setCurrent(pageNo);
|
||||
@@ -88,7 +85,7 @@ public class EduLetterBoxController {
|
||||
|
||||
@ApiOperation("提交回复信息")
|
||||
@PostMapping("/submitReplyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "提交回复信息", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "提交回复信息")
|
||||
public ResultBean submitReplyLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
if (ObjectUtil.isEmpty(currentUser)) {
|
||||
@@ -109,7 +106,7 @@ public class EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("提交审核")
|
||||
@PostMapping("/submitExamineLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "提交审核", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "提交审核")
|
||||
public ResultBean submitExamineLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
EduLetterBox eduLetterBox1 = eduLetterBoxMapper.selectById(eduLetterBox.getId());
|
||||
if ("0".equals(eduLetterBox1.getStatus())) {
|
||||
@@ -128,7 +125,7 @@ public class EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("撤回")
|
||||
@GetMapping("/retract")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "撤回", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "撤回")
|
||||
public ResultBean retract(@ApiParam("信箱id") @RequestParam Long id) {
|
||||
eduLetterBoxMapper.updateByReply(id);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -137,7 +134,7 @@ public class EduLetterBoxController {
|
||||
|
||||
@ApiOperation("批量公开")
|
||||
@PostMapping("/listOpenLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "批量公开", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "批量公开")
|
||||
public ResultBean listOpenLetter(@RequestBody List<Long> ids) {
|
||||
Collection<EduLetterBox> eduLetterBoxes = eduLetterBoxService.listByIds(ids);
|
||||
for (EduLetterBox eduLetterBox : eduLetterBoxes) {
|
||||
@@ -149,7 +146,7 @@ public class EduLetterBoxController {
|
||||
|
||||
@ApiOperation("批量回复")
|
||||
@PostMapping("/listReplyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "批量回复", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "批量回复")
|
||||
public ResultBean listReplyLetter(@RequestBody LetterBoxDTO letterBoxDTO) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
Collection<EduLetterBox> eduLetterBoxes = eduLetterBoxService.listByIds(letterBoxDTO.getIds());
|
||||
@@ -159,11 +156,11 @@ public class EduLetterBoxController {
|
||||
|
||||
@ApiOperation("进行置顶或公开操作")
|
||||
@GetMapping(value = "updateTopOrOpen")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "进行置顶或公开操作", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "进行置顶或公开操作")
|
||||
public ResultBean updateTopOrOpen(@ApiParam("信箱id") @RequestParam Long id,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top,
|
||||
@ApiParam("1为公开,0为取消公开") @RequestParam(required = false) Integer open) {
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top,
|
||||
@ApiParam("1为公开,0为取消公开") @RequestParam(required = false) Integer open) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
|
||||
if (ObjectUtil.isEmpty(currentUser)) {
|
||||
@@ -186,9 +183,9 @@ public class EduLetterBoxController {
|
||||
|
||||
@ApiOperation("取消置顶")
|
||||
@GetMapping(value = "updateTop")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "取消置顶", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "取消置顶")
|
||||
public ResultBean updateTop(@ApiParam("信箱id") @RequestParam Long id,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top) {
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top) {
|
||||
|
||||
if (ObjectUtil.isEmpty(FebsUtil.getCurrentUser())) {
|
||||
return ResultBean.buildError("登录失效请重新登录");
|
||||
@@ -199,7 +196,7 @@ public class EduLetterBoxController {
|
||||
|
||||
@GetMapping("/viewLetter")
|
||||
public ResultBean viewLetter(Long id, String title,
|
||||
Integer status, String contentType) {
|
||||
Integer status, String contentType) {
|
||||
EduLetterBox eduLetterBox = eduLetterBoxMapper.selectById(id);
|
||||
if (StrUtil.isNotBlank(eduLetterBox.getContent())) {
|
||||
eduLetterBox.setContent(EmojiParser.parseToUnicode(eduLetterBox.getContent()));
|
||||
@@ -235,7 +232,7 @@ public class EduLetterBoxController {
|
||||
for (int i = 0; i < listViewLetter.size(); i++) {
|
||||
// 判断是否只有一条数据
|
||||
if (Objects.equals(listViewLetter.get(0).getId(), id) && Objects
|
||||
.equals(listViewLetter.get(listViewLetter.size() - 1).getId(), id)) {
|
||||
.equals(listViewLetter.get(listViewLetter.size() - 1).getId(), id)) {
|
||||
previousShow = false;
|
||||
nextShow = false;
|
||||
break;
|
||||
@@ -276,16 +273,15 @@ public class EduLetterBoxController {
|
||||
@GetMapping("/getStaData")
|
||||
public ResultBean<StaLetterVO> getStaData(String startDate, String endDate) {
|
||||
List<Long> schoolIds = remoteDeptService.getSchoolByArea(null, null).getData().stream().map(Dept::getDeptId).collect(
|
||||
Collectors.toList());
|
||||
return ResultBean
|
||||
.buildSuccess(eduLetterBoxService.getStaData(LocalDate.parse(startDate), LocalDate.parse(endDate), schoolIds));
|
||||
Collectors.toList());
|
||||
return ResultBean.buildSuccess(eduLetterBoxService.getStaData(LocalDate.parse(startDate), LocalDate.parse(endDate), schoolIds));
|
||||
}
|
||||
|
||||
@ApiOperation("校长信息标题词云")
|
||||
@GetMapping("/titleCloud")
|
||||
public ResultBean<List<NameValueVO<String, Integer>>> titleCloud(String startDate, String endDate) {
|
||||
List<Long> schoolIds = remoteDeptService.getSchoolByArea(null, null).getData().stream().map(Dept::getDeptId).collect(
|
||||
Collectors.toList());
|
||||
Collectors.toList());
|
||||
return ResultBean.buildSuccess(eduLetterBoxService.titleCloud(startDate, endDate, schoolIds));
|
||||
}
|
||||
}
|
||||
|
||||
+32
-21
@@ -7,16 +7,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBox;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxConfig;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxReply;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.letter.service.EduLetterBoxReplyService;
|
||||
import com.yida.data.school.letter.service.EduLetterBoxService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -35,7 +32,6 @@ import java.util.Optional;
|
||||
@RestController
|
||||
@RequestMapping(value = "/letter/H5/letter")
|
||||
public class H5EduLetterBoxController {
|
||||
|
||||
@Autowired
|
||||
private EduLetterBoxService eduLetterBoxService;
|
||||
|
||||
@@ -51,16 +47,28 @@ public class H5EduLetterBoxController {
|
||||
* @apiParam {Integer} coreOrderId 参加的点单id:必传,作为判断
|
||||
* @apiParam {String} header 用户头像
|
||||
* @apiParam {String} nikeName 用户昵称
|
||||
* @apiParamExample {json} 请求样例: { coreOrderId : 1 appId : demoData nikeName : demoData header : demoData }
|
||||
* @apiParamExample {json} 请求样例:
|
||||
* {
|
||||
* coreOrderId : 1
|
||||
* appId : demoData
|
||||
* nikeName : demoData
|
||||
* header : demoData
|
||||
* }
|
||||
* @apiSuccess (200) {String} msg 信息
|
||||
* @apiSuccess (200) {int} code 200 代表无错误 其他 代表错误
|
||||
* @apiSuccess (200) {int} count 总条数
|
||||
* @apiSuccess (200) {object} data 数据详情
|
||||
* @apiSuccessExample {json} 返回样例: { "code": 200, "msg": "操作成功", "count": 0, "data": null }
|
||||
* @apiSuccessExample {json} 返回样例:
|
||||
* {
|
||||
* "code": 200,
|
||||
* "msg": "操作成功",
|
||||
* "count": 0,
|
||||
* "data": null
|
||||
* }
|
||||
*/
|
||||
@ApiOperation("新增信箱提问")
|
||||
@PostMapping("/addLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "新增信箱提问", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增信箱提问")
|
||||
public ResultBean addLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
if (ObjectUtil.isEmpty(currentUser)) {
|
||||
@@ -76,7 +84,7 @@ public class H5EduLetterBoxController {
|
||||
if (EmojiManager.containsEmoji(eduLetterBox.getTitle())) {
|
||||
return ResultBean.buildError("标题不能含有表情符号");
|
||||
}
|
||||
eduLetterBoxService.addLetter(eduLetterBox, currentUser);
|
||||
eduLetterBoxService.addLetter(eduLetterBox,currentUser);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@@ -88,15 +96,16 @@ public class H5EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("分页信箱列表")
|
||||
@GetMapping("/findLetterPageList")
|
||||
@ControllerLog(operation = "分页查询信息列表")
|
||||
public ResultBean<IPage<EduLetterBox>> findLetterPageList(@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("标题") @RequestParam(required = false) String title,
|
||||
@ApiParam("浏览次数传0按照创建时间排序,传1按照浏览数量排序") @RequestParam(required = false) Integer viewsNum,
|
||||
@ApiParam("identityId") @RequestParam(required = false) Long identityId) {
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("标题") @RequestParam(required = false) String title,
|
||||
@ApiParam("浏览次数传0按照创建时间排序,传1按照浏览数量排序") @RequestParam(required = false) Integer viewsNum,
|
||||
@ApiParam("identityId") @RequestParam(required = false) Long identityId) {
|
||||
Asserts.isNotNull(schoolId, "学校id为空");
|
||||
IPage<EduLetterBox> list = eduLetterBoxService.findViewList(new Page(pageNo, pageSize), title, schoolId,
|
||||
identityId, viewsNum);
|
||||
identityId, viewsNum);
|
||||
return ResultBean.buildSuccess(list);
|
||||
}
|
||||
|
||||
@@ -108,8 +117,10 @@ public class H5EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("查询信箱详情")
|
||||
@GetMapping("/getLetter")
|
||||
@ControllerLog(operation = "当前提问详情")
|
||||
public ResultBean getLetter(@ApiParam("信箱表id") @RequestParam Integer id) {
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(id)) {
|
||||
return ResultBean.buildError("id为空");
|
||||
}
|
||||
@@ -126,11 +137,11 @@ public class H5EduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("回复信箱")
|
||||
@PostMapping("/replyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "回复信箱", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "回复信箱")
|
||||
public ResultBean replyLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
if (ObjectUtil.isEmpty(eduLetterBox.getIdentityId()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getReplyContent()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getId())) {
|
||||
ObjectUtil.isEmpty(eduLetterBox.getReplyContent()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getId())) {
|
||||
return ResultBean.buildError("需传入id,appId,replyContent");
|
||||
}
|
||||
// 需要处理是处理初次提问的问题还是追问的问题
|
||||
@@ -151,11 +162,11 @@ public class H5EduLetterBoxController {
|
||||
|
||||
@ApiOperation("信箱点赞")
|
||||
@GetMapping("/upOrDownLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "信箱点赞", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "信箱点赞")
|
||||
public ResultBean upOrDownLetter(@ApiParam("信箱表id") @RequestParam Integer letterId,
|
||||
@ApiParam("0为有用,1为没用") @RequestParam Integer status,
|
||||
@ApiParam("0为点赞,1为取消") @RequestParam Integer type) {
|
||||
eduLetterBoxService.upOrDownLetter(letterId, status, FebsUtil.getCurrentUser().getUserId(), type);
|
||||
@ApiParam("0为有用,1为没用") @RequestParam Integer status,
|
||||
@ApiParam("0为点赞,1为取消") @RequestParam Integer type) {
|
||||
eduLetterBoxService.upOrDownLetter(letterId, status, FebsUtil.getCurrentUser().getUserId(),type);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
+50
-35
@@ -11,16 +11,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.vdurmont.emoji.EmojiManager;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBox;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxConfig;
|
||||
import com.yida.data.common.core.entity.letter.EduLetterBoxReply;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.common.core.vo.NameValueVO;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.dto.letterbox.LetterBoxConfigDTO;
|
||||
import com.yida.data.school.dto.letterbox.LetterBoxDTO;
|
||||
import com.yida.data.school.letter.mapper.EduLetterBoxMapper;
|
||||
@@ -103,16 +100,28 @@ public class OutEduLetterBoxController {
|
||||
* @apiParam {Integer} coreOrderId 参加的点单id:必传,作为判断
|
||||
* @apiParam {String} header 用户头像
|
||||
* @apiParam {String} nikeName 用户昵称
|
||||
* @apiParamExample {json} 请求样例: { coreOrderId : 1 appId : demoData nikeName : demoData header : demoData }
|
||||
* @apiParamExample {json} 请求样例:
|
||||
* {
|
||||
* coreOrderId : 1
|
||||
* appId : demoData
|
||||
* nikeName : demoData
|
||||
* header : demoData
|
||||
* }
|
||||
* @apiSuccess (200) {String} msg 信息
|
||||
* @apiSuccess (200) {int} code 200 代表无错误 其他 代表错误
|
||||
* @apiSuccess (200) {int} count 总条数
|
||||
* @apiSuccess (200) {object} data 数据详情
|
||||
* @apiSuccessExample {json} 返回样例: { "code": 200, "msg": "操作成功", "count": 0, "data": null }
|
||||
* @apiSuccessExample {json} 返回样例:
|
||||
* {
|
||||
* "code": 200,
|
||||
* "msg": "操作成功",
|
||||
* "count": 0,
|
||||
* "data": null
|
||||
* }
|
||||
*/
|
||||
@ApiOperation("新增信箱提问")
|
||||
@PostMapping("/addLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "新增信箱提问", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增信箱提问")
|
||||
public ResultBean addLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
CurrentUser currentUser = new CurrentUser();
|
||||
|
||||
@@ -120,7 +129,7 @@ public class OutEduLetterBoxController {
|
||||
return ResultBean.buildError("标题不能含有表情符号");
|
||||
}
|
||||
|
||||
eduLetterBoxService.addLetter(eduLetterBox, currentUser);
|
||||
eduLetterBoxService.addLetter(eduLetterBox,currentUser);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@@ -132,8 +141,10 @@ public class OutEduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("查询信箱详情")
|
||||
@GetMapping("/getLetter")
|
||||
@ControllerLog(operation = "当前提问详情")
|
||||
public ResultBean getLetter(@ApiParam("信箱表id") @RequestParam Integer id) {
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(id)) {
|
||||
return ResultBean.buildError("id为空");
|
||||
}
|
||||
@@ -150,11 +161,11 @@ public class OutEduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("回复信箱")
|
||||
@PostMapping("/replyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "回复信箱", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "回复信箱")
|
||||
public ResultBean replyLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
if (ObjectUtil.isEmpty(eduLetterBox.getIdentityId()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getReplyContent()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getId())) {
|
||||
ObjectUtil.isEmpty(eduLetterBox.getReplyContent()) ||
|
||||
ObjectUtil.isEmpty(eduLetterBox.getId())) {
|
||||
return ResultBean.buildError("需传入id,appId,replyContent");
|
||||
}
|
||||
// 需要处理是处理初次提问的问题还是追问的问题
|
||||
@@ -175,11 +186,11 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("信箱点赞")
|
||||
@GetMapping("/upOrDownLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "信箱点赞", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "信箱点赞")
|
||||
public ResultBean upOrDownLetter(@ApiParam("信箱表id") @RequestParam Integer letterId,
|
||||
@ApiParam("0为有用,1为没用") @RequestParam Integer status,
|
||||
@ApiParam("0为点赞,1为取消") @RequestParam Integer type) {
|
||||
eduLetterBoxService.upOrDownLetter(letterId, status, FebsUtil.getCurrentUser().getUserId(), type);
|
||||
@ApiParam("0为有用,1为没用") @RequestParam Integer status,
|
||||
@ApiParam("0为点赞,1为取消") @RequestParam Integer type) {
|
||||
eduLetterBoxService.upOrDownLetter(letterId, status, FebsUtil.getCurrentUser().getUserId(),type);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@@ -190,13 +201,14 @@ public class OutEduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("分页查询信箱列表")
|
||||
@GetMapping("/findLetterPageList")
|
||||
@ControllerLog(operation = "分页查询信箱列表")
|
||||
public ResultBean<IPage<EduLetterBox>> findLetterPageList(@ApiParam("问题名称") @RequestParam(required = false) String title,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("信件类型") @RequestParam(required = false) String contentType,
|
||||
@ApiParam("手机号") @RequestParam(required = false) String appPhone,
|
||||
@ApiParam("是否已回复0=否,1是") @RequestParam Integer reply,
|
||||
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@ApiParam("数量") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("信件类型") @RequestParam(required = false) String contentType,
|
||||
@ApiParam("手机号") @RequestParam(required = false) String appPhone,
|
||||
@ApiParam("是否已回复0=否,1是") @RequestParam Integer reply,
|
||||
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@ApiParam("数量") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
//查询分页数据
|
||||
Page page = new Page();
|
||||
page.setCurrent(pageNo);
|
||||
@@ -213,7 +225,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("提交回复信息")
|
||||
@PostMapping("/submitReplyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "提交回复信息", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "提交回复信息")
|
||||
public ResultBean submitReplyLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
|
||||
if (ObjectUtil.isEmpty(eduLetterBox.getReplyContent())) {
|
||||
@@ -231,7 +243,7 @@ public class OutEduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("提交审核")
|
||||
@PostMapping("/submitExamineLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "提交审核", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "提交审核")
|
||||
public ResultBean submitExamineLetter(@RequestBody EduLetterBox eduLetterBox) {
|
||||
EduLetterBox eduLetterBox1 = eduLetterBoxMapper.selectById(eduLetterBox.getId());
|
||||
if ("0".equals(eduLetterBox1.getStatus())) {
|
||||
@@ -250,7 +262,7 @@ public class OutEduLetterBoxController {
|
||||
*/
|
||||
@ApiOperation("撤回")
|
||||
@GetMapping("/retract")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "撤回", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "撤回")
|
||||
public ResultBean retract(@ApiParam("信箱id") @RequestParam Long id) {
|
||||
eduLetterBoxMapper.updateByReply(id);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -259,7 +271,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("批量公开")
|
||||
@PostMapping("/listOpenLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "批量公开", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "批量公开")
|
||||
public ResultBean listOpenLetter(@RequestBody List<Long> ids) {
|
||||
Collection<EduLetterBox> eduLetterBoxes = eduLetterBoxService.listByIds(ids);
|
||||
for (EduLetterBox eduLetterBox : eduLetterBoxes) {
|
||||
@@ -271,7 +283,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("批量回复")
|
||||
@PostMapping("/listReplyLetter")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "批量回复", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "批量回复")
|
||||
public ResultBean listReplyLetter(@RequestBody LetterBoxDTO letterBoxDTO) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
Collection<EduLetterBox> eduLetterBoxes = eduLetterBoxService.listByIds(letterBoxDTO.getIds());
|
||||
@@ -281,11 +293,11 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("进行置顶或公开操作")
|
||||
@GetMapping(value = "updateTopOrOpen")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "进行置顶或公开操作", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "进行置顶或公开操作")
|
||||
public ResultBean updateTopOrOpen(@ApiParam("信箱id") @RequestParam Long id,
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top,
|
||||
@ApiParam("1为公开,0为取消公开") @RequestParam(required = false) Integer open) {
|
||||
@ApiParam("学校id") @RequestParam Long schoolId,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top,
|
||||
@ApiParam("1为公开,0为取消公开") @RequestParam(required = false) Integer open) {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(top)) {
|
||||
Integer num = eduLetterBoxMapper.getTopNum(schoolId);
|
||||
@@ -303,9 +315,10 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("取消置顶")
|
||||
@GetMapping(value = "updateTop")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "取消置顶", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "取消置顶")
|
||||
public ResultBean updateTop(@ApiParam("信箱id") @RequestParam Long id,
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top) {
|
||||
@ApiParam("1为置顶,null为取消置顶") @RequestParam(required = false) Integer top) {
|
||||
|
||||
|
||||
eduLetterBoxMapper.updateTop(id, top);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -313,7 +326,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@GetMapping("/viewLetter")
|
||||
public ResultBean viewLetter(Long id, String title,
|
||||
Integer status, String contentType) {
|
||||
Integer status, String contentType) {
|
||||
EduLetterBox eduLetterBox = eduLetterBoxMapper.selectById(id);
|
||||
if (StrUtil.isNotBlank(eduLetterBox.getContent())) {
|
||||
eduLetterBox.setContent(EmojiParser.parseToUnicode(eduLetterBox.getContent()));
|
||||
@@ -349,7 +362,7 @@ public class OutEduLetterBoxController {
|
||||
for (int i = 0; i < listViewLetter.size(); i++) {
|
||||
// 判断是否只有一条数据
|
||||
if (Objects.equals(listViewLetter.get(0).getId(), id) && Objects
|
||||
.equals(listViewLetter.get(listViewLetter.size() - 1).getId(), id)) {
|
||||
.equals(listViewLetter.get(listViewLetter.size() - 1).getId(), id)) {
|
||||
previousShow = false;
|
||||
nextShow = false;
|
||||
break;
|
||||
@@ -388,6 +401,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("查询滚动图列表")
|
||||
@GetMapping("/findBannerList")
|
||||
@ControllerLog(operation = "查询滚动图列表")
|
||||
public ResultBean<List<EduLetterBoxConfig>> findBannerList(@RequestParam Long deptId) {
|
||||
|
||||
return ResultBean.buildSuccess(configService.findBannerList(deptId));
|
||||
@@ -395,6 +409,7 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("查询学校对应配置")
|
||||
@GetMapping("/findConfig")
|
||||
@ControllerLog(operation = "查询学校对应配置")
|
||||
public ResultBean<LetterBoxConfigDTO> findConfig(@RequestParam Long deptId) {
|
||||
|
||||
return ResultBean.buildSuccess(configService.findConfig(deptId));
|
||||
@@ -403,9 +418,9 @@ public class OutEduLetterBoxController {
|
||||
|
||||
@ApiOperation("新增或修改配置")
|
||||
@PostMapping("/saveOrUpdateConfig")
|
||||
@OperationLog(module = ModuleName.LETTER_BOX, methods = "新增或修改配置", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "新增或修改配置")
|
||||
public ResultBean saveOrUpdateConfig(@RequestBody LetterBoxConfigDTO config) {
|
||||
replyPersonService.saveOrUpdateConfig(config, config.getDeptId());
|
||||
replyPersonService.saveOrUpdateConfig(config,config.getDeptId());
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -163,7 +163,7 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
if (school.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
|
||||
EduApp appByCodeAndSchool = commonService
|
||||
.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null, letterBoxDTO.getSchoolId());
|
||||
.getAppByCodeAndSchool(AppConstant.LETTER_BOX, null, letterBoxDTO.getSchoolId());
|
||||
TextSchoolNotice textSchoolNotice = new TextSchoolNotice();
|
||||
Text text = new Text();
|
||||
textSchoolNotice.setText(text);
|
||||
@@ -201,7 +201,7 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
Dept school = commonService.getDept(eduLetterBox.getSchoolId());
|
||||
if (school.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
EduApp appByCodeAndSchool = commonService
|
||||
.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null, eduLetterBox.getSchoolId());
|
||||
.getAppByCodeAndSchool(AppConstant.LETTER_BOX, null, eduLetterBox.getSchoolId());
|
||||
TextSchoolNotice textSchoolNotice = new TextSchoolNotice();
|
||||
Text text = new Text();
|
||||
textSchoolNotice.setText(text);
|
||||
@@ -235,44 +235,44 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
if (type == 0) {
|
||||
//有用
|
||||
if (status == 0) {
|
||||
if (redisService.hasKey(AppConstant.INDEX_PARENT + letterId.toString())) {
|
||||
if (redisService.hasKey(AppConstant.LETTER_BOX_LIKE + letterId.toString())) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + letterId, 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_LIKE + letterId.toString(), 0L, -1L);
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
list.add(Long.valueOf(id));
|
||||
}
|
||||
list.add(userId);
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + letterId, list);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_LIKE + letterId.toString(), list);
|
||||
} else {
|
||||
List<Long> userList = new ArrayList<>();
|
||||
userList.add(userId);
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + letterId, userList);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_LIKE + letterId.toString(), userList);
|
||||
}
|
||||
}
|
||||
//没用
|
||||
else if (status == 1) {
|
||||
if (redisService.hasKey(AppConstant.INDEX_PARENT + "d" + letterId.toString())) {
|
||||
if (redisService.hasKey(AppConstant.LETTER_BOX_DISLIKE + letterId.toString())) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + "d" + letterId, 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_DISLIKE + letterId.toString(), 0L, -1L);
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
list.add(Long.valueOf(id));
|
||||
}
|
||||
list.add(userId);
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + "d" + letterId, list);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_DISLIKE + letterId.toString(), list);
|
||||
} else {
|
||||
List<Long> userList = new ArrayList<>();
|
||||
userList.add(userId);
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + "d" + letterId, userList);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_DISLIKE + letterId.toString(), userList);
|
||||
}
|
||||
}
|
||||
}
|
||||
//取消点赞
|
||||
else {
|
||||
if (redisService.hasKey(AppConstant.INDEX_PARENT + "d" + letterId)) {
|
||||
if (redisService.hasKey(AppConstant.LETTER_BOX_DISLIKE + letterId.toString())) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + "d" + letterId, 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_DISLIKE + letterId.toString(), 0L, -1L);
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
list.add(Long.valueOf(id));
|
||||
@@ -280,12 +280,12 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
list.remove(userId);
|
||||
}
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + "d" + letterId, list);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_DISLIKE + letterId.toString(), list);
|
||||
}
|
||||
|
||||
if (redisService.hasKey(AppConstant.INDEX_PARENT + letterId.toString())) {
|
||||
if (redisService.hasKey(AppConstant.LETTER_BOX_LIKE + letterId.toString())) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + letterId, 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_LIKE + letterId.toString(), 0L, -1L);
|
||||
if (CollectionUtil.isNotEmpty(userList)) {
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
@@ -293,7 +293,7 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
}
|
||||
list.remove(userId);
|
||||
}
|
||||
redisService.llSet(AppConstant.INDEX_PARENT + letterId.toString(), list);
|
||||
redisService.llSet(AppConstant.LETTER_BOX_LIKE + letterId.toString(), list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -350,7 +350,7 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
}
|
||||
|
||||
|
||||
EduApp appByCodeAndSchool = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SELECT, null, eduLetterBox.getSchoolId());
|
||||
EduApp appByCodeAndSchool = commonService.getAppByCodeAndSchool(AppConstant.LETTER_BOX_TEACHER, null, eduLetterBox.getSchoolId());
|
||||
|
||||
for (EduStaff staff : staffList) {
|
||||
if (ObjectUtil.isNotEmpty(staff)) {
|
||||
@@ -380,9 +380,9 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
*/
|
||||
public EduLetterBox statisticsLetter(EduLetterBox eduLetterBox, Long userId) {
|
||||
//没用数量
|
||||
if (redisService.hasKey(AppConstant.INDEX_PARENT + "d" + eduLetterBox.getId())) {
|
||||
if (redisService.hasKey(AppConstant.LETTER_BOX_DISLIKE + eduLetterBox.getId().toString())) {
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + "d" + eduLetterBox.getId(), 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_DISLIKE + eduLetterBox.getId().toString(), 0L, -1L);
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
list.add(Long.valueOf(id));
|
||||
@@ -396,10 +396,10 @@ public class EduLetterBoxServiceImpl extends ServiceImpl<EduLetterBoxMapper, Edu
|
||||
eduLetterBox.setDisLikeNum(0);
|
||||
}
|
||||
//有用数量
|
||||
if (redisService.hHasKey(eduLetterBox.getId().toString(), AppConstant.INDEX_PARENT)) {
|
||||
if (redisService.hHasKey(eduLetterBox.getId().toString(), AppConstant.LETTER_BOX_LIKE)) {
|
||||
|
||||
List<Long> list = new ArrayList<>();
|
||||
List<Object> userList = redisService.lGet(AppConstant.INDEX_PARENT + eduLetterBox.getId().toString(), 0L, -1L);
|
||||
List<Object> userList = redisService.lGet(AppConstant.LETTER_BOX_LIKE + eduLetterBox.getId().toString(), 0L, -1L);
|
||||
for (Object o : userList) {
|
||||
String id = String.valueOf(o);
|
||||
list.add(Long.valueOf(id));
|
||||
|
||||
+10
@@ -22,6 +22,7 @@ import com.yida.data.system.feign.RemoteDeptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -72,6 +73,7 @@ public class EduSchoolManuscriptController {
|
||||
pageSize), schoolId, keyword, author, publishDate, path, notShowId, type, status, label));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("保存、编辑稿件")
|
||||
@PostMapping("/saveManuscript")
|
||||
public ResultBean<AddManuscriptProgress> saveManuscript(@RequestBody EduSchoolManuscript manuscript) {
|
||||
@@ -151,4 +153,12 @@ public class EduSchoolManuscriptController {
|
||||
.in(EduSchoolManuscript::getSchoolId, schoolIds)
|
||||
.eq(EduSchoolManuscript::getType, type)) : 0);
|
||||
}
|
||||
|
||||
@ApiOperation("查询稿件可以发布的位置")
|
||||
@GetMapping("/getManuscriptPublishPath")
|
||||
public ResultBean<Map<Integer, String>> getManuscriptPublishPath() {
|
||||
return ResultBean.buildSuccess(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -45,4 +45,5 @@ public interface EduSchoolManuscriptService extends IService<EduSchoolManuscript
|
||||
void saveManuscriptToYidaApp(EduSchoolManuscript manuscript, Dept school, EduYidaApp yidaApp);
|
||||
|
||||
IPage<EduSchoolManuscript> findManuscriptByLabel(Page<EduSchoolManuscript> page, String label);
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -143,7 +143,7 @@ public class EduNoticeBuyServiceImpl extends ServiceImpl<EduNoticeBuyMapper, Edu
|
||||
remoteJobService.saveJob(job);
|
||||
} else if (eduNoticeBuy.getSendDate().isBefore(LocalDateTime.now())) {
|
||||
//立即发送
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
eduNoticeBuy.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
Text text = new Text();
|
||||
@@ -248,7 +248,7 @@ public class EduNoticeBuyServiceImpl extends ServiceImpl<EduNoticeBuyMapper, Edu
|
||||
public void updateBuyNoticeById(Long eduNoticeBuyId) {
|
||||
EduNoticeBuy eduNoticeBuy = getById(eduNoticeBuyId);
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
eduNoticeBuy.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
EduNoticeBuyProduct eduNoticeBuyProduct = eduNoticeBuyProductService
|
||||
@@ -300,7 +300,7 @@ public class EduNoticeBuyServiceImpl extends ServiceImpl<EduNoticeBuyMapper, Edu
|
||||
public void sendBuyNoticeAgain(Long eduNoticeBuyId) {
|
||||
EduNoticeBuy eduNoticeBuy = getById(eduNoticeBuyId);
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
eduNoticeBuy.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
EduNoticeBuyProduct eduNoticeBuyProduct = eduNoticeBuyProductService
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@ public class EduNoticeSchoolServiceImpl extends ServiceImpl<EduNoticeSchoolMappe
|
||||
}
|
||||
// 微信进行消息推送
|
||||
if (school.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.NOTICE_PARENT, null,
|
||||
notice.getSchoolId());
|
||||
String token = wxUtil.getAccessToken(eduApp.getWxCorpId(), eduApp.getWxSecret());
|
||||
switch (notice.getType()) {
|
||||
|
||||
+183
-151
@@ -4,6 +4,7 @@ import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
@@ -37,13 +38,13 @@ import com.yida.data.school.news.service.EduSchoolMatterService;
|
||||
import com.yida.data.school.vo.index.ManuscriptPageInfoVO;
|
||||
import com.yida.data.school.vo.news.AddManuscriptProgress;
|
||||
import com.yida.data.system.feign.RemoteCommonService;
|
||||
import javax.sound.sampled.Line.Info;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -68,21 +69,18 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
|
||||
public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
<EduSchoolManuscriptMapper, EduSchoolManuscript> implements EduSchoolManuscriptService {
|
||||
<EduSchoolManuscriptMapper, EduSchoolManuscript> implements EduSchoolManuscriptService {
|
||||
|
||||
private final static String JOB_BEAN_NAME = "schoolManuscriptTask";
|
||||
private final static String JOB_METHOD_NAME = "publishManuscript";
|
||||
private static final Pattern BASE64_IMG_HEAD_PATTERN = Pattern
|
||||
.compile("\\s*data:([a-z]+\\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;" +
|
||||
"base64)?,([A-Za-z0-9+/]{4}){2,}(?:[A-Za-z0-9+=]{4})");
|
||||
.compile("\\s*data:([a-z]+\\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;" +
|
||||
"base64)?,([A-Za-z0-9+/]{4}){2,}(?:[A-Za-z0-9+=]{4})");
|
||||
private static final Pattern BASE64_IMG_PATTERN = Pattern.compile("([A-Za-z0-9+/]{4}){2,}(?:[A-Za-z0-9+=]{4})");
|
||||
private static final Pattern URL_IMG_PATTERN = Pattern.compile("http:\\/\\/((?!http:\\/\\/).)+?(\\.jpg|\\.png)");
|
||||
// private static final Pattern URL_IMG_PATTERN_MINE = Pattern
|
||||
// .compile("http:\\/\\/((?!https:\\/\\/).)+?(\\/jpg|\\/png|\\/GIF|\\/gif|\\/PNG|\\/JPG)");
|
||||
private static final String URL_IMG_PATTERN_MINE = "((http|https|ftp):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+(:[0-9]+)?(/[\\w \\-.~!*:@&=+$,/?#%]*)";
|
||||
// private static final String LOCAL_IMG_URL_HRAD = "http://zbz.yd-data.com";
|
||||
private static final String URL_IMG_PATTERN_MINE = "((http|https|ftp):\\/\\/)?([\\w\\-]+\\.)+[\\w\\-]+(:[0-9]+)?(/[\\w \\-.~!*:@&=+$,/?#%;]*)";
|
||||
private static final ExecutorService PUBLISH_THREAD_POOL =
|
||||
new ThreadPoolExecutor(5, 10, 30, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
|
||||
new ThreadPoolExecutor(5, 10, 30, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
|
||||
private final RemoteJobService remoteJobService;
|
||||
private final EduSchoolHomeAnnouncementMapper eduSchoolHomeAnnouncementMapper;
|
||||
private final EduSchoolManuscriptAuthorMapper eduSchoolManuscriptAuthorMapper;
|
||||
@@ -96,12 +94,14 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
@Value("${febs.uploadUrl}")
|
||||
private String uploadUrl;
|
||||
|
||||
private final TransactionTemplate transactionTemplate;
|
||||
|
||||
@Override
|
||||
public IPage<ManuscriptPageInfoVO> listManuscriptPage(Page page, Long schoolId, String keyword,
|
||||
String author, String publishDate, Integer path,
|
||||
Long notShowId, Integer type, Integer status, Integer label) {
|
||||
String author, String publishDate, Integer path,
|
||||
Long notShowId, Integer type, Integer status, Integer label) {
|
||||
IPage<ManuscriptPageInfoVO> ipage = baseMapper.listManuscriptPage(page, schoolId, keyword, author,
|
||||
publishDate, path, notShowId, type, status, label);
|
||||
publishDate, path, notShowId, type, status, label);
|
||||
for (ManuscriptPageInfoVO record : ipage.getRecords()) {
|
||||
String htmlStr = HtmlUtil.cleanHtmlTag(record.getContent());
|
||||
if (StrUtil.isBlank(htmlStr) || htmlStr.length() < 50) {
|
||||
@@ -128,156 +128,179 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveManuscript(EduSchoolManuscript manuscript, String key) {
|
||||
redisService
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, AddManuscriptProgress.builder().key(key).finish(0).build());
|
||||
|
||||
// 添加处理进度
|
||||
AddManuscriptProgress addManuscriptProgress = new AddManuscriptProgress();
|
||||
addManuscriptProgress.setKey(key);
|
||||
|
||||
Dept school = commonService.getDept(manuscript.getSchoolId());
|
||||
if (StrUtil.isBlank(school.getWxPublicAppId()) && manuscript.getPublishPath()
|
||||
.contains(EduSchoolManuscript.WX_PUBLIC_PATH)) {
|
||||
addManuscriptProgress.setFinish(1);
|
||||
addManuscriptProgress.setErrorMsg("该学校未绑定微信公众号");
|
||||
try {
|
||||
// 添加初始缓存
|
||||
redisService
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, addManuscriptProgress);
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, AddManuscriptProgress.builder().key(key).finish(0).build());
|
||||
|
||||
throw new FebsException("该学校未绑定微信公众号");
|
||||
// Asserts.isFalse(StrUtil.isBlank(school.getWxPublicAppId()) && manuscript.getPublishPath()
|
||||
// .contains(EduSchoolManuscript.WX_PUBLIC_PATH), "该学校未绑定微信公众号");
|
||||
}
|
||||
|
||||
if (school.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
EduSchoolManuscriptAuthor author = eduSchoolManuscriptAuthorMapper.selectById(manuscript.getAuthorId());
|
||||
if (StrUtil.isBlank(author.getYidaAppUserId())) {
|
||||
addManuscriptProgress.setFinish(1);
|
||||
addManuscriptProgress.setErrorMsg("该作者未在易达APP中创建,请选择其他作者");
|
||||
redisService
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, addManuscriptProgress);
|
||||
throw new FebsException("该作者未在易达APP中创建,请选择其他作者");
|
||||
Dept school = commonService.getDept(manuscript.getSchoolId());
|
||||
if (StrUtil.isBlank(school.getWxPublicAppId()) && manuscript.getPublishPath()
|
||||
.contains(EduSchoolManuscript.WX_PUBLIC_PATH)) {
|
||||
addManuscriptProgress.setErrorMsg("该学校未绑定微信公众号");
|
||||
throw new FebsException("该学校未绑定微信公众号");
|
||||
}
|
||||
// Asserts.isTrue(StrUtil.isNotBlank(author.getYidaAppUserId()), "该作者未在易达APP中创建,请选择其他作者");
|
||||
}
|
||||
// 正则匹配base64为url
|
||||
Matcher matcher1 = BASE64_IMG_HEAD_PATTERN.matcher(manuscript.getContent());
|
||||
Matcher matcher2 = BASE64_IMG_PATTERN.matcher(manuscript.getContent());
|
||||
List<String> saveMatter = new ArrayList<>();
|
||||
if (matcher1.find()) {
|
||||
matcher2.find();
|
||||
for (int i = 0; i < matcher1.groupCount(); i++) {
|
||||
String base64 = matcher1.group(i);
|
||||
if (base64 == null || base64.length() < 22 || matcher2.group(i) == null || StrUtil
|
||||
.isBlankIfStr(matcher2.group(i))) {
|
||||
continue;
|
||||
|
||||
if (school.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
EduSchoolManuscriptAuthor author = eduSchoolManuscriptAuthorMapper.selectById(manuscript.getAuthorId());
|
||||
if (StrUtil.isBlank(author.getYidaAppUserId())) {
|
||||
addManuscriptProgress.setErrorMsg("该作者未在易达APP中创建,请选择其他作者");
|
||||
throw new FebsException("该作者未在易达APP中创建,请选择其他作者");
|
||||
}
|
||||
String base64Code = matcher2.group(i);
|
||||
String url = remoteCommonService.uploadImg(base64Code).getData();
|
||||
manuscript.setContent(manuscript.getContent().replace(base64, url));
|
||||
}
|
||||
}
|
||||
//正则匹配非本地媒资系统URL
|
||||
List<String> urlList = ReUtil.findAll(URL_IMG_PATTERN_MINE, manuscript.getContent(), 0, new ArrayList<>());
|
||||
log.info("匹配出的图片:【{}】", urlList);
|
||||
for (String url : urlList) {
|
||||
if (url == null || url.length() < 12 || url.contains(uploadUrl)) {
|
||||
continue;
|
||||
// 正则匹配base64为url
|
||||
Matcher matcher1 = BASE64_IMG_HEAD_PATTERN.matcher(manuscript.getContent());
|
||||
Matcher matcher2 = BASE64_IMG_PATTERN.matcher(manuscript.getContent());
|
||||
List<String> saveMatter = new ArrayList<>();
|
||||
if (matcher1.find()) {
|
||||
matcher2.find();
|
||||
for (int i = 0; i < matcher1.groupCount(); i++) {
|
||||
try {
|
||||
String base64 = matcher1.group(i);
|
||||
if (base64 == null || base64.length() < 22 || matcher2.group(i) == null || StrUtil
|
||||
.isBlankIfStr(matcher2.group(i))) {
|
||||
continue;
|
||||
}
|
||||
String base64Code = matcher2.group(i);
|
||||
String url = remoteCommonService.uploadImg(base64Code).getData();
|
||||
manuscript.setContent(manuscript.getContent().replace(base64, url));
|
||||
} catch (Exception e) {
|
||||
log.error("处理base图片失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
String path = com.yida.data.common.core.utils.FileUtil.downloadToLocal(url);
|
||||
|
||||
log.info("缓存本地图片地址:【{}】", path);
|
||||
//上传本地媒资系统
|
||||
String newUrl = com.yida.data.common.core.utils.FileUtil.uploadFileToMediaServer(uploadUrl, path);
|
||||
FileUtil.del(path);
|
||||
manuscript.setContent(manuscript.getContent().replace(url, newUrl));
|
||||
}
|
||||
// 上传图片到素材库
|
||||
if (CollUtil.isNotEmpty(saveMatter)) {
|
||||
List<EduSchoolMatter> list = eduSchoolMatterService.list(Wrappers.lambdaQuery(new EduSchoolMatter())
|
||||
.eq(EduSchoolMatter::getSchoolId, manuscript.getSchoolId())
|
||||
.in(EduSchoolMatter::getUrl, saveMatter)
|
||||
.select(EduSchoolMatter::getUrl));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
// 已存在的素材库
|
||||
List<String> collect = list.stream().map(x -> x.getUrl()).collect(Collectors.toList());
|
||||
saveMatter = saveMatter.stream().filter(x -> !collect.contains(x)).collect(Collectors.toList());
|
||||
//正则匹配非本地媒资系统URL
|
||||
List<String> urlList = ReUtil.findAll(URL_IMG_PATTERN_MINE, manuscript.getContent(), 0, new ArrayList<>());
|
||||
log.info("匹配出的图片:【{}】", urlList);
|
||||
for (String url : urlList) {
|
||||
try {
|
||||
if (url == null || url.length() < 12 || url.contains(uploadUrl)) {
|
||||
continue;
|
||||
}
|
||||
String path = com.yida.data.common.core.utils.FileUtil.downloadToLocal(url);
|
||||
log.info("缓存本地图片地址:【{}】", path);
|
||||
// 上传本地媒资系统
|
||||
// String base64 = com.yida.data.common.core.utils.FileUtil.convertFileToBase64(new File(path));
|
||||
// String newUrl = remoteCommonService.uploadImg(base64).getData();
|
||||
String newUrl = com.yida.data.common.core.utils.FileUtil.uploadFileToMediaServer(uploadUrl, path);
|
||||
FileUtil.del(path);
|
||||
manuscript.setContent(manuscript.getContent().replace(url, newUrl));
|
||||
} catch (Exception e) {
|
||||
log.error("处理图片失败, url: {}", url, e);
|
||||
}
|
||||
}
|
||||
// 上传图片到素材库
|
||||
if (CollUtil.isNotEmpty(saveMatter)) {
|
||||
eduSchoolMatterService.saveMatterBatch(saveMatter, manuscript.getSchoolId(), 0);
|
||||
List<EduSchoolMatter> list = eduSchoolMatterService.list(Wrappers.lambdaQuery(new EduSchoolMatter())
|
||||
.eq(EduSchoolMatter::getSchoolId, manuscript.getSchoolId())
|
||||
.in(EduSchoolMatter::getUrl, saveMatter)
|
||||
.select(EduSchoolMatter::getUrl));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
// 已存在的素材库
|
||||
List<String> collect = list.stream().map(EduSchoolMatter::getUrl).collect(Collectors.toList());
|
||||
saveMatter = saveMatter.stream().filter(x -> !collect.contains(x)).collect(Collectors.toList());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(saveMatter)) {
|
||||
eduSchoolMatterService.saveMatterBatch(saveMatter, manuscript.getSchoolId(), 0);
|
||||
}
|
||||
}
|
||||
// 使用编程式事务
|
||||
transactionTemplate.executeWithoutResult(transactionStatus -> {
|
||||
try {
|
||||
saveOrUpdate(manuscript);
|
||||
if (CollUtil.isNotEmpty(manuscript.getTags())) {
|
||||
List<Long> labels = manuscript.getTags();
|
||||
List<EduSchoolManuscriptLabel> list = new ArrayList<>();
|
||||
for (Long label : labels) {
|
||||
EduSchoolManuscriptLabel eduSchoolManuscriptLabel = new EduSchoolManuscriptLabel();
|
||||
eduSchoolManuscriptLabel.setLabel(label);
|
||||
eduSchoolManuscriptLabel.setManuscriptId(manuscript.getId());
|
||||
list.add(eduSchoolManuscriptLabel);
|
||||
}
|
||||
labelService.saveBatch(list);
|
||||
}
|
||||
if (Objects.isNull(manuscript.getContentType())) {
|
||||
// 如果没有则默认为文章类型
|
||||
manuscript.setContentType(1);
|
||||
}
|
||||
if (manuscript.getStatus() != 0 && manuscript.getContentType() != 2) {
|
||||
if (manuscript.getIsTiming() == 0) {
|
||||
// 定时发送
|
||||
StringBuilder cron = new StringBuilder();
|
||||
// cron表达式
|
||||
cron.append("0")
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getMinute())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getHour())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getDayOfMonth())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getMonthValue())
|
||||
.append(" ")
|
||||
.append("?")
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getYear());
|
||||
Job job = new Job();
|
||||
job.setBeanName(JOB_BEAN_NAME);
|
||||
job.setMethodName(JOB_METHOD_NAME);
|
||||
job.setParams(manuscript.getId().toString());
|
||||
job.setCronExpression(cron.toString());
|
||||
job.setRemark(String.format("学校稿件定时发送,name:[%s],id:[%d]", manuscript.getTitle(),
|
||||
manuscript.getId()));
|
||||
job.setStatus(Job.ScheduleStatus.NORMAL.getValue());
|
||||
remoteJobService.saveJob(job);
|
||||
} else {
|
||||
// 立即发送
|
||||
manuscript.setPublishDate(LocalDateTime.now());
|
||||
updateById(manuscript);
|
||||
publishManuscript(manuscript);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 手动回滚事务
|
||||
transactionStatus.setRollbackOnly();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new FebsException(e instanceof FebsException ? e.getMessage() : "保存失败");
|
||||
} finally {
|
||||
// 添加完成信息
|
||||
addManuscriptProgress.setFinish(1);
|
||||
redisService
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, addManuscriptProgress);
|
||||
}
|
||||
saveOrUpdate(manuscript);
|
||||
if (CollUtil.isNotEmpty(manuscript.getTags())) {
|
||||
List<Long> labels = manuscript.getTags();
|
||||
List<EduSchoolManuscriptLabel> list = new ArrayList<>();
|
||||
for (Long label : labels) {
|
||||
EduSchoolManuscriptLabel eduSchoolManuscriptLabel = new EduSchoolManuscriptLabel();
|
||||
eduSchoolManuscriptLabel.setLabel(label);
|
||||
eduSchoolManuscriptLabel.setManuscriptId(manuscript.getId());
|
||||
list.add(eduSchoolManuscriptLabel);
|
||||
}
|
||||
labelService.saveBatch(list);
|
||||
}
|
||||
if (Objects.isNull(manuscript.getContentType())) {
|
||||
// 如果没有则默认为文章类型
|
||||
manuscript.setContentType(1);
|
||||
}
|
||||
if (manuscript.getStatus() != 0 && manuscript.getContentType() != 2) {
|
||||
if (manuscript.getIsTiming() == 0) {
|
||||
// 定时发送
|
||||
StringBuilder cron = new StringBuilder();
|
||||
// cron表达式
|
||||
cron.append("0")
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getMinute())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getHour())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getDayOfMonth())
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getMonthValue())
|
||||
.append(" ")
|
||||
.append("?")
|
||||
.append(" ")
|
||||
.append(manuscript.getPublishDate().getYear());
|
||||
Job job = new Job();
|
||||
job.setBeanName(JOB_BEAN_NAME);
|
||||
job.setMethodName(JOB_METHOD_NAME);
|
||||
job.setParams(manuscript.getId().toString());
|
||||
job.setCronExpression(cron.toString());
|
||||
job.setRemark(String.format("学校稿件定时发送,name:[%s],id:[%d]", manuscript.getTitle(),
|
||||
manuscript.getId()));
|
||||
job.setStatus(Job.ScheduleStatus.NORMAL.getValue());
|
||||
remoteJobService.saveJob(job);
|
||||
} else {
|
||||
// 立即发送
|
||||
manuscript.setPublishDate(LocalDateTime.now());
|
||||
updateById(manuscript);
|
||||
publishManuscript(manuscript);
|
||||
}
|
||||
}
|
||||
addManuscriptProgress.setFinish(1);
|
||||
redisService
|
||||
.hset(CachePrefixConstant.ADD_MANUSCRIPT_PROGRESS, key, addManuscriptProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delManuscript(List<Long> ids) {
|
||||
Collection<EduSchoolManuscript> manuscriptList = listByIds(ids);
|
||||
String yidaAppUserId = null;
|
||||
for (EduSchoolManuscript manuscript : manuscriptList) {
|
||||
if (ObjectUtil.isNull(yidaAppUserId)) {
|
||||
if (ObjectUtil.isNotNull(manuscript.getAuthorId())) {
|
||||
EduSchoolManuscriptAuthor author = eduSchoolManuscriptAuthorMapper
|
||||
.selectById(manuscript.getAuthorId());
|
||||
if (ObjectUtil.isNotNull(author)) {
|
||||
yidaAppUserId = author.getYidaAppUserId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (manuscript.getStatus() == 1 && manuscript.getIsTiming() == 0) {
|
||||
remoteJobService.delJobByMethod(JOB_BEAN_NAME, JOB_METHOD_NAME, manuscript.getId().toString());
|
||||
}
|
||||
}
|
||||
|
||||
removeByIds(ids);
|
||||
List<String> manuscriptYidaIds = manuscriptList.stream().map(EduSchoolManuscript::getYidaAppMunascriptId)
|
||||
.filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
.filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(manuscriptYidaIds)) {
|
||||
EduYidaApp yidaApp = commonService.getYidaApp(manuscriptList.toArray(new EduSchoolManuscript[0])[0].getSchoolId());
|
||||
AppUtil.manuscriptDel(manuscriptYidaIds, yidaApp);
|
||||
AppUtil.manuscriptDel(manuscriptYidaIds, yidaApp, yidaAppUserId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +309,18 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
EduSchoolManuscript manuscript = getById(id);
|
||||
// 判断是否调用易达app撤回稿件接口
|
||||
if (Objects.nonNull(manuscript.getYidaAppMunascriptId())) {
|
||||
String yidaAppUserId = null;
|
||||
EduYidaApp yidaApp = commonService.getYidaApp(manuscript.getSchoolId());
|
||||
AppUtil.manuscriptDel(Collections.singletonList(manuscript.getYidaAppMunascriptId()), yidaApp);
|
||||
manuscript.setYidaAppMunascriptId("");
|
||||
|
||||
if (ObjectUtil.isNotNull(manuscript.getAuthorId())) {
|
||||
EduSchoolManuscriptAuthor author = eduSchoolManuscriptAuthorMapper
|
||||
.selectById(manuscript.getAuthorId());
|
||||
if (ObjectUtil.isNotNull(author)) {
|
||||
yidaAppUserId = author.getYidaAppUserId();
|
||||
}
|
||||
}
|
||||
AppUtil.manuscriptDel(Collections.singletonList(manuscript.getYidaAppMunascriptId()), yidaApp, yidaAppUserId);
|
||||
// manuscript.setYidaAppMunascriptId("");
|
||||
}
|
||||
// 修改为撤回(待发送)状态
|
||||
manuscript.setStatus(1);
|
||||
@@ -322,11 +354,11 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
EduSchoolManuscriptAuthor author;
|
||||
if (manuscript.getAuthorId() == null) {
|
||||
author = eduSchoolManuscriptAuthorMapper
|
||||
.selectOne(Wrappers.<EduSchoolManuscriptAuthor>lambdaQuery()
|
||||
.eq(EduSchoolManuscriptAuthor::getSchoolId, school.getDeptId())
|
||||
.isNotNull(EduSchoolManuscriptAuthor::getYidaAppUserId)
|
||||
.orderByAsc(EduSchoolManuscriptAuthor::getCreateDate)
|
||||
.last("limit 1"));
|
||||
.selectOne(Wrappers.<EduSchoolManuscriptAuthor>lambdaQuery()
|
||||
.eq(EduSchoolManuscriptAuthor::getSchoolId, school.getDeptId())
|
||||
.isNotNull(EduSchoolManuscriptAuthor::getYidaAppUserId)
|
||||
.orderByAsc(EduSchoolManuscriptAuthor::getCreateDate)
|
||||
.last("limit 1"));
|
||||
} else {
|
||||
author = eduSchoolManuscriptAuthorMapper.selectById(manuscript.getAuthorId());
|
||||
}
|
||||
@@ -337,11 +369,11 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
// 公告同步的稿件放入公告区
|
||||
if (manuscript.getNoticeSchoolId() != null) {
|
||||
EduSchoolHomeAnnouncement announcement = eduSchoolHomeAnnouncementMapper
|
||||
.selectOne(Wrappers.lambdaQuery(new EduSchoolHomeAnnouncement())
|
||||
.eq(EduSchoolHomeAnnouncement::getSchoolId, school.getDeptId()));
|
||||
.selectOne(Wrappers.lambdaQuery(new EduSchoolHomeAnnouncement())
|
||||
.eq(EduSchoolHomeAnnouncement::getSchoolId, school.getDeptId()));
|
||||
if (StrUtil.isNotBlank(announcement.getYidaAppRegionId())) {
|
||||
AppUtil.regionSaveContent(announcement.getYidaAppRegionId(), manuscriptId, null,
|
||||
school.getYidaAppColId(), yidaApp);
|
||||
school.getYidaAppColId(), yidaApp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,7 +381,7 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
@Override
|
||||
public IPage<EduSchoolManuscript> findManuscriptByLabel(Page<EduSchoolManuscript> page, String label) {
|
||||
List<EduSchoolManuscriptLabel> labelList = labelService.list(Wrappers.query(new EduSchoolManuscriptLabel())
|
||||
.lambda().eq(EduSchoolManuscriptLabel::getLabel, label));
|
||||
.lambda().eq(EduSchoolManuscriptLabel::getLabel, label));
|
||||
List<Long> manuscriptId = new ArrayList<>();
|
||||
for (EduSchoolManuscriptLabel item : labelList) {
|
||||
manuscriptId.add(item.getManuscriptId());
|
||||
@@ -359,7 +391,7 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
}
|
||||
|
||||
return page(page, Wrappers.query(new EduSchoolManuscript()).lambda().eq(EduSchoolManuscript::getType, 2)
|
||||
.in(EduSchoolManuscript::getId, manuscriptId));
|
||||
.in(EduSchoolManuscript::getId, manuscriptId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,7 +415,7 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
wxPublishPublic(manuscript, school);
|
||||
}
|
||||
// 发布公告到易达app
|
||||
if (school.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
if (school.getSchoolType().contains(Dept.TYPE_YIDA_APP) && publishPath.contains(EduSchoolManuscript.NEWS_PATH)) {
|
||||
saveManuscriptToYidaApp(manuscript, school, yidaApp);
|
||||
}
|
||||
// 稿件不是从学校通知同步且学校绑定企业微信才发送微信通知
|
||||
@@ -401,7 +433,7 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
}
|
||||
|
||||
private void wxPublishNotice(EduSchoolManuscript manuscript) {
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null, manuscript.getSchoolId());
|
||||
EduApp eduApp = commonService.getAppByCodeAndSchool(AppConstant.NOTICE_PARENT, null, manuscript.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(eduApp.getWxCorpId(), eduApp.getWxSecret());
|
||||
String contentText = HtmlUtil.cleanHtmlTag(manuscript.getContent());
|
||||
MpNewsSchoolNotice notice = new MpNewsSchoolNotice();
|
||||
@@ -411,8 +443,8 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
if (manuscript.getCoverType() != 0) {
|
||||
try {
|
||||
String path =
|
||||
com.yida.data.common.core.utils.FileUtil
|
||||
.downloadCompressBase64Img(manuscript.getCoverUrl().split(",")[0], 2048L);
|
||||
com.yida.data.common.core.utils.FileUtil
|
||||
.downloadCompressBase64Img(manuscript.getCoverUrl().split(",")[0], 2048L);
|
||||
File file = new File(path);
|
||||
article.setThumb_media_id(wxUtil.uploadTempFile(accessToken, "image", file));
|
||||
FileUtil.del(path);
|
||||
@@ -444,7 +476,7 @@ public class EduSchoolManuscriptServiceImpl extends ServiceImpl
|
||||
if (manuscript.getCoverType() != 0) {
|
||||
try {
|
||||
String path = com.yida.data.common.core.utils.FileUtil
|
||||
.downloadCompressBase64Img(manuscript.getCoverUrl().split(",")[0], 64L);
|
||||
.downloadCompressBase64Img(manuscript.getCoverUrl().split(",")[0], 64L);
|
||||
File file = new File(path);
|
||||
article.setThumb_media_id(wxPublicUtil.uploadTempMaterial("thumb", file, token));
|
||||
FileUtil.del(path);
|
||||
|
||||
+2
-13
@@ -125,21 +125,10 @@ public class EduSchoolMatterServiceImpl extends ServiceImpl
|
||||
eduSchoolMatterMatterGroupService.remove(Wrappers.lambdaQuery(new EduSchoolMatterMatterGroup())
|
||||
.in(EduSchoolMatterMatterGroup::getMatterId, ids));
|
||||
if (StrUtil.isNotBlank(school.getWxPublicAppId())) {
|
||||
String token;
|
||||
try {
|
||||
token = wxPublicUtil.getAccessToken(school.getWxPublicAppId(), school.getWxPublicSecret());
|
||||
} catch (Exception e) {
|
||||
log.error("获取token失败", e);
|
||||
return;
|
||||
}
|
||||
String token = wxPublicUtil.getAccessToken(school.getWxPublicAppId(), school.getWxPublicSecret());
|
||||
for (EduSchoolMatter matter : eduSchoolMatters) {
|
||||
if (StrUtil.isNotBlank(matter.getWxPublicMediaId())) {
|
||||
try {
|
||||
wxPublicUtil.deleteMaterial(matter.getWxPublicMediaId(), token);
|
||||
} catch (Exception e) {
|
||||
log.error("删除微信公众号素材失败", e);
|
||||
}
|
||||
|
||||
wxPublicUtil.deleteMaterial(matter.getWxPublicMediaId(), token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -72,10 +72,12 @@ public class EduSecondClassContentServiceImpl implements EduSecondClassContentSe
|
||||
existIds.add(subject.getId());
|
||||
}
|
||||
}
|
||||
eduSecondClassSubjectService
|
||||
.remove(Wrappers.<EduSecondClassSubject>lambdaQuery().eq(EduSecondClassSubject::getDeptId, deptId)
|
||||
.eq(EduSecondClassSubject::getTopicType, dto.getType())
|
||||
.notIn(EduSecondClassSubject::getId, existIds));
|
||||
if (CollUtil.isNotEmpty(existIds)) {
|
||||
eduSecondClassSubjectService
|
||||
.remove(Wrappers.<EduSecondClassSubject>lambdaQuery().eq(EduSecondClassSubject::getDeptId, deptId)
|
||||
.eq(EduSecondClassSubject::getTopicType, dto.getType())
|
||||
.notIn(EduSecondClassSubject::getId, existIds));
|
||||
}
|
||||
eduSecondClassSubjectService.saveOrUpdateBatch(dto.getSubjectList());
|
||||
} else {
|
||||
eduSecondClassSubjectService
|
||||
|
||||
+5
-2
@@ -1,5 +1,6 @@
|
||||
package com.yida.data.school.secondClass.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yida.data.common.core.entity.school.secondClass.EduSecondClassVenueGuide;
|
||||
import com.yida.data.common.core.entity.school.secondClass.EduSecondClassVenueOrder;
|
||||
@@ -33,8 +34,10 @@ public class EduSecondClassVenueOrderServiceImpl extends ServiceImpl
|
||||
|
||||
@Override
|
||||
public void saveOrder(EduSecondClassVenueOrder order) {
|
||||
EduSecondClassVenueGuide guide = eduSecondClassVenueGuideMapper.selectById(order.getGuideId());
|
||||
order.setDeptId(guide.getDeptId());
|
||||
if (ObjectUtil.isNotNull(order.getGuideId())) {
|
||||
EduSecondClassVenueGuide guide = eduSecondClassVenueGuideMapper.selectById(order.getGuideId());
|
||||
order.setDeptId(guide.getDeptId());
|
||||
}
|
||||
save(order);
|
||||
for (EduSecondClassVenueOrderMember member : order.getMemberList()) {
|
||||
member.setOrderId(order.getId());
|
||||
|
||||
+8
-13
@@ -4,26 +4,20 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.apply.EduApply;
|
||||
import com.yida.data.common.core.entity.apply.EduProductApply;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.transaction.mapper.EduProductApplyMapper;
|
||||
import com.yida.data.school.transaction.service.EduAppService;
|
||||
import com.yida.data.school.vo.transcation.EduApplyVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -40,6 +34,7 @@ public class EduApplyController {
|
||||
|
||||
@ApiOperation("应用分页查询")
|
||||
@GetMapping("/listApply")
|
||||
@ControllerLog(operation = "分页查询应用")
|
||||
public ResultBean<IPage<EduApply>> listApply(@ApiParam("app名字") @RequestParam String applyName,
|
||||
@ApiParam("当前页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("页面大小") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
@@ -52,7 +47,7 @@ public class EduApplyController {
|
||||
|
||||
@ApiOperation("新增应用")
|
||||
@PostMapping("/insertApply")
|
||||
@OperationLog(module = ModuleName.SCHOOL, methods = "新增应用", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增应用")
|
||||
public ResultBean insertApply(@ApiParam("应用名字") @RequestBody EduApplyVO applyFunction) {
|
||||
eduAppService.insertEduApplyService(applyFunction);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -61,7 +56,7 @@ public class EduApplyController {
|
||||
|
||||
@ApiOperation("修改应用")
|
||||
@PostMapping("/updateApply")
|
||||
@OperationLog(module = ModuleName.SCHOOL, methods = "修改应用", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改应用")
|
||||
public ResultBean upDataApply(@ApiParam("应用名字") @RequestBody EduApplyVO eduApply) {
|
||||
eduAppService.upDataApplyService(eduApply);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -70,7 +65,7 @@ public class EduApplyController {
|
||||
|
||||
@ApiOperation("删除应用")
|
||||
@GetMapping("/removeEduApply")
|
||||
@OperationLog(module = ModuleName.SCHOOL, methods = "删除应用", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除应用")
|
||||
public ResultBean removeEduApply(@ApiParam("应用id") @RequestParam Long applyId) {
|
||||
|
||||
List<EduProductApply> eduProductApplies = eduProductApplyMapper.selectList(Wrappers.lambdaQuery(new EduProductApply())
|
||||
|
||||
+3
-6
@@ -2,11 +2,8 @@ package com.yida.data.school.transaction.controller;
|
||||
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.apply.EduApplyFunction;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.transaction.service.EduApplyFunctionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -28,7 +25,7 @@ public class EduApplyFunctionController {
|
||||
|
||||
@ApiOperation("新增应用功能")
|
||||
@PostMapping("/insertApplyFunction")
|
||||
@OperationLog(module = ModuleName.TRANSATION, methods = "新增应用功能", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增应用功能")
|
||||
public ResultBean<EduApplyFunction> insertApply(@ApiParam("应用名字") @RequestParam EduApplyFunction eduApplyFunction) {
|
||||
eduApplyFunctionService.insertEduApplyFunctionService(eduApplyFunction);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -37,7 +34,7 @@ public class EduApplyFunctionController {
|
||||
|
||||
@ApiOperation("修改应用功能")
|
||||
@PostMapping("/updateApplyFunction")
|
||||
@OperationLog(module = ModuleName.TRANSATION, methods = "修改应用功能", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改应用功能")
|
||||
public ResultBean<EduApplyFunction> upDataApplyFunction(@ApiParam("应用名字") @RequestParam EduApplyFunction eduApplyFunction) {
|
||||
|
||||
eduApplyFunctionService.upDataEduApplyFunctionService(eduApplyFunction);
|
||||
@@ -47,7 +44,7 @@ public class EduApplyFunctionController {
|
||||
|
||||
@ApiOperation("删除应用功能")
|
||||
@GetMapping("/removeEduApplyFunction")
|
||||
@OperationLog(module = ModuleName.TRANSATION, methods = "删除应用功能", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除应用功能")
|
||||
public ResultBean removeEduApply(@ApiParam("功能id") @RequestParam Long functionId) {
|
||||
eduApplyFunctionService.removeById(functionId);
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
+10
-9
@@ -4,16 +4,13 @@ import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.apply.EduProduct;
|
||||
import com.yida.data.common.core.entity.apply.EduProductApply;
|
||||
import com.yida.data.common.core.entity.constant.FebsConstant;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.dto.transaction.ListBuyStudentDTO;
|
||||
import com.yida.data.school.dto.transaction.ProductSelectDTO;
|
||||
import com.yida.data.school.transaction.service.EduProductApplyService;
|
||||
@@ -46,6 +43,7 @@ public class EduProductController {
|
||||
// @Secured({"ROLE_role:agent:normal", "ROLE_role:agent:admin"})
|
||||
@ApiOperation("商品分页查询")
|
||||
@PostMapping("/listProduct")
|
||||
@ControllerLog(operation = "商品分页查询")
|
||||
public ResultBean listProduct(@RequestBody ProductSelectDTO dto) {
|
||||
Page page = new Page();
|
||||
page.setCurrent(dto.getCurrent());
|
||||
@@ -55,13 +53,14 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("查询商品详情")
|
||||
@GetMapping("/selectProduct")
|
||||
@ControllerLog(operation = "商品详情查询")
|
||||
public ResultBean<EduProduct> selectProduct(@ApiParam("商品id") @RequestParam Long productId) {
|
||||
return ResultBean.buildSuccess(eduProductService.getInfo(productId));
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品")
|
||||
@PostMapping("/upDateProduct")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "修改商品", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "修改商品")
|
||||
public ResultBean upDataProduct(@ApiParam("商品") @RequestBody EduProduct eduProduct) {
|
||||
Asserts.isTrue(eduProductService.count(Wrappers.lambdaQuery(new EduProduct())
|
||||
.eq(EduProduct::getProductCode, eduProduct.getProductCode())
|
||||
@@ -73,7 +72,7 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("商品上架")
|
||||
@GetMapping("/upDateProductById")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "商品上架", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改商品")
|
||||
public ResultBean upDateProductById(@ApiParam("商品") @RequestParam("id") Long id) {
|
||||
EduProduct eduProduct = new EduProduct();
|
||||
eduProduct.setProductId(id);
|
||||
@@ -84,7 +83,7 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("下架商品")
|
||||
@GetMapping("/soldOutProduct")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "下架商品", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "下架商品")
|
||||
public ResultBean soldOutProduct(@ApiParam("商品") @RequestParam Long productId) {
|
||||
EduProduct eduProduct = new EduProduct();
|
||||
eduProduct.setProductId(productId);
|
||||
@@ -97,7 +96,7 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("新增商品")
|
||||
@PostMapping("/insertProduct")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "新增商品", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增商品")
|
||||
public ResultBean insertProduct(@RequestBody EduProduct eduProduct) {
|
||||
Asserts.isTrue(eduProductService.count(Wrappers.lambdaQuery(new EduProduct())
|
||||
.eq(EduProduct::getProductCode, eduProduct.getProductCode())) == 0, "商品编码重复,请修改后重试");
|
||||
@@ -108,7 +107,7 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("删除商品")
|
||||
@GetMapping("/removeProduct")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "删除商品", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除商品")
|
||||
public ResultBean<EduProduct> removeProduct(@ApiParam("商品id") @RequestParam Long productId) {
|
||||
eduProductService.removeEduProductService(productId);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -116,6 +115,7 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("手机端商品列表查询")
|
||||
@GetMapping("/selectProductList")
|
||||
@ControllerLog(operation = "须知查询")
|
||||
public ResultBean<EduProductListVO> listApply(@ApiParam("学校id") @RequestParam Long schoolId) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
assert currentUser != null;
|
||||
@@ -124,13 +124,14 @@ public class EduProductController {
|
||||
|
||||
@ApiOperation("手机商品详情")
|
||||
@GetMapping("/selectProductAndApply")
|
||||
@ControllerLog(operation = "新增须知")
|
||||
public ResultBean<EduProduct> selectProductAndApply(@ApiParam("商品id") @RequestParam Long productId) {
|
||||
return ResultBean.buildSuccess(eduProductService.selectProductAndApply(productId));
|
||||
}
|
||||
|
||||
@ApiOperation("商品与应用取消关联")
|
||||
@GetMapping("/delEduProductApply")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "商品与应用取消关联", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "商品与应用取消关联")
|
||||
public ResultBean delEduProductApply(@ApiParam("应用id") @RequestParam Long applyId) {
|
||||
|
||||
eduProductApplyService.remove(Wrappers.lambdaQuery(new EduProductApply())
|
||||
|
||||
+4
-6
@@ -3,11 +3,8 @@ package com.yida.data.school.transaction.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.apply.EduProductModel;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.transaction.service.EduProductModelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -29,6 +26,7 @@ public class EduProductModelController {
|
||||
|
||||
@ApiOperation("须知查询")
|
||||
@GetMapping("/selectProductModel")
|
||||
@ControllerLog(operation = "须知查询")
|
||||
public ResultBean listModel(@ApiParam("须知名字") @RequestParam String modelName,
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize) {
|
||||
@@ -40,7 +38,7 @@ public class EduProductModelController {
|
||||
|
||||
@ApiOperation("新增须知")
|
||||
@PostMapping("/insertProductModel")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "新增商品须知", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增须知")
|
||||
public ResultBean insertModel(@RequestBody EduProductModel eduProductModel) {
|
||||
eduProductModelService.insertEduProductModelService(eduProductModel);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -49,7 +47,7 @@ public class EduProductModelController {
|
||||
|
||||
@ApiOperation("修改须知")
|
||||
@PostMapping("/updateProductModel")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "修改商品须知", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改须知")
|
||||
public ResultBean upDataModel(@RequestBody EduProductModel eduProductModel) {
|
||||
eduProductModelService.updateEduProductModelService(eduProductModel);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -58,7 +56,7 @@ public class EduProductModelController {
|
||||
|
||||
@ApiOperation("删除须知")
|
||||
@GetMapping("/removeEduProductModel")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "删除商品须知", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除须知")
|
||||
public ResultBean removeModel(@ApiParam("应用id") @RequestParam Integer modelId) {
|
||||
eduProductModelService.removeEduProductModelService(modelId);
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
+7
-31
@@ -1,22 +1,16 @@
|
||||
package com.yida.data.school.transaction.controller;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.apply.EduProductNoticeStudent;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.school.dto.transaction.ListBuyStudentDTO;
|
||||
import com.yida.data.school.transaction.service.EduProductNoticeService;
|
||||
import com.yida.data.school.transaction.service.EduProductNoticeStudentService;
|
||||
import com.yida.data.school.vo.transcation.DownStudentBuyDataVO;
|
||||
import com.yida.data.user.vo.DownLoadStaffAttendanceRecordVO;
|
||||
import com.yida.data.user.vo.ListParentByStudentIdsVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -42,7 +36,6 @@ public class EduProductNoticeStudentController {
|
||||
|
||||
private final EduProductNoticeStudentService eduProductNoticeStudentService;
|
||||
private final EduProductNoticeService eduProductNoticeService;
|
||||
private final RedisService redisService;
|
||||
|
||||
@PostMapping("/batchPutNotice")
|
||||
@ApiOperation("批量催缴")
|
||||
@@ -61,8 +54,8 @@ public class EduProductNoticeStudentController {
|
||||
@ApiOperation("通知记录")
|
||||
@GetMapping("/findRecordList")
|
||||
public ResultBean<IPage<EduProductNoticeStudent>> findRecordList(@RequestParam Long productId,
|
||||
@RequestParam Integer size,
|
||||
@RequestParam Integer pageNum) {
|
||||
@RequestParam Integer size,
|
||||
@RequestParam Integer pageNum) {
|
||||
Page page = new Page();
|
||||
page.setSize(size);
|
||||
page.setCurrent(pageNum);
|
||||
@@ -72,8 +65,8 @@ public class EduProductNoticeStudentController {
|
||||
@ApiOperation("查询通知记录对应家长")
|
||||
@GetMapping("/findRecordParent")
|
||||
public ResultBean<IPage<ListParentByStudentIdsVO>> findRecordParent(@RequestParam Long noticeId,
|
||||
@RequestParam Integer size,
|
||||
@RequestParam Integer pageNum) {
|
||||
@RequestParam Integer size,
|
||||
@RequestParam Integer pageNum) {
|
||||
Page page = new Page();
|
||||
page.setSize(size);
|
||||
page.setCurrent(pageNum);
|
||||
@@ -99,25 +92,8 @@ public class EduProductNoticeStudentController {
|
||||
@ApiOperation("导出需要续费的学生")
|
||||
@ResponseBody
|
||||
@PostMapping("/studentBuyExport")
|
||||
public ResultBean<DownStudentBuyDataVO> studentBuyExport(@RequestBody ListBuyStudentDTO listBuyStudentDTO,
|
||||
HttpServletResponse response) {
|
||||
String uuid = IdUtil.simpleUUID();
|
||||
DownStudentBuyDataVO vo = DownStudentBuyDataVO.builder()
|
||||
.key(uuid)
|
||||
.finish(0)
|
||||
.totalNum(100)
|
||||
.currentNum(0).build();
|
||||
redisService.hset(CachePrefixConstant.PRODUCT_BUY_DATA_DOWNLOAD, uuid, vo);
|
||||
eduProductNoticeStudentService.studentBuyExport(listBuyStudentDTO, response, uuid);
|
||||
return ResultBean.buildSuccess(vo);
|
||||
public void studentBuyExport(@RequestBody ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response) {
|
||||
|
||||
eduProductNoticeStudentService.studentBuyExport(listBuyStudentDTO, response);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取导出需要续费的学生进度")
|
||||
@GetMapping("/getStudentBuyExportProgress")
|
||||
public ResultBean<DownStudentBuyDataVO> getStudentBuyExportProgress(String key) {
|
||||
return ResultBean.buildSuccess(
|
||||
(DownStudentBuyDataVO) redisService.hget(CachePrefixConstant.PRODUCT_BUY_DATA_DOWNLOAD, key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-8
@@ -4,15 +4,12 @@ import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.apply.EduApplyProductOrder;
|
||||
import com.yida.data.common.core.entity.apply.EduApplyProductRefund;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.dto.transaction.EduApplyProductOrderDTO;
|
||||
import com.yida.data.school.transaction.service.EduProductOrderService;
|
||||
import com.yida.data.school.vo.transcation.PayInfoVO;
|
||||
@@ -36,13 +33,14 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("修改支付状态")
|
||||
@GetMapping("/upDateEduProductOrder")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "修改支付状态", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改支付状态")
|
||||
public ResultBean upDateEduProductOrder(@ApiParam("生成订单") @RequestParam EduApplyProductOrder eduApplyProductOrder) {
|
||||
return eduProductOrderService.updateProductOder(eduApplyProductOrder);
|
||||
}
|
||||
|
||||
@ApiOperation("待付款/交易成功订单批量分页查询")
|
||||
@PostMapping("/selectPageListProductOrder")
|
||||
@ControllerLog(operation = "待付款/交易成功订单批量分页查询")
|
||||
public ResultBean<IPage<EduApplyProductOrder>> selectPageListProductOrder(@ApiParam("订单查询条件") @RequestBody EduApplyProductOrderDTO dto) {
|
||||
Page page = new Page();
|
||||
page.setSize(dto.getSize());
|
||||
@@ -54,6 +52,7 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("手机端待付款/交易成功订单批量查询")
|
||||
@GetMapping("/selectListProductOrder")
|
||||
@ControllerLog(operation = "待付款/交易成功订单批量分页查询")
|
||||
public ResultBean<List<EduApplyProductOrder>> selectListProductOrder(@ApiParam("用户手机号") @RequestParam String phone,
|
||||
@ApiParam("studentId") @RequestParam Long studentId) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
@@ -64,7 +63,7 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("生成订单")
|
||||
@GetMapping("/createOrder")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "生成订单", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "生成订单")
|
||||
public ResultBean<PayInfoVO> insertEduProductOrder(@ApiParam("商品id") Long productId,
|
||||
@ApiParam("学生id") Long[] studentId,
|
||||
@ApiParam("支付方式,0-微信jsapi,1-微信h5") Integer payType) {
|
||||
@@ -74,7 +73,6 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("发起支付")
|
||||
@GetMapping("/payOrder")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "发起支付", type = OperationLogTypeEnum.INSERT)
|
||||
public ResultBean<PayInfoVO> payOrder(String orderCode) {
|
||||
Object prepay = redisService.get(CachePrefixConstant.ORDER_FLAG + orderCode);
|
||||
PayInfoVO infoVO = eduProductOrderService.getWxJsSign(orderCode, prepay.toString());
|
||||
@@ -84,7 +82,6 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("发起退款")
|
||||
@GetMapping("/refund")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "发起退款", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean refund(EduApplyProductRefund refund) {
|
||||
eduProductOrderService.refund(refund, FebsUtil.getCurrentUser());
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -115,13 +112,13 @@ public class EduProductOrderController {
|
||||
|
||||
@ApiOperation("订单详情查询")
|
||||
@GetMapping("/selectEduProductOrder")
|
||||
@ControllerLog(operation = "订单详情查询")
|
||||
public ResultBean selectEduProductOrder(@ApiParam("订单id") Long orderId) {
|
||||
return ResultBean.buildSuccess(eduProductOrderService.selectEduProductOrder(orderId));
|
||||
}
|
||||
|
||||
@ApiOperation("订单完成(前台支付完成后调用)")
|
||||
@GetMapping("/orderSuccess")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "订单完成(前台支付完成后调用)", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean orderSuccess(@ApiParam("订单号") String orderCode) {
|
||||
eduProductOrderService.orderSuccess(orderCode);
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
+6
-7
@@ -1,22 +1,21 @@
|
||||
package com.yida.data.school.transaction.controller;
|
||||
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.apply.EduProduct;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.transaction.service.EduProductNoticeService;
|
||||
import com.yida.data.school.transaction.service.EduProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import javax.annotation.Resource;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author chenbo
|
||||
*/
|
||||
@@ -32,7 +31,7 @@ public class InEduProductController {
|
||||
|
||||
@ApiOperation("商品上架")
|
||||
@GetMapping("/upDateProductById")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "商品上架", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改商品")
|
||||
public ResultBean upDateProductById(@ApiParam("商品") @RequestParam("id") Long id) {
|
||||
EduProduct eduProduct = new EduProduct();
|
||||
eduProduct.setProductId(id);
|
||||
@@ -43,7 +42,7 @@ public class InEduProductController {
|
||||
|
||||
@ApiOperation("发送商品催缴续费通知")
|
||||
@GetMapping("/productSendNotice")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "发送商品催缴续费通知", type = OperationLogTypeEnum.SELECT)
|
||||
@ControllerLog(operation = "发送商品催缴续费通知")
|
||||
public ResultBean productSendNotice(@ApiParam("通知id") @RequestParam("id") Long id) {
|
||||
eduProductNoticeService.productSendNotice(id);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -51,7 +50,7 @@ public class InEduProductController {
|
||||
|
||||
@ApiOperation("修改商品的状态为已失效")
|
||||
@GetMapping("/productMonitor")
|
||||
@OperationLog(module = ModuleName.PRODUCT, methods = "修改商品的状态为已失效", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改商品的状态为已失效")
|
||||
public ResultBean productMonitor() {
|
||||
eduProductNoticeService.productMonitor();
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
+1
-4
@@ -9,7 +9,6 @@ import com.yida.data.user.vo.ListParentByStudentIdsVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
/**
|
||||
* 催缴通知对应接收学生表 Service接口
|
||||
@@ -18,7 +17,6 @@ import org.springframework.scheduling.annotation.Async;
|
||||
* @date 2021-09-03 15:33:47
|
||||
*/
|
||||
public interface EduProductNoticeStudentService extends IService<EduProductNoticeStudent> {
|
||||
|
||||
/**
|
||||
* 批量催缴
|
||||
*
|
||||
@@ -40,8 +38,7 @@ public interface EduProductNoticeStudentService extends IService<EduProductNotic
|
||||
|
||||
void studentNotBuyExport(ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response);
|
||||
|
||||
@Async
|
||||
void studentBuyExport(ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response, String uuid);
|
||||
void studentBuyExport(ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 全部催缴
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class EduProductNoticeServiceImpl extends ServiceImpl
|
||||
EduProduct product = eduProductService.getById(notice.getProductId());
|
||||
|
||||
//催缴通知,给全校发
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
product.getSchoolId());
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
Text text = new Text();
|
||||
|
||||
+40
-89
@@ -1,9 +1,7 @@
|
||||
package com.yida.data.school.transaction.service.impl;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -12,7 +10,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.apply.EduProductNotice;
|
||||
import com.yida.data.common.core.entity.apply.EduProductNoticeStudent;
|
||||
import com.yida.data.common.core.entity.constant.AppConstant;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.notice.qywx.TextSchoolNotice;
|
||||
import com.yida.data.common.core.entity.notice.qywx.inside.Text;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
@@ -26,13 +23,10 @@ import com.yida.data.school.transaction.mapper.EduProductNoticeStudentMapper;
|
||||
import com.yida.data.school.transaction.service.EduProductNoticeService;
|
||||
import com.yida.data.school.transaction.service.EduProductNoticeStudentService;
|
||||
import com.yida.data.school.transaction.service.EduProductService;
|
||||
import com.yida.data.school.vo.transcation.DownStudentBuyDataVO;
|
||||
import com.yida.data.school.vo.transcation.EduProductNoticeVO;
|
||||
import com.yida.data.school.vo.transcation.StudentNotBuyExportVO;
|
||||
import com.yida.data.user.feign.RemoteStudentService;
|
||||
import com.yida.data.user.vo.ListParentByStudentIdsVO;
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -59,7 +53,7 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
|
||||
public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
<EduProductNoticeStudentMapper, EduProductNoticeStudent> implements EduProductNoticeStudentService {
|
||||
<EduProductNoticeStudentMapper, EduProductNoticeStudent> implements EduProductNoticeStudentService {
|
||||
|
||||
private final EduProductNoticeStudentMapper eduProductNoticeStudentMapper;
|
||||
@Resource
|
||||
@@ -75,14 +69,9 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
@Resource
|
||||
private EduProductMapper eduProductMapper;
|
||||
|
||||
private final RedisService redisService;
|
||||
|
||||
@Value("${febs.pageUrl}")
|
||||
private String pageUrl;
|
||||
|
||||
@Value("${febs.uploadUrl}")
|
||||
private String uploadUrl;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchPutNotice(List<EduProductNoticeStudent> noticeStudents) {
|
||||
@@ -100,8 +89,8 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
Long productId = noticeStudents.get(0).getProductId();
|
||||
Long schoolId = eduProductService.getById(productId).getSchoolId();
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
schoolId);
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
schoolId);
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
|
||||
//家长wxId
|
||||
@@ -124,7 +113,7 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
@Override
|
||||
public IPage<EduProductNoticeStudent> findRecordList(Page page, Long productId) {
|
||||
List<EduProductNotice> list = eduProductNoticeService.list(Wrappers.lambdaQuery(new EduProductNotice())
|
||||
.eq(EduProductNotice::getProductId, productId));
|
||||
.eq(EduProductNotice::getProductId, productId));
|
||||
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
return new Page<>();
|
||||
@@ -151,7 +140,7 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
}
|
||||
}
|
||||
List<EduProductNoticeStudent> list = list(Wrappers.lambdaQuery(new EduProductNoticeStudent())
|
||||
.in(EduProductNoticeStudent::getNoticeId, noticeId));
|
||||
.in(EduProductNoticeStudent::getNoticeId, noticeId));
|
||||
ArrayList<Long> studentIds = new ArrayList<>();
|
||||
for (EduProductNoticeStudent eduProductNoticeStudent : list) {
|
||||
studentIds.add(eduProductNoticeStudent.getStudentId());
|
||||
@@ -190,83 +179,45 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
|
||||
// 导出Excel
|
||||
EasyExcelUtil.exportExcelData(list, StudentNotBuyExportVO.class, "导出未购买导出数据",
|
||||
ExcelTypeEnum.XLS, response);
|
||||
ExcelTypeEnum.XLS, response);
|
||||
stopWatch.stop();
|
||||
log.info("导出未购买学生数据总共耗时: {}", stopWatch.getTotalTimeSeconds() + "秒");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void studentBuyExport(ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response, String uuid) {
|
||||
File file = null;
|
||||
String fileName = com.yida.data.common.core.utils.FileUtil.getLocalUploadAddress() + uuid + ".xlsx";
|
||||
file = new File(fileName);
|
||||
|
||||
try {
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
stopWatch.start();
|
||||
|
||||
List<EduProductNoticeVO> list1 = eduProductMapper.listBuyStudent(listBuyStudentDTO);
|
||||
List<Long> studentId = new ArrayList<>();
|
||||
for (EduProductNoticeVO eduProductNoticeVO : list1) {
|
||||
studentId.add(eduProductNoticeVO.getStudentId());
|
||||
}
|
||||
ArrayList<StudentNotBuyExportVO> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < studentId.size(); i++) {
|
||||
|
||||
log.info("学生ID:{}", studentId.get(i));
|
||||
|
||||
redisService.hset(CachePrefixConstant.PRODUCT_BUY_DATA_DOWNLOAD, uuid, DownStudentBuyDataVO.builder()
|
||||
.key(uuid)
|
||||
.finish(0)
|
||||
.totalNum(studentId.size())
|
||||
.currentNum(i + 1).build());
|
||||
|
||||
EduStudent data = remoteStudentService.getStudentNoPermission(studentId.get(i)).getData();
|
||||
|
||||
StudentNotBuyExportVO studentNotBuyExportVO = new StudentNotBuyExportVO();
|
||||
studentNotBuyExportVO.setCampusName(ObjectUtil.isNull(data) ? "" : data.getCampusName());
|
||||
studentNotBuyExportVO.setSectionName(ObjectUtil.isNull(data) ? "" : data.getSectionName());
|
||||
studentNotBuyExportVO.setGradeName(ObjectUtil.isNull(data) ? "" : data.getGradeName());
|
||||
studentNotBuyExportVO.setClassName(ObjectUtil.isNull(data) ? "" : data.getClassName());
|
||||
studentNotBuyExportVO.setStudentName(ObjectUtil.isNull(data) ? "" : data.getStuName());
|
||||
studentNotBuyExportVO.setIndexNo((long) i + 1);
|
||||
studentNotBuyExportVO.setStudentNumber(ObjectUtil.isNull(data) ? "" : data.getStuNumber());
|
||||
list.add(studentNotBuyExportVO);
|
||||
}
|
||||
|
||||
// 根据查询条件导出未购买学生数据
|
||||
// 导出数据
|
||||
EasyExcel.write(file)
|
||||
.excelType(ExcelTypeEnum.XLSX)
|
||||
// 这里放入动态头
|
||||
.head(StudentNotBuyExportVO.class).sheet("职工通行记录")
|
||||
// 当然这里数据也可以用 List<List<String>> 去传入
|
||||
.doWrite(list);
|
||||
// 上传文件到媒资
|
||||
String fileUrl = com.yida.data.common.core.utils.FileUtil.uploadFileToMediaServer(uploadUrl, file);
|
||||
|
||||
redisService
|
||||
.hset(CachePrefixConstant.PRODUCT_BUY_DATA_DOWNLOAD, uuid, DownStudentBuyDataVO.builder()
|
||||
.key(uuid)
|
||||
.finish(1)
|
||||
.filePath(fileUrl)
|
||||
.totalNum(list.size())
|
||||
.currentNum(list.size()).build());
|
||||
|
||||
// // 导出Excel
|
||||
// EasyExcelUtil.exportExcelData(list, StudentNotBuyExportVO.class, "导出需要已购买学生",
|
||||
// ExcelTypeEnum.XLS, response);
|
||||
stopWatch.stop();
|
||||
log.info("导出已购买学生数据总共耗时: {}", stopWatch.getTotalTimeSeconds() + "秒");
|
||||
} catch (IllegalStateException e) {
|
||||
log.error("导出已购买学生数据出错:{}", e);
|
||||
} finally {
|
||||
if (Objects.nonNull(file)) {
|
||||
cn.hutool.core.io.FileUtil.del(file);
|
||||
}
|
||||
public void studentBuyExport(ListBuyStudentDTO listBuyStudentDTO, HttpServletResponse response) {
|
||||
List<EduProductNoticeVO> list1 = eduProductMapper.listBuyStudent(listBuyStudentDTO);
|
||||
List<Long> studentId = new ArrayList<>();
|
||||
for (EduProductNoticeVO eduProductNoticeVO : list1) {
|
||||
studentId.add(eduProductNoticeVO.getStudentId());
|
||||
}
|
||||
|
||||
ArrayList<StudentNotBuyExportVO> list = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < studentId.size(); i++) {
|
||||
EduStudent data = remoteStudentService.getStudentNoPermission(studentId.get(i)).getData();
|
||||
StudentNotBuyExportVO welcomeStudentExportDTO = new StudentNotBuyExportVO();
|
||||
welcomeStudentExportDTO.setCampusName(data.getCampusName());
|
||||
welcomeStudentExportDTO.setSectionName(data.getSectionName());
|
||||
welcomeStudentExportDTO.setGradeName(data.getGradeName());
|
||||
welcomeStudentExportDTO.setClassName(data.getClassName());
|
||||
welcomeStudentExportDTO.setStudentName(data.getStuName());
|
||||
welcomeStudentExportDTO.setIndexNo((long) i + 1);
|
||||
welcomeStudentExportDTO.setStudentNumber(data.getStuNumber());
|
||||
list.add(welcomeStudentExportDTO);
|
||||
}
|
||||
|
||||
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
stopWatch.start();
|
||||
// 根据查询条件导出未购买学生数据
|
||||
|
||||
// 导出Excel
|
||||
EasyExcelUtil.exportExcelData(list, StudentNotBuyExportVO.class, "导出需要已购买学生",
|
||||
ExcelTypeEnum.XLS, response);
|
||||
stopWatch.stop();
|
||||
log.info("导出已购买学生数据总共耗时: {}", stopWatch.getTotalTimeSeconds() + "秒");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,8 +256,8 @@ public class EduProductNoticeStudentServiceImpl extends ServiceImpl
|
||||
notBuyStudentIds.add(student.getId());
|
||||
}
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null,
|
||||
schoolId);
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.PRODUCT_PARENT, null,
|
||||
schoolId);
|
||||
String accessToken = wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret());
|
||||
|
||||
//家长wxId
|
||||
|
||||
+30
-33
@@ -36,6 +36,7 @@ import com.yida.data.school.transaction.mapper.EduApplyProductOrderStudentMapper
|
||||
import com.yida.data.school.transaction.mapper.EduApplyProductRefundMapper;
|
||||
import com.yida.data.school.transaction.mapper.EduProductMapper;
|
||||
import com.yida.data.school.transaction.service.EduProductOrderService;
|
||||
import com.yida.data.school.transaction.service.EduStudentApplyService;
|
||||
import com.yida.data.school.transaction.util.GuuidUtil;
|
||||
import com.yida.data.school.vo.transcation.EduProductOrderVO;
|
||||
import com.yida.data.school.vo.transcation.PayInfoVO;
|
||||
@@ -70,6 +71,8 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
private static final ExecutorService ORDER_SUCCESS_POOL = new ThreadPoolExecutor(10, 20, 1,
|
||||
TimeUnit.MINUTES, new LinkedBlockingQueue<>());
|
||||
@Resource
|
||||
private EduStudentApplyService eduStudentApplyService;
|
||||
@Resource
|
||||
private EduProductMapper eduProductMapper;
|
||||
@Resource
|
||||
private EduApplyProductOrderStudentMapper eduApplyProductOrderStudentMapper;
|
||||
@@ -139,8 +142,7 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
orderStudentList.add(orderStudent);
|
||||
// 订单未超时 不允许再次下单
|
||||
EduApplyProductOrder studentOrder =
|
||||
(EduApplyProductOrder) redisService
|
||||
.get(CachePrefixConstant.STUDENT_ORDER + studentId.toString() + "." + product.getProductId().toString());
|
||||
(EduApplyProductOrder) redisService.get(CachePrefixConstant.STUDENT_ORDER + studentId.toString() + "." + product.getProductId().toString());
|
||||
// 未支付订单 学生与下单人的关系
|
||||
EduApplyProductOrderStudent existOrderStudent = null;
|
||||
// 可能数据不同步,查询数据库
|
||||
@@ -192,7 +194,7 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
switch (payType) {
|
||||
case 0:
|
||||
case 1:
|
||||
payWay = PayWay.WEI_XIN.getValue();
|
||||
payWay = PayWay.WEIXIN.getValue();
|
||||
break;
|
||||
}
|
||||
order.setPayWay(payWay);
|
||||
@@ -231,9 +233,8 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
// 添加学生的订单缓存
|
||||
for (EduApplyProductOrderStudent orderStudent : orderStudentList) {
|
||||
redisService.set(
|
||||
CachePrefixConstant.STUDENT_ORDER + orderStudent.getStudentId().toString() + "." + product.getProductId()
|
||||
.toString(),
|
||||
order, 900L);
|
||||
CachePrefixConstant.STUDENT_ORDER + orderStudent.getStudentId().toString() + "." + product.getProductId().toString(),
|
||||
order, 900L);
|
||||
}
|
||||
if (order.getPraccticalMoney() == 0D) {
|
||||
paySuccessUpdate(order.getOrderCode(), LocalDateTime.now());
|
||||
@@ -410,7 +411,7 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
ORDER_SUCCESS_POOL.submit(() -> {
|
||||
EduApplyProductOrder order = baseMapper.getOrderByCode(orderCode);
|
||||
//EduProduct product = eduProductMapper.selectById(order.getProductId());
|
||||
if (order != null && order.getPraccticalMoney() > 0D && PayWay.WEI_XIN.getValue().equals(order.getPayWay()) && "0,1"
|
||||
if (order != null && order.getPraccticalMoney() > 0D && PayWay.WEIXIN.getValue().equals(order.getPayWay()) && "0,1"
|
||||
.contains(order.getOrderStatus())) {
|
||||
boolean flag = false;
|
||||
EduPayWxConfig config = commonService.getPayWxConfigBySchool(order.getSchoolId());
|
||||
@@ -497,23 +498,21 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
// 包含的实际商品
|
||||
List<EduRealProduct> realProductList = product.getRealProductList();
|
||||
// 学生-应用关联关系
|
||||
// List<EduStudentApply> studentApplyList = new ArrayList<>();
|
||||
List<EduStudentApply> studentApplyList = new ArrayList<>();
|
||||
for (EduApplyProductOrderStudent orderStudent : studentList) {
|
||||
// 删除学生订单缓存
|
||||
redisService.del(
|
||||
CachePrefixConstant.STUDENT_ORDER + orderStudent.getStudentId().toString() + "." + product.getProductId()
|
||||
.toString());
|
||||
// // 购买了应用
|
||||
// if (CollUtil.isNotEmpty(applyList)) {
|
||||
// for (EduProductApply apply : applyList) {
|
||||
// EduStudentApply studentApply = new EduStudentApply();
|
||||
// studentApply.setStudentId(orderStudent.getStudentId());
|
||||
// studentApply.setApplyCode(apply.getApplyCode());
|
||||
// studentApply.setStartTime(apply.getBeginValidDate().atTime(0, 0, 0));
|
||||
// studentApply.setEndTime(apply.getEndValidDate().atTime(23, 59, 59));
|
||||
// studentApplyList.add(studentApply);
|
||||
// }
|
||||
// }
|
||||
redisService.del(CachePrefixConstant.STUDENT_ORDER + orderStudent.getStudentId().toString() + "." + product.getProductId().toString());
|
||||
// 购买了应用
|
||||
if (CollUtil.isNotEmpty(applyList)) {
|
||||
for (EduProductApply apply : applyList) {
|
||||
EduStudentApply studentApply = new EduStudentApply();
|
||||
studentApply.setStudentId(orderStudent.getStudentId());
|
||||
studentApply.setApplyCode(apply.getApplyCode());
|
||||
studentApply.setStartTime(apply.getBeginValidDate().atTime(0, 0, 0));
|
||||
studentApply.setEndTime(apply.getEndValidDate().atTime(23, 59, 59));
|
||||
studentApplyList.add(studentApply);
|
||||
}
|
||||
}
|
||||
// 购买了商品
|
||||
if (CollUtil.isNotEmpty(realProductList)) {
|
||||
for (EduRealProduct realProduct : realProductList) {
|
||||
@@ -525,10 +524,10 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 保存学生-应用关联关系
|
||||
// if (CollUtil.isNotEmpty(studentApplyList)) {
|
||||
// eduStudentApplyService.saveBatch(studentApplyList);
|
||||
// }
|
||||
// 保存学生-应用关联关系
|
||||
if (CollUtil.isNotEmpty(studentApplyList)) {
|
||||
eduStudentApplyService.saveBatch(studentApplyList);
|
||||
}
|
||||
// 删除订单缓存
|
||||
redisService.del(CachePrefixConstant.ORDER + orderCode);
|
||||
}
|
||||
@@ -593,7 +592,7 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
if (CollUtil.isNotEmpty(expireOrder)) {
|
||||
for (EduApplyProductOrder order : expireOrder) {
|
||||
// 微信订单
|
||||
if (PayWay.WEI_XIN.getValue().equals(order.getPayWay())) {
|
||||
if (PayWay.WEIXIN.getValue().equals(order.getPayWay())) {
|
||||
EduPayWxConfig config = commonService.getPayWxConfigBySchool(order.getSchoolId());
|
||||
// 主动查询是否已经支付了
|
||||
try {
|
||||
@@ -710,15 +709,13 @@ public class EduProductOrderServiceImpl extends ServiceImpl<EduApplyProductOrder
|
||||
eduProductMapper.updateProductStock(order.getProductId(), -num);
|
||||
redisService.unlock(LockPrefixConstant.PRODUCT_STOCK_EDIT_LOCK + order.getProductId());
|
||||
List<EduApplyProductOrderStudent> orderStudentList =
|
||||
eduApplyProductOrderStudentMapper.selectList(
|
||||
Wrappers.lambdaQuery(new EduApplyProductOrderStudent())
|
||||
.eq(EduApplyProductOrderStudent::getOrderId, order.getOrderId()));
|
||||
eduApplyProductOrderStudentMapper.selectList(
|
||||
Wrappers.lambdaQuery(new EduApplyProductOrderStudent())
|
||||
.eq(EduApplyProductOrderStudent::getOrderId, order.getOrderId()));
|
||||
if (CollUtil.isNotEmpty(orderStudentList)) {
|
||||
orderStudentList.forEach(student -> {
|
||||
// 删除学生订单缓存
|
||||
redisService.del(
|
||||
CachePrefixConstant.STUDENT_ORDER + student.getStudentId().toString() + "." + order
|
||||
.getProductId().toString());
|
||||
redisService.del(CachePrefixConstant.STUDENT_ORDER + student.getStudentId().toString() + "." + order.getProductId().toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class Scheduler {
|
||||
List<EduApplyProductOrder> expireOrder = eduApplyProductOrderMapper.selectExpireOrder(LocalDateTime.now());
|
||||
if (CollUtil.isNotEmpty(expireOrder)) {
|
||||
for (EduApplyProductOrder order : expireOrder) {
|
||||
if (PayWay.WEI_XIN.getValue().equals(order.getPayWay())) {
|
||||
if (PayWay.WEIXIN.getValue().equals(order.getPayWay())) {
|
||||
EduPayWxConfig config = commonService.getPayWxConfigBySchool(order.getSchoolId());
|
||||
// 主动查询是否已经支付了
|
||||
try {
|
||||
|
||||
+1
-1
@@ -224,7 +224,7 @@ public class EduVisitorRecordServiceImpl extends ServiceImpl
|
||||
if (staff != null) {
|
||||
try {
|
||||
EduApp app = commonService
|
||||
.getAppByCodeAndSchool(AppConstant.CONTACT_SELECT, null, visitorRecord.getSchoolId());
|
||||
.getAppByCodeAndSchool(AppConstant.VISITOR_STAFF, null, visitorRecord.getSchoolId());
|
||||
BaseStaffNotice notice = new BaseStaffNotice();
|
||||
notice
|
||||
.setText(new Text(String
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: "@env-name@"
|
||||
# active: "dev"
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
|
||||
+13
-15
@@ -49,20 +49,20 @@
|
||||
|
||||
<select id="getNoticeSchool" resultMap="BaseResultMap">
|
||||
select a.*,
|
||||
b.id rId,
|
||||
b.dept_id,
|
||||
b.dept_type,
|
||||
b.dept_name,
|
||||
b.dept_wx_id,
|
||||
b.student_id,
|
||||
b.student_name,
|
||||
b.parent_id,
|
||||
b.parent_wx_id,
|
||||
b.parent_name
|
||||
b.id rId,
|
||||
b.dept_id,
|
||||
b.dept_type,
|
||||
b.dept_name,
|
||||
b.dept_wx_id,
|
||||
b.student_id,
|
||||
b.student_name,
|
||||
b.parent_id,
|
||||
b.parent_wx_id,
|
||||
b.parent_name
|
||||
from edu_notice_school a
|
||||
left join edu_notice_school_receiver b on a.id = b.notice_id
|
||||
left join edu_notice_school_receiver b on a.id = b.notice_id
|
||||
where a.del_flag = 0
|
||||
and a.id = #{noticeId}
|
||||
and a.id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="listNotice" resultType="com.yida.data.school.vo.news.SchoolNoticePageVO">
|
||||
@@ -76,7 +76,6 @@
|
||||
a.status,
|
||||
a.type,
|
||||
a.is_confirm,
|
||||
a.create_name author,
|
||||
count(b.parent_id) confirm_num
|
||||
from edu_notice_school a
|
||||
LEFT JOIN ( SELECT notice_id, parent_id FROM edu_notice_school_receive_student WHERE is_confirm = 1 GROUP BY notice_id,
|
||||
@@ -111,8 +110,7 @@
|
||||
a.cover_url,
|
||||
a.content,
|
||||
a.content_url,
|
||||
a.type,
|
||||
a.create_name author
|
||||
a.type
|
||||
from edu_notice_school a
|
||||
left join edu_notice_school_receive_student b on a.id = b.notice_id
|
||||
where a.del_flag = 0
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
from edu_notice_system_user a
|
||||
inner join edu_notice_system b on a.notice_id = b.id
|
||||
where a.user_id = #{userId}
|
||||
order by b.create_date desc
|
||||
</select>
|
||||
|
||||
<select id="existNewMsg" resultType="java.lang.Integer">
|
||||
|
||||
+11
-9
@@ -5,6 +5,7 @@
|
||||
select distinct esm.id,esm.title,esma.name
|
||||
author,esm.publish_date,ifnull(esm.update_date,esm.create_date)updateDate,esm.cover_url,esm.cover_type,esm.content,
|
||||
esm.content_type ,
|
||||
esm.status,
|
||||
GROUP_CONCAT(esml.label) labels
|
||||
from edu_school_manuscript esm
|
||||
left join (select * from edu_school_manuscript_author where del_flag=0) esma on esm.author_id =
|
||||
@@ -93,17 +94,18 @@
|
||||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.yida.data.common.core.entity.school.EduSchoolManuscript">
|
||||
select a.*,b.name author_name,GROUP_CONCAT(c.label) as labels
|
||||
from edu_school_manuscript a left join edu_school_manuscript_author b on a.author_id=b.id
|
||||
LEFT JOIN edu_school_manuscript_label c on a.id = c.manuscript_id
|
||||
where a.del_flag=0
|
||||
and a.id=#{id}
|
||||
select a.*, b.name author_name, GROUP_CONCAT(c.label) as labels
|
||||
from edu_school_manuscript a
|
||||
left join edu_school_manuscript_author b on a.author_id = b.id
|
||||
LEFT JOIN edu_school_manuscript_label c on a.id = c.manuscript_id
|
||||
where a.del_flag = 0
|
||||
and a.id = #{id}
|
||||
GROUP BY a.id
|
||||
</select>
|
||||
<select id="getInfoIncludeDel" resultType="com.yida.data.common.core.entity.school.EduSchoolManuscript">
|
||||
select a.*,b.name author_name
|
||||
from edu_school_manuscript a left join edu_school_manuscript_author b on a.author_id=b.id
|
||||
where
|
||||
a.id=#{id}
|
||||
select a.*, b.name author_name
|
||||
from edu_school_manuscript a
|
||||
left join edu_school_manuscript_author b on a.author_id = b.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user