From 3631219246be48aec1e745e94e5b28ff4e8799c8 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期五, 20 十月 2023 19:35:54 +0800
Subject: [PATCH] 调整上海原版接口
---
igds-inout/src/main/java/com/ld/igds/m/service/HInoutConfService.java | 48 +++++++++++++++++++-----------------------------
1 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/m/service/HInoutConfService.java b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutConfService.java
index 5b68639..69581d2 100644
--- a/igds-inout/src/main/java/com/ld/igds/m/service/HInoutConfService.java
+++ b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutConfService.java
@@ -4,9 +4,11 @@
import com.ld.igds.models.InoutConf;
import com.ld.igds.models.InoutSysConf;
import com.ld.igds.util.ContextUtil;
+
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Session;
import org.springframework.stereotype.Component;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -64,42 +66,30 @@
return null;
}
- public List<InoutSysConf> getSysConfData(Map<String, Object> param) {
-
- Map<String, Object> args = new HashMap<String, Object>();
- String hql = " from " + InoutSysConf.class.getName()
- + " where companyId=:companyId and deptId=:deptId";
-
- args.put("companyId", ContextUtil.getCompanyId());
- String deptId = "";
- if (null != param) {
- deptId = (String) param.get("deptId");
- }
-
- if (StringUtils.isEmpty(deptId)) {
- deptId = ContextUtil.subDeptId(null);
- }
-
- args.put("deptId", deptId);
-
- return this.query(hql, args);
- }
-
public String saveSysConfData(InoutSysConf data) {
Session session = this.getSessionFactory().openSession();
try {
- if (StringUtils.isEmpty(data.getDeptId())) {
- data.setDeptId(ContextUtil.subDeptId(null));
- data.setCompanyId(ContextUtil.getCompanyId());
- session.save(data);
- } else {
- session.update(data);
- }
-
+ session.saveOrUpdate(data);
} finally {
session.flush();
session.close();
}
return null;
}
+
+ public InoutSysConf getSysConfData(String companyId, String deptId) {
+
+ String hql = " from " + InoutSysConf.class.getName()
+ + " where companyId=:companyId and deptId=:deptId";
+
+ Map<String, Object> args = new HashMap<String, Object>();
+ args.put("companyId", companyId);
+ args.put("deptId", deptId);
+
+ List<InoutSysConf> list = this.query(hql, args);
+
+ if(null == list || list.isEmpty()) return new InoutSysConf();
+
+ return list.get(0);
+ }
}
--
Gitblit v1.9.3