|
...
|
...
|
@@ -7,6 +7,8 @@ import com.lframework.starter.web.core.controller.DefaultBaseController; |
|
7
|
7
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
|
8
|
8
|
import com.lframework.starter.web.core.components.resp.PageResult;
|
|
9
|
9
|
import com.lframework.starter.web.core.components.resp.InvokeResult;
|
|
|
10
|
+import com.lframework.starter.web.inner.entity.SysDataDicItem;
|
|
|
11
|
+import com.lframework.starter.web.inner.service.system.SysDataDicItemService;
|
|
10
|
12
|
import com.lframework.xingyun.basedata.entity.Customer;
|
|
11
|
13
|
import com.lframework.xingyun.basedata.entity.ProductVariety;
|
|
12
|
14
|
import com.lframework.xingyun.basedata.service.customer.CustomerService;
|
|
...
|
...
|
@@ -50,6 +52,10 @@ public class ContractFrameworkController extends DefaultBaseController { |
|
50
|
52
|
private ProductVarietyService productVarietyService;
|
|
51
|
53
|
@Autowired
|
|
52
|
54
|
private CustomerService customerService;
|
|
|
55
|
+ @Autowired
|
|
|
56
|
+ private SysDataDicItemService sysDataDicItemService;
|
|
|
57
|
+
|
|
|
58
|
+ private static final String SUPPLIER_DIC_CODE = "SUPPLIER";
|
|
53
|
59
|
|
|
54
|
60
|
/**
|
|
55
|
61
|
* 查询列表
|
|
...
|
...
|
@@ -92,6 +98,8 @@ public class ContractFrameworkController extends DefaultBaseController { |
|
92
|
98
|
.collect(Collectors.toMap(Customer::getId, Function.identity())));
|
|
93
|
99
|
}
|
|
94
|
100
|
|
|
|
101
|
+ Map<String, String> sysDataDicItemMap = CollectionUtils.emptyIfNull(sysDataDicItemService.findByDicCode(SUPPLIER_DIC_CODE))
|
|
|
102
|
+ .stream().collect(Collectors.toMap(SysDataDicItem::getCode, SysDataDicItem::getName));
|
|
95
|
103
|
results.forEach(bo -> {
|
|
96
|
104
|
if (bo == null) return;
|
|
97
|
105
|
|
|
...
|
...
|
@@ -104,6 +112,10 @@ public class ContractFrameworkController extends DefaultBaseController { |
|
104
|
112
|
Customer customer = customerMap.get(bo.getCustomerId());
|
|
105
|
113
|
bo.setCustomerName(customer != null ? customer.getName() : "");
|
|
106
|
114
|
}
|
|
|
115
|
+
|
|
|
116
|
+ if (StringUtils.isNotBlank(bo.getCompany())) {
|
|
|
117
|
+ bo.setCompanyName(sysDataDicItemMap.get(bo.getCompany()));
|
|
|
118
|
+ }
|
|
107
|
119
|
});
|
|
108
|
120
|
|
|
109
|
121
|
boPageResult.setDatas(results);
|
|
...
|
...
|
@@ -141,7 +153,8 @@ public class ContractFrameworkController extends DefaultBaseController { |
|
141
|
153
|
Customer customer = customerService.findById(customerId);
|
|
142
|
154
|
result.setMaterialTypeName(productVariety != null ? productVariety.getName() : "");
|
|
143
|
155
|
result.setCustomerName(customer != null ? customer.getName() : "");
|
|
144
|
|
-
|
|
|
156
|
+ SysDataDicItem sysDataDicItem = sysDataDicItemService.findByCode(SUPPLIER_DIC_CODE, result.getCompany());
|
|
|
157
|
+ result.setCompanyName(sysDataDicItem != null ? sysDataDicItem.getName() : "");
|
|
145
|
158
|
return InvokeResultBuilder.success(result);
|
|
146
|
159
|
}
|
|
147
|
160
|
|
...
|
...
|
|