Переглянути джерело

张丁 测试作业票流程4.0

zhangding 3 роки тому
батько
коміт
0fa3dc2b3d

+ 3 - 5
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -372,13 +372,11 @@ public class TInvoiceBookingworkticketController extends BaseController
     public AjaxResult add(@RequestBody TInvoiceBookingworkticket tInvoiceBookingworkticket)
     {
        //先查当前登录的用户关联的承包商信息, 将名称 联系人 电话 都关联起来
-     //   LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
         String createAccount = SecurityUtils.getUsername();
-        TInvoiceContractor t= tInvoiceBookingworkticketService.selectTInvoiceContractorByName(createAccount);
+        SysUser sysUser=sysUserService.selectUserByUserName(createAccount);
         tInvoiceBookingworkticket.setCreaterCode(getUserId());
-        tInvoiceBookingworkticket.setContact(t.getContact());
-        tInvoiceBookingworkticket.setPhonenumber(t.getPhonenumber());
-        tInvoiceBookingworkticket.setWorkUnit(t.getContractorName());
+        tInvoiceBookingworkticket.setContact(sysUser.getNickName());
+        tInvoiceBookingworkticket.setPhonenumber(sysUser.getPhonenumber());
         tInvoiceBookingworkticketService.insertTInvoiceBookingworkticket(tInvoiceBookingworkticket);
 
         Long didi=tInvoiceBookingworkticket.getId();

+ 16 - 5
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/InvoiceEndSuccessListener.java

@@ -166,6 +166,7 @@ public class InvoiceEndSuccessListener implements Serializable, ExecutionListene
         List<SysDictData> book_work_type = iSysDictTypeService.selectDictDataByType("book_work_type");
         List<SysDictData> book_user_unit = iSysDictTypeService.selectDictDataByType("book_user_unit");
         List<SysDictData> book_risk_level = iSysDictTypeService.selectDictDataByType("book_risk_level");
+        List<SysDictData> DEPARTMENT = iSysDictTypeService.selectDictDataByType("DEPARTMENT");
         //构造模板的value
         StringBuilder content=new StringBuilder();
         StringBuilder contentUserUnit=new StringBuilder();
@@ -178,8 +179,8 @@ public class InvoiceEndSuccessListener implements Serializable, ExecutionListene
             if(tInvoiceWorkcontent.getRiskLevel()!=null){
                 for (SysDictData p : book_risk_level) {
                     if (tInvoiceWorkcontent.getRiskLevel().toString().equals(p.getDictValue())) {
-                        content.append("具体工作内容:"+tInvoiceWorkcontent.getWorkDescription()+" 区域:"+ticket.getWorkArea());//装置名称
-                        content.append(" 风险提醒:"+p.getDictLabel());
+                        content.append("具体工作内容:"+tInvoiceWorkcontent.getWorkDescription()+"  区域: "+ticket.getWorkArea());//装置名称
+                        content.append("  风险提醒: "+p.getDictLabel());
                     }
                 }
             }
@@ -211,10 +212,20 @@ public class InvoiceEndSuccessListener implements Serializable, ExecutionListene
                     params.put("workUnit", Texts.of(ticket.getWorkUnit()).fontSize(10).bold().create());
                 }
             }
-            //申请人
-            if(ticket.getContact()!=null) {
+            //申请人签名
+            if(tApproveReserveInvoice.getUserId()!=null) {
                 if (!params.containsKey("userName")) {
-                    params.put("userName", Texts.of(ticket.getContact()).fontSize(10).bold().create());
+                    SysUser sysUser = sysUserService.selectUserById(tApproveReserveInvoice.getUserId());
+                    params.put("userName",fileName(sysUser.getSignUrl()));
+                }
+            }
+            //联系单位
+            if(tApproveReserveInvoice.getUserId()!=null) {
+                SysUser sysUser = sysUserService.selectUserById(tApproveReserveInvoice.getUserId());
+                String dName= sysUser.getDept().getDeptName();
+                   //如果没有添加过  找到用户所属的部门添加进去
+                if (!params.containsKey("conUnit")) {
+                    params.put("conUnit",Texts.of(dName).fontSize(10).bold().create());
                 }
             }
             //作业类型

BIN
master/src/main/resources/static/word/invoice/book.docx


+ 13 - 9
ui/src/views/invoice/bookingworkticket/index.vue

@@ -391,7 +391,7 @@ import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addB
 import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
 import { listDevice, getDevice, delDevice, updateDevice, exportDevice, selectDevice} from "@/api/invoice/device";
 import { listUnit, getUnit, delUnit, addUnit, updateUnit, exportUnit,getUserByUnit} from "@/api/invoice/unit";
-import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus,userDataScope } from "@/api/system/user";
+import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus,userDataScope,getUserByUserName } from "@/api/system/user";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -560,7 +560,7 @@ export default {
         checkCategoryPromotion(oneId){
          
       getUserByUnit(oneId).then(response => {
-        this.form.userMg=null;
+   //     this.form.userMg=null;
         this.userMgOptions = response.data;
         //   let arr=  response.data.userIds.split(',');
       });
@@ -803,8 +803,11 @@ export default {
     handleAdd() {
       this.reset();
       this.resetForm1();
-      var names =this.$store.state.user.name
-      this.form.workUnit=names;
+       var names =this.$store.state.user.name
+       //查询用户归属的部门名称
+      getUserByUserName(names).then(response => {
+           this.form.workUnit=response.data.dept.deptName;
+      });
       this.open = true;
       this.title = "添加预约作业票台账";
 
@@ -812,21 +815,22 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-   //   console.log(row)
       const id = row.bookingticketId || this.ids
       getBookingworkticket(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改预约作业票台账";
         this.ruleForm=response.data.tInvoiceWorkcontentList
+           //  回显用户主管
+        this.checkCategoryPromotion(this.form.userUnit);
     //  console.log(row.floorLocation)  将后台的字符串数组重新转换为el-select要的数组格式
-           let arr=row.floorLocation.split(",")
-      let st=[]
+       let arr=row.floorLocation.split(",")
+       let st=[]
 		// 将字符串数组的每一项转换成Number,生成一个新的数组
       	for (var arrInt in arr) {
-			st.push(parseInt(arr[arrInt]))
+			  st.push(parseInt(arr[arrInt]))
 		}
-       this.form.floorLocation=st
+        this.form.floorLocation=st
 
         this.ruleForm.length=response.data.tInvoiceWorkcontentList.length
       });