|
|
@@ -239,8 +239,29 @@ public class UnitStBudgetApplyFormPlugin extends AbstractFormPlugin implements P
|
|
|
this.getView().showTipNotification("未加载到数据,根据【年度】、【填报单位】未加载到\"单位工资总额预算申报\"数据!");
|
|
|
return;
|
|
|
}
|
|
|
+ DynamicObject sourceAdj = null;
|
|
|
+ //查询调整单
|
|
|
+ if(formId.equalsIgnoreCase(StmConstant.UNITSTSETTLEMENT_ENTITYID)){
|
|
|
+ QFilter adjFilter = new QFilter(StmConstant.UNITSTBUDGETAPPLY_ENTITYID, QCP.equals,id)
|
|
|
+ .and(QFilterCommonHelper.getBillStatusFilter());
|
|
|
+ DynamicObjectCollection unitStBudgetAdjColl = QueryServiceHelper.query(
|
|
|
+ StmConstant.UNITSTBUDGETADJUST_ENTITYID,
|
|
|
+ queryFieldBuilder.buildSelect(),
|
|
|
+ new QFilter[]{qFilter},
|
|
|
+ queryFieldBuilder.buildOrder());
|
|
|
+ long adjId = 0;
|
|
|
+ if (!unitStBudgetAdjColl.isEmpty()) {
|
|
|
+ adjId = unitStBudgetAdjColl.get(0).getLong(FormConstant.ID_KEY);
|
|
|
+ MainEntityType adjEntityType = EntityMetadataCache.getDataEntityType(StmConstant.UNITSTBUDGETADJUST_ENTITYID);
|
|
|
+ DynamicObject[] adjLoad = BusinessDataServiceHelper.load(new Long[]{adjId}, adjEntityType);
|
|
|
+ if(adjLoad != null && adjLoad.length > 0){
|
|
|
+ sourceAdj = adjLoad[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- copyBudgetData(load[0]);
|
|
|
+ copyBudgetData(formId,load[0],sourceAdj);
|
|
|
DynamicObject dynamicObject = EntityHelper.newEntity(StmConstant.UNITSTBUDGETAPPLY_ENTITYID, load[0].getLong(StmConstant.ID_KEY));
|
|
|
this.getModel().setValue(StmConstant.UNITSTBUDGETAPPLY_ENTITYID, dynamicObject);
|
|
|
this.getView().showSuccessNotification("数据加载成功!");
|
|
|
@@ -262,12 +283,30 @@ public class UnitStBudgetApplyFormPlugin extends AbstractFormPlugin implements P
|
|
|
}
|
|
|
|
|
|
// 提取复制数据逻辑
|
|
|
- private void copyBudgetData(DynamicObject source) {
|
|
|
+ private void copyBudgetData(String formId,DynamicObject source,DynamicObject sourceAdj) {
|
|
|
DataEntityPropertyCollection properties = source.getDynamicObjectType().getProperties();
|
|
|
- for (IDataEntityProperty property : properties) {
|
|
|
- String name = property.getName();
|
|
|
- if (name.indexOf("nckd_") > -1 && this.getModel().getDataEntityType().getProperties().containsKey(name+"ls")) {
|
|
|
- this.getModel().setValue(name+"ls", source.get(name));
|
|
|
+ if(formId.equalsIgnoreCase(StmConstant.UNITSTBUDGETADJUST_ENTITYID)) {
|
|
|
+ for (IDataEntityProperty property : properties) {
|
|
|
+ String name = property.getName();
|
|
|
+ if (name.indexOf("nckd_") > -1 && this.getModel().getDataEntityType().getProperties().containsKey(name + "ls")) {
|
|
|
+ this.getModel().setValue(name + "ls", source.get(name));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for (IDataEntityProperty property : properties) {
|
|
|
+ String name = property.getName();
|
|
|
+ if (name.indexOf("nckd_") > -1 && this.getModel().getDataEntityType().getProperties().containsKey(name + "ls")) {
|
|
|
+ this.getModel().setValue(name + "ls", source.get(name));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sourceAdj != null){
|
|
|
+ DataEntityPropertyCollection propertiesAdj = sourceAdj.getDynamicObjectType().getProperties();
|
|
|
+ for (IDataEntityProperty property : propertiesAdj) {
|
|
|
+ String name = property.getName();
|
|
|
+ if (name.indexOf("nckd_") > -1 && this.getModel().getDataEntityType().getProperties().containsKey(name + "ad")) {
|
|
|
+ this.getModel().setValue(name + "ad", sourceAdj.get(name));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|