清账明细单-过滤创建人

This commit is contained in:
yuxueliang0813 2025-03-18 18:26:53 +08:00
parent 254c1fb04a
commit 04b2c46dfb
3 changed files with 61 additions and 5 deletions

View File

@ -40,14 +40,14 @@ public class ClearDetailBillListPlugin extends AbstractListPlugin implements Plu
@Override
public void initialize() {
//表单视图模型初始化创建插件后触发此事件
//表单视图模型初始化创建插件后触发此事件刷新按钮和字段过滤都会触发
super.initialize();
setArRole();
}
@Override
public void afterCreateNewData(EventObject e) {
//界面初始化或刷新新建数据包完毕后触发此事件
//界面初始化新建数据包完毕后触发此事件刷新按钮不会触发
super.afterCreateNewData(e);
setArRole();
}
}

View File

@ -3,6 +3,7 @@ package shjh.jhzj7.fi.fi.plugin.operate;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sap.db.jdbc.packet.ErrorLevel;
import kd.bos.coderule.api.CodeRuleInfo;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
@ -16,6 +17,7 @@ import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.bos.servicehelper.coderule.CodeRuleServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import shjh.jhzj7.fi.fi.utils.JhzjUtils;
@ -252,7 +254,9 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
private DynamicObject newDetailBill(DynamicObject prinfo, DynamicObject userinfo) {
//根据清账单和被通知人创建清账明细单
DynamicObject detailinfo = BusinessDataServiceHelper.newDynamicObject(entityName);
detailinfo.set("billno", prinfo.getString("billno"));//单据编号
CodeRuleInfo codeRule = CodeRuleServiceHelper.getCodeRule(entityName, detailinfo, null);
String number = CodeRuleServiceHelper.getNumber(codeRule, detailinfo);
detailinfo.set("billno", number);//单据编号
detailinfo.set("org", prinfo.getDynamicObject("org"));//公司
detailinfo.set("shjh_currency", prinfo.getDynamicObject("shjh_currency"));//币别
detailinfo.set("shjh_bizdate", prinfo.getDate("shjh_bizdate"));//业务日期
@ -361,7 +365,10 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
destinfo.set("shjh_receamount", srcinfo.getBigDecimal("shjh_receamount"));//收款金额
destinfo.set("shjh_bizbig", srcinfo.getDynamicObject("shjh_bizbig"));//业务大类
destinfo.set("shjh_bizsmall", srcinfo.getDynamicObject("shjh_bizsmall"));//业务小类
//处理单据编码规则
CodeRuleInfo codeRule = CodeRuleServiceHelper.getCodeRule(srcinfo.getDataEntityType().getName(), destinfo, null);
String number = CodeRuleServiceHelper.getNumber(codeRule, destinfo);
destinfo.set("billno", number);//单据编号
//新清账单需处理的字段为业务日期为源清账单的反清账日期单据状态=暂存清账日期=业务日期可修改清账状态=待清账已认领收款金额=0
//未认领收款金额=收款金额源清账单号=被复制的清账单单号是否被复制=
destinfo.set("shjh_bizdate", srcinfo.getDate("shjh_uncleardate"));//业务日期
@ -372,6 +379,11 @@ public class ClearAccountBillOperation extends AbstractOperationServicePlugIn im
destinfo.set("shjh_unclaimamount", srcinfo.getBigDecimal("shjh_receamount"));//未认领收款金额=收款金额
destinfo.set("shjh_srcbillno", srcinfo.getString("billno"));//源清账单号=被复制的清账单单号
destinfo.set("creator", srcinfo.getDynamicObject("creator"));//创建人
destinfo.set("createtime", new Date());//创建时间
destinfo.set("modifier", srcinfo.getDynamicObject("modifier"));//修改人
destinfo.set("modifytime", new Date());//修改时间
SaveServiceHelper.save(new DynamicObject[]{destinfo});
//原清账单是否被复制=
DB.update(DBRoute.of("fi"), updateSrcClear, new Object[]{srcinfo.getLong("id")});

View File

@ -0,0 +1,44 @@
package shjh.jhzj7.fi.fi.plugin.operate;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.db.DB;
import kd.bos.db.DBRoute;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
/**
* 理财收益批量预提-单据操作插件
* @author yuxueliang
*/
public class IntBillBatchOperation extends AbstractOperationServicePlugIn implements Plugin {
private static final String destName = "cim_intbill_reve";//预提记账处理
private static final String updateVoucher = "update t_cim_revenue set fk_shjh_needvoucher=1 where fid=?;";
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
super.afterExecuteOperationTransaction(e);
String eok = e.getOperationKey();
if("audit".equals(eok)){
DynamicObject[] dos = e.getDataEntities();
DynamicObject prinfo;//理财收益批量预提单
DynamicObject destinfo;//预提记账处理单
QFilter qFilter;
for (int i = 0; i < dos.length; i++) {
prinfo = BusinessDataServiceHelper.loadSingle(dos[i].getPkValue(), dos[i].getDataEntityType().getName());
if(prinfo.getBoolean("shjh_needvoucher")){
//将此字段值携带至预提记账处理单中 intbatchbillid
qFilter = new QFilter("intbatchbillid", QCP.equals, prinfo.getLong("id"));
destinfo = BusinessDataServiceHelper.loadSingle(destName,new QFilter[]{qFilter});
if(destinfo != null){
DB.update(DBRoute.of("fi"), updateVoucher, new Object[]{destinfo.getLong("id")});
}
}
}
}
}
}