|
@@ -5,6 +5,7 @@ import com.nuliji.tools.PageMessage;
|
|
import com.nuliji.tools.Response;
|
|
import com.nuliji.tools.Response;
|
|
import com.nuliji.tools.ResponseHelp;
|
|
import com.nuliji.tools.ResponseHelp;
|
|
import com.nuliji.tools.Transform;
|
|
import com.nuliji.tools.Transform;
|
|
|
|
+import com.qxgmat.data.constants.enums.status.AskStatus;
|
|
import com.qxgmat.data.constants.enums.status.DirectionStatus;
|
|
import com.qxgmat.data.constants.enums.status.DirectionStatus;
|
|
import com.qxgmat.data.constants.enums.user.AskTarget;
|
|
import com.qxgmat.data.constants.enums.user.AskTarget;
|
|
import com.qxgmat.data.constants.enums.user.MoneyRange;
|
|
import com.qxgmat.data.constants.enums.user.MoneyRange;
|
|
@@ -65,13 +66,16 @@ public class UserAskController {
|
|
if(!entity.getAnswer().isEmpty()){
|
|
if(!entity.getAnswer().isEmpty()){
|
|
|
|
|
|
entity.setAnswerTime(new Date());
|
|
entity.setAnswerTime(new Date());
|
|
- entity.setAnswerStatus(1);
|
|
|
|
|
|
+ entity.setAnswerStatus(AskStatus.ANSWER.index);
|
|
}
|
|
}
|
|
|
|
|
|
Manager manager = shiroHelp.getLoginManager();
|
|
Manager manager = shiroHelp.getLoginManager();
|
|
entity.setManagerId(manager.getId());
|
|
entity.setManagerId(manager.getId());
|
|
entity = userAskService.edit(entity);
|
|
entity = userAskService.edit(entity);
|
|
userAskService.updateOrder(dto.getOther());
|
|
userAskService.updateOrder(dto.getOther());
|
|
|
|
+
|
|
|
|
+ // 更新回答排序
|
|
|
|
+
|
|
managerLogService.log(request);
|
|
managerLogService.log(request);
|
|
return ResponseHelp.success(true);
|
|
return ResponseHelp.success(true);
|
|
}
|
|
}
|
|
@@ -115,7 +119,8 @@ public class UserAskController {
|
|
public Response<PageMessage<UserAskListDto>> list(
|
|
public Response<PageMessage<UserAskListDto>> list(
|
|
@RequestParam(required = false, defaultValue = "1") int page,
|
|
@RequestParam(required = false, defaultValue = "1") int page,
|
|
@RequestParam(required = false, defaultValue = "100") int size,
|
|
@RequestParam(required = false, defaultValue = "100") int size,
|
|
- @RequestParam(required = false) int category,
|
|
|
|
|
|
+ @RequestParam(required = false) String type,
|
|
|
|
+ @RequestParam(required = false) Integer category,
|
|
@RequestParam(required = false, name = "user_id") Number userId,
|
|
@RequestParam(required = false, name = "user_id") Number userId,
|
|
@RequestParam(required = false, name = "question_no_id") Number questionNoId,
|
|
@RequestParam(required = false, name = "question_no_id") Number questionNoId,
|
|
@RequestParam(required = false, name="target") String target,
|
|
@RequestParam(required = false, name="target") String target,
|
|
@@ -125,7 +130,7 @@ public class UserAskController {
|
|
@RequestParam(required = false, defaultValue = "id") String order,
|
|
@RequestParam(required = false, defaultValue = "id") String order,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
@RequestParam(required = false, defaultValue = "desc") String direction,
|
|
HttpSession session) {
|
|
HttpSession session) {
|
|
- Page<UserAsk> p = userAskService.listWithUser(page, size, category, userId, questionNoId, AskTarget.ValueOf(target), status, showStatus, MoneyRange.ValueOf(moneyRang), order, DirectionStatus.ValueOf(direction));
|
|
|
|
|
|
+ Page<UserAsk> p = userAskService.listWithUser(page, size, type, category, userId, questionNoId, AskTarget.ValueOf(target), AskStatus.ValueOf(status), showStatus, MoneyRange.ValueOf(moneyRang), order, DirectionStatus.ValueOf(direction));
|
|
List<UserAskListDto> pr = Transform.convert(p, UserAskListDto.class);
|
|
List<UserAskListDto> pr = Transform.convert(p, UserAskListDto.class);
|
|
|
|
|
|
// 绑定题目
|
|
// 绑定题目
|
|
@@ -136,7 +141,7 @@ public class UserAskController {
|
|
// 绑定题目编号
|
|
// 绑定题目编号
|
|
Collection questionNoIds = Transform.getIds(p, UserAsk.class, "questionNoId");
|
|
Collection questionNoIds = Transform.getIds(p, UserAsk.class, "questionNoId");
|
|
List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
|
|
List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
|
|
- Transform.combine(pr, questionNoList, UserAskListDto.class, "questionNoId", "question", QuestionNo.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
+ Transform.combine(pr, questionNoList, UserAskListDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
|
// 绑定用户
|
|
// 绑定用户
|
|
Collection userIds = Transform.getIds(p, UserAsk.class, "userId");
|
|
Collection userIds = Transform.getIds(p, UserAsk.class, "userId");
|