|
@@ -32,8 +32,8 @@ import cn.com.qmth.stmms.biz.report.service.ReportSubjectQuestionService;
|
|
|
* @Date 2019-04-17
|
|
|
*/
|
|
|
@Service
|
|
|
-public class ReportSubjectQuestionServiceImpl extends BaseQueryService<ReportSubjectQuestion>
|
|
|
- implements ReportSubjectQuestionService {
|
|
|
+public class ReportSubjectQuestionServiceImpl extends BaseQueryService<ReportSubjectQuestion> implements
|
|
|
+ ReportSubjectQuestionService {
|
|
|
|
|
|
@Autowired
|
|
|
private ReportSubjectQuestionDao reportSubjectQuestionDao;
|
|
@@ -58,8 +58,8 @@ public class ReportSubjectQuestionServiceImpl extends BaseQueryService<ReportSub
|
|
|
@Override
|
|
|
public List<ReportSubjectQuestion> findByQuery(final ReportSubjectQuery query) {
|
|
|
query.setSort(new Sort(Direction.ASC, "paperType", "mainNumber", "subNumber"));
|
|
|
- Page<ReportSubjectQuestion> result = reportSubjectQuestionDao
|
|
|
- .findAll(new Specification<ReportSubjectQuestion>() {
|
|
|
+ Page<ReportSubjectQuestion> result = reportSubjectQuestionDao.findAll(
|
|
|
+ new Specification<ReportSubjectQuestion>() {
|
|
|
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<ReportSubjectQuestion> root, CriteriaQuery<?> cQuery,
|
|
@@ -120,7 +120,12 @@ public class ReportSubjectQuestionServiceImpl extends BaseQueryService<ReportSub
|
|
|
public int compare(ReportSubjectQuestion o1, ReportSubjectQuestion o2) {
|
|
|
int i = o1.getMainNumber() - o2.getMainNumber();
|
|
|
if (i == 0) {
|
|
|
- return Integer.parseUnsignedInt(o1.getSubNumber()) - Integer.parseUnsignedInt(o2.getSubNumber());
|
|
|
+ if (o1.getSubNumber().contains("-")) {
|
|
|
+ return o1.getSubNumber().compareTo(o2.getSubNumber());
|
|
|
+ } else {
|
|
|
+ return Integer.parseUnsignedInt(o1.getSubNumber())
|
|
|
+ - Integer.parseUnsignedInt(o2.getSubNumber());
|
|
|
+ }
|
|
|
}
|
|
|
return i;
|
|
|
}
|