Przeglądaj źródła

张丁 预约票导出修改

zhangding 2 lat temu
rodzic
commit
cf2c0b8e35

+ 26 - 6
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -134,8 +134,9 @@ public class TInvoiceBookingworkticketController extends BaseController
 
         List<TInvoiceWorkcontent> tInvoiceWorkcontentList = tInvoiceBookingworkticketService.selectTInvoiceWorkcontentList(tInvoiceBookingworkticket);
         for (TInvoiceWorkcontent workcontent : tInvoiceWorkcontentList) {
-            TInvoiceBookingworkticket bookingworkticket=tInvoiceBookingworkticketService.selectTInvoiceBookingworkticketById(workcontent.getBookingticketId());
-            workcontent.setBookingworkticket(bookingworkticket);
+
+                TInvoiceBookingworkticket bookingworkticket=tInvoiceBookingworkticketService.selectTInvoiceBookingworkticketById(workcontent.getBookingticketId());
+                workcontent.setBookingworkticket(bookingworkticket);
         }
 
         SXSSFWorkbook wb = new SXSSFWorkbook(1000);
@@ -185,16 +186,29 @@ public class TInvoiceBookingworkticketController extends BaseController
         //填充数据
         int rowIndex = 1;
         int columnIndex = 1;
+        StringBuilder contentUserWorkType=new StringBuilder();
+        String cuw="";
         for (TInvoiceWorkcontent t: tInvoiceWorkcontentList) {
+            if(t.getBookingworkticket().getStatus()!=3){
+                continue;
+            }
             Row row = sheet.createRow(rowIndex);
             row.createCell(0).setCellValue("扬子石化-巴斯夫有限责任公司");
             //作业类型
             if (t.getWorkType()!= null){
+                String newStr=t.getWorkType()+",";
+                String[] wtArr=newStr.split(",");
+                List<String> contentlist = Arrays.asList(wtArr);
                 for (SysDictData p : book_work_type) {
-                    if (t.getWorkType().toString().equals(p.getDictValue())) {
-                        row.createCell(1).setCellValue(p.getDictLabel());
-                    }
+                    for (String c : contentlist)
+                        if (c.equals(p.getDictValue())) {
+                            contentUserWorkType.append(","+p.getDictLabel());//作业类型
+                        }
+                }
+                if(contentUserWorkType.toString().startsWith(",")){
+                    cuw=contentUserWorkType.substring(1);
                 }
+                row.createCell(1).setCellValue(cuw);
             }
             if (t.getBookingworkticket().getWorkStartTime()!= null){
                 row.createCell(2).setCellValue(new SimpleDateFormat("yyyy/MM/dd").format(t.getBookingworkticket().getWorkStartTime()));
@@ -226,6 +240,7 @@ public class TInvoiceBookingworkticketController extends BaseController
             //
             row.createCell(12).setCellValue("");
             rowIndex++;
+            contentUserWorkType.delete(0, contentUserWorkType.length());
         }
         // 接着上面的最后一行追加
         int rowIndex1 = sheet.getLastRowNum()+1;
@@ -285,7 +300,11 @@ public class TInvoiceBookingworkticketController extends BaseController
         int workType10=0; int workType11=0; int workType12=0; int workType13=0; int workType14=0;
         int workType15=0; int workType16=0; int workType17=0;
         //填充下一个表格
+        int count=0;
         for (TInvoiceWorkcontent t: tInvoiceWorkcontentList) {
+            if(t.getBookingworkticket().getStatus()!=3){
+                continue;
+            }
             //先将字符串 分割数组 再转成集合 防止出现 1,11这种情况判断不清
             String newStr=t.getWorkType()+",";
             String[] wtArr=newStr.split(",");
@@ -319,6 +338,7 @@ public class TInvoiceBookingworkticketController extends BaseController
             }else {
                 //变更、承包、停车装置暂无数据
             }
+            count++;
         }
 
         Row row = sheet.createRow(rowIndex1+1);
@@ -340,7 +360,7 @@ public class TInvoiceBookingworkticketController extends BaseController
         row.createCell(15).setCellValue(0);
         row.createCell(16).setCellValue(0);
         row.createCell(17).setCellValue(0);
-        row.createCell(18).setCellValue(tInvoiceWorkcontentList.size());
+        row.createCell(18).setCellValue(count);
 
 
         OutputStream out = null;

+ 1 - 0
ui/src/views/ehs/jobticket/index.vue

@@ -734,6 +734,7 @@ export default {
        this.postponeParams.id=null
        this.postponeParams.yqxkzh=this.postponeform.yqxkzh
        this.postponeParams.xpxp="12"
+       this.postponeParams.zypzt="10"
        this.postponeParams.kprq=this.postponeform.kprq
        this.postponeParams.qfsj=this.postponeform.qfsj
        this.postponeParams.qfbz=this.postponeform.qfbz

+ 3 - 15
ui/src/views/invoice/bookingworkticket/index.vue

@@ -666,23 +666,11 @@ export default {
     //作业票统计
     tickedStatis(){
         let putData=this.$refs.multipleTable.selection
-        let arr=[]
-        putData.forEach(item => {
-          if(item.whgzxkzh!=null||item.dhzyxkzh!=null 
-          ||item.xzkjxkzh!=null||item.gczyxkzh!=null
-          ||item.mbzyxkzh!=null){
-         arr.push(item)
-       }
-       
-       })
-       if(arr.length==0){
-        return this.msgError("你选择的数据都不是已经关联的完成的预约票,请重新选择!")
-       }else{
-          batchAddJobticket(arr).then(response => {
+     
+          batchAddJobticket(putData).then(response => {
        this.msgSuccess(this.$t(response.msg));
       });
-       }
-      
+  
     },
     //根据用户单位 查询对应选择的用户主管  根据用户单位 字段 查找对应的多个主管 返回 Sysuser的集合(id,name)
         checkCategoryPromotion(oneId){