|
|
@@ -10,6 +10,8 @@ import com.kym.service.miniapp.WashStationService;
|
|
|
import com.kym.service.mybatisplus.MyBaseServiceImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 洗车站点表 服务实现类
|
|
|
@@ -24,6 +26,46 @@ public class WashStationServiceImpl extends MyBaseServiceImpl<WashStationMapper,
|
|
|
|
|
|
// ====================================================== 运营平台接口 Start ===========================================================
|
|
|
|
|
|
+ @Override
|
|
|
+ public void add(WashStation station) {
|
|
|
+ CommUtil.assertsNonNulls(List.of(station.getStationName(),station.getStationId(),station.getStationType()),"参数异常");
|
|
|
+ Long count = lambdaQuery().eq(WashStation::getStationName, station.getStationName()).count();
|
|
|
+ CommUtil.asserts(count==0,"站点已存在");
|
|
|
+ save(station);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void modify(WashStation station) {
|
|
|
+ CommUtil.assertsNonNulls(List.of(station.getStationName(),station.getStationId(),station.getStationType(),station.getId()),"参数异常");
|
|
|
+ List<WashStation> list = lambdaQuery().eq(WashStation::getStationName, station.getStationName()).list();
|
|
|
+ CommUtil.asserts(list.size()<=1,"站点信息异常");
|
|
|
+ if(list.size()==1){
|
|
|
+ CommUtil.asserts(list.get(0).getStationName().equalsIgnoreCase(station.getStationName()),"站点已存在");
|
|
|
+ }
|
|
|
+ updateById(station);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageBean<WashStation> list(StationQueryParams query) {
|
|
|
+ PageHelper.startPage(query.getPageNum(),query.getPageSize());
|
|
|
+ List<WashStation> list = lambdaQuery()
|
|
|
+ .like(CommUtil.isNotEmptyAndNull(query.getStationName()), WashStation::getStationName, query.getStationName())
|
|
|
+ .like(CommUtil.isNotEmptyAndNull(query.getAddress()), WashStation::getAddress, query.getAddress())
|
|
|
+ .eq(CommUtil.isNotEmptyAndNull(query.getStationType()), WashStation::getStationType, query.getStationType())
|
|
|
+ .list();
|
|
|
+ return new PageBean<>(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public WashStation detail(Long id) {
|
|
|
+ return getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void remove(Long id) {
|
|
|
+
|
|
|
+ }
|
|
|
// ====================================================== 运营平台接口 Start ===========================================================
|
|
|
|
|
|
|
|
|
@@ -40,6 +82,7 @@ public class WashStationServiceImpl extends MyBaseServiceImpl<WashStationMapper,
|
|
|
return new PageBean<>(res);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
// ====================================================== 小程序接口 End ===========================================================
|
|
|
|
|
|
}
|