OMS-GW-物料信息
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
package com.mhd.oms.application.service.materialInfo;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInfoDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MaterialInfoApplicationService {
|
||||
|
||||
|
||||
private final WmsServiceFeign wmsServiceFeign;
|
||||
|
||||
public MaterialInfoApplicationService(WmsServiceFeign wmsServiceFeign) {
|
||||
this.wmsServiceFeign = wmsServiceFeign;
|
||||
}
|
||||
|
||||
public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO) {
|
||||
AjaxResult ajaxResult = wmsServiceFeign.getMaterialBaseInfoList(materialInfoDTO);
|
||||
if(ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
List<?> data = (List<?>) ajaxResult.get("data");
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(data);
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setCode(500);
|
||||
tableDataInfo.setMsg("查询失败");
|
||||
return tableDataInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.mhd.oms.interfaces.facade.materialInfo;
|
||||
|
||||
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.application.service.materialInfo.MaterialInfoApplicationService;
|
||||
import com.mhd.system.api.domain.MaterialInfoDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Api(tags = "物料信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/materialInfoApi")
|
||||
public class MaterialInfoApi extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private MaterialInfoApplicationService materialInfoApplicationService;
|
||||
|
||||
@ApiOperation("查询物料信息列表")
|
||||
@GetMapping("/queryList")
|
||||
public TableDataInfo queryList(MaterialInfoDTO materialInfoDTO){
|
||||
startPage();
|
||||
return materialInfoApplicationService.queryList(materialInfoDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user