yang_shj
11 months ago
34 changed files with 399 additions and 61 deletions
@ -0,0 +1,20 @@
|
||||
package com.hnac.hzims.operational.access.feign; |
||||
|
||||
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Component |
||||
public class AccessMaterialClientFallback implements IAccessMaterialClient { |
||||
|
||||
@Override |
||||
public List<MaterialConsumeVO> materialConsume(List<Long> basics) { |
||||
return new ArrayList<>(); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.hnac.hzims.operational.access.feign; |
||||
|
||||
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||
import com.hnac.hzims.operational.OperationalConstants; |
||||
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@FeignClient( |
||||
value = OperationalConstants.APP_NAME, |
||||
fallback = AccessMaterialClientFallback.class |
||||
) |
||||
public interface IAccessMaterialClient { |
||||
|
||||
String API_PREFIX = "/feign/accessMaterial"; |
||||
|
||||
String MATERIAL_CONSUME = API_PREFIX + "/materialConsume"; |
||||
|
||||
@GetMapping(MATERIAL_CONSUME) |
||||
List<MaterialConsumeVO> materialConsume(@RequestParam("basics") List<Long> basics); |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.hnac.hzims.operational.access.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class MaterialConsumeVO { |
||||
|
||||
@ApiModelProperty(value = "物资编号") |
||||
private Long basicId; |
||||
|
||||
@ApiModelProperty(value = "消耗数量") |
||||
private Integer expend; |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.hnac.hzims.operational.access.feign; |
||||
|
||||
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
||||
import com.hnac.hzims.operational.access.service.AccessPlanV4Service; |
||||
import com.hnac.hzims.operational.access.service.IOperAccessMaterialService; |
||||
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/feign/accessMaterial") |
||||
@Slf4j |
||||
@RequiredArgsConstructor |
||||
public class AccessMaterialClient implements IAccessMaterialClient { |
||||
|
||||
private final IOperAccessMaterialService accessMaterialService; |
||||
|
||||
/** |
||||
* 备品备件台账-物资消耗 |
||||
* @param basics |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<MaterialConsumeVO> materialConsume(@RequestParam("basics") List<Long> basics) { |
||||
return accessMaterialService.materialConsume(basics); |
||||
} |
||||
} |
Loading…
Reference in new issue