no message

main
HUOJIN\92525 2026-01-31 00:03:38 +08:00
parent 51d656ffeb
commit 043b90284c
3 changed files with 17 additions and 13 deletions

View File

@ -4,7 +4,7 @@ import java.util.Arrays;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.cpte.modules.constant.enums.BusinessTypeEnum;
import org.cpte.modules.constant.enums.AgvStatusEnum;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.cpte.modules.agvTask.entity.AgvTask;
@ -72,6 +72,7 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService>
@RequiresPermissions("agvTask:data_agv_task:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AgvTask agvTask) {
agvTask.setStatus(AgvStatusEnum.CREATED.getValue());
agvTaskService.save(agvTask);
return Result.OK("添加成功!");
}
@ -87,9 +88,7 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService>
@RequiresPermissions("agvTask:data_agv_task:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AgvTask agvTask) {
if (BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())) {
agvTaskService.editInBoundAgvTask(agvTask);
}
agvTaskService.editAgvTask(agvTask);
agvTaskService.updateById(agvTask);
return Result.OK("编辑成功!");
}

View File

@ -51,6 +51,6 @@ public interface IAgvTaskService extends IService<AgvTask> {
* AGV
* @param agvTask AGV
*/
void editInBoundAgvTask(AgvTask agvTask);
void editAgvTask(AgvTask agvTask);
}

View File

@ -144,10 +144,9 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
@Override
@Transactional(rollbackFor = Exception.class)
public void editInBoundAgvTask(AgvTask agvTask) {
public void editAgvTask(AgvTask agvTask) {
Point point = pointMapper.queryByPointCode(agvTask.getEndCode());
point.setStatus(CommonStatusEnum.USED.getValue());
pointMapper.updateById(point);
if(BusinessTypeEnum.INBOUND.getValue().equals(agvTask.getType())){
List<AsnDetail> asnDetails= asnDetailMapper.selectByMainId(agvTask.getBusinessDetailId());
for (AsnDetail asnDetail : asnDetails){
asnDetail.setToPointId(point.getId());
@ -156,4 +155,10 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl
asnDetailMapper.updateById(asnDetails);
}
}
if(!BusinessTypeEnum.OUTBOUND.getValue().equals(agvTask.getType())){
point.setStatus(CommonStatusEnum.USED.getValue());
pointMapper.updateById(point);
}
}
}