package com.unis.base.app.controller;

import com.unis.base.client.MedicineInfoFeign;
import com.unis.base.common.vo.ClhxyjbgtzVO;
import com.unis.base.common.vo.DYpxxQueryVO;
import com.unis.base.common.vo.FqwxhxpcszclyclqkbVO;
import com.unis.base.common.vo.KdBaseInfoVO;
import com.unis.base.common.vo.WxhxphjglpcjbbVO;
import com.unis.common.utils.ResponseWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 张琪
 * @date 2019年9月22日 下午3:43:34
 * @description 药剂信息
 */
@RestController
@Api(value = "药剂信息 ", tags = "药剂信息 维护")
@Slf4j
public class MedicineInfoController {
	@Autowired
	private MedicineInfoFeign  medicineInfoFeign;
	/**
	 * 分页获取药剂信息列表
	 * @param dYpxxQueryVO
	 * @param page
	 * @param limit
	 * @return
	 * @Param: 所属库名，药剂名称，月份
	 * @return 药剂信息列表
     */
   @PostMapping("/findDYpxxList/{pageNum}/{pageSize}")
   @ApiOperation(value = "分页获取药剂信息列表",notes = "参数：所属库名，药剂名称，月份")
   public ResponseWrapper findDYpxxList(@RequestBody DYpxxQueryVO dYpxxQueryVO,
   		@PathVariable(value = "pageNum") Integer pageNum, @PathVariable(value = "pageSize") Integer pageSize) {
		return medicineInfoFeign.findDYpxxList(dYpxxQueryVO, pageNum, pageSize);
    }

//    /**
//	 * 药剂信息信息-更改备案状态
//	 * @param tyXzzyxxVO
//	 * @return
//	 */
//	@PostMapping(value = "/medicineinfoStatus")
//	@ApiOperation(value = "药剂信息信息-更改备案状态", notes = "参数：备案信息")
//	public ResponseWrapper updateMedicineinfoStatus(@RequestBody DYpxxHisVO dYpxxHisVO) {
//		return medicineInfoFeign.updateMedicineinfoStatus(dYpxxHisVO);
//	}
//
	/**
	 * @author 张琪
	 * @Description 根据主键ID获取药剂信息
	 * @return 药剂信息信息
	 */
	@ApiOperation(value = "根据主键编码获取药剂信息", notes = "参数：主键ID")
	@GetMapping(value = "/medicineinfoInfo/{ypId}")
	public ResponseWrapper getMedicineinfoInfoByLsId(@PathVariable("ypId")String ypId) {
		return medicineInfoFeign.getMedicineinfoInfoByLsId(ypId);
	}

	@ApiOperation(value = "查询报表list，分页", notes = "参数：企业库点名称，时间模糊查询、当前页、页面大小")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "page", value = "起始页", required = true),
			@ApiImplicitParam(name = "size", value = "每页展示行数", required = true)})
	@PostMapping(value = "/reportsInfo")
	public ResponseWrapper findReportsInfoList(@RequestBody KdBaseInfoVO VO,
											   Integer page,
											   Integer size) throws Exception {
		return medicineInfoFeign.findReportsInfoList(VO, page, size);
	}

	@ApiOperation(value = "根据库点id查询储量化学药剂保管台账信息", notes = "参数：储量化学药剂保管台账库点id")
	@GetMapping(value = "/clhxyjbgtz/{id}/")
	public ResponseWrapper findClhxyjbgtzByKddm(@PathVariable("id") String id) throws Exception {
		return medicineInfoFeign.findClhxyjbgtzByKddm(id);
	}

	@ApiOperation(value = "根据库点id查询废弃危险化学品产生、贮存、利用处置情况表信息", notes = "参数：废弃危险化学品产生、贮存、利用处置情况表库点id")
	@GetMapping(value = "/fqwxhxpcszclyclqkb/{id}/")
	public ResponseWrapper findFqwxhxpcszclyclqkbByKddm(@PathVariable("id") String id) throws Exception {
		return medicineInfoFeign.findFqwxhxpcszclyclqkbByKddm(id);
	}

	@ApiOperation(value = "根据库点id查询危险化学品环境管理排查基本表信息", notes = "参数：危险化学品环境管理排查基本表信息库点id")
	@GetMapping(value = "/wxhxphjglpcjbbByKdmc/{id}/")
	public ResponseWrapper findWxhxphjglpcjbbVOBykdmc(@PathVariable("id") String id) throws Exception {
		return medicineInfoFeign.findWxhxphjglpcjbbVOBykdmc(id);
	}

	@ApiOperation(value = "根据库点代码和时间查询危险化学品环境管理排查基本表信息", notes = "参数：危险化学品环境管理排查基本表信息库点代码和时间")
	@PostMapping(value = "/wxhxphjglpcjbbApp/")
	public ResponseWrapper findWxhxphjglpcjbbVOApp(@RequestBody KdBaseInfoVO VO) throws Exception {
		return medicineInfoFeign.findWxhxphjglpcjbbVOApp(VO);
	}
}
