修正循环依赖,添加了停机Type的查询
This commit is contained in:
@@ -3,6 +3,8 @@ package com.fizz.business.controller;
|
|||||||
import com.fizz.business.domain.ProStoppage;
|
import com.fizz.business.domain.ProStoppage;
|
||||||
import com.fizz.business.form.ProStoppageForm;
|
import com.fizz.business.form.ProStoppageForm;
|
||||||
import com.fizz.business.service.ProStoppageService;
|
import com.fizz.business.service.ProStoppageService;
|
||||||
|
import com.fizz.business.service.ProStoppageTypeService;
|
||||||
|
import com.fizz.business.domain.vo.ProStoppageTypeVO;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -22,6 +24,9 @@ public class ProStoppageController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ProStoppageService proStoppageService;
|
private ProStoppageService proStoppageService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProStoppageTypeService proStoppageTypeService;
|
||||||
|
|
||||||
// @PostMapping("/add")
|
// @PostMapping("/add")
|
||||||
// @ApiOperation("新增停机记录")
|
// @ApiOperation("新增停机记录")
|
||||||
// public R<Boolean> add(@RequestBody ProStoppage proStoppage) {
|
// public R<Boolean> add(@RequestBody ProStoppage proStoppage) {
|
||||||
@@ -51,4 +56,15 @@ public class ProStoppageController {
|
|||||||
public R<List<Object>> calc(@RequestBody ProStoppageForm form) {
|
public R<List<Object>> calc(@RequestBody ProStoppageForm form) {
|
||||||
return R.ok(proStoppageService.calc(form));
|
return R.ok(proStoppageService.calc(form));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/types")
|
||||||
|
@Operation(summary = "查询停机类型")
|
||||||
|
public R<List<ProStoppageTypeVO>> types() {
|
||||||
|
return R.ok(proStoppageTypeService.listAll().stream().map(item -> {
|
||||||
|
ProStoppageTypeVO vo = new ProStoppageTypeVO();
|
||||||
|
vo.setStopType(item.getStopType());
|
||||||
|
vo.setRemark(item.getRemark());
|
||||||
|
return vo;
|
||||||
|
}).collect(java.util.stream.Collectors.toList()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.fizz.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("pro_stoppage_type")
|
||||||
|
public class ProStoppageType {
|
||||||
|
|
||||||
|
@TableId(value = "STOP_TYPE", type = IdType.INPUT)
|
||||||
|
private Integer stopType;
|
||||||
|
|
||||||
|
@TableField("REMARK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField("INSDATE")
|
||||||
|
private LocalDateTime insdate;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.fizz.business.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProStoppageTypeVO {
|
||||||
|
|
||||||
|
private Integer stopType;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.fizz.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.fizz.business.domain.ProStoppageType;
|
||||||
|
|
||||||
|
public interface ProStoppageTypeMapper extends BaseMapper<ProStoppageType> {
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.fizz.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.fizz.business.domain.ProStoppageType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProStoppageTypeService extends IService<ProStoppageType> {
|
||||||
|
|
||||||
|
List<ProStoppageType> listAll();
|
||||||
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ public class ProStoppageServiceImpl extends ServiceImpl<ProStoppageMapper, ProSt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteProStoppage(Long stopid) {
|
public boolean deleteProStoppage(Long stopid) {
|
||||||
return this.deleteProStoppage(stopid);
|
return this.removeById(stopid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.fizz.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.fizz.business.domain.ProStoppageType;
|
||||||
|
import com.fizz.business.mapper.ProStoppageTypeMapper;
|
||||||
|
import com.fizz.business.service.ProStoppageTypeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ProStoppageTypeServiceImpl extends ServiceImpl<ProStoppageTypeMapper, ProStoppageType> implements ProStoppageTypeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProStoppageType> listAll() {
|
||||||
|
return baseMapper.selectList(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -66,6 +66,7 @@ public class TrackServiceImpl implements TrackService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@org.springframework.context.annotation.Lazy
|
||||||
private SegmentTrackerService segmentTrackerService;
|
private SegmentTrackerService segmentTrackerService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user