|
@@ -28,7 +28,12 @@ import com.iamberry.rst.utils.OrderUtils;
|
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
import com.iamberry.wechat.tools.*;
|
|
|
import com.iamberry.wechat.tools.payUtil.DatetimeUtil;
|
|
|
+import com.lowagie.text.html.HtmlParser;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.jsoup.Jsoup;
|
|
|
+import org.jsoup.nodes.Document;
|
|
|
+import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.select.Elements;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -559,7 +564,30 @@ public class AwaitSendController {
|
|
|
} else if("sto".equalsIgnoreCase(salesOrderInfo.getSalesPostFirm())) {
|
|
|
jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(salesId.toString(), goodName));
|
|
|
}else{
|
|
|
- jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(ctrOrderUUID(salesOrderInfo.getSalesOrderId()), goodName));
|
|
|
+ if ("sf".equalsIgnoreCase(salesOrderInfo.getSalesPostFirm())) {
|
|
|
+ String uid = ctrOrderUUID(salesOrderInfo.getSalesOrderId());
|
|
|
+ // 替换Html
|
|
|
+ Document html = Jsoup.parse(jsonObject.getString("PrintTemplate"));
|
|
|
+ Elements f9 = html.getElementsByClass("f9");
|
|
|
+ if (f9 == null || f9.size() == 0) {
|
|
|
+ jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(ctrOrderUUID(salesOrderInfo.getSalesOrderId()), goodName));
|
|
|
+ } else {
|
|
|
+ for (Element element : f9) {
|
|
|
+ String text = element.text();
|
|
|
+ if (text.contains(uid)) {
|
|
|
+ // 设置内容
|
|
|
+ element.text("寄托物:" + goodName);
|
|
|
+ // 设置样式
|
|
|
+ String style = element.attr("style");
|
|
|
+ element.attr("style", style.replace("height:15px;", ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 替换json内容
|
|
|
+ jsonObject.put("PrintTemplate",html.toString());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(ctrOrderUUID(salesOrderInfo.getSalesOrderId()), goodName));
|
|
|
+ }
|
|
|
}
|
|
|
// 提交数据库
|
|
|
if (salesOrderService.printOrder(changeOrderList, AdminUtils.getLoginAdminId()) <= 0) {
|