Commit 2c9d0bc9 authored by YangZhaoJun1's avatar YangZhaoJun1

通过审核接口增加更改子任务及排课任务状态的判断,发布排课接口

parent 13e0fa98
......@@ -108,7 +108,7 @@ public class BArrangeController extends PaginationController<BArrange> {
data.getInfluenceReason());
}
@ApiOperation(value="查看 集合", notes="查看单 集合")
@ApiOperation(value="列表视图,通过教学单位code进行查询", notes="列表视图,通过教学单位code进行查询")
@GetMapping(value = "/findDtoBybSubtaskId")
public Result findDtoBybSubtaskId(String bSubtaskId) {
return Result.builder(new PersistModel(1),
......@@ -118,7 +118,7 @@ public class BArrangeController extends PaginationController<BArrange> {
}
@ApiOperation(value="查看 集合", notes="查看单 集合")
@ApiOperation(value="列表视图,查询全部", notes="列表视图,查询全部")
@GetMapping(value = "/findDtoByMany")
public Result findDtoByMany(String agencyCode,String name,String termCode,String teacherCode) {
return Result.builder(new PersistModel(1),
......@@ -138,4 +138,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.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);
}
package org.rcisoft.business.barrange.dao;
import org.apache.ibatis.annotations.Select;
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);
}
......@@ -46,5 +46,9 @@ public class BArrange extends IdEntity<BArrange> {
@Transient
private List<BSubtask> childList;
public BArrange(String businessId, String status) {
this.businessId = businessId;
this.status = status;
}
}
......@@ -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;
}
}
......@@ -52,4 +52,6 @@ public interface BArrangeService {
List<ScheduleDto> queryDtoByMany(String agencyCode,String name,String termCode,String teacherCode);
int changeArrangeToSl(String businessId, String subTaskId ,String termCode);
PersistModel release(String businessId);
}
......@@ -215,6 +215,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 = {"方案计划名","方案人数","方案课组","课程号","课程名","开课院系","课程属性","总学分","总学时",
......@@ -304,6 +306,9 @@ public class BArrangeServiceImpl implements BArrangeService {
BSubAgency bSubAgency = new BSubAgency(subAgencyId,"1");
bSubAgencyRepository.updateByPrimaryKeySelective(bSubAgency);
//修改sl_schedule表状态为保存
bSlScheduleRepository.updateStatusBySubAgencyId(subAgencyId,"1");
}
......@@ -399,6 +404,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);//批量插入课程方向
//批量插入
......@@ -407,4 +414,11 @@ public class BArrangeServiceImpl implements BArrangeService {
return result;
}
@Override
public PersistModel release(String businessId) {
BArrange bArrange = new BArrange(businessId,"2");
int line = bArrangeRepository.updateByPrimaryKeySelective(bArrange);
return new PersistModel(line);
}
}
......@@ -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,7 +106,7 @@ public class BCompanyServiceImpl implements BCompanyService{
@Override
public PersistModel stopOrStartUser(String businessId) {
String status = "1";
BCompany nowStatus = bCompanyRepository.selectOne(new BCompany(businessId,"0","1"));
BCompany nowStatus = bCompanyRepository.selectOne(new BCompany(businessId,"0"));
if(nowStatus.getFlag().equals("1")){
status="0";
}
......
......@@ -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> {
@Update("update b_sl_schedule set sl_id = #{slId} where sub_agency_id = #{subAgencyId} and del_flag = 0 and glag = 1")
int updateSlIdBySubAgencyId(@Param("slId") String slId, @Param("subAgencyId") 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);
}
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