|
@@ -52,6 +52,7 @@ public class SinSurEmpChgCoordBatchEditPluginEx extends AbstractFormPlugin imple
|
|
|
HRBaseServiceHelper helper = new HRBaseServiceHelper(this.getEntityNumber());
|
|
HRBaseServiceHelper helper = new HRBaseServiceHelper(this.getEntityNumber());
|
|
|
DynamicObject[] billCols = helper.load(String.join(",", queryFields), new QFilter[]{new QFilter("id", "in", this.getSelectIds())});
|
|
DynamicObject[] billCols = helper.load(String.join(",", queryFields), new QFilter[]{new QFilter("id", "in", this.getSelectIds())});
|
|
|
showEntryData(billCols);
|
|
showEntryData(billCols);
|
|
|
|
|
+ setWelfareTypeInsuranceTypeAttrEnable();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -107,6 +108,17 @@ public class SinSurEmpChgCoordBatchEditPluginEx extends AbstractFormPlugin imple
|
|
|
DynamicObject welfaretype = (DynamicObject) model.getValue("nckd_welfaretype", subRowIndex);
|
|
DynamicObject welfaretype = (DynamicObject) model.getValue("nckd_welfaretype", subRowIndex);
|
|
|
DynamicObject sinSurDimension = (DynamicObject) model.getValue("nckd_sinsurdimension", subRowIndex);
|
|
DynamicObject sinSurDimension = (DynamicObject) model.getValue("nckd_sinsurdimension", subRowIndex);
|
|
|
getDimensionValue(sinSurStd, welfaretype, sinSurDimension, rowIndex, subRowIndex);
|
|
getDimensionValue(sinSurStd, welfaretype, sinSurDimension, rowIndex, subRowIndex);
|
|
|
|
|
+ setWelfareTypeInsuranceTypeAttrEnable();
|
|
|
|
|
+
|
|
|
|
|
+ // 如果是险种,新旧值不一样的情况下,把个人基数跟单位基数清除掉
|
|
|
|
|
+ if(HRStringUtils.equalsAny(key, "nckd_welfaretype")) {
|
|
|
|
|
+ if(e.getChangeSet()[0].getNewValue() != e.getChangeSet()[0].getOldValue()) {
|
|
|
|
|
+ model.setValue(SitConstant.PAY_BASE_OF_EMPLOYEE_KEY, null, subRowIndex, rowIndex);
|
|
|
|
|
+ model.setValue(SitConstant.PAY_BASE_OF_COMPANY_KEY, null, subRowIndex, rowIndex);
|
|
|
|
|
+ this.getView().updateView("nckd_subentryentity");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
// 如果是 参保标准发生变化,当前单据体下的子单据体都需要更新
|
|
// 如果是 参保标准发生变化,当前单据体下的子单据体都需要更新
|
|
|
else if (HRStringUtils.equals(key, "sinsurstd_r31")) {
|
|
else if (HRStringUtils.equals(key, "sinsurstd_r31")) {
|
|
@@ -373,4 +385,57 @@ public class SinSurEmpChgCoordBatchEditPluginEx extends AbstractFormPlugin imple
|
|
|
return SITCoordinationUtils.queryDimensionValue(sinSurStdId, welfaretypeId);
|
|
return SITCoordinationUtils.queryDimensionValue(sinSurStdId, welfaretypeId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取当前子单据体的所有险种
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private Set<Long> getWelfareTypeIds() {
|
|
|
|
|
+ DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("entryentity");
|
|
|
|
|
+ Set<Long> welfareTypeIds = new HashSet<>();
|
|
|
|
|
+ for (DynamicObject dynamicObject : entryEntity) {
|
|
|
|
|
+ DynamicObjectCollection subEntryEntity = dynamicObject.getDynamicObjectCollection("nckd_subentryentity");
|
|
|
|
|
+ welfareTypeIds.addAll(subEntryEntity.stream().map(subEntry -> subEntry.getLong("nckd_welfaretype.id")).collect(Collectors.toSet()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return welfareTypeIds;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 设置险种对应的险种属性是否可用
|
|
|
|
|
+ */
|
|
|
|
|
+ private void setWelfareTypeInsuranceTypeAttrEnable() {
|
|
|
|
|
+ DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("entryentity");
|
|
|
|
|
+ Set<Long> welfareTypeIds = this.getWelfareTypeIds();
|
|
|
|
|
+ Map<Long, Map<Long, Boolean>> welfareTypeInsuranceTypeAttrMap = SITCoordinationUtils.queryInsuranceTypeAttrSetting(welfareTypeIds, Arrays.asList(SitConstant.PAY_BASE_OF_EMPLOYEE_ID, SitConstant.PAY_BASE_OF_COMPANY_ID));
|
|
|
|
|
+ for (int index = 0; index < entryEntity.size(); index++) {
|
|
|
|
|
+ DynamicObject entry = entryEntity.get(index);
|
|
|
|
|
+ DynamicObjectCollection subEntryEntity = entry.getDynamicObjectCollection("nckd_subentryentity");
|
|
|
|
|
+ for (int subIndex = 0; subIndex < subEntryEntity.size(); subIndex++) {
|
|
|
|
|
+ DynamicObject dynamicObject = subEntryEntity.get(subIndex);
|
|
|
|
|
+ if (dynamicObject.getBoolean("nckd_insured")) {
|
|
|
|
|
+ long welfareTypeId = dynamicObject.getLong("nckd_welfaretype.id");
|
|
|
|
|
+ Map<Long, Boolean> insuranceTypeAttrMap = (Map) welfareTypeInsuranceTypeAttrMap.get(welfareTypeId);
|
|
|
|
|
+ if ((Boolean) insuranceTypeAttrMap.get(SitConstant.PAY_BASE_OF_EMPLOYEE_ID)) {
|
|
|
|
|
+ this.getView().setEnable(Boolean.TRUE, index, new String[]{SitConstant.PAY_BASE_OF_EMPLOYEE_KEY});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.getView().setEnable(Boolean.FALSE, index, new String[]{SitConstant.PAY_BASE_OF_EMPLOYEE_KEY});
|
|
|
|
|
+ dynamicObject.set(SitConstant.PAY_BASE_OF_EMPLOYEE_KEY, (Object) null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ((Boolean) insuranceTypeAttrMap.get(SitConstant.PAY_BASE_OF_COMPANY_ID)) {
|
|
|
|
|
+ this.getView().setEnable(Boolean.TRUE, index, new String[]{SitConstant.PAY_BASE_OF_COMPANY_KEY});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.getView().setEnable(Boolean.FALSE, index, new String[]{SitConstant.PAY_BASE_OF_COMPANY_KEY});
|
|
|
|
|
+ dynamicObject.set(SitConstant.PAY_BASE_OF_COMPANY_KEY, (Object) null);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dynamicObject.set(SitConstant.PAY_BASE_OF_EMPLOYEE_KEY, (Object) null);
|
|
|
|
|
+ dynamicObject.set(SitConstant.PAY_BASE_OF_COMPANY_KEY, (Object) null);
|
|
|
|
|
+ this.getView().setEnable(Boolean.FALSE, index, new String[]{SitConstant.PAY_BASE_OF_EMPLOYEE_KEY});
|
|
|
|
|
+ this.getView().setEnable(Boolean.FALSE, index, new String[]{SitConstant.PAY_BASE_OF_COMPANY_KEY});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|