package com.prolog.rdc.tms.controller.basicConfigure.xlsimport;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.product.core.framework.controller.BaseController;
import com.prolog.rdc.tms.model.dto.basicConfigure.ImportStdFeildQueryDTO;
import com.prolog.rdc.tms.service.basicConfigure.ImportStdFeildService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 
 *
 * 基础配置-标准模板详情控制层
 *
 * @className :SysImportStdFeildController
 * @author :fanzw
 * @creationTime :2022/06/21
 * @description :
 *
 * @modifier :fanzw
 * @modifyTime :2022/06/21
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
@RestController
@Api(tags = "基础配置-标准模板详情")
@RequestMapping("/sysimport/stdfeild")
public class ImportStdFeildController extends BaseController {

	@Autowired
	private ImportStdFeildService importStdFeildService;

	@UserLog("标准模板列查询")
	@ApiOperation(value = "标准模板列查询", notes = "标准模板列查询")
	@GetMapping(value = "/list/{importObjNo}")
	public RestMessage<List<ImportStdFeildQueryDTO>> list(@ApiParam(value = "importObjNo", name = "导入对象编码") @PathVariable(value = "importObjNo") String importObjNo) throws Exception {
		List<ImportStdFeildQueryDTO> list = importStdFeildService.list(importObjNo);
		return RestMessage.newInstance(true, "查询成功", list);
	}

	@GetMapping(value = "/generate/{importObjNo}")
	public RestMessage<String> generate(@PathVariable("importObjNo") String importObjNo) throws Exception {
		importStdFeildService.generate(importObjNo);
		return RestMessage.newInstance(true, "查询成功", null);
	}
}
