fix:出入库区修改优化

This commit is contained in:
zhengxuming
2025-08-13 14:19:00 +08:00
parent 85d4a8d302
commit 1b7f80e2f7
3 changed files with 11 additions and 4 deletions

View File

@@ -52,8 +52,7 @@ public class SchBasePointController {
@PostMapping("/updatePointType")
@Log("修改点位类型")
public ResponseEntity<Object> updatePointType(@Validated @RequestBody SchBasePoint entity) {
schBasePointService.updatePointType(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
return new ResponseEntity<>(schBasePointService.updatePointType(entity),HttpStatus.OK);
}

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
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.dto.SchBasePointQuery;
@@ -45,7 +46,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
*
* @param entity /
*/
void updatePointType(SchBasePoint entity);
PdaResponse updatePointType(SchBasePoint entity);
/**
* 多选删除

View File

@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
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.StatusEnum;
import org.nl.wms.sch_manage.service.ISchBasePointService;
@@ -142,11 +143,15 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
}
@Override
public void updatePointType(SchBasePoint entity) {
public PdaResponse updatePointType(SchBasePoint entity) {
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
if (point == null) {
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
}
if(!"YLXCQ".equals(point.getRegion_code())){
throw new BadRequestException("只允许更改原料卸车区的点位");
}
point.setPoint_type(entity.getPoint_type());
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
@@ -155,6 +160,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
point.setUpdate_name(nickName);
point.setUpdate_time(now);
pointMapper.updateById(point);
return PdaResponse.requestOk();
}
@Override