JournalEntryImportController.java 3.23 KB
Newer Older
neo's avatar
neo committed
1 2
package pwc.taxtech.atms.controller;

3
import com.google.errorprone.annotations.FormatString;
neo's avatar
neo committed
4 5
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.http.MediaType;
neo's avatar
neo committed
7 8 9 10 11 12
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
13
import pwc.taxtech.atms.dto.vatdto.ImportVoucherDto;
neo's avatar
neo committed
14
import pwc.taxtech.atms.dto.vatdto.QueryJeDto;
15
import pwc.taxtech.atms.service.IdentityService;
16
import pwc.taxtech.atms.vat.service.impl.JournalEntryImportServiceImpl;
neo's avatar
neo committed
17 18 19 20 21 22

@RestController
@RequestMapping(value = "/api/v1/journalEntryImport")
public class JournalEntryImportController {

    @Autowired
23
    private JournalEntryImportServiceImpl journalEntryDataImportService;
24 25
    @Autowired
    private IdentityService identityService;
neo's avatar
neo committed
26 27 28 29

    @ApiOperation(value = "queryJournalEntryData", notes = "")
    @RequestMapping(value = "/queryJournalEntryData", method = RequestMethod.POST)
    public ResponseEntity queryJournalEntryData(@RequestBody QueryJeDto queryJeDto) {
30
        return ResponseEntity.ok(journalEntryDataImportService.qeryJournalEntryData(queryJeDto));
neo's avatar
neo committed
31
    }
neo's avatar
neo committed
32 33 34 35

    @ApiOperation(value = "getValidationInfo", notes = "")
    @RequestMapping(value = "getValidationInfo/{type}/{period}", method = RequestMethod.GET)
    public ResponseEntity getValidationInfo(@PathVariable Integer type, @PathVariable Integer period) {
36
        return ResponseEntity.ok(journalEntryDataImportService.getValidationInfoList(type, period));
neo's avatar
neo committed
37
    }
38

39
    @RequestMapping(value = "importJournalEntry", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
40 41 42 43 44 45
    public ResponseEntity ImportJournalEntryData(@RequestBody ImportVoucherDto importParam) {
        journalEntryDataImportService.ImportJournalEntryData(importParam.VoucherList, importParam.ImportType,
                identityService.getIdentityUser().getID());
        return ResponseEntity.ok().build();
    }

46
    @RequestMapping(value = "importAuditAdjust/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
47
    public ResponseEntity ImportAuditAdjust(@RequestBody ImportVoucherDto importParam, @PathVariable Integer period) {
48 49 50 51 52
        return ResponseEntity.ok().body(journalEntryDataImportService.ImportAuditAdjust(importParam.VoucherList,
                period, importParam.ImportType, identityService.getIdentityUser().getID()));
    }

    @RequestMapping(value = "getAuditAdjust/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
53
    public ResponseEntity GetAuditAdjust(@PathVariable Integer period) {
54 55 56 57 58 59 60 61 62
        return ResponseEntity.ok().body(journalEntryDataImportService.GetAuditAdjust(period));
    }


    @RequestMapping(value = "queryAuditAdjust", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseEntity QueryAuditAdjust(QueryJeDto queryDto) {
        return ResponseEntity.ok().body(journalEntryDataImportService.QueryAuditAdjust(queryDto));
    }

neo's avatar
neo committed
63 64
}