处方-导出
This commit is contained in:
@@ -357,3 +357,37 @@ func (r *Export) OrderProduct(c *gin.Context) {
|
||||
|
||||
responses.OkWithData(ossAddress, c)
|
||||
}
|
||||
|
||||
// OrderPrescription 处方
|
||||
func (r *Export) OrderPrescription(c *gin.Context) {
|
||||
orderPrescriptionRequest := requests.OrderPrescriptionRequest{}
|
||||
req := orderPrescriptionRequest.OrderPrescriptionExportList
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 参数验证
|
||||
if err := global.Validate.Struct(req); err != nil {
|
||||
responses.FailWithMessage(utils.Translate(err), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
orderPrescriptionDao := dao.OrderPrescriptionDao{}
|
||||
orderPrescriptions, err := orderPrescriptionDao.GetOrderPrescriptionExportListSearch(req)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
// 业务处理
|
||||
exportService := service.ExportService{}
|
||||
ossAddress, err := exportService.OrderPrescription(orderPrescriptions)
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.OkWithData(ossAddress, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user