提交内容:定时任务,操作代码,获取token

备注:修改定时任务,操作代码,获取token
提交人:邹江涛
This commit is contained in:
zoujiangtao 2024-12-18 15:41:52 +08:00
parent 03276621b6
commit c612e0c417
3 changed files with 48 additions and 1 deletions

View File

@ -248,6 +248,8 @@ public class ApiService {
dynamic.set("shkd_pushstatus", "结算失败");
} else if ("TS".equals(objects[0].getString("bankpaystatus"))) {
dynamic.set("shkd_pushstatus", "已结算");
} else {
dynamic.set("shkd_pushstatus", "结算失败");
}
dynamicObjects.add(dynamic);

View File

@ -0,0 +1,45 @@
package shkd.sys.sys.plugin.operation;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
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.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import shkd.sys.sys.mservice.ApiService;
import shkd.sys.sys.plugin.form.ApiMappingBillPlugin;
import java.util.ArrayList;
import java.util.List;
/**
* 单据操作插件
*/
public class HitBackOperationServicePlugin extends AbstractOperationServicePlugIn implements Plugin {
private static final Log logger = LogFactory.getLog(ApiMappingBillPlugin.class);
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs args) {
super.afterExecuteOperationTransaction(args);
List<DynamicObject> dynamicObjectList = new ArrayList<>();
DynamicObject[] entities = args.getDataEntities();
for (DynamicObject dynamicObject : entities) {
BusinessDataServiceHelper.load(dynamicObject.getDataEntityType().getName(), "id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,payeebanknum," +
"payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype,org,bizdate,description," +
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus,bankpaystatus"
, new QFilter("id", QCP.equals, dynamicObject.getPkValue())
.and("billstatus", QCP.equals, "C")//已审核
.and("shkd_pushstatus", QCP.equals, "未结算").toArray());
try {
ApiService.paymentSlipsJson(dynamicObject, "BIPNO", dynamicObjectList);
SaveServiceHelper.save(dynamicObjectList.toArray(new DynamicObject[0]));
logger.info("执行打回操作成功,单据编号:{}", dynamicObject.getString("billno"));
} catch (Exception e) {
logger.info("执行打回操作失败,错误信息 → \n{}", e);
}
}
}
}

View File

@ -100,7 +100,7 @@ public class PushTaskPlugin extends AbstractTask implements Plugin {
"id,billno,actpayamt,entry,entry.e_expenseitem,entry.e_remark,settletype,payeebanknum," +
"payeetype,payeenumber,payeracctbank,payeebank,payeebankname,paymenttype,org,bizdate,description," +
"shkd_pushstatus,shkd_businessnumber,shkd_businessid,shkd_businessname,billstatus,bankpaystatus"
, new QFilter("bankpaystatus", QCP.equals, "TS")
, new QFilter("bankpaystatus", QCP.equals, "TS")//付款成功
.and("shkd_pushstatus", QCP.equals, "结算失败").toArray());
dynamicObjects = Arrays.asList(objects4);
dynamicObjects.addAll(Arrays.asList(objects5));