|
@@ -6,6 +6,8 @@ import com.sckw.contract.model.vo.req.QueryListReqVo;
|
|
|
import com.sckw.contract.api.model.dto.res.TradeEntInfoResVo;
|
|
import com.sckw.contract.api.model.dto.res.TradeEntInfoResVo;
|
|
|
import com.sckw.contract.service.operateService.KwcContractTradeService;
|
|
import com.sckw.contract.service.operateService.KwcContractTradeService;
|
|
|
import com.sckw.core.model.enums.EntTypeEnum;
|
|
import com.sckw.core.model.enums.EntTypeEnum;
|
|
|
|
|
+import com.sckw.core.web.context.LoginEntHolder;
|
|
|
|
|
+import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.response.BaseResult;
|
|
import com.sckw.core.web.response.BaseResult;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -46,6 +49,19 @@ public class KwcPurchaseController {
|
|
|
|
|
|
|
|
@PostMapping("queryTradeEntList")
|
|
@PostMapping("queryTradeEntList")
|
|
|
public BaseResult<List<TradeEntInfoResVo>> queryTradeEntList(@RequestBody TradeEntListQueryFeignDto queryFeignDto) {
|
|
public BaseResult<List<TradeEntInfoResVo>> queryTradeEntList(@RequestBody TradeEntListQueryFeignDto queryFeignDto) {
|
|
|
|
|
+ if(queryFeignDto.getCurEntId() == null){
|
|
|
|
|
+ queryFeignDto.setCurEntId(LoginUserHolder.getEntId());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(queryFeignDto.getTradeEntType() == null){
|
|
|
|
|
+ String entTypes = LoginEntHolder.get().getEntTypes();
|
|
|
|
|
+ if (entTypes.contains(String.valueOf(EntTypeEnum.SUPPLIER.getCode()))) {
|
|
|
|
|
+ queryFeignDto.setTradeEntType(EntTypeEnum.PURCHASER.getCode());
|
|
|
|
|
+ } else if (entTypes.contains(String.valueOf(EntTypeEnum.PURCHASER.getCode()))) {
|
|
|
|
|
+ queryFeignDto.setTradeEntType(EntTypeEnum.SUPPLIER.getCode());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return BaseResult.success(Collections.emptyList());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return BaseResult.success(kwcContractTradeService.queryTradeEntList(queryFeignDto));
|
|
return BaseResult.success(kwcContractTradeService.queryTradeEntList(queryFeignDto));
|
|
|
}
|
|
}
|
|
|
|
|
|