Bladeren bron

耗材参数

XMLWAN 3 jaren geleden
bovenliggende
commit
5d577169c8

+ 6 - 4
controllers/doctors_api_controller.go Bestand weergeven

@@ -678,14 +678,15 @@ func (this *DoctorsApiController) GetAccessList() {
678 678
 func (this *DoctorsApiController) GetInspectionMajorItem() {
679 679
 
680 680
 	other_start_time := this.GetString("other_start_time")
681
+	last_time := this.GetString("last_time")
681 682
 	timeLayout := "2006-01-02"
682 683
 	loc, _ := time.LoadLocation("Local")
683 684
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", other_start_time+" 23:59:59", loc)
684
-	fmt.Println("startTime2222345555533344334334433433344", startTime.Unix())
685
+	lastTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", last_time+" 00:00:00", loc)
685 686
 	patient_id, _ := this.GetInt64("patient_id")
686 687
 	adminUserInfo := this.GetAdminUserInfo()
687 688
 	orgId := adminUserInfo.CurrentOrgId
688
-	list, err := service.GetInspectionMajorItem(startTime.Unix(), orgId, patient_id)
689
+	list, err := service.GetInspectionMajorItem(startTime.Unix(), lastTime.Unix(), orgId, patient_id)
689 690
 	if err == nil {
690 691
 		this.ServeSuccessJSON(map[string]interface{}{
691 692
 			"list": list,
@@ -794,7 +795,7 @@ func (this *DoctorsApiController) SaveCreationInspection() {
794 795
 	record_time := this.GetString("record_time")
795 796
 	timeLayout := "2006-01-02"
796 797
 	loc, _ := time.LoadLocation("Local")
797
-	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
798
+	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
798 799
 	after_pressure := this.GetString("after_pressure")
799 800
 	template_summary_id, _ := this.GetInt64("template_summary_id")
800 801
 	template_plan_id, _ := this.GetInt64("template_plan_id")
@@ -863,6 +864,7 @@ func (this *DoctorsApiController) GetTemplateSummaryList() {
863 864
 	orgId := this.GetAdminUserInfo().CurrentOrgId
864 865
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
865 866
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
867
+	fmt.Println("hhhhhhhhhhhhhh777777", endTime.Unix())
866 868
 	list, err := service.GetTemplateSummaryList(patient_id, orgId, startTime.Unix(), endTime.Unix())
867 869
 	if err == nil {
868 870
 		this.ServeSuccessJSON(map[string]interface{}{
@@ -943,7 +945,7 @@ func (this *DoctorsApiController) UpdateTempalteSummary() {
943 945
 	record_time := this.GetString("record_time")
944 946
 	timeLayout := "2006-01-02"
945 947
 	loc, _ := time.LoadLocation("Local")
946
-	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
948
+	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
947 949
 	after_pressure := this.GetString("after_pressure")
948 950
 	template_summary_id, _ := this.GetInt64("template_summary_id")
949 951
 	template_plan_id, _ := this.GetInt64("template_plan_id")

+ 10 - 2
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Bestand weergeven

@@ -2817,15 +2817,23 @@ func (this *NewDialysisApiController) GetAllDoctorList() {
2817 2817
 }
2818 2818
 
2819 2819
 func (this *NewDialysisApiController) GetTreateSummary() {
2820
+	timeLayout := "2006-01-02"
2821
+	loc, _ := time.LoadLocation("Local")
2820 2822
 
2821 2823
 	startTime := this.GetString("start_time")
2822
-	startTimeUnix, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", startTime)
2824
+	fmt.Println("开始烧豆腐阿方阿方阿方", startTime)
2825
+
2823 2826
 	endTime := this.GetString("end_time")
2824
-	endTimeUnix, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", endTime)
2827
+	startTimeUnix, _ := time.ParseInLocation(timeLayout+" 15:04:05", startTime+" 00:00:00", loc)
2828
+	endTimeUnix, _ := time.ParseInLocation(timeLayout+" 15:04:05", endTime+" 23:59:59", loc)
2829
+
2825 2830
 	limit, _ := this.GetInt64("limit")
2826 2831
 	page, _ := this.GetInt64("page")
2827 2832
 	creater, _ := this.GetInt64("creater")
2833
+
2828 2834
 	patient_id, _ := this.GetInt64("patient_id")
2835
+
2836
+	fmt.Println("hhhhhhhhhhhhhhhkaishi", startTimeUnix.Unix())
2829 2837
 	list, total, err := service.GetTreateSummary(startTimeUnix.Unix(), endTimeUnix.Unix(), limit, page, creater, patient_id)
2830 2838
 
2831 2839
 	//var inspectionTemplate []*models.VmInspection

+ 3 - 1
controllers/print_data_api_controller.go Bestand weergeven

@@ -208,12 +208,14 @@ func (this *PrintDataAPIController) GetGoodDetailPrintList() {
208 208
 	//出库详情
209 209
 	if types == 2 {
210 210
 		list, err := service.GetWarehouseOutInfoGoodDetailPrintList(adminUserInfo.CurrentOrgId, startTime, endTime, limit, page)
211
+		stockTotal, err := service.GetOutStockTotalCountTwo(startTime, endTime, adminUserInfo.CurrentOrgId)
211 212
 		if err != nil {
212 213
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
213 214
 			return
214 215
 		}
215 216
 		this.ServeSuccessJSON(map[string]interface{}{
216
-			"list": list,
217
+			"list":       list,
218
+			"stockTotal": stockTotal,
217 219
 		})
218 220
 	}
219 221
 

+ 34 - 3
controllers/stock_in_api_controller.go Bestand weergeven

@@ -107,6 +107,7 @@ func StockManagerApiRegistRouters() {
107 107
 	beego.Router("/api/stock/getadjustpriceinfo", &StockManagerApiController{}, "Get:GetAdjustPriceById")
108 108
 	beego.Router("/api/stock/savereportstock", &StockManagerApiController{}, "Post:SaveReportStock")
109 109
 	beego.Router("/api/stock/getreportstocklist", &StockManagerApiController{}, "Get:GetReportStockList")
110
+	beego.Router("/api/stock/savecheckdamage", &StockManagerApiController{}, "Get:SaveCheckDamage")
110 111
 }
111 112
 
112 113
 func (c *StockManagerApiController) CreateWarehouse() {
@@ -5129,7 +5130,7 @@ func (this *StockManagerApiController) SaveReportStock() {
5129 5130
 }
5130 5131
 
5131 5132
 func (this *StockManagerApiController) GetReportStockList() {
5132
-	fmt.Println("2323323322332323232233232322323232323")
5133
+
5133 5134
 	timeLayout := "2006-01-02"
5134 5135
 	loc, _ := time.LoadLocation("Local")
5135 5136
 	start_time := this.GetString("start_time")
@@ -5155,7 +5156,7 @@ func (this *StockManagerApiController) GetReportStockList() {
5155 5156
 			return
5156 5157
 		}
5157 5158
 		endTime = theTime.Unix()
5158
-		fmt.Println("endtime2322332233223", endTime)
5159
+
5159 5160
 	}
5160 5161
 
5161 5162
 	orgId := this.GetAdminUserInfo().CurrentOrgId
@@ -5163,10 +5164,40 @@ func (this *StockManagerApiController) GetReportStockList() {
5163 5164
 	fmt.Println("startTime", startTime, "endTime", endTime)
5164 5165
 	list, total, _ := service.GetReportStockList(startTime, endTime, orgId, keyword, page, limit)
5165 5166
 	doctorlist, _ := service.GetAllDoctorThree(orgId)
5166
-	fmt.Println("list232232322332232323", list)
5167
+
5167 5168
 	this.ServeSuccessJSON(map[string]interface{}{
5168 5169
 		"list":       list,
5169 5170
 		"total":      total,
5170 5171
 		"doctorlist": doctorlist,
5171 5172
 	})
5172 5173
 }
5174
+
5175
+func (this *StockManagerApiController) SaveCheckDamage() {
5176
+	fmt.Println("hhhhhhhhhhhhhhhhhhhh")
5177
+	timeLayout := "2006-01-02"
5178
+	loc, _ := time.LoadLocation("Local")
5179
+	idstr := this.GetString("ids")
5180
+	ids := strings.Split(idstr, ",")
5181
+	check_time := this.GetString("check_time")
5182
+	var checkTime int64
5183
+	if len(check_time) > 0 {
5184
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", check_time+" 00:00:00", loc)
5185
+		if err != nil {
5186
+			fmt.Println(err)
5187
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5188
+			return
5189
+		}
5190
+		checkTime = theTime.Unix()
5191
+	}
5192
+	checker, _ := this.GetInt64("checker")
5193
+	reportprice := models.XtStockReportPrice{
5194
+		Checker:       checker,
5195
+		CheckerStatus: 1,
5196
+		CheckerTime:   checkTime,
5197
+	}
5198
+	err := service.UpdateCheckDamage(ids, reportprice)
5199
+	fmt.Println(err)
5200
+	this.ServeSuccessJSON(map[string]interface{}{
5201
+		"reportPrice": reportprice,
5202
+	})
5203
+}

+ 8 - 5
service/patientmanage_service.go Bestand weergeven

@@ -1622,12 +1622,15 @@ func GetTotalBedNumber(orgid int64, ids []string) (list []*models.XtDeviceNumber
1622 1622
 	return list, total, err
1623 1623
 }
1624 1624
 
1625
-func GetInspectionMajorItem(startime int64, orgid int64, patientid int64) (inspection []*models.XtInspection, err error) {
1625
+func GetInspectionMajorItem(startime int64, lasttime int64, orgid int64, patientid int64) (inspection []*models.XtInspection, err error) {
1626 1626
 
1627 1627
 	db := XTReadDB().Table("xt_inspection as x").Where("x.status = 1")
1628 1628
 	if startime > 0 {
1629 1629
 		db = db.Where("x.inspect_date<=?", startime)
1630 1630
 	}
1631
+	if lasttime > 0 {
1632
+		db = db.Where("x.inspect_date>=?", lasttime)
1633
+	}
1631 1634
 	if orgid > 0 {
1632 1635
 		db = db.Where("x.org_id = ?", orgid)
1633 1636
 	}
@@ -1750,10 +1753,10 @@ func UpdateTempalteSummary(summary *models.XtTemplateSummary) error {
1750 1753
 func GetTemplateSummaryList(patientid int64, orgid int64, startime int64, endtime int64) (summary []*models.XtTemplateSummary, err error) {
1751 1754
 	db := XTReadDB().Model(&summary).Where("status = 1")
1752 1755
 	if startime > 0 {
1753
-		db = db.Where("ctime >=?", startime)
1756
+		db = db.Where("record_time >=?", startime)
1754 1757
 	}
1755 1758
 	if endtime > 0 {
1756
-		db = db.Where("ctime<=?", endtime)
1759
+		db = db.Where("record_time<=?", endtime)
1757 1760
 	}
1758 1761
 	if patientid > 0 {
1759 1762
 		db = db.Where("patient_id = ?", patientid)
@@ -1761,7 +1764,7 @@ func GetTemplateSummaryList(patientid int64, orgid int64, startime int64, endtim
1761 1764
 	if orgid > 0 {
1762 1765
 		db = db.Where("user_org_id = ?", orgid)
1763 1766
 	}
1764
-	err = db.Order("ctime desc").Find(&summary).Error
1767
+	err = db.Order("record_time desc").Find(&summary).Error
1765 1768
 	return summary, err
1766 1769
 }
1767 1770
 
@@ -1794,7 +1797,7 @@ func GetTreateSummary(startime int64, endtime int64, limit int64, page int64, cr
1794 1797
 	if patient_id > 0 {
1795 1798
 		db = db.Where("patient_id = ?", patient_id)
1796 1799
 	}
1797
-	err = db.Count(&total).Offset(offset).Limit(limit).Find(&list).Error
1800
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("record_time desc").Find(&list).Error
1798 1801
 	return list, total, err
1799 1802
 }
1800 1803
 

+ 6 - 0
service/user_service.go Bestand weergeven

@@ -177,3 +177,9 @@ func GetAllHisDoctor(orgid int64) (appRole []*models.App_Role, err error) {
177 177
 	err = UserReadDB().Where("org_id = ?  AND status = 1 AND  (user_type = ? OR user_type = ?) ", orgid, 2, 1).Find(&appRole).Error
178 178
 	return appRole, err
179 179
 }
180
+
181
+func UpdateCheckDamage(ids []string, reportPrice models.XtStockReportPrice) error {
182
+
183
+	err := XTWriteDB().Model(&reportPrice).Where("id in(?) and status = 1", ids).Updates(map[string]interface{}{"checker": reportPrice.Checker, "checker_time": reportPrice.CheckerTime}).Error
184
+	return err
185
+}