Browse Source

Merge branch 'master' into dev-lgl

lgl 11 months ago
parent
commit
f53f8f2232

+ 39 - 11
src/main/java/com/liang/controller/PrjContractController.java

@@ -7,9 +7,13 @@ import com.liang.common.base.BaseController;
7 7
 import com.liang.common.base.BaseResult;
8 8
 import com.liang.common.utils.GetJsonIDUtil;
9 9
 import com.liang.entity.PrjContract;
10
+import com.liang.entity.SysLsUserEntity;
11
+import com.liang.entity.SysUserInfo;
12
+import com.liang.entity.serverinfo.Sys;
10 13
 import com.liang.service.BaseProjecttypeService;
11 14
 import com.liang.service.PrjContractService;
12 15
 import com.liang.service.PrjPayplanService;
16
+import com.liang.service.SysUserInfoService;
13 17
 import io.swagger.models.auth.In;
14 18
 import org.springframework.data.domain.Page;
15 19
 import org.springframework.data.domain.PageRequest;
@@ -41,7 +45,7 @@ public class PrjContractController extends BaseController {
41 45
     @Resource
42 46
     private BaseProjecttypeService projecttypeService;
43 47
     @Resource
44
-    private PrjPayplanService prjPayplanService;
48
+    private SysUserInfoService sysUserInfoService;
45 49
 
46 50
     /**
47 51
      * 分页查询
@@ -72,7 +76,9 @@ public class PrjContractController extends BaseController {
72 76
      * @return
73 77
      */
74 78
     @RequestMapping(value = "/init", method = RequestMethod.GET)
75
-    public String init() {
79
+    public String init(Model model) {
80
+
81
+        model.addAttribute("userId", getSysUserId());
76 82
         return "prjcontract/list";
77 83
     }
78 84
 
@@ -82,24 +88,45 @@ public class PrjContractController extends BaseController {
82 88
      * @return
83 89
      */
84 90
     @ResponseBody
85
-    @RequestMapping(value = "/list", method = RequestMethod.GET)
91
+    @RequestMapping(value = "/list/{id}", method = RequestMethod.GET)
86 92
     public BaseResult list(@RequestParam("page") Integer pageNum,
87 93
                            @RequestParam("limit") Integer pageSize,
94
+                           @PathVariable(required = false) Integer id,
88 95
                            @RequestParam(required = false, defaultValue = "", value = "rws") String rws,
89 96
                            @RequestParam(required = false, defaultValue = "", value = "htmc") String htmc,
90 97
                            @RequestParam(required = false, defaultValue = "", value = "rwsmc") String rwsmc,
91 98
                            @RequestParam(required = false, defaultValue = "", value = "sortName") String sortName,
92 99
                            @RequestParam(required = false, defaultValue = "", value = "sortOrder") String sortOrder) {
100
+        List<SysUserInfo> lists = sysUserInfoService.getDept(id);
93 101
         PageHelper.startPage(pageNum, pageSize);
94
-
95
-        Map<String, String> paraMap = new HashMap<>();
102
+        Map<String, Object> paraMap = new HashMap<>();
96 103
         paraMap.put("sortName", sortName);
97 104
         paraMap.put("sortOrder", sortOrder);
98 105
         paraMap.put("htmc", htmc);
99 106
         paraMap.put("rws", rws);
100 107
         paraMap.put("rwsmc", rwsmc);
101
-        List<PrjContract> list = prjContractService.getContractList(paraMap);
102 108
 
109
+        boolean containsKeyField = false;
110
+        if (lists.size() > 0){
111
+            for (int i = 0; i<lists.size();i++) {
112
+                // 假设 obj 是一个包含字段的对象,例如 obj.getField() 是获取字段的方法
113
+                if (lists.get(i).getUserPostName() == null){
114
+                    continue;
115
+
116
+                }
117
+                if (lists.get(i).getUserPostName().contains("部门主任")) {
118
+                    containsKeyField = true;
119
+                    break;
120
+                }
121
+
122
+            }
123
+            if(!containsKeyField){
124
+                paraMap.put("id",id);
125
+            }
126
+        }
127
+
128
+        // 部门的可以查看本部门的 ,主任查看 本部门全部的
129
+        List<PrjContract> list = prjContractService.getContractList(paraMap);
103 130
         PageInfo<PrjContract> pageinfo = new PageInfo<>(list);
104 131
         //取出查询结果
105 132
         List<PrjContract> rows = pageinfo.getList();
@@ -107,7 +134,6 @@ public class PrjContractController extends BaseController {
107 134
         Map<String, Object> result = new HashMap<>();
108 135
         result.put(RESULT_ROWS, rows);
109 136
         result.put(RESULT_TOTAL, total);
110
-
111 137
         return BaseResult.success(result);
112 138
     }
113 139
 
@@ -146,10 +172,11 @@ public class PrjContractController extends BaseController {
146 172
     public BaseResult doAdd(PrjContract prjContract) {
147 173
         prjContract.setCjr(getSysUserId());
148 174
         int num = prjContractService.insert(prjContract);
149
-        if (num > 0)
175
+        if (num > 0) {
150 176
             return BaseResult.success("保存成功!", prjContract);
151
-        else
177
+        } else {
152 178
             return BaseResult.failure("保存失败!");
179
+        }
153 180
     }
154 181
 
155 182
     /**
@@ -175,10 +202,11 @@ public class PrjContractController extends BaseController {
175 202
     @RequestMapping(value = "/doUpdate", method = RequestMethod.POST)
176 203
     public BaseResult doUpdate(PrjContract prjContract) {
177 204
         int num = prjContractService.update(prjContract);
178
-        if (num > 0)
205
+        if (num > 0) {
179 206
             return BaseResult.success("保存成功!", prjContract);
180
-        else
207
+        } else {
181 208
             return BaseResult.failure("保存失败!");
209
+        }
182 210
     }
183 211
 
184 212
     /**

+ 10 - 2
src/main/java/com/liang/controller/StaBudgetapprovalController.java

@@ -1304,6 +1304,15 @@ public class StaBudgetapprovalController extends BaseController {
1304 1304
 
1305 1305
         return resultMap;
1306 1306
     }
1307
+    @ResponseBody
1308
+    @RequestMapping(value = "/getAll",method = RequestMethod.GET)
1309
+    public BaseResult getAll(){
1310
+        Map<String, String> paraMap = new HashMap<>();
1311
+        List<FeeManagemant> list = prjProjectService.getFyglList(paraMap);
1312
+
1313
+    return BaseResult.success(list);
1314
+    }
1315
+
1307 1316
 
1308 1317
     /**
1309 1318
      * 项目备用金信息
@@ -1421,7 +1430,7 @@ public class StaBudgetapprovalController extends BaseController {
1421 1430
      * @return
1422 1431
      */
1423 1432
     @ResponseBody
1424
-    @RequestMapping(value = "/getSubNode/{nys}", method = RequestMethod.GET)
1433
+    @RequestMapping(value = "/getSubNode/{nys}", method = RequestMethod.POST)
1425 1434
     public Object getSubNode(@PathVariable Integer nys,
1426 1435
                              @RequestParam Integer page,
1427 1436
                              @RequestParam Integer limit,
@@ -1441,7 +1450,6 @@ public class StaBudgetapprovalController extends BaseController {
1441 1450
 
1442 1451
     /**
1443 1452
      * 未关联项目备用金列表
1444
-     *
1445 1453
      * @return
1446 1454
      */
1447 1455
     @ResponseBody

+ 7 - 0
src/main/java/com/liang/dao/SysUserInfoDao.java

@@ -183,6 +183,13 @@ public interface SysUserInfoDao {
183 183
      * @return
184 184
      */
185 185
     List<String> getPostNameByUserId(Integer userId);
186
+
187
+    /**
188
+     * 获取Id人员的岗位信息
189
+     */
190
+    List<SysUserInfo> getDept(Integer id);
191
+
192
+
186 193
 }
187 194
 
188 195
 

+ 4 - 0
src/main/java/com/liang/service/SysUserInfoService.java

@@ -169,4 +169,8 @@ public interface SysUserInfoService {
169 169
     List<String> getPostNameByUserId(Integer userId);
170 170
 
171 171
 
172
+
173
+    List<SysUserInfo> getDept(Integer id);
174
+
175
+
172 176
 }

+ 6 - 0
src/main/java/com/liang/service/impl/SysUserInfoServiceImpl.java

@@ -214,4 +214,10 @@ public class SysUserInfoServiceImpl implements SysUserInfoService {
214 214
         return this.sysUserInfoDao.getPostNameByUserId(userId);
215 215
     }
216 216
 
217
+    @Override
218
+    public List<SysUserInfo> getDept(Integer id) {
219
+        return this.sysUserInfoDao.getDept(id);
220
+    }
221
+
222
+
217 223
 }

+ 3 - 0
src/main/resources/mapper/PrjContractDao.xml

@@ -198,6 +198,9 @@
198 198
         <if test="rwsmc != null and rwsmc != ''">
199 199
             and x.ZWMC like '%'+#{rwsmc}+'%'
200 200
         </if>
201
+        <if test="id != null and id != ''">
202
+            and u.user_id = #{id}
203
+        </if>
201 204
         <choose>
202 205
             <when test="sortName != null and sortName != '' and sortOrder != null and sortOrder != ''">
203 206
                 order by ${sortName} ${sortOrder}

+ 14 - 0
src/main/resources/mapper/SysUserInfoDao.xml

@@ -420,5 +420,19 @@
420 420
         where u.user_id = #{userId}
421 421
     </select>
422 422
 
423
+    <select id="getDept" resultMap="SysUserInfoMap">
424
+
425
+        select u.*, d.dept_name as deptName, d1.dept_name as deptName1, d2.dept_name as deptName2, p.post_name as userPostName
426
+        from sys_user_info u
427
+                 left join sys_dept_info d on d.dept_id = u.dept_id
428
+                 left join sys_dept_info d1 on d1.dept_id = d.parent_id
429
+                 left join sys_dept_info d2 on d2.dept_id = d1.parent_id
430
+                 left join sys_user_post up on up.user_id = u.user_id
431
+                 left join sys_post_info p on p.post_id = up.post_id
432
+        where u.user_id = #{id}
433
+
434
+    </select>
435
+
436
+
423 437
 </mapper>
424 438
 

+ 6 - 4
src/main/resources/templates/annualbudget/add_apply.html

@@ -651,16 +651,18 @@
651 651
             searchKey: 'mc',
652 652
             searchPlaceholder: '搜索费用名称',
653 653
             table: {
654
-                url: AjaxUtil.ctx + 'staBudgetapproval/getSubNode/' + ysId,
655
-                method: 'get',
654
+                url: AjaxUtil.ctx + 'staBudgetapproval/getSubNode/' + ysId+'/?searchKey='+tableSelect.searchKey,
655
+                method: 'post',
656 656
                 cols: [
657 657
                     [
658 658
                         {type: "radio", fixed: 'left'},
659
-                        {type: 'numbers', align: 'center'},
659
+                        {type: 'numbers', align: 'center',title: '序号'},
660 660
                         {field: 'fymc', width: '50%', title: '费用名称'},
661
-                        {field: 'ysje', title: '预算金额(万元)'}
661
+                        {field: 'ysje', title: '预算金额(万元)',align: 'center'}
662 662
                     ]
663
+
663 664
                 ]
665
+
664 666
             },
665 667
             done: function (elem, data) {
666 668
                 var NEWJSON = [];

+ 4 - 3
src/main/resources/templates/prjcontract/list.html

@@ -58,7 +58,7 @@
58 58
                 </button>
59 59
             </div>
60 60
         </script>
61
-
61
+        <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userId}">
62 62
         <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
63 63
 
64 64
     </div>
@@ -73,10 +73,11 @@
73 73
     layui.use(['form', 'table', 'treeTable'], function () {
74 74
         var form = layui.form,
75 75
             table = layui.table;
76
-
76
+        var userId = $("#userId").val();
77
+        console.log('当前账户ID'+userId);
77 78
         var currTable = table.render({
78 79
             elem: '#currentTableId',
79
-            url: AjaxUtil.ctx + 'prjContract/list',
80
+            url: AjaxUtil.ctx + 'prjContract/list/'+userId,
80 81
             method: 'get',
81 82
             toolbar: '#toolbarDemo',
82 83
             // defaultToolbar: ['filter', 'exports', 'print'],

+ 29 - 6
src/main/resources/templates/stafeemanage/list_feemanage.html

@@ -61,7 +61,8 @@
61 61
                         </div>
62 62
 
63 63
                         <div class="layui-inline" style="margin-left: 0px">
64
-                            <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
64
+                            <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn">
65
+                                <i class="layui-icon"></i> 搜 索</button>
65 66
                             <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-reset-btn"><i class="layui-icon layui-icon-refresh"></i> 重 置 </button>
66 67
                         </div>
67 68
                     </div>
@@ -73,10 +74,10 @@
73 74
 </div>
74 75
 <script type="text/html" id="toolbarDemo">
75 76
     <div class="layui-btn-container">
76
-        <button class="layui-btn layui-btn-sm layui-btn-warm" lay-event="view">
77
+<!--        <button class="layui-btn layui-btn-sm layui-btn-warm" lay-event="view">
77 78
             <i class="layui-icon layui-icon-file" style="font-size: 10px;"></i>查看
78
-        </button>
79
-        <button class="layui-btn layui-btn-sm" lay-event="exportExcel">
79
+        </button>-->
80
+        <button class="layui-btn layui-btn-sm" lay-event="export">
80 81
             <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表
81 82
         </button>
82 83
     </div>
@@ -103,8 +104,8 @@
103 104
             // defaultToolbar: ['filter', 'print'],
104 105
             cols: [
105 106
                 [
106
-                    {type: "checkbox", fixed: 'left'},
107
-                    {type: 'numbers', align: 'center', fixed: 'left'},
107
+                    {type: "radio", title:'😊' ,fixed: 'left'},
108
+                    {type: 'numbers', align: 'center', fixed: 'left',title: '序号'},
108 109
                     // {field: 'id', title: 'ID',hide:true},
109 110
                     {field: 'zwmc', width: '20%', title: '项目名称'},
110 111
                     {field: 'erpbh', width: '8%', title: 'ERP编号'},
@@ -145,6 +146,8 @@
145 146
             }
146 147
         });
147 148
 
149
+
150
+
148 151
         // 监听搜索操作
149 152
         form.on('submit(data-search-btn)', function (data) {
150 153
             // 执行搜索重载
@@ -269,6 +272,26 @@
269 272
             a.click();
270 273
             a.parentNode.removeChild(a);
271 274
         }
275
+        else if (obj.event === 'export'){
276
+            console.log('导出按钮');
277
+            $.ajax({
278
+                url: AjaxUtil.ctx + 'staBudgetapproval/getAll',
279
+                type: 'get',
280
+                success: function (res) {
281
+                    console.log('返回了数据'+res.data);
282
+                    res.data.forEach(function (item){
283
+
284
+                        console.log('Item:',item)
285
+            });
286
+
287
+                    table.exportFile('currentTableId',res.data,'xls'); //表名 数据  格式
288
+                },
289
+                error: function (xhr, status, error) {
290
+                    console.error('Error fetching data:', error);
291
+                }
292
+            });
293
+
294
+        }
272 295
         });
273 296
     });
274 297
     function setUpdateFlag() {