Quellcode durchsuchen

修改记录审批完成状态

梁世豪 vor 10 Monaten
Ursprung
Commit
4753536ad6

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

@@ -138,5 +138,7 @@ public interface PrjAnnualbudgetdetailDao {
138 138
     List<PrjAnnualbudgetdetail> getXGJL(int xmid);
139 139
 
140 140
     Double getXMZYS(String id);
141
+
142
+    void updateSPTGZT(@Param("nys") Integer id, @Param("fymc") String fymc, @Param("sptgzt") String xgjlxz);
141 143
 }
142 144
 

+ 4 - 0
src/main/java/com/liang/entity/PrjAnnualbudgetdetail.java

@@ -206,6 +206,10 @@ public class PrjAnnualbudgetdetail implements Serializable {
206 206
      */
207 207
     private Double dnzyzf;
208 208
 
209
+    private String xgjlxz;
210
+
211
+    private String sptgzt;
212
+
209 213
     private BigDecimal bndsqje;
210 214
     private BigDecimal bndbzje;
211 215
 

+ 14 - 1
src/main/java/com/liang/service/impl/PrjAnnualbudgetServiceImpl.java

@@ -6,6 +6,7 @@ import com.liang.common.exception.CustomException;
6 6
 import com.liang.dao.PrjAnnualbudgetDao;
7 7
 import com.liang.dao.PrjAnnualbudgetdetailDao;
8 8
 import com.liang.entity.PrjAnnualbudget;
9
+import com.liang.entity.PrjAnnualbudgetdetail;
9 10
 import com.liang.entity.PrjProject;
10 11
 import com.liang.service.PrjAnnualbudgetService;
11 12
 import com.liang.service.PrjProjectService;
@@ -135,7 +136,19 @@ public class PrjAnnualbudgetServiceImpl implements PrjAnnualbudgetService {
135 136
 
136 137
     @Override
137 138
     public int updateSpzt(PrjAnnualbudget annualbudget) {
138
-        return this.prjAnnualbudgetDao.updateSpzt(annualbudget);
139
+        int num = prjAnnualbudgetDao.updateSpzt(annualbudget);
140
+//        审批通过后修改记录中添加审批通过状态
141
+//        1.获取年度预算列表
142
+        List<PrjAnnualbudgetdetail> xgjl = prjAnnualbudgetdetailDao.getXGJL(annualbudget.getId());
143
+//       2.拼接审批通过状态字段数据
144
+        if (annualbudget.getSpzt().equals("审批结束")&&num>0){
145
+            for (int i = 0; i < xgjl.size(); i++) {
146
+                String xgjlxz = xgjl.get(i).getXmz() + ","+xgjl.get(i).getYsje()+","+xgjl.get(i).getByj();
147
+//                xgjl.get(i).setXgjlxz(xgjlxz);
148
+            prjAnnualbudgetdetailDao.updateSPTGZT(annualbudget.getId(),xgjl.get(i).getFymc(),xgjlxz);
149
+            }
150
+        }
151
+        return num;
139 152
     }
140 153
 
141 154
     @Resource

+ 6 - 1
src/main/java/com/liang/service/impl/PrjAnnualbudgetdetailServiceImpl.java

@@ -236,7 +236,12 @@ public class PrjAnnualbudgetdetailServiceImpl implements PrjAnnualbudgetdetailSe
236 236
 
237 237
     @Override
238 238
     public List<PrjAnnualbudgetdetail> getXGJL(int xmid) {
239
-        return this.prjAnnualbudgetdetailDao.getXGJL(xmid);
239
+        List<PrjAnnualbudgetdetail> xgjl = prjAnnualbudgetdetailDao.getXGJL(xmid);
240
+        for (int i = 0; i < xgjl.size(); i++) {
241
+          String xgjlxz = xgjl.get(i).getXmz() + ","+xgjl.get(i).getYsje()+","+xgjl.get(i).getByj();
242
+          xgjl.get(i).setXgjlxz(xgjlxz);
243
+        }
244
+        return xgjl;
240 245
     }
241 246
 
242 247
     @Override

+ 10 - 3
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml

@@ -497,6 +497,13 @@
497 497
             NYS in (SELECT ID from prj_AnnualBudget where RWS = #{id} )
498 498
 
499 499
     </update>
500
+    <update id="updateSPTGZT">
501
+        UPDATE
502
+            prj_AnnualBudgetDetail
503
+        SET  SPTGZT = #{sptgzt}
504
+        where NYS = #{nys}
505
+          AND FYMC = #{fymc}
506
+    </update>
500 507
 
501 508
     <!--通过主键删除-->
502 509
     <delete id="deleteById">
@@ -656,12 +663,12 @@
656 663
            nys in (select  ID from prj_AnnualBudget where rws = (select  rws from prj_AnnualBudget where id = #{nys}))
657 664
     </select>
658 665
     <select id="getXGJL" resultType="com.liang.entity.PrjAnnualbudgetdetail">
659
-        select a.fymc,a.xmzys,a.ysje,b.nf
666
+        select a.fymc,a.sptgzt,a.xmzys,COALESCE(a.ysje,0)YSJE,COALESCE(a.xmz,0)as XMZ,COALESCE(a.byj,0)as BYJ,b.nf
660 667
         from
661 668
             prj_AnnualBudgetDetail  a
662
-        left join prj_AnnualBudget b on  a.NYS = b.id
669
+                left join prj_AnnualBudget b on  a.NYS = b.id
663 670
         where
664
-            NYS =#{xmid}
671
+            a.NYS =#{xmid}
665 672
     </select>
666 673
     <select id="getXMZYS" resultType="java.lang.Double">
667 674
         select YSJE from prj_AnnualBudgetDetail where NYS = #{id} and FJ = ''