package com.unis.base.app.controller;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.unis.base.client.MedicineInfoHisFeign;
import com.unis.base.common.vo.DYpxxHisVO;
import com.unis.base.common.vo.DYpxxQueryHisVO;
import com.unis.common.utils.ResponseWrapper;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 张琪
 * @date 2019年9月22日 下午3:49:46
 * @description 
 */
@RestController
@Slf4j
@Api(value = "药剂日志信息",tags = "药剂信息日志查询")
public class MedicineInfoHisController {
	@Autowired
	private MedicineInfoHisFeign medicineInfoHisFeign;
	
	/**
	 * 分页信息
	 * @param pageNum
	 * @param pageSize
	 * @param dYpxxQueryHisVO
	 * @return
	 */
	@ApiOperation(value = "药剂信息历史记录列表 根据条件【分页查询】",notes = "参数：方案编号/作业单编号")
	@PostMapping(value = "/medicineinfoHisPageList/{pageNum}/{pageSize}")
	public ResponseWrapper getMedicineinfoHisList(@PathVariable(value = "pageNum") Integer pageNum,
			  @PathVariable(value = "pageSize") Integer pageSize,@RequestBody DYpxxQueryHisVO dYpxxQueryHisVO) {
		return medicineInfoHisFeign.getMedicineinfoHisList(pageNum, pageSize, dYpxxQueryHisVO);
	}
	
	/**
	 * @author 张琪
	 * @Description 根据主键ID获取药剂信息历史信息
	 * @return 药剂信息信息
	 */
	@ApiOperation(value = "根据主键编码获取药剂信息历史信息", notes = "参数：主键ID")
	@GetMapping(value = "/medicineinfoHisInfo/{lsId}")
	public ResponseWrapper getMedicineinfoHisInfoByLsId(@PathVariable("lsId")String lsId) {
		return medicineInfoHisFeign.getMedicineinfoHisInfoByLsId(lsId);
	}
	
	/**
	 * @author 张琪
	 * @Description 新增药剂日志信息
	 * @param 药剂信息信息对象 models
	 * @return 新增状态
	 */
	@ApiOperation(value = "新增药剂日志信息", notes = "参数：备案类型【0_未备案，1_待提交，2_待审核，3_已驳回，4_已备案】")
	@PostMapping(value = "/medicineinfoHisInfoSave")
    public ResponseWrapper insert(@RequestBody DYpxxHisVO dYpxxHisVO) {
		return medicineInfoHisFeign.insert(dYpxxHisVO);
	}
}
