往来家居明细数据判断
This commit is contained in:
parent
58825bcf40
commit
77c6f1a246
|
@ -91,15 +91,16 @@ public class DailyreimbursHomeCheckOp extends AbstractOperationServicePlugIn {
|
|||
String message = String.format("提交人没有往来居家配置。");
|
||||
this.addFatalErrorMessage(extendedDataEntity, message);
|
||||
}
|
||||
int monthTime = 0;
|
||||
Integer monthTime = null;
|
||||
for (Row row : homeDataSet) {
|
||||
monthTime = row.getInteger("monthTime");
|
||||
}
|
||||
if(monthTime != 0){
|
||||
DynamicObjectCollection tripentry = dataEntity.getDynamicObjectCollection("zcgj_homeentity");//
|
||||
if(tripentry==null || tripentry.isEmpty()){
|
||||
this.addFatalErrorMessage(extendedDataEntity, String.format("请录入往来居家明细!"));
|
||||
}
|
||||
|
||||
if(monthTime != null){
|
||||
Map<String,Integer> homeentityCountMap = new HashMap<>();
|
||||
int i = 1;
|
||||
boolean isOk=true;
|
||||
|
@ -167,6 +168,8 @@ public class DailyreimbursHomeCheckOp extends AbstractOperationServicePlugIn {
|
|||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
this.addFatalErrorMessage(extendedDataEntity, String.format("往来家居配置有误!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug
|
|||
e.getFieldKeys().add("zcgj_is_include_home");
|
||||
e.getFieldKeys().add("applier");
|
||||
e.getFieldKeys().add("zcgj_homeentity");
|
||||
e.getFieldKeys().add("costcompany");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,9 +47,9 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug
|
|||
//当前切换选择的组织
|
||||
Long currentOrgId = RequestContext.get().getOrgId();
|
||||
//当前所在的组织是属于矿山下的
|
||||
if(OrgCheckUtils.isKS(currentOrgId)){
|
||||
//if(OrgCheckUtils.isKS(currentOrgId)){
|
||||
e.getValidators().add(new ValidatorExt());
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
class ValidatorExt extends AbstractValidator {
|
||||
|
@ -63,13 +64,17 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug
|
|||
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
|
||||
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
||||
long aLong = dataEntity.getLong("id");
|
||||
DynamicObject companyObj = (DynamicObject) dataEntity.get("costcompany");//核算组织(费用承担公司)
|
||||
if (companyObj != null) {
|
||||
Long companyId = companyObj.getLong("id");
|
||||
if (OrgCheckUtils.isKS(companyId)) {
|
||||
//获取报销人
|
||||
DynamicObject applier = dataEntity.getDynamicObject("applier");
|
||||
long applierId = applier.getLong("id");
|
||||
//获取申请日期
|
||||
//Date bizdate = dataEntity.getDate( "bizdate");
|
||||
//获取是否探亲
|
||||
//如果是探亲,则进行逻辑判断
|
||||
//如果是往来家居,则进行逻辑判断
|
||||
boolean isHome = dataEntity.getBoolean(prefix + "_is_include_home");
|
||||
|
||||
//判断是否来往家居地
|
||||
|
@ -88,19 +93,19 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug
|
|||
this.addFatalErrorMessage(extendedDataEntity, message);
|
||||
}
|
||||
|
||||
int monthTime = 0;
|
||||
Integer monthTime = null;
|
||||
for (Row row : homeDataSet) {
|
||||
monthTime = row.getInteger("monthTime");
|
||||
}
|
||||
if(monthTime != 0){
|
||||
DynamicObjectCollection tripentry = dataEntity.getDynamicObjectCollection("zcgj_homeentity");//oa流程分录
|
||||
boolean isOk=true;
|
||||
|
||||
Map<String,Integer> homeentityCountMap = new HashMap<>();
|
||||
int i = 1;
|
||||
if(tripentry==null || tripentry.isEmpty()){
|
||||
this.addFatalErrorMessage(extendedDataEntity, String.format("请录入往来居家明细数据"));
|
||||
}
|
||||
if(monthTime != null){
|
||||
boolean isOk=true;
|
||||
Map<String,Integer> homeentityCountMap = new HashMap<>();
|
||||
int i = 1;
|
||||
|
||||
for (DynamicObject dynamicObject : tripentry) {
|
||||
Date bxmonth = dynamicObject.getDate("zcgj_bxmonth");
|
||||
String yearMonth = dateFormat.format(bxmonth);
|
||||
|
@ -165,8 +170,11 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug
|
|||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
this.addFatalErrorMessage(extendedDataEntity, String.format("往来家居配置有误!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue