Commit bec57933 authored by Ken you's avatar Ken you

add test ebs je api ---Ken

parent b9fcb4da
......@@ -8,7 +8,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import pwc.taxtech.atms.service.EbsApiService;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
......@@ -17,6 +19,8 @@ import java.util.List;
public class EbsApiController {
private static final Logger logger= LoggerFactory.getLogger(EbsApiController.class);
@Resource
private EbsApiService ebsApiService;
@RequestMapping(value = "/queryRemoteServerThenUpdateJE", method = RequestMethod.POST)
public ApiResultDto queryRemoteServerThenUpdateJE(@RequestBody List<JEqueryDto> items) {
......@@ -24,7 +28,8 @@ public class EbsApiController {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(queryRemoteServerThenUpdateJE(items));
ebsApiService.queryRemoteServerThenUpdateJE(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("queryRemoteServerThenUpdateJE error.", e);
}
......
package pwc.taxtech.atms.service.impl;
import org.junit.Test;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import pwc.taxtech.atms.service.EbsApiService;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class EbsApiServiceImplTest extends CommonIT {
@Resource
private EbsApiService ebsApiService;
@Resource
private DistributedIdService distributedIdService;
@Test
public void queryRemoteServerThenUpdateJE(){
List<JEqueryDto> items=new ArrayList<>();
for(int i=0;i<10;i++){
JEqueryDto jEqueryDto=new JEqueryDto();
jEqueryDto.setId(distributedIdService.nextId());
jEqueryDto.setOrganizationId("44250A49-F3EF-4A1E-89E0-165BB89A94D0");
jEqueryDto.setProjectId("44250A49-F3EF-4A1E-89E0-165BB89A94D0");
jEqueryDto.setDate(new Date());
jEqueryDto.setSource("这是哪里"+i);
jEqueryDto.setLedgerId("我关联谁"+i);
jEqueryDto.setLedgerName("我是谁"+i);
jEqueryDto.setCurrencyCode("123"+i);
jEqueryDto.setStatus("1");
jEqueryDto.setHeaderId("123456789");
jEqueryDto.setLineNum("1");
jEqueryDto.setApprovalStatus("1");
jEqueryDto.setPostedStatus("1");
jEqueryDto.setPeriod(0);
jEqueryDto.setAccountingDate(new Date());
jEqueryDto.setJournalSource("setJournalSource");
jEqueryDto.setCategory("setCategory");
jEqueryDto.setName("setName");
jEqueryDto.setVoucherNum("setVoucherNum");
jEqueryDto.setDescription("setDescription");
jEqueryDto.setSegment1("setSegment1");
jEqueryDto.setSegment2("setSegment2");
jEqueryDto.setSegment3("");
jEqueryDto.setSegment4("");
jEqueryDto.setSegment5("");
jEqueryDto.setSegment6("");
jEqueryDto.setSegment7("");
jEqueryDto.setSegment8("");
jEqueryDto.setSegment9("");
jEqueryDto.setSegment10("");
jEqueryDto.setSegment1Name("");
jEqueryDto.setSegment2Name("");
jEqueryDto.setSegment3Name("");
jEqueryDto.setSegment4Name("");
jEqueryDto.setSegment5Name("");
jEqueryDto.setSegment6Name("");
jEqueryDto.setSegment7Name("");
jEqueryDto.setSegment8Name("");
jEqueryDto.setSegment9Name("");
jEqueryDto.setSegment10Name("");
jEqueryDto.setJournalCurrencyCode("");
jEqueryDto.setSobCurrencyCode("");
jEqueryDto.setAccountedDr(new BigDecimal("0"));
jEqueryDto.setAccountedCr(new BigDecimal("0"));
jEqueryDto.setEnteredDr(new BigDecimal("0"));
jEqueryDto.setEnteredCr(new BigDecimal("0"));
jEqueryDto.setCfItem("");
jEqueryDto.setAttribute1("");
jEqueryDto.setAttribute2(new Date());
jEqueryDto.setAttribute3("");
jEqueryDto.setAttribute4("");
jEqueryDto.setAttribute5("");
jEqueryDto.setAttribute6("");
jEqueryDto.setAttribute7("");
jEqueryDto.setAttribute8("");
jEqueryDto.setAttribute9("");
jEqueryDto.setAttribute10("");
jEqueryDto.setAttribute11("");
jEqueryDto.setAttribute12("");
jEqueryDto.setAttribute13("");
jEqueryDto.setAttribute14("");
jEqueryDto.setAttribute15("");
jEqueryDto.setAttribute16("");
items.add(jEqueryDto);
}
ebsApiService.queryRemoteServerThenUpdateJE(items);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment