|
@@ -897,6 +897,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
897
|
897
|
project_name = project.(map[string]interface{})["project_name"].(string)
|
898
|
898
|
|
899
|
899
|
}
|
|
900
|
+ fmt.Println("id3232322332232323323223322323", id)
|
900
|
901
|
if project_type == 3 {
|
901
|
902
|
|
902
|
903
|
//查找该耗材的出库记录
|
|
@@ -905,6 +906,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
905
|
906
|
//for _, it := range goodWarehouseInfo {
|
906
|
907
|
// total_count += it.Count
|
907
|
908
|
//}
|
|
909
|
+
|
908
|
910
|
if len(goodWarehouseInfo) == 0 {
|
909
|
911
|
//查询耗材库存
|
910
|
912
|
list, _ := service.GetGoodWarehouseInfoSeven(project_id)
|
|
@@ -918,11 +920,22 @@ func (c *HisApiController) CreateHisPrescription() {
|
918
|
920
|
c.ServeDynamicFailJsonSend(project_name + "库存不足")
|
919
|
921
|
return
|
920
|
922
|
}
|
|
923
|
+ //查找今日该患者已经出库的所有耗材
|
|
924
|
+ goodList, _ := service.GetAllAutoRecordByPatient(patient_id, recordDateTime)
|
|
925
|
+ fmt.Println("goodList3323223232323232323", goodList)
|
|
926
|
+ for _, item := range goodList {
|
|
927
|
+ //回退库存
|
|
928
|
+ service.ModefyWarehouseInfo(item.Count, item.WarehouseInfotId)
|
|
929
|
+ }
|
|
930
|
+ //删除记录
|
|
931
|
+ service.DeleteAutoWarehouse(patient_id, recordDateTime)
|
921
|
932
|
}
|
922
|
933
|
if len(goodWarehouseInfo) > 0 {
|
923
|
934
|
//查询该患者耗材的历史数据
|
924
|
935
|
ordProject, _ := service.GetHisProjectPrescriptionByPatientIdOne(id)
|
|
936
|
+ fmt.Println("ordOr2323233232323232323223232", ordProject)
|
925
|
937
|
count, _ := strconv.ParseInt(ordProject.Count, 10, 64)
|
|
938
|
+ fmt.Println("id3232322332232323323223322323", id)
|
926
|
939
|
fmt.Println("parsetotal33223232323232323", parsetotal)
|
927
|
940
|
fmt.Println("count2332322332232332", count)
|
928
|
941
|
//数量发生改变
|
|
@@ -2355,6 +2368,10 @@ func (c *HisApiController) DeleteProject() {
|
2355
|
2368
|
service.CreateHisLabelRecord(&label)
|
2356
|
2369
|
|
2357
|
2370
|
if stockConfig.IsOpen == 1 {
|
|
2371
|
+ if project.Type == 2 {
|
|
2372
|
+ err := service.DelelteProject(id, c.GetAdminUserInfo().CurrentOrgId)
|
|
2373
|
+ fmt.Println(err)
|
|
2374
|
+ }
|
2358
|
2375
|
if project.Type == 3 {
|
2359
|
2376
|
good, _ := service.FindGoodInfoByIdTwo(project.ProjectId)
|
2360
|
2377
|
f_count, _ := strconv.ParseFloat(project.Count, 64)
|