工厂列表返回id - 添加工厂详情接口
This commit is contained in:
parent
296e46d5af
commit
4c2fc60cd2
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factory.SfFactoryInfoDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.factory.SfFactoryInfoService;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.screendata.ScreenDataService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -14,9 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -29,6 +28,8 @@ public class FactoryScreenDataController {
|
||||
|
||||
@Resource
|
||||
private ScreenDataService screenDataService;
|
||||
@Resource
|
||||
private SfFactoryInfoService sfFactoryInfoService;
|
||||
|
||||
/**
|
||||
* @param code
|
||||
@ -164,4 +165,13 @@ public class FactoryScreenDataController {
|
||||
ObtainFactoryInboundAndOutboundStatusVO data = screenDataService.getObtainFactoryInboundAndOutboundStatus(factoryId);
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@GetMapping("/getFactoryInfoById")
|
||||
@Operation(summary = "获取工厂详情")
|
||||
@PermitAll
|
||||
public CommonResult<SfFactoryInfoDO> getFactoryInfoById(@RequestParam Long factoryId) {
|
||||
SfFactoryInfoDO sfFactoryInfo = sfFactoryInfoService.getSfFactoryInfo(factoryId);
|
||||
return success(sfFactoryInfo);
|
||||
}
|
||||
|
||||
}
|
@ -12,6 +12,8 @@ import lombok.Data;
|
||||
@Schema(description = "大屏数据 - 工厂基础滚动数据 Response VO")
|
||||
@Data
|
||||
public class FactoryRollDataRespVO {
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "工厂id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "江西省南昌市第一工厂")
|
||||
private String name;
|
||||
|
@ -11,7 +11,8 @@
|
||||
|
||||
<select id="getFactoryRollData"
|
||||
resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO">
|
||||
SELECT a.name as name,
|
||||
SELECT a.id as id,
|
||||
a.name as name,
|
||||
a.short_name as shortName,
|
||||
a.city_name as cityName,
|
||||
(select count(1) from sf_staff where factory_id = a.id and `status` = 1) as total,
|
||||
|
Loading…
Reference in New Issue
Block a user