|
@@ -0,0 +1,87 @@
|
|
|
+package com.platform.rest.controller.sb;
|
|
|
+
|
|
|
+import com.platform.common.bean.AbstractPageResultBean;
|
|
|
+import com.platform.common.util.BeanConverterUtil;
|
|
|
+import com.platform.common.util.R;
|
|
|
+import com.platform.common.validation.group.AddGroup;
|
|
|
+import com.platform.common.validation.group.UpdateGroup;
|
|
|
+import com.platform.dao.dto.sb.SbInfoDTO;
|
|
|
+import com.platform.dao.entity.sb.SbInfo;
|
|
|
+import com.platform.dao.util.ExcelUtil;
|
|
|
+import com.platform.dao.util.TreeUtil;
|
|
|
+import com.platform.dao.vo.export.sb.ExportSbInfoMeasureVO;
|
|
|
+import com.platform.dao.vo.export.sb.ExportSbInfoVO;
|
|
|
+import com.platform.dao.vo.sb.SbInfoVO;
|
|
|
+import com.platform.dao.vo.sb.SbInfoWorkplaceVO;
|
|
|
+import com.platform.office.poi.excel.ExcelImportUtil;
|
|
|
+import com.platform.office.poi.excel.entity.ImportParams;
|
|
|
+import com.platform.rest.log.annotation.SysLog;
|
|
|
+import com.platform.service.sb.SbInfoService;
|
|
|
+import com.platform.service.sb.impl.SbInfoServiceImpl;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.FileInputStream;
|
|
|
+import java.io.FileNotFoundException;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description 设备台账
|
|
|
+ * @Author liuyu
|
|
|
+ * @Date 2020-04-21 21:05:46
|
|
|
+ * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/sb/counts")
|
|
|
+public class SbCountController {
|
|
|
+
|
|
|
+ private final SbInfoService sbInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询厂区和车间分组数据
|
|
|
+ *
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("group")
|
|
|
+ public R selectCountByPositionGroup() {
|
|
|
+ return new R<>(sbInfoService.selectCountByPositionGroup());
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据位置code查询设备数量,按照类别分组
|
|
|
+ *
|
|
|
+ * @param code 位置code
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/type/{code}")
|
|
|
+ public R selectCountByPositionGroupBySbType(@PathVariable String code) {
|
|
|
+ return new R<>(sbInfoService.selectCountByPositionGroupBySbType(code));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备状态台账
|
|
|
+ *
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/status/{code}")
|
|
|
+ public R getCount(@PathVariable String code) {
|
|
|
+ return new R(sbInfoService.selectCountBySbStatusGroup(code));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备自定义类型台账-按照每个车间划分
|
|
|
+ *
|
|
|
+ * @param code 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/useType/{code}")
|
|
|
+ public R getById(@PathVariable String code) {
|
|
|
+ return new R(sbInfoService.selectCountByUseTypeGroup(code));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|