|
@@ -260,7 +260,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
pWorkOrderInfo.getProcess().equals(28)){
|
|
|
List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
|
|
|
for (OaInputDto oaInputDto : oaInputDtos) {
|
|
|
- if(!"子表单".equals(oaInputDto.getName())){
|
|
|
+ if(!StringUtils.equals("子表单",oaInputDto.getName()) && !StringUtils.equals("分摊明细",oaInputDto.getName())){
|
|
|
continue;
|
|
|
}
|
|
|
String submitForm = oaInputDto.getModel();
|
|
@@ -268,99 +268,138 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
|
|
|
continue;
|
|
|
}
|
|
|
List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
|
|
|
- nullUser: for (HashMap hashMap : hashMaps) {
|
|
|
- FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
- financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
|
|
|
- financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
|
|
|
- financialExpenditure.setApplyUser(realName);
|
|
|
- financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
|
|
|
- financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
|
|
|
- List<OaColumnDto> columns = oaInputDto.getColumns();
|
|
|
- if(columns != null && columns.size() > 0){
|
|
|
- for (OaColumnDto column : columns) {
|
|
|
- List<OaInputDto> columnList = column.getList();
|
|
|
- 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())){
|
|
|
- int organId = Integer.parseInt(o.toString());
|
|
|
- Organization organization = organizationDao.get(organId);
|
|
|
- if(organization != null){
|
|
|
- financialExpenditure.setOrganId(organization.getId());
|
|
|
- financialExpenditure.setOrganName(organization.getName());
|
|
|
+ if(StringUtils.equals("分摊明细",oaInputDto.getName())){
|
|
|
+ //处理房租的分摊明细
|
|
|
+ nullUser:
|
|
|
+ for (HashMap hashMap : hashMaps) {
|
|
|
+ FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
+ financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
|
|
|
+ financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
|
|
|
+ financialExpenditure.setApplyUser(realName);
|
|
|
+ financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
|
|
|
+ financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
|
|
|
+ List<OaColumnDto> columns = oaInputDto.getColumns();
|
|
|
+ if (columns != null && columns.size() > 0) {
|
|
|
+ for (OaColumnDto column : columns) {
|
|
|
+ List<OaInputDto> columnList = column.getList();
|
|
|
+ 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.setAmount(financialExpenditure.getAmount().add(new BigDecimal(Double.parseDouble(o.toString()))));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ } else if (name.contains("日期")) {
|
|
|
+ Object o = hashMap.get(inputDto.getModel());
|
|
|
+ if (Objects.nonNull(o) && StringUtils.isNotEmpty(o.toString())) {
|
|
|
+ financialExpenditure.setCause(o.toString());
|
|
|
+ continue;
|
|
|
}
|
|
|
- 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()))));
|
|
|
- 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("费用类型")){
|
|
|
- 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ financialExpenditureList.add(financialExpenditure);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ nullUser:
|
|
|
+ for (HashMap hashMap : hashMaps) {
|
|
|
+ FinancialExpenditure financialExpenditure = new FinancialExpenditure();
|
|
|
+ financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
|
|
|
+ financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
|
|
|
+ financialExpenditure.setApplyUser(realName);
|
|
|
+ financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
|
|
|
+ financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
|
|
|
+ List<OaColumnDto> columns = oaInputDto.getColumns();
|
|
|
+ if (columns != null && columns.size() > 0) {
|
|
|
+ for (OaColumnDto column : columns) {
|
|
|
+ List<OaInputDto> columnList = column.getList();
|
|
|
+ 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())) {
|
|
|
+ int organId = Integer.parseInt(o.toString());
|
|
|
+ Organization organization = organizationDao.get(organId);
|
|
|
+ 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()))));
|
|
|
+ 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("费用类型")) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ financialExpenditureList.add(financialExpenditure);
|
|
|
}
|
|
|
- financialExpenditureList.add(financialExpenditure);
|
|
|
}
|
|
|
}
|
|
|
//课程退费
|