1.注释整理
This commit is contained in:
parent
120ef7a4ee
commit
c3586aa8bc
|
|
@ -14,4 +14,6 @@ public class Constants {
|
|||
public static final String TYPE_ADD = "add"; //新增类型
|
||||
public static final String TYPE_UNSETTLE = "unsettle"; //反结算类型
|
||||
public static final String TYPE_PAY = "pay"; //付款类型
|
||||
public static final String GET = "get"; //付款类型
|
||||
public static final String POST = "post"; //付款类型
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,17 @@ public class HttpClient {
|
|||
private static RestTemplate restTemplate = new RestTemplate();
|
||||
private final static Log logger = LogFactory.getLog(HttpClient.class);
|
||||
|
||||
public static ResponseEntity doPost(String url, Object body,String token_name ,String token_access,HashMap<String,String> queryMap) throws ConnectException {
|
||||
/**
|
||||
*
|
||||
* @param url 请求url
|
||||
* @param body 请求体
|
||||
* @param token_name 请求tokenname
|
||||
* @param token_access 请求token
|
||||
* @param queryMap 请求头query
|
||||
* @return
|
||||
* @throws ConnectException
|
||||
*/
|
||||
public static ResponseEntity sendRequest(String url, Object body,String token_name ,String token_access,HashMap<String,String> queryMap,String requestType ) throws ConnectException {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
if (StringUtils.isNotBlank(token_access)) {
|
||||
headers.set(token_name, token_access);
|
||||
|
|
@ -48,16 +58,22 @@ public class HttpClient {
|
|||
headers.set("Content-Type", "application/json;charset=UTF-8");
|
||||
headers.set("Accept", "application/json;charset=UTF-8");
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url);
|
||||
|
||||
HttpMethod httpMethod = "POST".equalsIgnoreCase(requestType) ? HttpMethod.POST : HttpMethod.GET;
|
||||
if(!queryMap.isEmpty()){
|
||||
for (Map.Entry<String, String> map : queryMap.entrySet()) {
|
||||
builder.queryParam(map.getKey(),map.getValue());
|
||||
}
|
||||
}
|
||||
HttpEntity<String> requestEntity = new HttpEntity(JSON.toJSONString(body), headers);
|
||||
ResponseEntity<String> responseEntity = restTemplate.exchange(builder.build().toString(), HttpMethod.POST, requestEntity, String.class);
|
||||
ResponseEntity<String> responseEntity = restTemplate.exchange(builder.build().toString(), httpMethod, requestEntity, String.class);
|
||||
return responseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 财务中台token获取方法
|
||||
* @return
|
||||
* @throws ConnectException
|
||||
*/
|
||||
public static String Bearer_Token() throws ConnectException {
|
||||
// 创建 Basic Auth 认证头
|
||||
String auth = USERNAME + ":" + PASSWORD;
|
||||
|
|
@ -71,7 +87,7 @@ public class HttpClient {
|
|||
headers.set("Authorization", "Basic " + encodedAuth);
|
||||
HashMap<String, String> body = new HashMap<>();
|
||||
body.put("sid","ERP");
|
||||
ResponseEntity responseEntity = doPost(URL, body, null, null,null);
|
||||
ResponseEntity responseEntity = sendRequest(URL, body, null, null,null,Constants.POST);
|
||||
Object responseEntityBody = responseEntity.getBody();
|
||||
JSONObject jsonObject1 = JSON.parseObject(responseEntity.getBody().toString());
|
||||
String accessToken = jsonObject1.get("accessToken").toString();
|
||||
|
|
|
|||
|
|
@ -3,19 +3,15 @@ package tqq9.lc123.cloud.app.plugin.form.ap;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.control.Button;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
//import kd.fi.arapcommon.form.ManualSettleBasePlugin;
|
||||
//import kd.fi.arapcommon.service.IManualSettleService;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ package tqq9.lc123.cloud.app.plugin.form.ap;
|
|||
|
||||
import kd.bos.algo.DataSet;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.bill.BillShowParameter;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.metadata.IDataEntityProperty;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.db.DB;
|
||||
import kd.bos.db.DBRoute;
|
||||
|
|
@ -13,17 +11,12 @@ import kd.bos.entity.datamodel.IDataModel;
|
|||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.ShowFormHelper;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.list.ListFilterParameter;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.ORM;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import scala.annotation.meta.param;
|
||||
import tqq9.lc123.cloud.app.plugin.form.conm.purconmAddRebateRulesPlugin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.EventObject;
|
||||
|
|
@ -41,6 +34,9 @@ public class PayApplyFormPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 付款申请点击抵扣订单弹出手工结算
|
||||
*/
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
|
|
@ -69,6 +65,9 @@ public class PayApplyFormPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款申请供应商可抵扣金额
|
||||
*/
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
super.afterCreateNewData(e);
|
||||
|
|
@ -87,6 +86,9 @@ public class PayApplyFormPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款申请供应商可抵扣金额
|
||||
*/
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
|
|
|
|||
|
|
@ -5,33 +5,23 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.ObjectUtils;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.param.CustomParam;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.IFormView;
|
||||
import kd.bos.form.ShowFormHelper;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.form.field.MulBasedataEdit;
|
||||
import kd.bos.form.field.RefBillEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
import kd.bos.list.ListFilterParameter;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.EventObject;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 返利规则表单插件
|
||||
|
|
|
|||
|
|
@ -1,18 +1,15 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.conm;
|
||||
|
||||
import kd.bos.bill.BillShowParameter;
|
||||
import kd.bos.bill.OperationStatus;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.datamodel.events.BeforeDeleteRowEventArgs;
|
||||
import kd.bos.form.*;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.StyleCss;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.form.events.HyperLinkClickEvent;
|
||||
|
|
@ -24,9 +21,6 @@ import kd.bos.orm.query.QCP;
|
|||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.DeleteServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import scala.annotation.meta.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
|
@ -92,50 +86,8 @@ public class purconmAddRebateRulesPlugin extends AbstractFormPlugin implements H
|
|||
param.getOpenStyle().setShowType(ShowType.Modal);
|
||||
this.getView().showForm(param);
|
||||
}
|
||||
// else if (StringUtils.equals("tqq9_rebate_deleterow", itemKey)) {
|
||||
// EntryGrid entryGrid = this.getControl("tqq9_entryentity");
|
||||
// int[] selectRows = entryGrid.getSelectRows();
|
||||
// DynamicObjectCollection tqq9_entryentity = this.getModel().getDataEntity(true).getDynamicObjectCollection("tqq9_entryentity");
|
||||
// List<Long> rebate = new ArrayList<>();
|
||||
// StringBuilder stringBuilder = new StringBuilder();
|
||||
// for (int i = 0; i < selectRows.length; i++) {
|
||||
// int selectRow = selectRows[i];
|
||||
// DynamicObject dynamicObject = tqq9_entryentity.get(selectRow);
|
||||
// DynamicObject tqq9_pur_rebate = dynamicObject.getDynamicObject("tqq9_pur_rebate");
|
||||
// if (tqq9_pur_rebate != null) {
|
||||
// String name = dynamicObject.getString("name");
|
||||
// if (tqq9_pur_rebate.getString("status").equals("A")) {
|
||||
// rebate.add(tqq9_pur_rebate.getLong("id"));
|
||||
// } else {
|
||||
// stringBuilder.append(",").append("名称为:'" + name + "'的返利规则为非暂存状态,无法删除");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// DeleteServiceHelper.delete("tqq9_pur_rebate", new QFilter[]{new QFilter("id", QCP.in, rebate)});
|
||||
// if (stringBuilder.length() > 0) {
|
||||
// this.getView().showMessage(stringBuilder.substring(1));
|
||||
// } else {
|
||||
// this.getView().showMessage("选择编码规则均为暂存状态,删除成功");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void click(EventObject evt) {
|
||||
// Control c = (Control) evt.getSource();
|
||||
// String key = c.getKey().toLowerCase();
|
||||
// if ("tqq9_rulename".equals(key)) {
|
||||
// BillShowParameter param = new BillShowParameter();
|
||||
// param.setFormId("tqq9_pur_rebate");
|
||||
// param.setCustomParam("purcontract_billno", this.getModel().getValue("billno"));
|
||||
// param.setCustomParam("purcontract_supplier", this.getModel().getValue("supplier"));
|
||||
// param.setCustomParam("purcontract_tqq9_dxpp", this.getModel().getValue("tqq9_dxpp"));
|
||||
// param.setCloseCallBack(new CloseCallBack(this, "entry_rebateSync_click"));
|
||||
// param.getOpenStyle().setShowType(ShowType.Modal);
|
||||
// this.getView().showForm(param);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void hyperLinkClick(HyperLinkClickEvent hyperLinkClickEvent) {
|
||||
|
|
|
|||
|
|
@ -7,17 +7,11 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.form.IFormView;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.StyleCss;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.form.events.HyperLinkClickEvent;
|
||||
import kd.bos.form.events.HyperLinkClickListener;
|
||||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.im;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,8 @@ import kd.bos.orm.query.QCP;
|
|||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import tqq9.lc123.cloud.app.plugin.form.im.ReturnStockSyncNoticePlugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 表单通用插件,带出创建人部门,许可证号
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package tqq9.lc123.cloud.app.plugin.form.pm;
|
|||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import kd.bos.db.DB;
|
|||
import kd.bos.db.DBRoute;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import kd.bos.orm.query.QCP;
|
|||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import tqq9.lc123.cloud.app.api.utils.Constants;
|
||||
import tqq9.lc123.cloud.app.api.utils.HttpClient;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -331,10 +332,9 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn {
|
|||
// DynamicObject org = (DynamicObject)model.getValue("org");//组织
|
||||
// HashMap<String,String> queryMap =new HashMap<>();
|
||||
// queryMap.put("supplierId",newValue.getString("number"));
|
||||
//// queryMap.put("supplierId","1024");
|
||||
// queryMap.put("companyId",org.getString("number"));
|
||||
// try {
|
||||
// ResponseEntity responseEntity = HttpClient.doPost(URL, null, "Authorization", "Bearer b96dad1eb4f84c41bae651162aeacdd3", queryMap);
|
||||
// ResponseEntity responseEntity = HttpClient.sendRequest(URL, null, "Authorization", "Bearer b96dad1eb4f84c41bae651162aeacdd3", queryMap, Constants.GET);
|
||||
// JSONObject responseEntityBody = (JSONObject)responseEntity.getBody();
|
||||
// JSONArray data = responseEntityBody.getJSONArray("data");
|
||||
// for (Object datum : data) {
|
||||
|
|
@ -357,8 +357,6 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn {
|
|||
// } catch (ConnectException ex) {
|
||||
// throw new RuntimeException(ex);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@ import kd.bos.bill.BillShowParameter;
|
|||
import kd.bos.bill.OperationStatus;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
import kd.bos.dataentity.utils.ObjectUtils;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.*;
|
||||
import kd.bos.form.control.Control;
|
||||
|
|
@ -22,21 +18,13 @@ import kd.bos.form.events.AfterDoOperationEventArgs;
|
|||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.form.events.HyperLinkClickEvent;
|
||||
import kd.bos.form.events.HyperLinkClickListener;
|
||||
import kd.bos.form.field.ItemClassEdit;
|
||||
import kd.bos.form.field.RefBillEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
import kd.bos.list.ListFilterParameter;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.plugin.sample.dynamicform.pcform.field.template.PropertyChanged;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.workflow.bpmn.model.basedata.BaseDataHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.sys;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.entity.LocaleString;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.form.field.ComboEdit;
|
||||
|
|
@ -14,12 +10,9 @@ import kd.bos.form.field.ComboItem;
|
|||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import tqq9.lc123.cloud.app.plugin.form.pm.PurorderEntryIntroPaybillPlugin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 客户界面插件
|
||||
|
|
|
|||
Loading…
Reference in New Issue