Commit 92ca92ee authored by curryft's avatar curryft

Merge branch 'master' of 103.249.252.109:lcy/education

# Conflicts:
#	src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
#	src/main/java/org/rcisoft/business/tquestion/dao/TQuestionRepository.java
parents 90a39a5d 47ba7c3f
......@@ -418,4 +418,37 @@ public class BChapterController extends PaginationController<BChapter> {
MessageConstant.MESSAGE_ALERT_ERROR,
bChapterService.queryMdFileByChapterId(businessId));
}
@ApiOperation(value="查询学生章节列表", notes="根据学生id查询学生章节列表")
@ApiImplicitParams({@ApiImplicitParam(name = "slId", value = "开课id", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "lessonOrSl", value = "课程或开课;0:开课 1:课程", required = true, dataType = "varchar")})
@GetMapping(value = "/queryBChaptersByStudent")
public Result queryBChaptersByStudent(BChapter param) {
Map<String, Object> map = new HashedMap();
String userId = UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID);
param.setUserId(userId);
map.put("RoleFlag", RoleFlagEnum.STUDENT.getFlag());
map.put("scoreList", bChapterService.queryScoreListBySlIdAndStuId(param.getSlId(), userId));
map.put("chapterList", bChapterService.queryBChaptersByStudent(param));
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
map);
}
@ApiOperation(value="打分", notes="根据章节ID和学号进行打分")
@ApiImplicitParams({@ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "slId", value = "开课id", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "studentCode", value = "学号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "score", value = "分数", required = true, dataType = "varchar"),})
@PreAuthorize("hasRole('ROLE_1002')")
@PostMapping(value = "/Mark")
public Result Mark(String chapterId,String slId,String studentCode,String score) {
return Result.builder(new PersistModel(bChapterService.Mark(chapterId,slId,studentCode,score)),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
studentCode);
}
}
package org.rcisoft.business.bcode.controller;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* Created by Administrator on 2018/1/16.
*/
public class testJava {
/*public static void main(String args[]) {
String fileName = "test.java";
test(fileName);
}*/
public static void exeCmd() {
BufferedReader br = null;
try {
//Runtime.getRuntime().exec("E:");
Process p = Runtime.getRuntime().exec("java E:/eduServer/test");
//Process p = Runtime.getRuntime().exec("java test");
br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
StringBuilder sb = new StringBuilder();
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
}
System.out.println(sb.toString());
} catch (Exception e) {
e.printStackTrace();
}
finally
{
if (br != null)
{
try {
br.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public static void main(String[] args) {
String commandStr = "java www.taobao.com";
//String commandStr = "ipconfig";
testJava.exeCmd();
}
}
......@@ -5,6 +5,7 @@ package org.rcisoft.business.tquestion.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.json.JSONArray;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,7 +31,7 @@ import java.util.List;
* Created by yangzhaojun on 2018-1-15 19:49:07.
*/
@RestController
@RequestMapping("/t/question")
@RequestMapping("/tQuestion")
public class TQuestionController extends PaginationController<TQuestion> {
@Autowired
......@@ -41,6 +42,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
@PreAuthorize("hasRole('ROLE_1002')")
<<<<<<< .merge_file_oAfXkc
public Result add(@Valid TQuestion tQuestion, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
throw new ServiceException(ResultServiceEnums.PARAMETER_ERROR.getCode(),
......@@ -48,6 +50,10 @@ public class TQuestionController extends PaginationController<TQuestion> {
}
tQuestion.setToken(getToken());
PersistModel data = tQuestionServiceImpl.save(tQuestion);
=======
public Result add(@Valid TQuestion tQuestion, String[] questionOptions) {
PersistModel data = tQuestionServiceImpl.save(tQuestion,questionOptions);
>>>>>>> .merge_file_cs5OSX
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......@@ -59,11 +65,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@PostMapping("/remove")
@PreAuthorize("hasRole('ROLE_1002')")
public Result delete(@PathVariable String id) {
TQuestion tQuestion = new TQuestion();
tQuestion.setBusinessId(id);
tQuestion.setToken(getToken());
PersistModel data = tQuestionServiceImpl.remove(tQuestion);
return Result.builder(data,
return Result.builder(new PersistModel(tQuestionServiceImpl.remove(id,getToken())),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
id);
......
......@@ -42,7 +42,11 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
+"where 1=1"
+"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
<<<<<<< .merge_file_ontliA
+"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if><script>")
=======
+"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if></script>")
>>>>>>> .merge_file_LlwUcr
List<TQuestion> queryTQuestions(TQuestion tQuestion);
@Update("<script> update t_question set del_flag = 1 and flag = 0 where FIND_IN_SET(business_id,idInfoList)<script>")
......
......@@ -16,14 +16,14 @@ public interface TQuestionService {
* @param tQuestion
* @return
*/
PersistModel save(TQuestion tQuestion);
PersistModel save(TQuestion tQuestion, String[] questionOptions);
/**
* 逻辑删除
* @param tQuestion
* @param id
* @return
*/
PersistModel remove(TQuestion tQuestion);
int remove(String id, String token);
/**
* 修改
......
package org.rcisoft.business.tquestion.service.impl;
import org.apache.commons.collections.MapUtils;
import org.json.JSONArray;
import org.rcisoft.business.tquestion.entity.TQuestionOptions;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.util.UserUtil;
......@@ -17,7 +19,11 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/**
......@@ -39,9 +45,10 @@ public class TQuestionServiceImpl implements TQuestionService {
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel save(TQuestion tQuestion){
public PersistModel save(TQuestion tQuestion, String[] questionOptions){
List<String> list = Arrays.asList(questionOptions);
Map map = MapUtils.putAll(new HashMap(), questionOptions);
TQuestionOptions tQuestionOptions = new TQuestionOptions();
tQuestion.setCommonBusinessId();
//增加操作
UserUtil.setCurrentPersistOperation(tQuestion);
int line = tQuestionRepository.insertSelective(tQuestion);
......@@ -57,17 +64,19 @@ public class TQuestionServiceImpl implements TQuestionService {
/**
* 逻辑删除
* @param tQuestion
* @param id
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel remove(TQuestion tQuestion){
public int remove(String id, String token){
TQuestion tQuestion = new TQuestion();
tQuestion.setBusinessId(id);
UserUtil.setCurrentMergeOperation(tQuestion);
int line = tQuestionRepository.logicalDelete(tQuestion);
log.info(UserUtil.getUserInfoProp(tQuestion.getToken(),UserUtil.USER_USERNAME)+"逻辑删除了ID为"+
tQuestion.getBusinessId()+"的信息");
return new PersistModel(line,MessageConstant.MESSAGE_ALERT_SUCCESS);
log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"逻辑删除了ID为"+
tQuestion.getBusinessId()+"的信息");
return line;
}
/**
......
......@@ -5,7 +5,7 @@
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>
%date %-5level %d - %msg%n
%d - %msg%n
</pattern>
</layout>
</appender>
......@@ -24,7 +24,7 @@
<!--滚动策略-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--路径-->
<fileNamePattern>/working/test/info.%d.log</fileNamePattern>
<fileNamePattern>/Users/liuzhichao/logback/info.%d.log</fileNamePattern>
</rollingPolicy>
</appender>
......@@ -45,7 +45,7 @@
<!--滚动策略-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--路径-->
<fileNamePattern>/working/test/error.%d.log</fileNamePattern>
<fileNamePattern>/Users/liuzhichao/logback/error.%d.log</fileNamePattern>
</rollingPolicy>
</appender>
<!--
......
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