kongdeqiang
2023-06-05 957fe0a4eda7e4616d91d0b8939901bff6366542
修改
4个文件已修改
31 ■■■■■ 已修改文件
src/main/java/com/boying/controller/phone/YCPayController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/entity/OrderRecord.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/service/EnterParkService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/service/impl/EnterParkServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -40,6 +40,7 @@
    private final TicketBlackService ticketBlackService;
    private final SystemConfigProperties systemConfigProperties;
    private final WhiteListService whiteListService;
    private final EnterParkService enterParkService;
    /**
     * 查询订单接口
@@ -261,6 +262,13 @@
        orderRecord.setTicketStatus(0);
        orderRecord.setPayCode(outPark.getPayCode());
        orderRecordService.saveOrUpdate(orderRecord);
        if(outPark.getImgId() != null){
            orderRecord.setImgOutId(outPark.getImgId());
        }
        EnterPark enterPark = enterParkService.getByCarNoAndDate(outPark.getCarNo(), outPark.getParkId(), outPark.getEnterTime());
        if(enterPark != null && enterPark.getImgId() != null){
            orderRecord.setImgInId(enterPark.getImgId());
        }
    }
    //插入执法订单记录
src/main/java/com/boying/entity/OrderRecord.java
@@ -107,12 +107,12 @@
    //图片id
    @ApiModelProperty(value = "入场图片id")
    @Column(columnDefinition = "int comment '入场图片id'")
    private Long imgInId;
    private Integer imgInId;
    //图片id
    @ApiModelProperty(value = "出场图片id")
    @Column(columnDefinition = "int comment '出场图片id'")
    private Long imgOutId;
    private Integer imgOutId;
    @Transient
    @TableField(exist = false)
src/main/java/com/boying/service/EnterParkService.java
@@ -4,6 +4,7 @@
import com.boying.entity.EnterPark;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -23,4 +24,6 @@
    List<EnterPark> findByCarNo(String carNo,Integer parkId);
    @Transactional(readOnly = false)
    void deleteByCarNo(String carNo,Integer parkId);
    EnterPark getByCarNoAndDate(String carNo, Integer parkId, LocalDateTime dateTime);
}
src/main/java/com/boying/service/impl/EnterParkServiceImpl.java
@@ -12,6 +12,7 @@
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@@ -64,4 +65,19 @@
        enterParkMapper.delete(wrapper);
    }
    @Override
    public EnterPark getByCarNoAndDate(String carNo, Integer parkId, LocalDateTime dateTime) {
        QueryWrapper<EnterPark> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(EnterPark::getCarNo,carNo)
                .eq(EnterPark::getParkId,parkId)
                .eq(EnterPark::getCreateTime,dateTime);
        List<EnterPark> enterParks = enterParkMapper.selectList(wrapper);
        if(enterParks.size()>0){
            return enterParks.get(0);
        }else {
            return null;
        }
    }
}