|
@@ -29,6 +29,7 @@ import (
|
|
const (
|
|
const (
|
|
bigMemberContractNoFlag = "JYDZ05"
|
|
bigMemberContractNoFlag = "JYDZ05"
|
|
subVipContractNoFlag = "JYDZ06"
|
|
subVipContractNoFlag = "JYDZ06"
|
|
|
|
+ staticSourceDir = "resources/static/contract/"
|
|
|
|
|
|
/*
|
|
/*
|
|
1 超级订阅:https://www.kdocs.cn/l/cpqTn293crus
|
|
1 超级订阅:https://www.kdocs.cn/l/cpqTn293crus
|
|
@@ -336,7 +337,7 @@ func (detail *ContractDetail) getDocxFile(createTime time.Time) (filePath string
|
|
//计算第一页空行数,把落款固定到最下部
|
|
//计算第一页空行数,把落款固定到最下部
|
|
|
|
|
|
// read and parse the template docx
|
|
// read and parse the template docx
|
|
- doc, err := docx.Open(fmt.Sprintf("web/static/contract/%s.docx", detail.ContractTemplate))
|
|
|
|
|
|
+ doc, err := docx.Open(fmt.Sprintf("%s%s.docx", staticSourceDir, detail.ContractTemplate))
|
|
if err != nil {
|
|
if err != nil {
|
|
return "", errors.Wrap(err, "docx文件模版文件异常")
|
|
return "", errors.Wrap(err, "docx文件模版文件异常")
|
|
}
|
|
}
|
|
@@ -426,7 +427,7 @@ func (detail *ContractDetail) convertWordToPDF(inputDocxPath string) error {
|
|
y = 500 + rand.Int63n(200)
|
|
y = 500 + rand.Int63n(200)
|
|
}
|
|
}
|
|
|
|
|
|
- exeSeal := exec.Command(commandName, commandArg, fmt.Sprintf("convert %s \\( %s -resize 50%% \\) -gravity southeast -geometry +%d+%d -composite %s", fileTmpPath, "web/static/contract/z.png", x, y, fileTmpPath))
|
|
|
|
|
|
+ exeSeal := exec.Command(commandName, commandArg, fmt.Sprintf("convert %s \\( %s -resize 50%% \\) -gravity southeast -geometry +%d+%d -composite %s", fileTmpPath, fmt.Sprintf("%sz.png", staticSourceDir), x, y, fileTmpPath))
|
|
if _, err := exeSeal.CombinedOutput(); err != nil {
|
|
if _, err := exeSeal.CombinedOutput(); err != nil {
|
|
return errors.Wrap(err, "Command execution exeSeal failed:")
|
|
return errors.Wrap(err, "Command execution exeSeal failed:")
|
|
}
|
|
}
|