|
|
@@ -149,20 +149,16 @@ public class SysQuotationController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "获取用户对应报价单")
|
|
|
@GetMapping(value = "/getThemeByUserId")
|
|
|
- public HttpResult< List<String>> getThemeByUserId() {
|
|
|
+ public HttpResult<SysOrganizationQuotation> getThemeByUserId() {
|
|
|
SysUser user = getUser();
|
|
|
LambdaQueryWrapper<SysOrganizationQuotation> oQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
oQueryWrapper.eq(SysOrganizationQuotation::getAuthorizationId, user.getId());
|
|
|
- List<SysOrganizationQuotation> list = sysOrganizationQuotationService.list(oQueryWrapper);
|
|
|
- List<String> themeCodes = new ArrayList<>();
|
|
|
- if (list == null || list.size() == 0) {
|
|
|
- themeCodes.add("QD");
|
|
|
- } else {
|
|
|
- for (SysOrganizationQuotation quotation : list) {
|
|
|
- themeCodes.add(quotation.getThemeCode());
|
|
|
- }
|
|
|
+ SysOrganizationQuotation quotationServiceOne = sysOrganizationQuotationService.getOne(oQueryWrapper);
|
|
|
+ if (quotationServiceOne == null) {
|
|
|
+ quotationServiceOne = new SysOrganizationQuotation();
|
|
|
+ quotationServiceOne.setThemeCode("QD");
|
|
|
}
|
|
|
- return HttpResult.ok(themeCodes);
|
|
|
+ return HttpResult.ok(quotationServiceOne);
|
|
|
}
|
|
|
|
|
|
}
|