diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformation.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformation.java index b2a646d1c7..2b186e63c5 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformation.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformation.java @@ -5,7 +5,6 @@ import com.yxt.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; - import java.util.Date; /** @@ -50,5 +49,7 @@ public class BusVehicleInformation extends BaseEntity { private String transferName; // 移交人 @ApiModelProperty("剩余随车资料") private String vehicleHandoverData; //剩余随车资料 + @ApiModelProperty("移交备注") + private String transferRemarks; // 移交备注 } diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationDto.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationDto.java index 1559d4c605..b25895677d 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationDto.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationDto.java @@ -1,9 +1,7 @@ package com.yxt.anrui.buscenter.api.busvehicleinformation; - import com.yxt.common.core.dto.Dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; - import java.util.Date; /** @@ -43,4 +41,6 @@ public class BusVehicleInformationDto implements Dto { private String remarks; @ApiModelProperty("随车资料") private String vehicleHandoverData; //剩余随车资料 + @ApiModelProperty("移交备注") + private String transferRemarks; // 移交备注 } diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationVo.java index e9f036ce24..f1c777bf7e 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationVo.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationVo.java @@ -39,8 +39,10 @@ public class BusVehicleInformationVo implements Vo { private Date recTime; // 接收时间 @ApiModelProperty("移交人") private String transferName; // 移交人 - @ApiModelProperty("备注信息") + @ApiModelProperty("接收备注") private String remarks; + @ApiModelProperty("移交备注") + private String transferRemarks; // 移交备注 @ApiModelProperty("剩余随车资料") private String vehicleHandoverData; //剩余随车资料 diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandover.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandover.java index a6736c96f9..3f8a15b159 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandover.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandover.java @@ -19,8 +19,8 @@ import java.util.Date; @TableName("bus_vehicle_information_handover") public class BusVehicleInformationHandover extends BaseEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("交接状态") - private Integer handoverState; // 交接状态 + @ApiModelProperty("完成状态 0未完成1已完成") + private Integer completeState; // 完成状态 @ApiModelProperty("移交状态key002待移交 001未移交 004已移交 003移交中") private String transferStateKey; @ApiModelProperty("移交状态") diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverDto.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverDto.java index 32bcf51ec5..cf9ee7e62d 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverDto.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverDto.java @@ -24,8 +24,8 @@ public class BusVehicleInformationHandoverDto implements Dto { private String transferStateKey; @ApiModelProperty("移交状态") private String transferStateValue; - @ApiModelProperty("交接状态") - private Integer handoverState; // 交接状态 + @ApiModelProperty("完成状态 0未完成1已完成") + private Integer completeState; // 完成状态 @ApiModelProperty("创建人sid") private String createBySid; // 创建人sid @ApiModelProperty("车架号") diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java index 7e9ea69574..6ad71552bf 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java @@ -34,9 +34,9 @@ public interface BusVehicleInformationHandoverFeign { @ApiOperation("交车准备中随车资料交接确认修改状态") - @PostMapping("/updateHandoverState") + @PostMapping("/updateCompleteState") @ResponseBody - public ResultBean updateHandoverState(@RequestBody BusVehicleInformationHandoverDto dto); + public ResultBean updateCompleteState(@RequestBody BusVehicleInformationHandoverDto dto); @ApiOperation("根据sid删除记录") diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeignFallback.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeignFallback.java index 877951c60f..397cea861f 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeignFallback.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeignFallback.java @@ -24,7 +24,7 @@ public class BusVehicleInformationHandoverFeignFallback implements BusVehicleInf } @Override - public ResultBean updateHandoverState(BusVehicleInformationHandoverDto dto) { + public ResultBean updateCompleteState(BusVehicleInformationHandoverDto dto) { return null; } diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverRest.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverRest.java index af4256875c..954e43e331 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverRest.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverRest.java @@ -40,8 +40,8 @@ public class BusVehicleInformationHandoverRest implements BusVehicleInformationH } @Override - public ResultBean updateHandoverState(BusVehicleInformationHandoverDto dto) { - return busVehicleInformationHandoverService.updateHandoverState(dto); + public ResultBean updateCompleteState(BusVehicleInformationHandoverDto dto) { + return busVehicleInformationHandoverService.updateCompleteState(dto); } @Override diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverService.java index 4bfa1cf06a..75a1095e4c 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverService.java @@ -19,6 +19,7 @@ import com.yxt.common.core.vo.PagerVo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -44,12 +45,14 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService saveOrUpdate(BusVehicleInformationHandoverDto dto) { - ResultBean rb = ResultBean.fireFail(); if (StringUtils.isNotBlank(dto.getSid())) { String sid = dto.getSid(); BusVehicleInformationHandover entity = fetchBySid(sid); BeanUtil.copyProperties(dto, entity, "id", "sid"); + //移交状态改为移交中 + entity.setTransferStateKey("003"); + entity.setTransferStateValue("移交中"); BusVehicleInformationDto informationDto = dto.getBusVehicleInformation(); //判断是不是一次交接还是二次 List informations = busVehicleInformationService.getByHandoverSid(sid); @@ -57,7 +60,7 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService updateHandoverState(BusVehicleInformationHandoverDto dto) { + public ResultBean updateCompleteState(BusVehicleInformationHandoverDto dto) { ResultBean rb = ResultBean.fireFail(); BusVehicleInformationHandover entity = fetchBySid(dto.getSid()); + entity.setTransferStateKey("004"); + entity.setTransferStateValue("已移交"); List informationList = busVehicleInformationService.getByHandoverSid(dto.getSid()); - BusVehicleInformationDto informationDto = dto.getBusVehicleInformation(); - if (null != informationList) { - for (BusVehicleInformation busVehicleInformation : informationList) { - if ("001".equals(busVehicleInformation.getHandoverNum())) { - if (informationList.size() < 2) { - if (null != informationDto) { - if (null != informationDto.getRecTime()) { - busVehicleInformation.setRecTime(informationDto.getRecTime()); - } - if (StringUtils.isNotBlank(informationDto.getTransferName())) { - busVehicleInformation.setTransferName(informationDto.getTransferName()); - } - busVehicleInformationService.updateById(busVehicleInformation); - } - } - if (busVehicleInformation.getVehicleKeyNum() < 1 - || busVehicleInformation.getCertificate() < 1 - || busVehicleInformation.getApplyForm() < 1 - || busVehicleInformation.getManual() < 1 - || busVehicleInformation.getEnvironmentalList() < 1 - || busVehicleInformation.getDirverCard() < 1 - ) { - entity.setHandoverState(1); - } else { - if (busVehicleInformation.getGasCertificate() < 1) { - if (busVehicleInformation.getIsFuelVehicle() == 0) { - entity.setHandoverState(2); - } else { - entity.setHandoverState(1); - } - } else { - entity.setHandoverState(2); - } - } - } - if ("002".equals(busVehicleInformation.getHandoverNum())) { - if (null != informationDto) { - if (null != informationDto.getRecTime()) { - busVehicleInformation.setRecTime(informationDto.getRecTime()); - } - if (StringUtils.isNotBlank(informationDto.getTransferName())) { - busVehicleInformation.setTransferName(informationDto.getTransferName()); - } - busVehicleInformationService.updateById(busVehicleInformation); - } - entity.setHandoverState(2); + if (entity.getCompleteState() == 0 && informationList.size() > 1) { + entity.setCompleteState(1); + } + if (null != dto.getBusVehicleInformation()) { + BusVehicleInformationDto informationDto = dto.getBusVehicleInformation(); + if (informationList.size() > 0) { + if (informationList.size() > 1) { + BusVehicleInformation information = busVehicleInformationService.selectByHandoverNumAndHandoverSid("002", dto.getSid()); + information.setRemarks(informationDto.getRemarks()); + information.setRecTime(informationDto.getRecTime()); + busVehicleInformationService.updateById(information); + } else { + BusVehicleInformation information = busVehicleInformationService.selectByHandoverNumAndHandoverSid("001", dto.getSid()); + information.setRemarks(informationDto.getRemarks()); + information.setRecTime(informationDto.getRecTime()); + busVehicleInformationService.updateById(information); } } + } baseMapper.updateById(entity); return rb.success().setData(dto.getSid());