From e045a93166bcf696012770856c1ac36cf92740b5 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期四, 22 一月 2026 17:51:50 +0800
Subject: [PATCH] 增加单价配置
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java
index d218b7a..c31f47b 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java
@@ -3,12 +3,12 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.domain.Dept;
+import com.fzzy.igds.domain.PledgeContract;
import com.fzzy.igds.mapper.CoreDeptMapper;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.system.service.ISysDeptService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
@@ -23,11 +23,61 @@
public class CoreDeptService {
@Resource
- private ISysDeptService iSysDeptService;
- @Resource
private CoreDeptMapper coreDeptMapper;
@Resource
private InoutConfService inoutConfService;
+
+ /**
+ * 鏍规嵁鐢ㄦ埛绫诲瀷鑾峰彇瀵瑰簲搴撳尯鍒楄〃淇℃伅
+ *
+ * @param parentId
+ * @return
+ */
+ public List<Dept> getDeptByUserType(String parentId) {
+
+ if(StringUtils.isNotBlank(parentId)){
+ //鏌ュ叕鍙镐笅鎵�鏈夊簱鍖�
+ return this.listDept(null,null, parentId);
+ }
+ //鑾峰彇褰撳墠鐧诲綍浜�
+ SysUser user = ContextUtil.getLoginUser();
+
+ if (Constant.USER_TYPE_10.equals(user.getUserType())) {
+ //鐩戠鐢ㄦ埛锛岀洿鎺ユ煡璇㈢粍缁囦笅鎵�鏈夊簱鍖�
+ return this.listDept(null,user.getCompanyId(),null);
+ }
+ if (Constant.USER_TYPE_20.equals(user.getUserType())) {
+ //閾惰鐢ㄦ埛锛屾牴鎹悎鍚屾煡璇㈤摱琛屼笅鎵�鏈夊簱鍖�
+ return this.getDeptByBank(user.getUserData());
+ }
+ if (Constant.USER_TYPE_30.equals(user.getUserType())) {
+ //搴撳尯鐢ㄦ埛
+ String deptId = user.getDeptId() + "";
+ if(ContextUtil.isDepotUser(deptId)){
+ //鏌ヨ鐢ㄦ埛鎵�灞炲簱鍖�
+ return this.listDept(deptId,null,null);
+ }else {
+ //鏌ヨ鐢ㄦ埛鎵�灞炲叕鍙镐笅鎵�鏈夊簱鍖�
+ return this.listDept(null,null, deptId);
+ }
+ }
+ return this.listDept(null,user.getCompanyId(),null);
+ }
+
+ /**
+ * 鏍规嵁閾惰id锛屽叧鑱斿悎鍚岃〃鏌ヨ搴撳尯鍒楄〃
+ * @param bankId 閾惰鍙�
+ * @return
+ */
+ public List<Dept> getDeptByBank(String bankId) {
+ if (StringUtils.isBlank(bankId)){
+ return null;
+ }
+ QueryWrapper<PledgeContract> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("c.pledge_bank", bankId);
+
+ return coreDeptMapper.selectDeptByBankId(queryWrapper);
+ }
/**
* 鏍规嵁鏉′欢鏌ヨ搴撳尯淇℃伅
@@ -62,7 +112,7 @@
if (Constant.USER_TYPE_30.equals(user.getUserType())) {
return this.listDept(ContextUtil.subDeptId(user),null,null);
}else {
- return this.listDept(null,null,user.getDeptId() + "%");
+ return this.listDept(null,null,user.getDeptId()+"");
}
}
--
Gitblit v1.9.3