VehicleServiceTest.java 8.65 KB
package cn.com.glsx.stdinterface.modules.service;

import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.dto.VehicleDto;
import cn.com.glsx.stdinterface.dto.WorkOrderAddrVerifyDTO;
import cn.com.glsx.stdinterface.modules.entity.Vehicle;
import cn.com.glsx.stdinterface.modules.model.AddrVerifyBatchBo;
import cn.com.glsx.stdinterface.modules.model.AddrVerifyBatchDTO;
import cn.com.glsx.stdinterface.modules.model.XBAddrVerifyBo;
import cn.com.glsx.stdinterface.modules.model.XBAddrVerifyDTO;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class VehicleServiceTest {

    @Autowired
    private VehicleService vehicleService;

    @Test
    public void testddd() {
        String sn = "1190909618";
        Vehicle vehicle = vehicleService.getVehicleInfoBySn(sn);
        if (vehicle != null) {
            VehicleDto vehicleDto = new VehicleDto();
            vehicleDto.setId(vehicle.getId());
            vehicleDto.setVin(vehicle.getVin());
            vehicleDto.setCreateBy(vehicle.getCreatedBy());
            vehicleDto.setCreateDate((vehicle.getCreatedDate() != null) ? DateUtil.format(vehicle.getCreatedDate(), "yyyy-MM-dd HH:mm:ss") : "");
            System.out.println("==" + JSONObject.toJSONString(vehicleDto));
        }
        System.out.println("end");
    }

    @Test
    public void testGetVdId() {
        Long vdId = vehicleService.getVdId("1510112899");
        System.out.println(vdId);

    }

    @Test
    public void test() {
        XBAddrVerifyBo verifyBO = new XBAddrVerifyBo();
        verifyBO.setSn("93107720006");
        verifyBO.setOrderSource("仲利国际");
        XBAddrVerifyDTO verifyDTO = vehicleService.addrVerifyByXB(verifyBO);
        System.out.println("verifyDTO = " + JSONUtil.toJsonStr(verifyDTO));
    }

    @Test
    public void testAddrVerifyBatch() {
        AddrVerifyBatchBo addrVerifyBatchBo = new AddrVerifyBatchBo();
        addrVerifyBatchBo.setSnList(Lists.newArrayList("2691212734", "1570731232", "1570921355", "1570915965", "1570921461", "4711014006",
                "4711014013",
                "4711014037",
                "4711014065",
                "4711014057",
                "4711014029",
                "4711014096",
                "4711014010",
                "4711014008",
                "4711014093",
                "4711014036",
                "4711014034",
                "4711014022",
                "4711014032",
                "4711014094",
                "4711014069",
                "4711014012",
                "4711014098",
                "4711014081",
                "4711014015",
                "4711014024",
                "4711014086",
                "4711014062",
                "4711014085",
                "4711014025",
                "4711014091",
                "4711014020",
                "4711014063",
                "4711014033",
                "4711014028",
                "4711014071",
                "4711014095",
                "4711014001",
                "4711014054",
                "4711014044",
                "4711014017",
                "4711014049",
                "4711014055",
                "4711014002",
                "4711014007",
                "4711014064",
                "4711014074",
                "4711014027",
                "4711014048",
                "4711014087",
                "4711014068",
                "4711014076",
                "4711014097",
                "4711014004",
                "4711014070",
                "4711014100",
                "4711014067",
                "4711014058",
                "4711014043",
                "4711014038",
                "4711014077",
                "4711014014",
                "4711014080",
                "4711014040",
                "4711014084",
                "4711014011",
                "4711014059",
                "4711014053",
                "4711014082",
                "4711014009",
                "4711014083",
                "4711014005",
                "4711014051",
                "4711014092",
                "4711014089",
                "4711014021",
                "4711014075",
                "4711014042",
                "4711014079",
                "4711014066",
                "4711014088",
                "4711014072",
                "4711014030",
                "4711014052",
                "4711014019",
                "4711014031",
                "4711014026",
                "4711014016",
                "4711014041",
                "4711014045",
                "4711014050",
                "4711014060",
                "4711014056",
                "4711014035",
                "4711014046",
                "4711014047",
                "1510927176",
                "75111051090",
                "1510928296",
                "75111240208",
                "1511012663",
                "75111240862",
                "75201050986",
                "75111241929",
                "45111120326",
                "45111120452",
                "45111120466",
                "1511012660",
                "75111240852",
                "1510115677",
                "75201160550",
                "1510112585",
                "75111051100",
                "1510115673",
                "75201160551",
                "1510927166",
                "75111051081",
                "1510927189",
                "75111051086",
                "75111240204",
                "75111241544",
                "1511224181",
                "1610520319",
                "45203070553",
                "1510927193",
                "75111051097",
                "15111090754",
                "45203070935",
                "15111090757",
                "45203070942",
                "93107720006",
                "2192801101",
                "1570921355",
                "1570915965",
                "2691212734",
                "1570731232",
                "3010006003",
                "3010006004",
                "3010006005",
                "1591113211",
                "2691113936",
                "1510112899",
                "1700000001",
                "1610507001",
                "3010005933 ",
                "75111051416",
                "1610127312",
                "1610127300",
                "1610127297",
                "1610127307",
                "1610127299",
                "1610127306",
                "1610127303",
                "1610127301",
                "1610127298",
                "75108032084",
                "75108032085",
                "75108032075",
                "75111240322",
                "75111241284",
                "45111120391",
                "1611012312",
                "1611012313",
                "2601204222",
                "2601025417",
                "2601204204",
                "1610111616",
                "1610111624",
                "1610111618",
                "1610111619",
                "1610111615",
                "2600628225",
                "2600628223",
                "2600628222",
                "2600628228",
                "2600628224",
                "2600628221",
                "1610525087",
                "2601025374",
                "2601025381",
                "2601025400",
                "1610113004",
                "1610108136",
                "1610113259",
                "1610113270",
                "1610113262",
                "1610108146",
                "1610108192",
                "1610125392",
                "1610125393",
                "1610125403",
                "1610125401",
                "1610125388",
                "1610125394",
                "1610701065",
                "1610701050",
                "1610701225",
                "1610701066",
                "1610701220",
                "1610701070",
                "1610701223",
                "75108030030",
                "75111240485",
                "75111240484",
                "2601023676"));
        addrVerifyBatchBo.setOrderSource("仲利国际");
        List<AddrVerifyBatchDTO> verifyBatchDTOList = vehicleService.addrVerifyBatch(addrVerifyBatchBo);
        System.out.println("verifyBatchDTOList = " + JSONUtil.toJsonStr(verifyBatchDTOList));
    }


}