Parcourir la source

1.年度预算修改记录 2.费用申请页面新建 3.年度预算增加查询条件

梁世豪 il y a 10 mois
Parent
commit
73824283d3

+ 6 - 3
src/main/java/com/liang/controller/PrjAnnualBudgetRecordController.java

@@ -26,6 +26,8 @@ public class PrjAnnualBudgetRecordController extends BaseController {
26 26
 
27 27
     @Resource
28 28
     private PrjAnnualBudgetRecordService prjAnnualBudgetRecordService;
29
+    @Resource
30
+    private  PrjAnnualbudgetdetailService prjAnnualbudgetdetailService;
29 31
 
30 32
     /**
31 33
      * 在年度预算修改记录表中添加修改前的数据(年度预算明细)
@@ -65,10 +67,11 @@ public class PrjAnnualBudgetRecordController extends BaseController {
65 67
                              @RequestParam(required = false, defaultValue = "", value = "sortName") String sortName,
66 68
                              @RequestParam(required = false, defaultValue = "", value = "sortOrder") String sortOrder) {
67 69
         PageHelper.startPage(pageNum, pageSize);
68
-        List<PrjAnnualBudgetRecord> list = prjAnnualBudgetRecordService.queryRecordByNdysid(xmid);
69
-        PageInfo<PrjAnnualBudgetRecord> pageinfo = new PageInfo<>(list);
70
+//        List<PrjAnnualBudgetRecord> list = prjAnnualBudgetRecordService.queryRecordByNdysid(xmid);
71
+        List<PrjAnnualbudgetdetail> list = prjAnnualbudgetdetailService.getXGJL(xmid);
72
+        PageInfo<PrjAnnualbudgetdetail> pageinfo = new PageInfo<>(list);
70 73
         //取出查询结果
71
-        List<PrjAnnualBudgetRecord> rows = pageinfo.getList();
74
+        List<PrjAnnualbudgetdetail> rows = pageinfo.getList();
72 75
         int total = (int) pageinfo.getTotal();
73 76
         Map<String, Object> result = new HashMap<>();
74 77
         result.put(RESULT_ROWS, rows);

+ 37 - 1
src/main/java/com/liang/controller/StaBudgetapprovalController.java

@@ -14,6 +14,7 @@ import com.liang.service.*;
14 14
 import io.swagger.annotations.ApiOperation;
15 15
 import lombok.Synchronized;
16 16
 import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
17
+import org.apache.poi.hpsf.Decimal;
17 18
 import org.springframework.data.domain.Page;
18 19
 import org.springframework.data.domain.PageRequest;
19 20
 import org.springframework.http.ResponseEntity;
@@ -231,7 +232,7 @@ public class StaBudgetapprovalController extends BaseController {
231 232
     }
232 233
 
233 234
     /**
234
-     * 新建数据
235
+     * 新建数据(年度预算页面)
235 236
      *
236 237
      * @return
237 238
      */
@@ -241,6 +242,26 @@ public class StaBudgetapprovalController extends BaseController {
241 242
         model.addAttribute("userInfo", userInfo);
242 243
         return "annualbudget/add_apply";
243 244
     }
245
+    /**
246
+     * 新建数据(费用申请页面)
247
+     *
248
+     * @return
249
+     */
250
+    @RequestMapping(value = "/forAdd", method = RequestMethod.GET)
251
+    public String forAdd(Model model) {
252
+        SysUserInfo userInfo = getSysUserInfo();
253
+        model.addAttribute("userInfo", userInfo);
254
+        return "stabudgetapproval/add";
255
+    }
256
+
257
+    @RequestMapping(value = "/init_prjAnnualbudget", method = RequestMethod.GET)
258
+    public String init_prjAnnualbudget(Model model) {
259
+        //项目类型
260
+        List<Map<String, String>> xmlxList = projecttypeService.getXMLX();
261
+        model.addAttribute("xmlxList", xmlxList);
262
+
263
+        return "stabudgetapproval/list_annualbudget";
264
+    }
244 265
 
245 266
     /**
246 267
      * 保存数据(费用申请)
@@ -1599,5 +1620,20 @@ public class StaBudgetapprovalController extends BaseController {
1599 1620
         String bh = staBudgetapprovalService.getBhById(id);
1600 1621
         return BaseResult.success(bh);
1601 1622
     }
1623
+
1624
+    /**
1625
+     * 获取项目总预算
1626
+     *
1627
+     * @return
1628
+     */
1629
+    @ResponseBody
1630
+    @PostMapping("/getXMZYS/{id}")
1631
+    public BaseResult getXMZYS(@PathVariable String id) {
1632
+        Double xmzys = prjAnnualbudgetdetailService.getXMZYS(id);
1633
+//        select YSJE from prj_AnnualBudgetDetail where NYS = b.NYS and FJ = ''
1634
+        return BaseResult.success(xmzys);
1635
+    }
1636
+
1637
+
1602 1638
 }
1603 1639
 

+ 4 - 0
src/main/java/com/liang/dao/PrjAnnualbudgetdetailDao.java

@@ -134,5 +134,9 @@ public interface PrjAnnualbudgetdetailDao {
134 134
     List<PrjAnnualbudgetYzxqkVo> getNf(@Param("nys")Integer nys);
135 135
 
136 136
     List<PrjAnnualbudgetdetail> listAllBudgetDetail(@Param("nys") Integer nys);
137
+
138
+    List<PrjAnnualbudgetdetail> getXGJL(int xmid);
139
+
140
+    Double getXMZYS(String id);
137 141
 }
138 142
 

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

@@ -91,4 +91,8 @@ public interface PrjAnnualbudgetdetailService {
91 91
     Integer getSubNodeCount(@Param("nys") Integer nys, @Param("page") Integer page, @Param("limit") Integer limit);
92 92
 
93 93
     List<PrjAnnualbudgetdetail> listAllBudgetDetail(@Param("nys") Integer nys);
94
+
95
+    List<PrjAnnualbudgetdetail> getXGJL(int xmid);
96
+
97
+    Double getXMZYS(String id);
94 98
 }

+ 12 - 0
src/main/java/com/liang/service/impl/PrjAnnualbudgetdetailServiceImpl.java

@@ -234,4 +234,16 @@ public class PrjAnnualbudgetdetailServiceImpl implements PrjAnnualbudgetdetailSe
234 234
         return this.prjAnnualbudgetdetailDao.listAllBudgetDetail(nys);
235 235
     }
236 236
 
237
+    @Override
238
+    public List<PrjAnnualbudgetdetail> getXGJL(int xmid) {
239
+        return this.prjAnnualbudgetdetailDao.getXGJL(xmid);
240
+    }
241
+
242
+    @Override
243
+    public Double getXMZYS(String id) {
244
+        Double xmzys = prjAnnualbudgetdetailDao.getXMZYS(id);
245
+        System.out.println("xmzys = " + xmzys);
246
+        return xmzys;
247
+    }
248
+
237 249
 }

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

@@ -372,6 +372,9 @@
372 372
         <if test="nf != null and nf != ''">
373 373
             and a.NF = #{nf}
374 374
         </if>
375
+        <if test="add != null and add != ''">
376
+            and a.SPZT = '审批结束'
377
+        </if>
375 378
         <choose>
376 379
             <when test="sortName != null and sortName != '' and sortOrder != null and sortOrder != ''">
377 380
                 order by ${sortName} ${sortOrder}

+ 12 - 0
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml

@@ -655,5 +655,17 @@
655 655
         where
656 656
            nys in (select  ID from prj_AnnualBudget where rws = (select  rws from prj_AnnualBudget where id = #{nys}))
657 657
     </select>
658
+    <select id="getXGJL" resultType="com.liang.entity.PrjAnnualbudgetdetail">
659
+        select a.fymc,a.xmzys,a.ysje,b.nf
660
+        from
661
+            prj_AnnualBudgetDetail  a
662
+        left join prj_AnnualBudget b on  a.NYS = b.id
663
+        where
664
+            NYS =#{xmid}
665
+    </select>
666
+    <select id="getXMZYS" resultType="java.lang.Double">
667
+        select YSJE from prj_AnnualBudgetDetail where NYS = #{id} and FJ = ''
668
+    </select>
669
+
658 670
 </mapper>
659 671
 

+ 5 - 6
src/main/resources/templates/annualbudget/view_record.html

@@ -55,17 +55,16 @@
55 55
                 [
56 56
                     {type: 'numbers', align: 'center'},
57 57
                     {field: 'fymc', width: '20%', title: '费用名称'},
58
+                    {field: 'nf', width: '10%', title: '年份'},
58 59
                     {field: 'xmzys', width: '20%', title: '项目总预算'},
59
-                    {field: 'ysje', width: '10%', title: '预算金额', align: 'center'},
60
-                    {field: 'xmz', width: '10%', title: '项目组', align: 'center'},
61
-                    {field: 'byj', width: '10%', title: '备用金', align: 'center'},
62
-                    {field: 'bjsj', width: '15%', title: '编辑时间', align: 'center'}
60
+                    {field: 'sptgysje', width: '20%', title: '审批通过状态'},
61
+                    {field: 'ysje', width: '20%', title: '现在'},
63 62
                 ]
64 63
             ],
65 64
             sortName: 'jtsj',
66 65
             autoSort: false,
67
-            limits: [10, 15, 20, 25, 50, 100],
68
-            limit: 10,
66
+            limits: [20, 25, 50, 100],
67
+            limit: 30,
69 68
             page: true,
70 69
             skin: 'grid',
71 70
             parseData: function (res) { //res 即为原始返回的数据