Commit 9d7e1d4c authored by 李博今's avatar 李博今

Merge branch 'V2.0.3' of http://103.249.252.28:90/lcy/education

# Conflicts:
#	src/main/java/org/rcisoft/business/bslschedule/dao/BSlScheduleRepository.java
parents e2b20a3a 815e4223
......@@ -152,4 +152,16 @@ public class BArrangeController extends PaginationController<BArrange> {
@ApiOperation(value="发布", notes="发布")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),})
@PostMapping("/release")
public Result release(String businessId) {
PersistModel data = bArrangeServiceImpl.release(businessId);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
businessId);
}
}
package org.rcisoft.business.barrange.dao;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.rcisoft.business.barrange.entity.BSubAgency;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface BSubAgencyRepository extends BaseMapper<BSubAgency> {
@Select("SELECT DISTINCT(`status`) from b_sub_agency " +
"where subtask_id = " +
"(SELECT subtask_id FROM b_sub_agency where business_id = #{subAgencyId})")
List<String> querySubAgencyStatusBySubAgencyId(String subAgencyId);
@Select("SELECT subtask_id FROM b_sub_agency where business_id = #{subAgencyId}")
String querySubTaskIdBySubAgencyId(String subAgencyId);
@Update("update b_sub_agency set del_flag = 1 where subtask_id = #{0}")
void deletePervious(String businessId);
......
package org.rcisoft.business.barrange.dao;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.rcisoft.business.barrange.entity.BSubtask;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface BSubtaskRepository extends BaseMapper<BSubtask> {
@Select("SELECT DISTINCT(`status`) from b_subtask\n" +
"where arrange_id = \n" +
"(SELECT arrange_id FROM b_subtask where business_id = #{subTaskId})")
List<String> querySubTaskStatusById(String subTaskId);
@Select("SELECT arrange_id FROM b_subtask where business_id = #{subTaskId}")
String queryArrangeIdById(String subTaskId);
@Update("update b_subtask set del_flag = 1 where arrange_id = #{0}")
void deleteSubtask(String businessId);
......
......@@ -46,6 +46,10 @@ public class BArrange extends IdEntity<BArrange> {
@Transient
private List<BSubtask> childList;
public BArrange(String businessId, String status) {
this.businessId = businessId;
this.status = status;
}
@Transient
private String termName;
......
......@@ -38,5 +38,10 @@ public class BSubtask extends IdEntity<BSubtask> {
@Transient
private String agencyCode;
public BSubtask(String businessId, String status) {
this.businessId = businessId;
this.status = status;
}
}
......@@ -54,5 +54,7 @@ public interface BArrangeService {
int changeArrangeToSl(String businessId, String subTaskId ,String termCode);
PersistModel release(String businessId);
BSubAgency selectSubAgencyAndOption(String subAgencyId);
}
......@@ -212,6 +212,8 @@ public class BArrangeServiceImpl implements BArrangeService {
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Override
public PersistModel importExcel(HSSFWorkbook hwb, String token , String subAgencyId) {
//先将原来的excel数据删除
ArrayList<ScheduleDto> scheduleDtos = new ArrayList<ScheduleDto>();
String[] headers = {"方案计划名","方案人数","方案课组","课程号","课程名","开课院系","课程属性","总学分","总学时",
......@@ -299,6 +301,9 @@ public class BArrangeServiceImpl implements BArrangeService {
BSubAgency bSubAgency = new BSubAgency(subAgencyId,"1");
bSubAgencyRepository.updateByPrimaryKeySelective(bSubAgency);
//修改sl_schedule表状态为保存
bSlScheduleRepository.updateStatusBySubAgencyId(subAgencyId,"1");
}
......@@ -395,6 +400,8 @@ public class BArrangeServiceImpl implements BArrangeService {
//复制章节及文件目录
chapterService.addBslFormLesson(null,sl.getLessonCode(), sl.getBusinessId());
}
BSubtask bSubtask = new BSubtask(subTaskId,"5");
bSubtaskRepository.updateByPrimaryKeySelective(bSubtask);//将子任务状态置为已开课
bTermRepository.MaxSlCodeByTermCode(termCode,String.valueOf(maxSlCode));//将该学期的开课序号存入
bDirectionRepository.insertList(bLessonDirections);//批量插入课程方向
//批量插入
......@@ -404,6 +411,11 @@ public class BArrangeServiceImpl implements BArrangeService {
}
@Override
public PersistModel release(String businessId) {
BArrange bArrange = new BArrange(businessId, "2");
int line = bArrangeRepository.updateByPrimaryKeySelective(bArrange);
return new PersistModel(line);
}
public BSubAgency selectSubAgencyAndOption(String subAgencyId) {
return bArrangeRepository.selectSubAgencyAndOption(subAgencyId);
}
......
......@@ -44,4 +44,9 @@ public class BCompany extends IdEntity<BCompany>{
this.flag = flag;
}
public BCompany(String businessId, String delFlag) {
this.businessId = businessId;
this.delFlag = delFlag;
}
}
......@@ -106,10 +106,7 @@ public class BCompanyServiceImpl implements BCompanyService{
@Override
public PersistModel stopOrStartUser(String businessId) {
String status = "1";
BCompany bCompany = new BCompany();
bCompany.setBusinessId(businessId);
bCompany.setDelFlag("0");
BCompany nowStatus = bCompanyRepository.selectOne(bCompany);
BCompany nowStatus = bCompanyRepository.selectOne(new BCompany(businessId,"0"));
if(nowStatus.getFlag().equals("1")){
status="0";
}
......@@ -124,4 +121,10 @@ public class BCompanyServiceImpl implements BCompanyService{
int line = bCompanyRepository.updateByPrimaryKeySelective(company);
return new PersistModel(line);
}
}
......@@ -38,10 +38,10 @@ public class BOpinionController extends PaginationController<BOpinion> {
}
@ApiOperation(value="审核通过", notes="根据排课ID通过审核")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "子任务ID(1-50)", required = true, dataType = "varchar")})
@ApiImplicitParams({@ApiImplicitParam(name = "subAgencyId", value = "子任务中对应的教学单位ID(1-50)", required = true, dataType = "varchar")})
@PutMapping(value = "/auditPass")
public Result auditPass(@RequestParam String businessId){
PersistModel data = bOpinionService.auditPass(businessId);
public Result auditPass(@RequestParam String subAgencyId){
PersistModel data = bOpinionService.auditPass(subAgencyId);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......@@ -49,11 +49,11 @@ public class BOpinionController extends PaginationController<BOpinion> {
}
@ApiOperation(value="审核驳回", notes="审核驳回,填写审核意见")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "子任务ID(1-50)", required = true, dataType = "varchar"),
@ApiImplicitParams({@ApiImplicitParam(name = "subAgencyId", value = "子任务ID(1-50)", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "opinion", value = "审核意见(1-200)", required = true, dataType = "varchar")})
@PostMapping("/auditFail")
public Result auditFail(String opinion,String id){
PersistModel data = bOpinionService.save(opinion,id);
public Result auditFail(String opinion,String subAgencyId){
PersistModel data = bOpinionService.save(opinion,subAgencyId);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -6,12 +6,14 @@ import org.apache.ibatis.annotations.Update;
import org.rcisoft.business.barrange.entity.BSubtask;
import org.rcisoft.business.bopinion.entity.BOpinion;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by Administrator on 2017/12/21.
*/
@Repository
public interface BOpinionRepository extends BaseMapper<BOpinion> {
@Select("select * from b_opinion where sl_id = #{slId} order by create_date DESC")
......
......@@ -12,8 +12,8 @@ public interface BOpinionService {
List<BOpinion> queryOpinionBySlId(String slId);
PersistModel auditPass(String businessId);
PersistModel auditPass(String subAgencyId);
PersistModel save(String opinion,String id);
PersistModel save(String opinion,String subAgencyId);
}
package org.rcisoft.business.bopinion.service.impl;
import org.rcisoft.business.barrange.dao.BArrangeRepository;
import org.rcisoft.business.barrange.dao.BSubAgencyRepository;
import org.rcisoft.business.barrange.dao.BSubtaskRepository;
import org.rcisoft.business.barrange.entity.BArrange;
import org.rcisoft.business.barrange.entity.BSubtask;
import org.rcisoft.business.bopinion.dao.BOpinionRepository;
import org.rcisoft.business.bopinion.entity.BOpinion;
......@@ -26,6 +30,15 @@ public class BOpinionServiceImpl implements BOpinionService{
@Autowired
private BOpinionRepository bOpinionRepository;
@Autowired
private BSubAgencyRepository bSubAgencyRepository;
@Autowired
private BSubtaskRepository bSubtaskRepository;
@Autowired
private BArrangeRepository bArrangeRepository;
@Override
public List<BOpinion> queryOpinionBySlId(String slId) {
return bOpinionRepository.queryOpinionBySlId(slId);
......@@ -33,13 +46,31 @@ public class BOpinionServiceImpl implements BOpinionService{
/**
* 审核通过
* @param businessId
* @param subAgencyId
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel auditPass(String businessId) {
int line = bOpinionRepository.changeSubtaskStatus(businessId);
public PersistModel auditPass(String subAgencyId) {
//根据subTaskId查询
int line = bOpinionRepository.changeSubtaskStatus(subAgencyId);
//获得子任务id
String subTaskId = bSubAgencyRepository.querySubTaskIdBySubAgencyId(subAgencyId);
//根据subAgencyId查询子任务下每个教学单位的审核状态
List<String> subAgencyStatus = bSubAgencyRepository.querySubAgencyStatusBySubAgencyId(subAgencyId);
if(subAgencyStatus.size()==1&&subAgencyStatus.get(0).equals("3")){//审核全部通过,将子任务状态置为通过
BSubtask bSubtask = new BSubtask(subTaskId,"3");
bSubtaskRepository.updateByPrimaryKeySelective(bSubtask);
}
//查询该排课任务下所有子任务的状态
String arrangeId = bSubtaskRepository.queryArrangeIdById(subTaskId);
List<String> subTaskStatus = bSubtaskRepository.querySubTaskStatusById(subTaskId);
if(subTaskStatus.size()==1&&subTaskStatus.get(0).equals("3")){//审核全部通过,将排课任务状态置为完成
BArrange bArrange = new BArrange(arrangeId,"3");
bArrangeRepository.updateByPrimaryKeySelective(bArrange);
}
return new PersistModel(line);
}
......
......@@ -44,5 +44,8 @@ public interface BSlScheduleRepository extends BaseMapper<BSlSchedule> {
@Delete("delete from b_sl_schedule where sub_agency_id = #{subAgencyId}")
int avoidRepeatBSlSchedule(String subAgencyId);
@Update("update b_sl_schedule set status = #{status} where sub_agency_id = #{subAgencyId} and del_flag = 0 and glag = 1")
int updateStatusBySubAgencyId(@Param("subAgencyId") String subAgencyId, @Param("status") String status);
}
......@@ -13,7 +13,7 @@ server:
druid:
url: jdbc:mysql://192.168.1.125:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root
password: 123456
password: root
initial-size: 1
min-idle: 1
max-active: 20
......@@ -56,15 +56,17 @@ spring:
resources:
add-mappings: false
redis:
host: 106.2.3.134
port: 7482
# host: 106.2.3.134
# port: 7482
host: 127.0.0.1
port: 6379
pool:
max-idle: 50
max-active: 1000
min-idle: 5
max-wait: -1
database: 0
password: ''
password: '123456'
timeout: 3600
freemarker:
charset: UTF-8
......@@ -116,8 +118,8 @@ global:
min_password: 6
max_password: 16
path:
base_upload_server_location: G:/education_res
physical_upload_server_location: G:/education_res
base_upload_server_location: E:/eduServer
physical_upload_server_location: E:/eduServer
course_location: course
lesson_location: lesson
sl_location: sl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment