合同
This commit is contained in:
		| @@ -43,7 +43,9 @@ public class SysContract extends BaseEntity { | ||||
|      * 服务时间 | ||||
|      */ | ||||
|     @Excel(name = "服务时间") | ||||
|     private Integer serveTime; | ||||
|     private int serveTime; | ||||
|  | ||||
|     private String serveTimeStr; | ||||
|  | ||||
|     /** | ||||
|      * 金额 | ||||
| @@ -59,6 +61,11 @@ public class SysContract extends BaseEntity { | ||||
|     @Excel(name = "文件路径") | ||||
|     private String path; | ||||
|  | ||||
|     /** | ||||
|      * 签约日期 | ||||
|      */ | ||||
|     private String signDate; | ||||
|  | ||||
|     /** | ||||
|      * 合同状态 | ||||
|      * 0-未签订;1-已签订 | ||||
| @@ -89,11 +96,11 @@ public class SysContract extends BaseEntity { | ||||
|         this.phone = phone; | ||||
|     } | ||||
|  | ||||
|     public Integer getServeTime() { | ||||
|     public int getServeTime() { | ||||
|         return serveTime; | ||||
|     } | ||||
|  | ||||
|     public void setServeTime(Integer serveTime) { | ||||
|     public void setServeTime(int serveTime) { | ||||
|         this.serveTime = serveTime; | ||||
|     } | ||||
|  | ||||
| @@ -137,6 +144,23 @@ public class SysContract extends BaseEntity { | ||||
|         this.cusId = cusId; | ||||
|     } | ||||
|  | ||||
|     public String getSignDate() { | ||||
|         return signDate; | ||||
|     } | ||||
|  | ||||
|     public void setSignDate(String signDate) { | ||||
|         this.signDate = signDate; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public String getServeTimeStr() { | ||||
|         return serveTimeStr; | ||||
|     } | ||||
|  | ||||
|     public void setServeTimeStr(String serveTimeStr) { | ||||
|         this.serveTimeStr = serveTimeStr; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) | ||||
| @@ -147,6 +171,8 @@ public class SysContract extends BaseEntity { | ||||
|                 .append("phone", getPhone()) | ||||
|                 .append("serveTime", getServeTime()) | ||||
|                 .append("amount", getAmount()) | ||||
|                 .append("amountUpper", getAmountUpper()) | ||||
|                 .append("signDate", getSignDate()) | ||||
|                 .append("path", getPath()) | ||||
|                 .append("createBy", getCreateBy()) | ||||
|                 .append("createTime", getCreateTime()) | ||||
|   | ||||
| @@ -59,5 +59,5 @@ public interface ISysContractService | ||||
|      */ | ||||
|     public int deleteSysContractById(Long id); | ||||
|  | ||||
|     public int signContract(SysContract sysContract); | ||||
|     public boolean signContract(SysContract sysContract); | ||||
| } | ||||
|   | ||||
| @@ -98,9 +98,12 @@ public class SysContractServiceImpl implements ISysContractService { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int signContract(SysContract sysContract) { | ||||
|         String templatePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running/pdf/contract.pdf"; | ||||
|         String filePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running" + sysContract.getPath() + ".pdf"; | ||||
|     public boolean signContract(SysContract sysContract) { | ||||
| //        String templatePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running/pdf/contract.pdf"; | ||||
| //        String filePath = "/Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running" + sysContract.getPath(); | ||||
|         String templatePath = "/home/workspace/RuoYi-Vue/running/pdf/contract.pdf"; | ||||
|         String filePath = "/home/www/web/long.busyinn.com/file" + sysContract.getPath(); | ||||
|  | ||||
|         PdfReader reader; | ||||
|         FileOutputStream out; | ||||
|         ByteArrayOutputStream bos; | ||||
| @@ -116,11 +119,11 @@ public class SysContractServiceImpl implements ISysContractService { | ||||
|             form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED)); | ||||
|  | ||||
|             form.setField("name", sysContract.getName(), true); | ||||
|             form.setField("time", sysContract.getServeTime().toString(), true); | ||||
|             form.setField("time", sysContract.getServeTimeStr(), true); | ||||
|             form.setField("moneyUpper", sysContract.getAmountUpper(), true); | ||||
|             form.setField("money", sysContract.getAmount().intValue() + "", true); | ||||
|             form.setField("phone", sysContract.getPhone(), true); | ||||
|             form.setField("date", sysContract.getCreateTime().toString(), true); | ||||
|             form.setField("date", DateUtils.getDate(), true); | ||||
|             form.setField("cusId", sysContract.getCusId(), true); | ||||
|  | ||||
|  | ||||
| @@ -138,6 +141,8 @@ public class SysContractServiceImpl implements ISysContractService { | ||||
|                 copy.addPage(importPage); | ||||
|             } | ||||
|             doc.close(); | ||||
|  | ||||
|             return true; | ||||
|         } catch (FileNotFoundException e) { | ||||
|             e.printStackTrace(); | ||||
|         } catch (IOException e) { | ||||
| @@ -145,6 +150,6 @@ public class SysContractServiceImpl implements ISysContractService { | ||||
|         } catch (DocumentException e) { | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|         return 0; | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user