fix:出入库区修改优化
This commit is contained in:
@@ -52,8 +52,7 @@ public class SchBasePointController {
|
|||||||
@PostMapping("/updatePointType")
|
@PostMapping("/updatePointType")
|
||||||
@Log("修改点位类型")
|
@Log("修改点位类型")
|
||||||
public ResponseEntity<Object> updatePointType(@Validated @RequestBody SchBasePoint entity) {
|
public ResponseEntity<Object> updatePointType(@Validated @RequestBody SchBasePoint entity) {
|
||||||
schBasePointService.updatePointType(entity);
|
return new ResponseEntity<>(schBasePointService.updatePointType(entity),HttpStatus.OK);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
import org.nl.wms.sch_manage.service.dto.SchBasePointQuery;
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
|||||||
*
|
*
|
||||||
* @param entity /
|
* @param entity /
|
||||||
*/
|
*/
|
||||||
void updatePointType(SchBasePoint entity);
|
PdaResponse updatePointType(SchBasePoint entity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||||
import org.nl.wms.sch_manage.enums.PointStatusEnum;
|
import org.nl.wms.sch_manage.enums.PointStatusEnum;
|
||||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
@@ -142,11 +143,15 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updatePointType(SchBasePoint entity) {
|
public PdaResponse updatePointType(SchBasePoint entity) {
|
||||||
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
|
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
|
||||||
if (point == null) {
|
if (point == null) {
|
||||||
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
|
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!"YLXCQ".equals(point.getRegion_code())){
|
||||||
|
throw new BadRequestException("只允许更改原料卸车区的点位");
|
||||||
|
}
|
||||||
point.setPoint_type(entity.getPoint_type());
|
point.setPoint_type(entity.getPoint_type());
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -155,6 +160,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
point.setUpdate_name(nickName);
|
point.setUpdate_name(nickName);
|
||||||
point.setUpdate_time(now);
|
point.setUpdate_time(now);
|
||||||
pointMapper.updateById(point);
|
pointMapper.updateById(point);
|
||||||
|
|
||||||
|
return PdaResponse.requestOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user