Jelajahi Sumber

LY 工作票 值班导出票号

ly 2 tahun lalu
induk
melakukan
ce5849e533

+ 16 - 0
master/src/main/java/com/ruoyi/project/ehs/controller/TJobticketController.java

@@ -314,6 +314,22 @@ public class TJobticketController extends BaseController {
         return toAjax(tJobticketService.updateTJobticket(tJobticket));
     }
 
+    /**
+     * 修改工作票状态
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:jobticket:edit')")
+    @Log(title = "工作票状态", businessType = BusinessType.UPDATE)
+    @PutMapping("/status")
+    public AjaxResult editStatus(@RequestBody TJobticket tJobticket) {
+        if ("18".equals(tJobticket.getZypzt()) ) {
+            //批量
+            return toAjax(tJobticketMapper.updateTJobticketStatus(tJobticket));
+        }else {
+            //单个
+            return toAjax(tJobticketService.updateTJobticket(tJobticket));
+        }
+    }
+
     /**
      * 删除工作票
      */

+ 2 - 0
master/src/main/java/com/ruoyi/project/ehs/mapper/TJobticketMapper.java

@@ -82,4 +82,6 @@ public interface TJobticketMapper
     int selectTJobticketSameData(TJobticket tJobticket);
 
     int countXp(TJobticket tJobticket);
+
+    int updateTJobticketStatus(TJobticket tJobticket);
 }

+ 49 - 42
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -626,52 +626,59 @@ public class TInvoiceBookingworkticketController extends BaseController {
         StringBuilder contentUserWorkType = new StringBuilder();
         String cuw = "";
         for (TInvoiceWorkcontent t : tInvoiceWorkcontentList) {
-            if (t.getBookingworkticket().getStatus() != 3) {
-                continue;
-            }
-            Row row = sheet.createRow(rowIndex);
-            //开始时间
-            if (t.getBookingworkticket().getWorkStartTime() != null) {
-                row.createCell(0).setCellValue(new SimpleDateFormat("yyyy/MM/dd").format(t.getBookingworkticket().getWorkStartTime()));
-            }
-            //作业类型
-            if (t.getWorkType() != null) {
-                String newStr = t.getWorkType() + ",";
-                String[] wtArr = newStr.split(",");
-                List<String> contentlist = Arrays.asList(wtArr);
-                for (SysDictData p : book_work_type) {
-                    for (String c : contentlist)
-                        if (c.equals(p.getDictValue())) {
-                            contentUserWorkType.append("," + p.getDictLabel());//作业类型
-                        }
+            try {
+                if (t.getBookingworkticket().getStatus() != 3) {
+                    continue;
                 }
-                if (contentUserWorkType.toString().startsWith(",")) {
-                    cuw = contentUserWorkType.substring(1);
+                Row row = sheet.createRow(rowIndex);
+                //开始时间
+                if (t.getBookingworkticket().getWorkStartTime() != null) {
+                    row.createCell(0).setCellValue(new SimpleDateFormat("yyyy/MM/dd").format(t.getBookingworkticket().getWorkStartTime()));
                 }
-                row.createCell(1).setCellValue(cuw);
-            }
-            if (t.getBookingworkticket().getWorkArea() != null) {
-                row.createCell(2).setCellValue(t.getBookingworkticket().getWorkArea());
-            }
-            //作业地址
-            if (t.getWorkDescription() != null) {
-                row.createCell(3).setCellValue(t.getWorkDescription());
-            }
-            //工艺主管
-            row.createCell(4).setCellValue(t.getBookingworkticket().getUserSupName() + " " + t.getBookingworkticket().getUserSupPhone());
-            //作业单位
-            if (t.getBookingworkticket().getWorkUnit() != null) {
-                row.createCell(5).setCellValue(t.getBookingworkticket().getWorkUnit());
+                //作业类型
+                if (t.getWorkType() != null) {
+                    String newStr = t.getWorkType() + ",";
+                    String[] wtArr = newStr.split(",");
+                    List<String> contentlist = Arrays.asList(wtArr);
+                    for (SysDictData p : book_work_type) {
+                        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().getWorkArea() != null) {
+                    row.createCell(2).setCellValue(t.getBookingworkticket().getWorkArea());
+                }
+                //作业地址
+                if (t.getWorkDescription() != null) {
+                    row.createCell(3).setCellValue(t.getWorkDescription());
+                }
+                //工艺主管
+                row.createCell(4).setCellValue(t.getBookingworkticket().getUserSupName() + " " + t.getBookingworkticket().getUserSupPhone());
+                //作业单位
+                if (t.getBookingworkticket().getWorkUnit() != null) {
+                    row.createCell(5).setCellValue(t.getBookingworkticket().getWorkUnit());
+                }
+                //负责人
+                row.createCell(6).setCellValue(t.getBookingworkticket().getContact());
+                //电话
+                row.createCell(7).setCellValue(t.getBookingworkticket().getPhonenumber());
+                //用户
+                row.createCell(8).setCellValue(t.getBookingworkticket().getUserMgName() + " " + t.getBookingworkticket().getUserMgPhone());
+                //票号
+                String ticketNo = t.getWhgzxkzh() + t.getDhzyxkzh()+t.getGczyxkzh()+t.getMbzyxkzh()+t.getXzkjxkzh() + t.getYqxkzh();
+                row.createCell(9).setCellValue(ticketNo.replaceAll("null" , ""));
+                rowIndex++;
+                contentUserWorkType.delete(0, contentUserWorkType.length());
+            }catch (Exception e) {
+                logger.error(e.toString());
             }
-            //负责人
-            row.createCell(6).setCellValue(t.getBookingworkticket().getContact());
-            //电话
-            row.createCell(7).setCellValue(t.getBookingworkticket().getPhonenumber());
-            //用户
-            row.createCell(8).setCellValue(t.getBookingworkticket().getUserMgName() + " " + t.getBookingworkticket().getUserMgPhone());
 
-            rowIndex++;
-            contentUserWorkType.delete(0, contentUserWorkType.length());
         }
 
         OutputStream out = null;

+ 15 - 0
master/src/main/resources/mybatis/ehs/TJobticketMapper.xml

@@ -307,6 +307,21 @@
         where id = #{id}
     </update>
 
+    <update id="updateTJobticketStatus" parameterType="TJobticket">
+        update t_jobticket
+        <trim prefix="SET" suffixOverrides=",">
+            zypzt = #{zypzt},
+        </trim>
+            <where>
+                <if test="whgzxkzh != null  and whgzxkzh != ''">and whgzxkzh = #{whgzxkzh}</if>
+                <if test="dhzyxkzh != null  and dhzyxkzh != ''">and dhzyxkzh = #{dhzyxkzh}</if>
+                <if test="xzkjxkzh != null  and xzkjxkzh != ''">and xzkjxkzh = #{xzkjxkzh}</if>
+                <if test="mbzyxkzh != null  and mbzyxkzh != ''">and mbzyxkzh = #{mbzyxkzh}</if>
+                <if test="gczyxkzh != null  and gczyxkzh != ''">and gczyxkzh = #{gczyxkzh}</if>
+            </where>
+    </update>
+
+
     <update id="deleteTJobticketById" parameterType="Long">
         update t_jobticket
         set del_flag = 2

+ 9 - 0
ui/src/api/ehs/jobticket.js

@@ -49,6 +49,15 @@ export function updateJobticket(data) {
     data: data
   })
 }
+// 修改工作票
+export function updateJobticketStatus(data) {
+  return request({
+    url: '/ehs/jobticket/status',
+    method: 'put',
+    data: data
+  })
+}
+
 
 // 删除工作票
 export function delJobticket(id) {

+ 3 - 2
ui/src/views/ehs/jobticket/index.vue

@@ -677,7 +677,7 @@ import {
   addJobticket,
   updateJobticket,
   exportJobticket,
-  selectChengbaoshang
+  updateJobticketStatus
 } from "@/api/ehs/jobticket";
 import {
   listUnit,
@@ -978,6 +978,7 @@ export default {
       const id = row.id || this.ids
       getJobticket(id).then(response => {
         this.postponeform = response.data;
+        this.postponeform.kprq = this.getNowFormatDate()
         //  this.checkCategoryPromotion(response.data.userUnit);
       });
       this.postponeParams = base.deepClone(row)
@@ -1115,7 +1116,7 @@ export default {
       this.form = row;
       row.zypzt = index;
       this.form.zypzt = index;
-      updateJobticket(this.form).then(response => {
+      updateJobticketStatus(this.form).then(response => {
         this.msgSuccess(this.$t('修改成功'));
         this.open = false;
         this.getList();