|
@@ -304,20 +304,14 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
for (OaInputDto inputDto : columnList) {
|
|
|
String name = inputDto.getName();
|
|
|
- if (name.contains("金额")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setCurrentAmount(new BigDecimal(Double.parseDouble(o.toString())));
|
|
|
- }else {
|
|
|
- continue nullAmount;
|
|
|
- }
|
|
|
- } else if (name.contains("日期")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setEffectiveTime(o.toString());
|
|
|
- }else {
|
|
|
- continue nullAmount;
|
|
|
- }
|
|
|
+ Object o = hashMap.get(inputDto.getModel());
|
|
|
+ if (Objects.isNull(o) || StringUtils.isEmpty(o.toString())) {
|
|
|
+ continue nullAmount;
|
|
|
+ }
|
|
|
+ if (StringUtils.equals(name,"金额")) {
|
|
|
+ financialExpenditure.setCurrentAmount(new BigDecimal(Double.parseDouble(o.toString())));
|
|
|
+ } else if (StringUtils.equals(name,"日期")) {
|
|
|
+ financialExpenditure.setEffectiveTime(o.toString());
|
|
|
}
|
|
|
}
|
|
|
financialExpenditure.setFeeProject(feeProjectEnum);
|
|
@@ -342,7 +336,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
for (HashMap hashMap : hashMaps) {
|
|
|
FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
financialExpenditure.setAprovalTime(endTime);
|
|
|
- financialExpenditure.setPaymentTime(endTime);
|
|
|
financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
|
|
|
financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
|
|
|
financialExpenditure.setApplyUser(realName);
|
|
@@ -357,84 +350,52 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
if (columnList != null && columnList.size() > 0) {
|
|
|
for (OaInputDto inputDto : columnList) {
|
|
|
String name = inputDto.getName();
|
|
|
- if (name.contains("课程组编号")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setVipGroupId(Long.parseLong(o.toString()));
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("课程类型")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setGroupType(o.toString());
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("乐团编号")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setMusicGroupId(o.toString());
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("退费项目")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setReturnFeeType(o.toString());
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("学员编号")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setStudentId(Integer.parseInt(o.toString()));
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- continue nullUser;
|
|
|
- }
|
|
|
- } else if (name.contains("分部")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- Organization organization = organizationDao.get(Integer.parseInt(o.toString()));
|
|
|
- if (organization != null) {
|
|
|
- financialExpenditure.setOrganId(organization.getId());
|
|
|
- financialExpenditure.setOrganName(organization.getName());
|
|
|
- }
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("金额") || name.contains("住宿费") || name.contains("出差补助") || name.contains("交通费")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setAmount(financialExpenditure.getAmount().add(new BigDecimal(Double.parseDouble(o.toString()))));
|
|
|
- financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("情况说明") || name.contains("事由")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setCause(o.toString());
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("支出类型")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("费用类型") || name.contains("费用类别")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
- continue;
|
|
|
- }
|
|
|
- } else if (name.contains("住宿费")) {
|
|
|
- Object o = hashMap.get(inputDto.getModel());
|
|
|
- if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
- financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
- continue;
|
|
|
+ Object o = hashMap.get(inputDto.getModel());
|
|
|
+ if (Objects.isNull(o) || StringUtils.isEmpty(o.toString())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (StringUtils.equals(name,"课程组编号")) {
|
|
|
+ financialExpenditure.setVipGroupId(Long.parseLong(o.toString()));
|
|
|
+ } else if (StringUtils.equals(name,"课程类型")) {
|
|
|
+ financialExpenditure.setGroupType(o.toString());
|
|
|
+ } else if (StringUtils.equals(name,"乐团编号")) {
|
|
|
+ financialExpenditure.setMusicGroupId(o.toString());
|
|
|
+ } else if (StringUtils.equals(name,"退费项目")) {
|
|
|
+ financialExpenditure.setReturnFeeType(o.toString());
|
|
|
+ } else if (StringUtils.equals(name,"学员编号")) {
|
|
|
+ financialExpenditure.setStudentId(Integer.parseInt(o.toString()));
|
|
|
+ } else if (StringUtils.equals(name,"分部")) {
|
|
|
+ Organization organization = organizationDao.get(Integer.parseInt(o.toString()));
|
|
|
+ if (organization != null) {
|
|
|
+ financialExpenditure.setOrganId(organization.getId());
|
|
|
+ financialExpenditure.setOrganName(organization.getName());
|
|
|
}
|
|
|
+ } else if (StringUtils.equals(name,"金额") || StringUtils.equals(name,"住宿费") || StringUtils.equals(name,"出差补助") || StringUtils.equals(name,"交通费")) {
|
|
|
+ financialExpenditure.setAmount(financialExpenditure.getAmount().add(new BigDecimal(Double.parseDouble(o.toString()))));
|
|
|
+ financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
|
|
|
+ } else if (StringUtils.equals(name,"情况说明") || StringUtils.equals(name,"事由")) {
|
|
|
+ financialExpenditure.setCause(o.toString());
|
|
|
+ } else if (StringUtils.equals(name,"支出类型")) {
|
|
|
+ financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
|
|
|
+ } else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
|
|
|
+ financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
+ } else if (StringUtils.equals(name,"住宿费")) {
|
|
|
+ financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
+ } else if (StringUtils.equals(name,"日期") || StringUtils.equals(name,"费用发生日期")) {
|
|
|
+ financialExpenditure.setPaymentTime(DateUtil.stringToDate(o.toString(),DateUtil.DEFAULT_PATTERN));
|
|
|
+ } else if (StringUtils.equals(name,"费用分摊月份")) {
|
|
|
+ financialExpenditure.setEffectiveTime(o.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if(financialExpenditure.getPaymentTime() == null){
|
|
|
+ financialExpenditure.setPaymentTime(endTime);
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(financialExpenditure.getEffectiveTime())){
|
|
|
+ financialExpenditure.setEffectiveTime(DateUtil.format(financialExpenditure.getPaymentTime(),DateUtil.ISO_YEAR_MONTH_FORMAT));
|
|
|
+ }
|
|
|
financialExpenditureList.add(financialExpenditure);
|
|
|
}
|
|
|
}
|
|
@@ -505,6 +466,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
financialExpenditure.setAprovalTime(endTime);
|
|
|
financialExpenditure.setPaymentTime(endTime);
|
|
|
financialExpenditure.setType(expenditureTypeEnum);
|
|
|
+ financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
|
|
|
financialExpenditure.setApplyUser(realName);
|
|
|
financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
|
|
|
financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
|
|
@@ -536,31 +498,19 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
}
|
|
|
for (OaInputDto oaInputDto : oaInputDtos) {
|
|
|
String name = oaInputDto.getName();
|
|
|
- if(name.contains("金额")){
|
|
|
- Object o = formData.get(oaInputDto.getModel());
|
|
|
- if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
- financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
|
|
|
- financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
|
|
|
- continue;
|
|
|
- }
|
|
|
- }else if(name.contains("情况说明")){
|
|
|
- Object o = formData.get(oaInputDto.getModel());
|
|
|
- if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
- financialExpenditure.setCause(o.toString());
|
|
|
- continue;
|
|
|
- }
|
|
|
- }else if(name.contains("支出类型")){
|
|
|
- Object o = formData.get(oaInputDto.getModel());
|
|
|
- if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
- financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
|
|
|
- continue;
|
|
|
- }
|
|
|
- }else if(name.contains("费用类型")){
|
|
|
- Object o = formData.get(oaInputDto.getModel());
|
|
|
- if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
- financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
- continue;
|
|
|
- }
|
|
|
+ Object o = formData.get(oaInputDto.getModel());
|
|
|
+ if(Objects.isNull(o) || StringUtils.isEmpty(o.toString())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(StringUtils.equals(name,"金额")){
|
|
|
+ financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
|
|
|
+ financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
|
|
|
+ }else if(StringUtils.equals(name,"情况说明")){
|
|
|
+ financialExpenditure.setCause(o.toString());
|
|
|
+ }else if(StringUtils.equals(name,"支出类型")){
|
|
|
+ financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
|
|
|
+ }else if(StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")){
|
|
|
+ financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
|
|
|
}
|
|
|
}
|
|
|
financialExpenditureDao.insert(financialExpenditure);
|
|
@@ -596,6 +546,8 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
|
|
|
nullUser: for (HashMap hashMap : hashMaps) {
|
|
|
FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
+ financialExpenditure.setAprovalTime(now);
|
|
|
+ financialExpenditure.setPaymentTime(now);
|
|
|
financialExpenditure.setEffectiveTime(DateUtil.format(now,DateUtil.ISO_YEAR_MONTH_FORMAT));
|
|
|
List<OaColumnDto> columns = oaInputDto.getColumns();
|
|
|
if(columns != null && columns.size() > 0){
|
|
@@ -604,25 +556,25 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
if(columnList != null && columnList.size() > 0){
|
|
|
for (OaInputDto inputDto : columnList) {
|
|
|
String name = inputDto.getName();
|
|
|
- if(name.contains("课程组编号")){
|
|
|
+ if(StringUtils.equals(name,"课程组编号")){
|
|
|
Object o = hashMap.get(inputDto.getModel());
|
|
|
if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
financialExpenditure.setVipGroupId(Long.parseLong(o.toString()));
|
|
|
continue;
|
|
|
}
|
|
|
- }else if(name.contains("课程类型")){
|
|
|
+ }else if(StringUtils.equals(name,"课程类型")){
|
|
|
Object o = hashMap.get(inputDto.getModel());
|
|
|
if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
financialExpenditure.setGroupType(o.toString());
|
|
|
continue;
|
|
|
}
|
|
|
- }else if(name.contains("乐团编号")){
|
|
|
+ }else if(StringUtils.equals(name,"乐团编号")){
|
|
|
Object o = hashMap.get(inputDto.getModel());
|
|
|
if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
financialExpenditure.setMusicGroupId(o.toString());
|
|
|
continue;
|
|
|
}
|
|
|
- }else if(name.contains("学员编号")){
|
|
|
+ }else if(StringUtils.equals(name,"学员编号")){
|
|
|
Object o = hashMap.get(inputDto.getModel());
|
|
|
if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
financialExpenditure.setStudentId(Integer.parseInt(o.toString()));
|
|
@@ -630,7 +582,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
}else {
|
|
|
continue nullUser;
|
|
|
}
|
|
|
- }else if(name.contains("金额")){
|
|
|
+ }else if(StringUtils.equals(name,"金额")){
|
|
|
Object o = hashMap.get(inputDto.getModel());
|
|
|
if(Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())){
|
|
|
financialExpenditure.setAmount(new BigDecimal(Double.parseDouble(o.toString())));
|