药品、处方列表关联药房信息
This commit is contained in:
@@ -283,6 +283,8 @@ type OrderProductData struct {
|
||||
City string // 城市
|
||||
County string // 区县
|
||||
Address string // 详细地址
|
||||
PharmacyName string // 发货药房
|
||||
PharmacyCode string // 药房代码
|
||||
}
|
||||
|
||||
// OrderProductItemData 药品订单-药品列表
|
||||
@@ -346,6 +348,8 @@ type OrderPrescriptionData struct {
|
||||
PatientMobile string // 患者电话
|
||||
DoctorAdvice string // 医嘱
|
||||
OrderPrescriptionIcd string // 处方诊断疾病
|
||||
PharmacyName string // 开方药房
|
||||
PharmacyCode string // 药房代码
|
||||
CreatedAt string // 创建时间
|
||||
}
|
||||
|
||||
@@ -1497,6 +1501,8 @@ func (r *ExportService) OrderInquiry(d []*model.OrderInquiry) (string, error) {
|
||||
func (r *ExportService) OrderProduct(d []*model.OrderProduct) (string, error) {
|
||||
header := []utils.HeaderCellData{
|
||||
{Value: "系统订单编号", CellType: "string", NumberFmt: "", ColWidth: 25, Colour: "#FFD700"},
|
||||
{Value: "发货药房", CellType: "string", NumberFmt: "", ColWidth: 25, Colour: "#FFD700"},
|
||||
{Value: "药房代码", CellType: "string", NumberFmt: "", ColWidth: 18, Colour: "#FFD700"},
|
||||
{Value: "订单状态", CellType: "string", NumberFmt: "", ColWidth: 18, Colour: "#FFD700"},
|
||||
{Value: "订单金额", CellType: "float64", NumberFmt: "0.0000", ColWidth: 18, Colour: "#FFD700"},
|
||||
{Value: "优惠卷总金额", CellType: "float64", NumberFmt: "0.0000", ColWidth: 18, Colour: "#FFD700"},
|
||||
@@ -1545,9 +1551,22 @@ func (r *ExportService) OrderProduct(d []*model.OrderProduct) (string, error) {
|
||||
|
||||
var dataSlice []interface{}
|
||||
for _, v := range d {
|
||||
pharmacyName := v.PharmacyName
|
||||
pharmacyCode := v.PharmacyCode
|
||||
if v.Pharmacy != nil {
|
||||
if pharmacyName == "" {
|
||||
pharmacyName = v.Pharmacy.PharmacyName
|
||||
}
|
||||
if pharmacyCode == "" {
|
||||
pharmacyCode = v.Pharmacy.PharmacyCode
|
||||
}
|
||||
}
|
||||
|
||||
data := OrderProductData{
|
||||
OrderProductNo: v.OrderProductNo,
|
||||
EscrowTradeNo: v.EscrowTradeNo,
|
||||
PharmacyName: pharmacyName,
|
||||
PharmacyCode: pharmacyCode,
|
||||
OrderProductStatus: utils.OrderProductStatusToString(v.OrderProductStatus),
|
||||
PayChannel: utils.PayChannelToString(v.PayChannel),
|
||||
PayStatus: utils.PayStatusToString(v.PayStatus),
|
||||
@@ -1789,6 +1808,8 @@ func (r *ExportService) OrderServicePackage(d []*model.OrderServicePackage) (str
|
||||
// OrderPrescription 处方
|
||||
func (r *ExportService) OrderPrescription(d []*model.OrderPrescription) (string, error) {
|
||||
header := []utils.HeaderCellData{
|
||||
{Value: "开方药房", CellType: "string", NumberFmt: "", ColWidth: 25},
|
||||
{Value: "药房代码", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
{Value: "医生姓名", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
{Value: "药师姓名", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
{Value: "处方状态", CellType: "string", NumberFmt: "", ColWidth: 18},
|
||||
@@ -1815,7 +1836,20 @@ func (r *ExportService) OrderPrescription(d []*model.OrderPrescription) (string,
|
||||
|
||||
var dataSlice []interface{}
|
||||
for _, v := range d {
|
||||
pharmacyName := v.PharmacyName
|
||||
pharmacyCode := v.PharmacyCode
|
||||
if v.Pharmacy != nil {
|
||||
if pharmacyName == "" {
|
||||
pharmacyName = v.Pharmacy.PharmacyName
|
||||
}
|
||||
if pharmacyCode == "" {
|
||||
pharmacyCode = v.Pharmacy.PharmacyCode
|
||||
}
|
||||
}
|
||||
|
||||
data := OrderPrescriptionData{
|
||||
PharmacyName: pharmacyName,
|
||||
PharmacyCode: pharmacyCode,
|
||||
PrescriptionStatus: utils.PrescriptionStatusToString(v.PrescriptionStatus),
|
||||
PharmacistAuditStatus: utils.PharmacistAuditStatusToString(v.PharmacistAuditStatus),
|
||||
PharmacistFailReason: v.PharmacistFailReason,
|
||||
|
||||
@@ -247,9 +247,15 @@ func (r *OrderService) ReportPreProduct(orderProductId, adminUserId int64) (bool
|
||||
|
||||
presRequests[0] = presRequest
|
||||
|
||||
// 终端代码:优先使用订单关联药房的代码,未配置则使用全局配置
|
||||
terminalCode := config.C.Pre.PrePlatTerminalCode
|
||||
if orderProduct.PharmacyCode != "" {
|
||||
terminalCode = orderProduct.PharmacyCode
|
||||
}
|
||||
|
||||
// 处理上传数据-基础数据
|
||||
ReportPreRequest := prescription.ReportPreRequest{
|
||||
TerminalCode: config.C.Pre.PrePlatTerminalCode,
|
||||
TerminalCode: terminalCode,
|
||||
OrderNo: orderProduct.OrderProductNo, // 订单编号
|
||||
TransactNo: orderProduct.EscrowTradeNo, // 流水单号
|
||||
PayDate: time.Time(orderProduct.PayTime).Format("2006-01-02 15:04:05"), // 支付时间
|
||||
|
||||
Reference in New Issue
Block a user