|
|
|
@ -2,6 +2,7 @@ package jnpf.paymentdoc.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
@ -407,9 +408,40 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
|
|
|
|
|
paymentdocMessage.setFullName(PermissionUtil.getLinkInfoByOrgId(userEntity.getOrganizeId(), organizeService, false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String substring = null;
|
|
|
|
|
String substring1 = null;
|
|
|
|
|
if (paymentdocMessage.getFullName()!=null){
|
|
|
|
|
String fullName = paymentdocMessage.getFullName();
|
|
|
|
|
substring = fullName.substring(fullName.indexOf("/")+1, fullName.indexOf("/", fullName.indexOf("/")+1));
|
|
|
|
|
if (fullName.length()>fullName.indexOf(substring)+2){
|
|
|
|
|
substring1 = fullName.substring(fullName.indexOf(substring) + substring.length()+1, fullName.length());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
StringBuilder payEnclosureStr = new StringBuilder();
|
|
|
|
|
if (paymentdocMessage.getEnclosure()!=null){
|
|
|
|
|
String enclosure = paymentdocMessage.getEnclosure();
|
|
|
|
|
JSONArray jsonToJsonArray = JsonUtil.getJsonToJsonArray(enclosure);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < jsonToJsonArray.size(); i++) {
|
|
|
|
|
Map o = (Map)jsonToJsonArray.get(i);
|
|
|
|
|
Object name = o.get("name");
|
|
|
|
|
if (i==0){
|
|
|
|
|
payEnclosureStr.append(name);
|
|
|
|
|
payEnclosureStr.append("<br/>"+name);
|
|
|
|
|
}else {
|
|
|
|
|
payEnclosureStr.append("<br/>"+name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
paymentdocMessage.setEnclosure(payEnclosureStr.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// StringUtil.indexOf()
|
|
|
|
|
// String templateFilePath = configValueUtil.getTemplateFilePath() +"paymentDocPdf//";
|
|
|
|
|
Map<String, Object> map = JsonUtil.stringToMap(JSONUtil.toJsonStr(paymentDocMessage));
|
|
|
|
|
|
|
|
|
|
map.put("substring",substring);
|
|
|
|
|
map.put("substring1",substring1);
|
|
|
|
|
// map.put("reportList",paymentDocNodeInfo);
|
|
|
|
|
FlowBeforeController bean = SpringContext.getBean(FlowBeforeController.class);
|
|
|
|
|
ActionResult info = null;
|
|
|
|
@ -432,8 +464,23 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
|
|
|
|
|
map1.put("node",map2.get("node"));
|
|
|
|
|
maps.add(map1);
|
|
|
|
|
}
|
|
|
|
|
ArrayList<Map<String, Object>> maps1 = new ArrayList<Map<String, Object>>();
|
|
|
|
|
int num=6;
|
|
|
|
|
|
|
|
|
|
if (maps.size()>num){
|
|
|
|
|
for (int i = 0; i < maps.size(); i++) {
|
|
|
|
|
Map<String, Object> map1 = maps.get(i);
|
|
|
|
|
if (i>=num){
|
|
|
|
|
maps1.add(map1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while (maps.size()>num){
|
|
|
|
|
maps.remove(num);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
map.put("reportList",maps);
|
|
|
|
|
map.put("reportList1",maps1);
|
|
|
|
|
byte[] bytes = null;
|
|
|
|
|
ByteArrayOutputStream out = null;
|
|
|
|
|
ExportPdf exportPdf = new ExportPdf();
|
|
|
|
@ -445,8 +492,10 @@ public class PaymentdocServiceImpl extends ServiceImpl<PaymentdocMapper, Payment
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String fileName = paymentdocMessage.getCustomerName()==null?"城市矿产请示.pdf":paymentdocMessage.getCustomerName()+"请示.pdf";
|
|
|
|
|
if (substring==null){
|
|
|
|
|
substring="城市矿产";
|
|
|
|
|
}
|
|
|
|
|
String fileName = paymentdocMessage.getCustomerName()==null?substring+"请示.pdf":substring+"请示("+paymentdocMessage.getCustomerName()+").pdf";
|
|
|
|
|
|
|
|
|
|
HttpServletResponse response = ServletUtil.getResponse();
|
|
|
|
|
response.reset();
|
|
|
|
|