Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d23e169d9e
@ -1,6 +1,7 @@
|
||||
package com.mt.wms.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mt.wms.basic.params.KilnInfoParam;
|
||||
import com.mt.wms.basic.params.KilnInfoQueryParam;
|
||||
import com.mt.wms.basic.service.KilnInfoService;
|
||||
@ -14,6 +15,7 @@ import com.mt.wms.core.params.IdParam;
|
||||
import com.mt.wms.core.vo.IdVo;
|
||||
import com.mt.wms.core.vo.PageVo;
|
||||
import com.mt.wms.core.vo.R;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -51,21 +53,42 @@ public class KilnInfoServiceImpl extends BaseService implements KilnInfoService
|
||||
|
||||
@Override
|
||||
public R<PageVo<KilnInfoVo>> page(KilnInfoQueryParam kilnInfoQueryParam) {
|
||||
return null;
|
||||
QueryWrapper<KilnInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(KilnInfo.VALID,1);
|
||||
Page<KilnInfo> page = kilnInfoServiceBiz.page(new Page<>(kilnInfoQueryParam.getCurrent(), kilnInfoQueryParam.getSize()), wrapper);
|
||||
return successful(new PageVo<>(page,KilnInfoVo.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> add(KilnInfoParam kilnInfoParam) {
|
||||
return null;
|
||||
QueryWrapper<KilnInfo> wrapper=new QueryWrapper<>();
|
||||
|
||||
KilnInfo kilnInfo=new KilnInfo();
|
||||
BeanUtils.copyProperties(kilnInfoParam,kilnInfo);
|
||||
setCommonField(kilnInfo);
|
||||
kilnInfoServiceBiz.save(kilnInfo);
|
||||
return successful(IdVo.builder().id(kilnInfo.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> update(KilnInfoParam kilnInfoParam) {
|
||||
return null;
|
||||
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(kilnInfoParam.getId());
|
||||
if (!kilnInfoParam.getKilnName().equals(kilnInfo.getKilnName())){
|
||||
QueryWrapper<KilnInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(KilnInfo.KILN_NAME,kilnInfoParam.getKilnName());
|
||||
wrapper.eq(KilnInfo.VALID,1);
|
||||
Assert.eqZero(kilnInfoServiceBiz.count(wrapper),"车辆名称已存在!");
|
||||
}
|
||||
KilnInfo updatewKilnInfo=new KilnInfo();
|
||||
BeanUtils.copyProperties(kilnInfoParam,updatewKilnInfo);
|
||||
setUpdateCommonField(updatewKilnInfo);
|
||||
kilnInfoServiceBiz.updateById(updatewKilnInfo);
|
||||
return successful(IdVo.builder().id(updatewKilnInfo.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> delete(IdParam idParam) {
|
||||
return null;
|
||||
kilnInfoServiceBiz.removeById(idParam.getId());
|
||||
return successful(IdVo.builder().id(idParam.getId()).build());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.mt.wms.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mt.wms.basic.params.LocationInfoParam;
|
||||
import com.mt.wms.basic.params.LocationInfoQueryParam;
|
||||
import com.mt.wms.basic.service.LocationInfoService;
|
||||
@ -54,21 +55,42 @@ public class LocationInfoServiceImpl extends BaseService implements LocationInfo
|
||||
|
||||
@Override
|
||||
public R<PageVo<LocationInfoVo>> page(LocationInfoQueryParam locationInfoQueryParam) {
|
||||
return null;
|
||||
QueryWrapper<Location> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(Location.VALID,1);
|
||||
Page<Location> page = locationServiceBiz.page(new Page<>(locationInfoQueryParam.getCurrent(), locationInfoQueryParam.getSize()), wrapper);
|
||||
return successful(new PageVo<>(page,LocationInfoVo.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> add(LocationInfoParam locationInfoParam) {
|
||||
return null;
|
||||
QueryWrapper<Location> wrapper=new QueryWrapper<>();
|
||||
|
||||
Location location=new Location();
|
||||
BeanUtils.copyProperties(locationInfoParam,location);
|
||||
setCommonField(location);
|
||||
locationServiceBiz.save(location);
|
||||
return successful(IdVo.builder().id(location.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> update(LocationInfoParam locationInfoParam) {
|
||||
return null;
|
||||
Location location = locationServiceBiz.getById(locationInfoParam.getId());
|
||||
if (!locationInfoParam.getCode().equals(location.getCode())){
|
||||
QueryWrapper<Location> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(Location.CODE,locationInfoParam.getCode());
|
||||
wrapper.eq(Location.VALID,1);
|
||||
Assert.eqZero(locationServiceBiz.count(wrapper),"库位编码已存在!");
|
||||
}
|
||||
Location updateLocation=new Location();
|
||||
BeanUtils.copyProperties(locationInfoParam,updateLocation);
|
||||
setUpdateCommonField(updateLocation);
|
||||
locationServiceBiz.updateById(updateLocation);
|
||||
return successful(IdVo.builder().id(updateLocation.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> delete(IdParam idParam) {
|
||||
return null;
|
||||
locationServiceBiz.removeById(idParam.getId());
|
||||
return successful(IdVo.builder().id(idParam.getId()).build());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.mt.wms.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mt.wms.basic.params.VehicleParam;
|
||||
import com.mt.wms.basic.params.VehicleQueryParam;
|
||||
import com.mt.wms.basic.service.VehicleService;
|
||||
@ -54,21 +55,42 @@ public class VehicleServiceImpl extends BaseService implements VehicleService {
|
||||
|
||||
@Override
|
||||
public R<PageVo<VehicleVo>> page(VehicleQueryParam vehicleQueryParam) {
|
||||
return null;
|
||||
QueryWrapper<VehicleInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(VehicleInfo.VALID,1);
|
||||
Page<VehicleInfo> page = vehicleInfoServiceBiz.page(new Page<>(vehicleQueryParam.getCurrent(), vehicleQueryParam.getSize()), wrapper);
|
||||
return successful(new PageVo<>(page,VehicleVo.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> add(VehicleParam vehicleParam) {
|
||||
return null;
|
||||
QueryWrapper<VehicleInfo> wrapper=new QueryWrapper<>();
|
||||
|
||||
VehicleInfo vehicleInfo=new VehicleInfo();
|
||||
BeanUtils.copyProperties(vehicleParam,vehicleInfo);
|
||||
setCommonField(vehicleInfo);
|
||||
vehicleInfoServiceBiz.save(vehicleInfo);
|
||||
return successful(IdVo.builder().id(vehicleInfo.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> update(VehicleParam vehicleParam) {
|
||||
return null;
|
||||
VehicleInfo vehicleInfo = vehicleInfoServiceBiz.getById(vehicleParam.getId());
|
||||
if (!vehicleParam.getCode().equals(vehicleInfo.getCode())){
|
||||
QueryWrapper<VehicleInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq(VehicleInfo.CODE,vehicleParam.getCode());
|
||||
wrapper.eq(VehicleInfo.VALID,1);
|
||||
Assert.eqZero(vehicleInfoServiceBiz.count(wrapper),"车辆编码已存在!");
|
||||
}
|
||||
VehicleInfo updateVehicleInfo=new VehicleInfo();
|
||||
BeanUtils.copyProperties(vehicleParam,updateVehicleInfo);
|
||||
setUpdateCommonField(updateVehicleInfo);
|
||||
vehicleInfoServiceBiz.updateById(updateVehicleInfo);
|
||||
return successful(IdVo.builder().id(updateVehicleInfo.getId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<IdVo> delete(IdParam idParam) {
|
||||
return null;
|
||||
vehicleInfoServiceBiz.removeById(idParam.getId());
|
||||
return successful(IdVo.builder().id(idParam.getId()).build());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user