From 096296cd7485c5583c8194d88cca700e3c4d84a0 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期一, 01 十二月 2025 16:50:42 +0800
Subject: [PATCH] 调整基础配置信息查询方式,取消jpa
---
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticePR.java | 86 ++++++++++++------------------------------
1 files changed, 25 insertions(+), 61 deletions(-)
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticePR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticePR.java
index 74ead93..35a3da4 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticePR.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutNoticePR.java
@@ -2,10 +2,12 @@
import com.bstek.dorado.annotation.DataProvider;
+import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.provider.Page;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.data.NoticeDto;
+import com.fzzy.igds.data.NoticeParam;
import com.fzzy.igds.service.InoutNoticeService;
import com.fzzy.igds.domain.InoutNoticeIn;
import com.fzzy.igds.domain.InoutNoticeOut;
@@ -41,12 +43,12 @@
@Resource
private SysDeptService sysDeptService;
- /**
+/* *//**
* inoutNoticePR#getTitle 鏍规嵁鎶ヨ〃绫诲瀷锛岃幏鍙栭粯璁ゆ煡璇俊鎭紝姣斿琛ㄥご淇℃伅绛�
*
* @param
* @return
- */
+ *//*
@DataProvider
public Map<String, Object> getTitle(Map<String, Object> param) {
Map<String, Object> result = new HashMap<String, Object>();
@@ -72,7 +74,7 @@
}
}
return result;
- }
+ }*/
/**
* inoutNoticePR#getYearQuery 榛樿骞翠唤
@@ -143,11 +145,13 @@
public InoutNoticeIn initAddIn() {
SysUser user = ContextUtil.getLoginUser();
InoutNoticeIn data = new InoutNoticeIn();
- data.setId("RKTZD_" + ContextUtil.generateId());
+ data.setId(ContextUtil.generateOrderId("RK"));
data.setName("鍏ュ簱閫氱煡鍗�");
data.setCompanyId(user.getCompanyId());
data.setDeptId(ContextUtil.subDeptId(user));
- data.setTag(Constant.YN_Y);
+ data.setYear(DateFormatUtils.format(new Date(), "yyyy"));
+ data.setCreateBy(ContextUtil.getLoginUserName());
+ data.setCreateTime(new Date());
return data;
}
@@ -158,62 +162,20 @@
* @return
*/
@DataProvider
- public void pageQueryIn(Page<InoutNoticeIn> page, Map<String, Object> param) {
- if (null == param) {
- param = new HashMap<>();
- }
- Map<String, Object> finalParam = param;
+ public void pageQueryIn(Page<InoutNoticeIn> page, NoticeParam param) {
+ com.baomidou.mybatisplus.extension.plugins.pagination.Page<InoutNoticeIn> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize());
- //澶氬弬鏁板垎椤垫煡璇�
- Pageable pageable = PageRequest.of(0, 10000, Sort.Direction.ASC, InoutNoticeIn.SORT_PROP);
- Specification<InoutNoticeIn> specification = new Specification<InoutNoticeIn>() {
- private static final long serialVersionUID = 1L;
+ inoutNoticeService.pageQueryIn(corePage, param);
- public Predicate toPredicate(Root<InoutNoticeIn> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
- List<Predicate> predicates = new ArrayList<Predicate>(); //鎵�鏈夌殑鏂█
-
- Predicate predicate1 = cb.equal(root.get("companyId"), ContextUtil.getCompanyId());
- predicates.add(predicate1);
- Predicate predicate2 = cb.equal(root.get("deptId"), ContextUtil.subDeptId(null));
- predicates.add(predicate2);
-
- String key = String.valueOf(finalParam.get("year"));
- if (StringUtils.isBlank(key)) {
- Predicate predicate3 = cb.equal(root.get("year"), key);
- predicates.add(predicate3);
- }
- key = (String) finalParam.get("id");
- if (StringUtils.isBlank(key)) {
- Predicate predicate4 = cb.equal(root.get("id"), key);
- predicates.add(predicate4);
- }
- key = (String) finalParam.get("customerName");
- if (StringUtils.isBlank(key)) {
- Predicate predicate5 = cb.like(root.get("customerName"), "%" + key + "%");
- predicates.add(predicate5);
- }
- key = (String) finalParam.get("completeStatus");
- if (StringUtils.isBlank(key)) {
- Predicate predicate6 = cb.equal(root.get("completeStatus"), key);
- predicates.add(predicate6);
- }
- key = (String) finalParam.get("foodVariety");
- if (StringUtils.isBlank(key)) {
- Predicate predicate7 = cb.equal(root.get("foodVariety"), key);
- predicates.add(predicate7);
- }
- return cb.and(predicates.toArray(new Predicate[0]));
- }
- };
- org.springframework.data.domain.Page<InoutNoticeIn> japPage = inoutNoticeService.queryAllNoticeIn(specification, pageable);
- page.setEntityCount((int) japPage.getTotalElements());
- page.setEntities(japPage.getContent());
+ // 閲嶆柊灏佽
+ page.setEntities(corePage.getRecords());
+ page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal())));
}
/**
* inoutNoticePR#saveIn 鏇存柊鍏ュ簱閫氱煡鍗�
*/
- @Expose
+ @DataResolver
public String saveIn(InoutNoticeIn data) {
InoutNoticeIn inoutNoticeIn = new InoutNoticeIn();
BeanUtils.copyProperties(data, inoutNoticeIn);
@@ -279,9 +241,10 @@
return cb.and(predicates.toArray(new Predicate[0]));
}
};
- org.springframework.data.domain.Page<InoutNoticeIn> japPage = inoutNoticeService.queryAllNoticeIn(specification, pageable);
+ //org.springframework.data.domain.Page<InoutNoticeIn> japPage = inoutNoticeService.queryAllNoticeIn(specification, pageable);
- return japPage.getContent();
+ //return japPage.getContent();
+ return null;
}
/**
@@ -382,9 +345,9 @@
return cb.and(predicates.toArray(new Predicate[0]));
}
};
- org.springframework.data.domain.Page<InoutNoticeOut> japPage = inoutNoticeService.queryAllNoticeOut(specification, pageable);
- page.setEntityCount((int) japPage.getTotalElements());
- page.setEntities(japPage.getContent());
+ //org.springframework.data.domain.Page<InoutNoticeOut> japPage = inoutNoticeService.queryAllNoticeOut(specification, pageable);
+ //page.setEntityCount((int) japPage.getTotalElements());
+ //page.setEntities(japPage.getContent());
}
/**
@@ -458,9 +421,10 @@
return cb.and(predicates.toArray(new Predicate[0]));
}
};
- org.springframework.data.domain.Page<InoutNoticeOut> japPage = inoutNoticeService.queryAllNoticeOut(specification, pageable);
+ //org.springframework.data.domain.Page<InoutNoticeOut> japPage = inoutNoticeService.queryAllNoticeOut(specification, pageable);
- return japPage.getContent();
+ //return japPage.getContent();
+ return null;
}
/**
--
Gitblit v1.9.3