|
|
|
|
@ -5,10 +5,13 @@ import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartRelationEntity; |
|
|
|
|
import org.springframework.cloud.openfeign.FeignClient; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 零件服务Feign客户端 |
|
|
|
|
* 修正点:所有GET请求参数添加@RequestParam注解,解决Feign多Body参数异常 |
|
|
|
|
* @author liweidong |
|
|
|
|
*/ |
|
|
|
|
@FeignClient( |
|
|
|
|
@ -19,13 +22,9 @@ public interface IPartClient { |
|
|
|
|
String API_PREFIX = "/feign/client/part"; |
|
|
|
|
|
|
|
|
|
String GET_PART = API_PREFIX + "/getPart"; |
|
|
|
|
|
|
|
|
|
String GET_SUB_PART = API_PREFIX + "/getSubPart"; |
|
|
|
|
|
|
|
|
|
String BATCH_PARTS = API_PREFIX + "/batchParts"; |
|
|
|
|
|
|
|
|
|
String REWORK_TASK = API_PREFIX + "/reworkTask"; |
|
|
|
|
|
|
|
|
|
String SYNC_PART = API_PREFIX + "/syncPart"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -35,7 +34,10 @@ public interface IPartClient { |
|
|
|
|
* @return 零件信息 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping(GET_PART) |
|
|
|
|
public DsPartEntity getPart(String partCode,String version); |
|
|
|
|
DsPartEntity getPart( |
|
|
|
|
@RequestParam("partCode") String partCode, // 新增:指定查询参数名
|
|
|
|
|
@RequestParam("version") String version // 新增:指定查询参数名
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取子件 |
|
|
|
|
@ -43,15 +45,19 @@ public interface IPartClient { |
|
|
|
|
* @return 子件集合 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping(GET_SUB_PART) |
|
|
|
|
public List<DsPartRelationEntity> getSubPart(Long partId); |
|
|
|
|
List<DsPartRelationEntity> getSubPart( |
|
|
|
|
@RequestParam("partId") Long partId // 新增:指定查询参数名
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量获取零件信息 |
|
|
|
|
* @param ids 零件Ids |
|
|
|
|
* @param ids 零件Ids(集合参数需指定参数名,Feign会自动解析为多个id=xxx) |
|
|
|
|
* @return 零件集合 |
|
|
|
|
*/ |
|
|
|
|
@GetMapping(BATCH_PARTS) |
|
|
|
|
public List<DsPartEntity> batchParts(List<Long> ids); |
|
|
|
|
List<DsPartEntity> batchParts( |
|
|
|
|
@RequestParam("ids") List<Long> ids // 新增:指定查询参数名
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 返工任务同步 |
|
|
|
|
@ -64,4 +70,4 @@ public interface IPartClient { |
|
|
|
|
*/ |
|
|
|
|
@GetMapping(SYNC_PART) |
|
|
|
|
void syncPart(); |
|
|
|
|
} |
|
|
|
|
} |