fix(system):修改单位返回值逻辑

This commit is contained in:
zhaoqing
2026-08-13 10:31:49 +08:00
parent d17146dc4b
commit 84d4df0809
3 changed files with 21 additions and 11 deletions
@@ -30,11 +30,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -591,11 +587,24 @@ public class ExpenseAccountApplicationService {
throw new ServiceException("组织ID不能为空");
}
ExpenseAccountPO expenseAccountPO = expenseAccountDomainService.getInfoByOrgAndCode(subjectCode, organizationId);
// 组装计费单位列表:单位-单位英文
List<String> unit = new ArrayList<>();
// // 组装计费单位列表:单位-单位英文
// List<String> unit = new ArrayList<>();
// if (expenseAccountPO != null) {
// unit.add(expenseAccountPO.getBillingUnit() + "-" + expenseAccountPO.getBillingUnitEn());
// unit.add(expenseAccountPO.getBillingUnit2() + "-" + expenseAccountPO.getBillingUnitEn2());
// expenseAccountPO.setUnit(unit);
// }
// 组装计费单位列表(数组)
List<Map<String, String>> unit = new ArrayList<>();
if (expenseAccountPO != null) {
unit.add(expenseAccountPO.getBillingUnit() + "-" + expenseAccountPO.getBillingUnitEn());
unit.add(expenseAccountPO.getBillingUnit2() + "-" + expenseAccountPO.getBillingUnitEn2());
Map<String, String> unit1 = new HashMap<>();
unit1.put("unit", expenseAccountPO.getBillingUnit() + "-" + expenseAccountPO.getBillingUnitEn());
unit.add(unit1);
Map<String, String> unit2 = new HashMap<>();
unit2.put("unit", expenseAccountPO.getBillingUnit2() + "-" + expenseAccountPO.getBillingUnitEn2());
unit.add(unit2);
expenseAccountPO.setUnit(unit);
}
return expenseAccountPO;
@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.mhd.common.core.web.domain.BaseVOEntity;
@@ -161,6 +162,6 @@ public class ExpenseAccountPO extends BaseVOEntity{
private String ncSubjectCode;
@ApiModelProperty("计费单位列表(单位-单位英文)")
private List<String> unit;
private List<Map<String, String>> unit;
}
@@ -333,7 +333,7 @@ public class ExpenseAccountApi extends BaseController{
public AjaxResult getInfoByOrgAndCode(@RequestParam("subjectCode") String subjectCode,@RequestParam("organizationId") Long organizationId)
{
ExpenseAccountPO expenseAccountPO = expenseAccountApplicationService.getInfoByOrgAndCode(subjectCode, organizationId);
return AjaxResult.success(expenseAccountPO);
return AjaxResult.success(expenseAccountPO.getUnit());
}