|
@@ -40,12 +40,13 @@ public class DigitalReceiptService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<JSONObject> medicineInquiry(MedicineInquiry inquiry) throws Exception {
|
|
|
- int existPageNoCount = rxDao.getPageNoCount(inquiry.getPageNum());
|
|
|
- if (existPageNoCount == 100) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
|
|
|
- "页码[" + inquiry.getPageNum() + "]已存在!");
|
|
|
+ if (inquiry.needSaving()) {
|
|
|
+ if (inquiry.getPageNum() == 1) {
|
|
|
+ rxDao.truncateTable();
|
|
|
+ } else {
|
|
|
+ rxDao.deleteByPageNo(inquiry.getPageNum());
|
|
|
+ }
|
|
|
}
|
|
|
- rxDao.deleteByPageNo(inquiry.getPageNum());
|
|
|
return executeQuery(inquiry);
|
|
|
}
|
|
|
|
|
@@ -74,10 +75,12 @@ public class DigitalReceiptService {
|
|
|
log.info(list.toJSONString());
|
|
|
throw new Exception(e);
|
|
|
}
|
|
|
- Integer nextPage = decryptResult.getInteger("nextPage");
|
|
|
- if (null != nextPage && nextPage > inquiry.getPageNum()) {
|
|
|
- inquiry.setPageNum(nextPage);
|
|
|
- executeQuery(inquiry);
|
|
|
+ if (!inquiry.onlyCurrentPage()) {
|
|
|
+ Integer nextPage = decryptResult.getInteger("nextPage");
|
|
|
+ if (null != nextPage && nextPage > inquiry.getPageNum()) {
|
|
|
+ inquiry.setPageNum(nextPage);
|
|
|
+ executeQuery(inquiry);
|
|
|
+ }
|
|
|
}
|
|
|
decryptResult.remove("list");
|
|
|
}
|