Browse Source

随车资料添加移交状态

master
fanzongzhe 2 years ago
parent
commit
bfba3f9929
  1. 3
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformation.java
  2. 4
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationDto.java
  3. 4
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformation/BusVehicleInformationVo.java
  4. 4
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandover.java
  5. 4
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverDto.java
  6. 4
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java
  7. 2
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeignFallback.java
  8. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverRest.java
  9. 96
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicleinformationhandover/BusVehicleInformationHandoverService.java

3
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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
@ -50,5 +49,7 @@ public class BusVehicleInformation extends BaseEntity {
private String transferName; // 移交人 private String transferName; // 移交人
@ApiModelProperty("剩余随车资料") @ApiModelProperty("剩余随车资料")
private String vehicleHandoverData; //剩余随车资料 private String vehicleHandoverData; //剩余随车资料
@ApiModelProperty("移交备注")
private String transferRemarks; // 移交备注
} }

4
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; package com.yxt.anrui.buscenter.api.busvehicleinformation;
import com.yxt.common.core.dto.Dto; import com.yxt.common.core.dto.Dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
@ -43,4 +41,6 @@ public class BusVehicleInformationDto implements Dto {
private String remarks; private String remarks;
@ApiModelProperty("随车资料") @ApiModelProperty("随车资料")
private String vehicleHandoverData; //剩余随车资料 private String vehicleHandoverData; //剩余随车资料
@ApiModelProperty("移交备注")
private String transferRemarks; // 移交备注
} }

4
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; // 接收时间 private Date recTime; // 接收时间
@ApiModelProperty("移交人") @ApiModelProperty("移交人")
private String transferName; // 移交人 private String transferName; // 移交人
@ApiModelProperty("备注信息") @ApiModelProperty("接收备注")
private String remarks; private String remarks;
@ApiModelProperty("移交备注")
private String transferRemarks; // 移交备注
@ApiModelProperty("剩余随车资料") @ApiModelProperty("剩余随车资料")
private String vehicleHandoverData; //剩余随车资料 private String vehicleHandoverData; //剩余随车资料

4
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") @TableName("bus_vehicle_information_handover")
public class BusVehicleInformationHandover extends BaseEntity { public class BusVehicleInformationHandover extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("交接状态") @ApiModelProperty("完成状态 0未完成1已完成")
private Integer handoverState; // 交接状态 private Integer completeState; // 完成状态
@ApiModelProperty("移交状态key002待移交 001未移交 004已移交 003移交中") @ApiModelProperty("移交状态key002待移交 001未移交 004已移交 003移交中")
private String transferStateKey; private String transferStateKey;
@ApiModelProperty("移交状态") @ApiModelProperty("移交状态")

4
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; private String transferStateKey;
@ApiModelProperty("移交状态") @ApiModelProperty("移交状态")
private String transferStateValue; private String transferStateValue;
@ApiModelProperty("交接状态") @ApiModelProperty("完成状态 0未完成1已完成")
private Integer handoverState; // 交接状态 private Integer completeState; // 完成状态
@ApiModelProperty("创建人sid") @ApiModelProperty("创建人sid")
private String createBySid; // 创建人sid private String createBySid; // 创建人sid
@ApiModelProperty("车架号") @ApiModelProperty("车架号")

4
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvehicleinformationhandover/BusVehicleInformationHandoverFeign.java

@ -34,9 +34,9 @@ public interface BusVehicleInformationHandoverFeign {
@ApiOperation("交车准备中随车资料交接确认修改状态") @ApiOperation("交车准备中随车资料交接确认修改状态")
@PostMapping("/updateHandoverState") @PostMapping("/updateCompleteState")
@ResponseBody @ResponseBody
public ResultBean<String> updateHandoverState(@RequestBody BusVehicleInformationHandoverDto dto); public ResultBean<String> updateCompleteState(@RequestBody BusVehicleInformationHandoverDto dto);
@ApiOperation("根据sid删除记录") @ApiOperation("根据sid删除记录")

2
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 @Override
public ResultBean<String> updateHandoverState(BusVehicleInformationHandoverDto dto) { public ResultBean<String> updateCompleteState(BusVehicleInformationHandoverDto dto) {
return null; return null;
} }

4
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 @Override
public ResultBean<String> updateHandoverState(BusVehicleInformationHandoverDto dto) { public ResultBean<String> updateCompleteState(BusVehicleInformationHandoverDto dto) {
return busVehicleInformationHandoverService.updateHandoverState(dto); return busVehicleInformationHandoverService.updateCompleteState(dto);
} }
@Override @Override

96
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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -44,12 +45,14 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
* @return * @return
*/ */
public ResultBean<String> saveOrUpdate(BusVehicleInformationHandoverDto dto) { public ResultBean<String> saveOrUpdate(BusVehicleInformationHandoverDto dto) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
if (StringUtils.isNotBlank(dto.getSid())) { if (StringUtils.isNotBlank(dto.getSid())) {
String sid = dto.getSid(); String sid = dto.getSid();
BusVehicleInformationHandover entity = fetchBySid(sid); BusVehicleInformationHandover entity = fetchBySid(sid);
BeanUtil.copyProperties(dto, entity, "id", "sid"); BeanUtil.copyProperties(dto, entity, "id", "sid");
//移交状态改为移交中
entity.setTransferStateKey("003");
entity.setTransferStateValue("移交中");
BusVehicleInformationDto informationDto = dto.getBusVehicleInformation(); BusVehicleInformationDto informationDto = dto.getBusVehicleInformation();
//判断是不是一次交接还是二次 //判断是不是一次交接还是二次
List<BusVehicleInformation> informations = busVehicleInformationService.getByHandoverSid(sid); List<BusVehicleInformation> informations = busVehicleInformationService.getByHandoverSid(sid);
@ -57,7 +60,7 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
for (BusVehicleInformation information : informations) { for (BusVehicleInformation information : informations) {
BusVehicleInformation twiceInformation = new BusVehicleInformation(); BusVehicleInformation twiceInformation = new BusVehicleInformation();
if ("001".equals(information.getHandoverNum())) { if ("001".equals(information.getHandoverNum())) {
BeanUtil.copyProperties(information, twiceInformation, "id", "sid", "recTime", "transferName", "remarks", "vehicleHandoverData"); BeanUtil.copyProperties(information, twiceInformation, "id", "sid", "recTime", "transferRemarks", "remarks", "vehicleHandoverData");
if (null != informationDto.getRecTime()) { if (null != informationDto.getRecTime()) {
twiceInformation.setRecTime(informationDto.getRecTime()); twiceInformation.setRecTime(informationDto.getRecTime());
} }
@ -75,7 +78,7 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
twiceInformation.setEnvironmentalList(1); twiceInformation.setEnvironmentalList(1);
twiceInformation.setDirverCard(1); twiceInformation.setDirverCard(1);
twiceInformation.setHandoverNum("002"); twiceInformation.setHandoverNum("002");
twiceInformation.setRemarks(informationDto.getRemarks()); twiceInformation.setTransferRemarks(informationDto.getTransferRemarks());
twiceInformation.setVehicleHandoverData(informationDto.getVehicleHandoverData()); twiceInformation.setVehicleHandoverData(informationDto.getVehicleHandoverData());
busVehicleInformationService.insert(twiceInformation); busVehicleInformationService.insert(twiceInformation);
} }
@ -85,7 +88,11 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
BusVehicleInformation newInformation = new BusVehicleInformation(); BusVehicleInformation newInformation = new BusVehicleInformation();
BeanUtil.copyProperties(informationDto, newInformation, "id", "sid"); BeanUtil.copyProperties(informationDto, newInformation, "id", "sid");
newInformation.setHandoverNum("001"); newInformation.setHandoverNum("001");
//接收人
newInformation.setRecName(dto.getRecName()); newInformation.setRecName(dto.getRecName());
//移交人
newInformation.setTransferName(informationDto.getTransferName());
newInformation.setTransferRemarks(informationDto.getTransferRemarks());
newInformation.setHandoverSid(sid); newInformation.setHandoverSid(sid);
if (null != fetchBySid(sid).getIsFuelVehicle()) { if (null != fetchBySid(sid).getIsFuelVehicle()) {
newInformation.setIsFuelVehicle(fetchBySid(sid).getIsFuelVehicle()); newInformation.setIsFuelVehicle(fetchBySid(sid).getIsFuelVehicle());
@ -140,22 +147,22 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
|| busVehicleInformation.getEnvironmentalList() < 1 || busVehicleInformation.getEnvironmentalList() < 1
|| busVehicleInformation.getDirverCard() < 1 || busVehicleInformation.getDirverCard() < 1
) { ) {
entity.setHandoverState(1); entity.setCompleteState(0);
} else { } else {
if (busVehicleInformation.getGasCertificate() < 1) { if (busVehicleInformation.getGasCertificate() < 1) {
if (busVehicleInformation.getIsFuelVehicle() == 0) { if (busVehicleInformation.getIsFuelVehicle() == 0) {
entity.setHandoverState(2); entity.setCompleteState(1);
} else { } else {
entity.setHandoverState(1); entity.setCompleteState(0);
} }
} else { } else {
entity.setHandoverState(2); entity.setCompleteState(0);
} }
} }
} }
if ("002".equals(busVehicleInformation.getHandoverNum())) { // if ("002".equals(busVehicleInformation.getHandoverNum())) {
entity.setHandoverState(2); // entity.setCompleteState(1);
} // }
} }
} }
baseMapper.updateById(entity); baseMapper.updateById(entity);
@ -175,6 +182,8 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
} }
} }
} }
entity.setTransferStateKey("002");
entity.setTransferStateValue("待移交");
baseMapper.insert(entity); baseMapper.insert(entity);
return rb.success().setData(entity.getSid()); return rb.success().setData(entity.getSid());
} }
@ -376,58 +385,31 @@ public class BusVehicleInformationHandoverService extends MybatisBaseService<Bus
* @param dto * @param dto
* @return * @return
*/ */
public ResultBean<String> updateHandoverState(BusVehicleInformationHandoverDto dto) { public ResultBean<String> updateCompleteState(BusVehicleInformationHandoverDto dto) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
BusVehicleInformationHandover entity = fetchBySid(dto.getSid()); BusVehicleInformationHandover entity = fetchBySid(dto.getSid());
entity.setTransferStateKey("004");
entity.setTransferStateValue("已移交");
List<BusVehicleInformation> informationList = busVehicleInformationService.getByHandoverSid(dto.getSid()); List<BusVehicleInformation> informationList = busVehicleInformationService.getByHandoverSid(dto.getSid());
BusVehicleInformationDto informationDto = dto.getBusVehicleInformation(); if (entity.getCompleteState() == 0 && informationList.size() > 1) {
if (null != informationList) { entity.setCompleteState(1);
for (BusVehicleInformation busVehicleInformation : informationList) { }
if ("001".equals(busVehicleInformation.getHandoverNum())) { if (null != dto.getBusVehicleInformation()) {
if (informationList.size() < 2) { BusVehicleInformationDto informationDto = dto.getBusVehicleInformation();
if (null != informationDto) { if (informationList.size() > 0) {
if (null != informationDto.getRecTime()) { if (informationList.size() > 1) {
busVehicleInformation.setRecTime(informationDto.getRecTime()); BusVehicleInformation information = busVehicleInformationService.selectByHandoverNumAndHandoverSid("002", dto.getSid());
} information.setRemarks(informationDto.getRemarks());
if (StringUtils.isNotBlank(informationDto.getTransferName())) { information.setRecTime(informationDto.getRecTime());
busVehicleInformation.setTransferName(informationDto.getTransferName()); busVehicleInformationService.updateById(information);
} } else {
busVehicleInformationService.updateById(busVehicleInformation); BusVehicleInformation information = busVehicleInformationService.selectByHandoverNumAndHandoverSid("001", dto.getSid());
} information.setRemarks(informationDto.getRemarks());
} information.setRecTime(informationDto.getRecTime());
if (busVehicleInformation.getVehicleKeyNum() < 1 busVehicleInformationService.updateById(information);
|| 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);
} }
} }
} }
baseMapper.updateById(entity); baseMapper.updateById(entity);
return rb.success().setData(dto.getSid()); return rb.success().setData(dto.getSid());

Loading…
Cancel
Save