|
@@ -1109,7 +1109,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1109
|
1109
|
return
|
1110
|
1110
|
}
|
1111
|
1111
|
|
1112
|
|
- if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
|
|
1112
|
+ if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 || adminInfo.CurrentOrgId == 9671 {
|
1113
|
1113
|
if prescribing_number > batch_number_all_count {
|
1114
|
1114
|
c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
|
1115
|
1115
|
return
|
|
@@ -1126,7 +1126,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1126
|
1126
|
c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
1127
|
1127
|
return
|
1128
|
1128
|
}
|
1129
|
|
- if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
|
|
1129
|
+ if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 || adminInfo.CurrentOrgId == 9671 {
|
1130
|
1130
|
if num > batch_number_all_count {
|
1131
|
1131
|
c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
|
1132
|
1132
|
return
|
|
@@ -1195,7 +1195,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1195
|
1195
|
c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
1196
|
1196
|
return
|
1197
|
1197
|
}
|
1198
|
|
- if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
|
|
1198
|
+ if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 || adminInfo.CurrentOrgId == 9671 {
|
1199
|
1199
|
if prescribing_number > batch_number_all_count {
|
1200
|
1200
|
c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
|
1201
|
1201
|
return
|
|
@@ -1213,7 +1213,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1213
|
1213
|
c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
1214
|
1214
|
return
|
1215
|
1215
|
}
|
1216
|
|
- if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
|
|
1216
|
+ if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 || adminInfo.CurrentOrgId == 9671 {
|
1217
|
1217
|
if prescribing_number > batch_number_all_count {
|
1218
|
1218
|
c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
|
1219
|
1219
|
return
|
|
@@ -1269,7 +1269,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1269
|
1269
|
c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(info.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(info.StockMinNumber, 10) + drug.MinUnit)
|
1270
|
1270
|
return
|
1271
|
1271
|
}
|
1272
|
|
- if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 {
|
|
1272
|
+ if adminInfo.CurrentOrgId == 10215 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 3877 || adminInfo.CurrentOrgId == 9671 {
|
1273
|
1273
|
// 查询该药品最后一次出库记录
|
1274
|
1274
|
outInfo, _ := service.GetLastDrugWarehouseOutByDrugIdTwenty(drug_id, patient_id, recordDateTime, adviceId)
|
1275
|
1275
|
|
|
@@ -1990,6 +1990,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
1990
|
1990
|
projects := items["project"].([]interface{})
|
1991
|
1991
|
if len(projects) > 0 {
|
1992
|
1992
|
for _, project := range projects {
|
|
1993
|
+
|
1993
|
1994
|
var p models.HisPrescriptionProject
|
1994
|
1995
|
p.PrescriptionId = tempPrescription.ID
|
1995
|
1996
|
p.Ctime = time.Now().Unix()
|
|
@@ -2001,13 +2002,20 @@ func (c *HisApiController) CreateHisPrescription() {
|
2001
|
2002
|
p.HisPatientId = his_patient_id
|
2002
|
2003
|
p.Status = 1
|
2003
|
2004
|
p.StartTime = pTime
|
2004
|
|
- p.IsOut = 2
|
|
2005
|
+
|
2005
|
2006
|
errcode := c.setProjectWithJSON(&p, project.(map[string]interface{}))
|
2006
|
2007
|
if errcode > 0 {
|
2007
|
2008
|
c.ServeFailJSONWithSGJErrorCode(errcode)
|
2008
|
2009
|
return
|
2009
|
2010
|
}
|
2010
|
|
-
|
|
2011
|
+ fmt.Println("projext22222222222222", p.ID)
|
|
2012
|
+ if p.ID == 0 {
|
|
2013
|
+ p.IsOut = 2
|
|
2014
|
+ }
|
|
2015
|
+ if p.ID > 0 {
|
|
2016
|
+ projectDetail, _ := service.GetHisPrescriptonProjectById(p.ID)
|
|
2017
|
+ p.IsOut = projectDetail.IsOut
|
|
2018
|
+ }
|
2011
|
2019
|
service.CreateHisProjectTwo(&p)
|
2012
|
2020
|
projectList = append(projectList, p)
|
2013
|
2021
|
var randNum int
|
|
@@ -2640,7 +2648,7 @@ func (c *HisApiController) DeletePrescription() {
|
2640
|
2648
|
service.CreateStockFlowOne(flow)
|
2641
|
2649
|
|
2642
|
2650
|
//查询已出库数量
|
2643
|
|
- dialysisInfo, _ := service.GetGoodDialysisOutInfo(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.SysRecordTime, item.ProjectId)
|
|
2651
|
+ dialysisInfo, _ := service.GetGoodDialysisOutInfoSix(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.SysRecordTime, item.ProjectId)
|
2644
|
2652
|
|
2645
|
2653
|
if prescribingNumber < dialysisInfo.Count {
|
2646
|
2654
|
//改变数量
|
|
@@ -3034,13 +3042,14 @@ func (c *HisApiController) DeleteProject() {
|
3034
|
3042
|
service.CreateStockFlowOne(flow)
|
3035
|
3043
|
|
3036
|
3044
|
//查询已出库数量
|
3037
|
|
- dialysisInfo, _ := service.GetGoodDialysisOutInfo(adminInfo.CurrentOrgId, info.PatientId, info.SysRecordTime, project.ProjectId)
|
|
3045
|
+ dialysisInfo, _ := service.GetGoodDialysisOutInfoSix(adminInfo.CurrentOrgId, info.PatientId, info.SysRecordTime, project.ProjectId)
|
3038
|
3046
|
|
3039
|
3047
|
if prescribingNumber < dialysisInfo.Count {
|
3040
|
3048
|
//改变数量
|
3041
|
3049
|
service.UpdateAutoGood(adminInfo.CurrentOrgId, info.PatientId, info.SysRecordTime, project.ProjectId, id, prescribingNumber)
|
3042
|
3050
|
}
|
3043
|
|
-
|
|
3051
|
+ fmt.Println("prescribingNumber", prescribingNumber)
|
|
3052
|
+ fmt.Println("Count2332333223qw", dialysisInfo.Count)
|
3044
|
3053
|
if prescribingNumber == dialysisInfo.Count {
|
3045
|
3054
|
//删除出库表
|
3046
|
3055
|
service.DeleteAutoRedeceDetailTen(adminInfo.CurrentOrgId, info.PatientId, info.SysRecordTime, project.ProjectId)
|