|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace.vo.ExceptionMisplaceRespVO;
|
|
|
import cn.iocoder.yudao.module.iscs.controller.admin.isolationpoint.vo.BindingPointVO;
|
|
|
import cn.iocoder.yudao.module.iscs.controller.admin.isolationpoint.vo.PointDetailVO;
|
|
|
import cn.iocoder.yudao.module.iscs.controller.admin.lotostation.vo.LotoStationPageReqVO;
|
|
|
@@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.iscs.service.jobticketpoints.JobTicketPointsServi
|
|
|
import cn.iocoder.yudao.module.iscs.service.map.MapService;
|
|
|
import cn.iocoder.yudao.module.iscs.service.sop.SopPointsService;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
@@ -71,6 +73,13 @@ public class LotoStationServiceImpl extends ServiceImpl<LotoStationMapper, LotoS
|
|
|
List<LotoStationDO> list1 = list(Wrappers.<LotoStationDO>lambdaQuery()
|
|
|
.eq(LotoStationDO::getLotoSerialNumber, createReqVO.getLotoSerialNumber()));
|
|
|
Assert.isTrue(list1.isEmpty(), "该序列号已被使用,请重新填写!");
|
|
|
+ // 判断mapId有没有被使用
|
|
|
+ if (createReqVO.getMapId() != null) {
|
|
|
+ List<LotoStationDO> list2 = list(Wrappers.<LotoStationDO>lambdaQuery()
|
|
|
+ .eq(LotoStationDO::getMapId, createReqVO.getMapId())
|
|
|
+ .ne(LotoStationDO::getDeleted, 1));
|
|
|
+ Assert.isTrue(list2.isEmpty(), "该地图已被其他锁定站使用!");
|
|
|
+ }
|
|
|
// 插入
|
|
|
LotoStationDO lotoStation = BeanUtils.toBean(createReqVO, LotoStationDO.class);
|
|
|
lotoStationMapper.insert(lotoStation);
|
|
|
@@ -82,6 +91,14 @@ public class LotoStationServiceImpl extends ServiceImpl<LotoStationMapper, LotoS
|
|
|
@Override
|
|
|
public void updateLotoStation(LotoStationSaveReqVO updateReqVO) {
|
|
|
Assert.notNull(updateReqVO.getId(), "主键id不能为空!");
|
|
|
+ // 判断mapId有没有被使用
|
|
|
+ if (updateReqVO.getMapId() != null) {
|
|
|
+ List<LotoStationDO> list2 = list(Wrappers.<LotoStationDO>lambdaQuery()
|
|
|
+ .eq(LotoStationDO::getMapId, updateReqVO.getMapId())
|
|
|
+ .ne(LotoStationDO::getId, updateReqVO.getId())
|
|
|
+ .ne(LotoStationDO::getDeleted, 1));
|
|
|
+ Assert.isTrue(list2.isEmpty(), "该地图已被其他锁定站使用!");
|
|
|
+ }
|
|
|
// 判断名称重复
|
|
|
List<LotoStationDO> list = list(Wrappers.<LotoStationDO>lambdaQuery()
|
|
|
.eq(LotoStationDO::getLotoName, updateReqVO.getLotoName())
|
|
|
@@ -145,8 +162,13 @@ public class LotoStationServiceImpl extends ServiceImpl<LotoStationMapper, LotoS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PageResult<LotoStationDO> getLotoStationPage(LotoStationPageReqVO pageReqVO) {
|
|
|
- return lotoStationMapper.selectPage(pageReqVO);
|
|
|
+ public PageResult<LotoStationRespVO> getLotoStationPage(LotoStationPageReqVO pageReqVO) {
|
|
|
+ Page<LotoStationDO> page = new Page<LotoStationDO>().setCurrent(pageReqVO.getPageNo()).setSize(pageReqVO.getPageSize());
|
|
|
+ Page<LotoStationRespVO> pageResult = lotoStationMapper.getLotoStationPage(page, pageReqVO);
|
|
|
+ PageResult<LotoStationRespVO> respVOPageResult = new PageResult<>();
|
|
|
+ respVOPageResult.setList(pageResult.getRecords());
|
|
|
+ respVOPageResult.setTotal(pageResult.getTotal());
|
|
|
+ return respVOPageResult;
|
|
|
}
|
|
|
|
|
|
@Override
|