parent
caf380e8c3
commit
3d0df51d47
|
|
@ -1,6 +1,11 @@
|
||||||
package tqq9.lc123.cloud.app.plugin.form.im;
|
package tqq9.lc123.cloud.app.plugin.form.im;
|
||||||
|
|
||||||
import kd.bos.bill.AbstractBillPlugIn;
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
|
@ -15,5 +20,19 @@ public class InvCountBillPLugin extends AbstractBillPlugIn {
|
||||||
super.afterCreateNewData(e);
|
super.afterCreateNewData(e);
|
||||||
//给泛微审批状态设置初始默认值--待提交
|
//给泛微审批状态设置初始默认值--待提交
|
||||||
this.getModel().setValue("tqq9_fwstate", "A");
|
this.getModel().setValue("tqq9_fwstate", "A");
|
||||||
|
//设置创建部门
|
||||||
|
DynamicObject creator = (DynamicObject) this.getModel().getValue("creator");
|
||||||
|
if(creator != null){
|
||||||
|
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("id", QCP.equals, creator.getLong("id"))});
|
||||||
|
DynamicObjectCollection entryentity = bos_user.getDynamicObjectCollection("entryentity");
|
||||||
|
DynamicObject dept = null;
|
||||||
|
for (DynamicObject dynamicObject : entryentity) {
|
||||||
|
boolean ispartjob = dynamicObject.getBoolean("ispartjob");
|
||||||
|
if (!ispartjob) {
|
||||||
|
dept = dynamicObject.getDynamicObject("dpt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.getModel().setValue("tqq9_dept", dept);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,14 @@ public class PaymentbillPushPaystateOp extends AbstractOperationServicePlugIn {
|
||||||
if ("1".equals(status)) {
|
if ("1".equals(status)) {
|
||||||
dataEntity.set("tqq9_ispushfw", true);
|
dataEntity.set("tqq9_ispushfw", true);
|
||||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||||
|
}else{
|
||||||
|
dataEntity.set("tqq9_ispushfw", false);
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
dataEntity.set("tqq9_ispushfw", false);
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package tqq9.lc123.cloud.app.plugin.trd;
|
package tqq9.lc123.cloud.app.plugin.trd;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
@ -10,7 +12,6 @@ import kd.bos.orm.query.QFilter;
|
||||||
import kd.bos.servicehelper.AttachmentServiceHelper;
|
import kd.bos.servicehelper.AttachmentServiceHelper;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import scala.Dynamic;
|
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
|
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.FWUtils;
|
import tqq9.lc123.cloud.app.plugin.utils.FWUtils;
|
||||||
|
|
@ -593,7 +594,10 @@ public class FWImpl {
|
||||||
String tqq9_fwrequestid = dataEntity.getString("tqq9_fwrequestid");//泛微流程ID
|
String tqq9_fwrequestid = dataEntity.getString("tqq9_fwrequestid");//泛微流程ID
|
||||||
if(StringUtils.isNotBlank(tqq9_fwrequestid)){
|
if(StringUtils.isNotBlank(tqq9_fwrequestid)){
|
||||||
Date paydate = dataEntity.getDate("paydate");//付款日期
|
Date paydate = dataEntity.getDate("paydate");//付款日期
|
||||||
String jyrq = sdf.format(paydate);
|
String jyrq = "";
|
||||||
|
if(paydate != null){
|
||||||
|
jyrq = sdf.format(paydate);
|
||||||
|
}
|
||||||
String jyzy = dataEntity.getString("description");//摘要
|
String jyzy = dataEntity.getString("description");//摘要
|
||||||
String tqq9_cwztfkzt = dataEntity.getString("tqq9_cwztfkzt");//财务中台付款状态
|
String tqq9_cwztfkzt = dataEntity.getString("tqq9_cwztfkzt");//财务中台付款状态
|
||||||
|
|
||||||
|
|
@ -618,21 +622,31 @@ public class FWImpl {
|
||||||
String tqq9_dzhdbh = dataEntity.getString("tqq9_dzhdbh");//电子回单编号
|
String tqq9_dzhdbh = dataEntity.getString("tqq9_dzhdbh");//电子回单编号
|
||||||
String tqq9_digital_receipt = dataEntity.getString("tqq9_digital_receipt");//电子回单编号
|
String tqq9_digital_receipt = dataEntity.getString("tqq9_digital_receipt");//电子回单编号
|
||||||
String filename = "";
|
String filename = "";
|
||||||
try {
|
HttpRequest request = HttpRequest.get(tqq9_digital_receipt);
|
||||||
URL url = new URL(tqq9_digital_receipt);
|
HttpResponse response = request.execute();
|
||||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
String contentDisposition = response.header("Content-Disposition");
|
||||||
// 尝试从响应头获取
|
if (contentDisposition != null && contentDisposition.contains("filename=")) {
|
||||||
String disposition = conn.getHeaderField("Content-Disposition");
|
filename = contentDisposition.split("filename=")[1].replace("\"", "");
|
||||||
if (disposition != null && disposition.contains("filename=")) {
|
|
||||||
filename = disposition.split("filename=")[1].replace("\"", "").trim();
|
|
||||||
}
|
|
||||||
} catch (MalformedURLException ex) {
|
|
||||||
throw new RuntimeException(ex);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
throw new RuntimeException(ex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List<Map<String, Object>> attachments = AttachmentServiceHelper.getAttachments("cas_paybill", dataEntity.getPkValue(), "attachmentpanel");
|
||||||
|
// for (Map<String, Object> attachment : attachments) {
|
||||||
|
// String filePath = (String) attachment.get("url");
|
||||||
|
// System.out.println();
|
||||||
|
// }
|
||||||
|
byte[] bytes = HttpUtil.downloadBytes(tqq9_digital_receipt);
|
||||||
|
String content = cn.hutool.core.codec.Base64.encode(bytes);
|
||||||
if(StringUtils.isBlank(filename)){
|
if(StringUtils.isBlank(filename)){
|
||||||
filename = "银行电子回单"+new Date().getTime()+".pdf";
|
filename = "银行电子回单"+new Date().getTime();
|
||||||
|
String hz = ".jpg";
|
||||||
|
if(tqq9_digital_receipt.contains(".pdf")){
|
||||||
|
hz = ".pdf";
|
||||||
|
}else if(tqq9_digital_receipt.contains(".jpeg")){
|
||||||
|
hz = ".jpeg";
|
||||||
|
}else if(tqq9_digital_receipt.contains(".png")){
|
||||||
|
hz = ".png";
|
||||||
|
}
|
||||||
|
filename = filename + hz;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject mainTable = new JSONObject();
|
JSONObject mainTable = new JSONObject();
|
||||||
|
|
@ -644,7 +658,7 @@ public class FWImpl {
|
||||||
JSONArray files = new JSONArray();
|
JSONArray files = new JSONArray();
|
||||||
JSONObject file = new JSONObject();
|
JSONObject file = new JSONObject();
|
||||||
file.put("name", filename);
|
file.put("name", filename);
|
||||||
file.put("content", tqq9_digital_receipt);
|
file.put("content", content);
|
||||||
files.add(file);
|
files.add(file);
|
||||||
mainTable.put("dzhdwj", files);
|
mainTable.put("dzhdwj", files);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue