瀏覽代碼

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 1 年之前
父節點
當前提交
fae5b9408f

二進制
XT_New.exe 查看文件


+ 1 - 1
conf/app.conf 查看文件

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9531
3
-runmode = prod
3
+runmode = dev
4 4
 #dev/prod
5 5
 
6 6
 #

+ 2 - 0
controllers/dialysis_api_controller.go 查看文件

@@ -4173,6 +4173,8 @@ func (c *DialysisApiController) GetDialysisOrder() {
4173 4173
 	//相关操作对应的操作人
4174 4174
 	//operators, _ := service.GetAdminUserES(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, operatorIDs)
4175 4175
 	operators, err := service.GetAdminUserEsOne(adminUserInfo.CurrentOrgId)
4176
+
4177
+	fmt.Println("operators", operators)
4176 4178
 	templateInfo, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
4177 4179
 
4178 4180
 	//获取当前日期月份的第一天

+ 5 - 0
controllers/dialysis_record_api_controller.go 查看文件

@@ -1595,6 +1595,11 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1595 1595
 		tempassessmentAfterDislysis.SealingFluidDispose = lastAssessmentAfterDislysis.SealingFluidDispose
1596 1596
 		tempassessmentAfterDislysis.SealingFluidSpecial = lastAssessmentAfterDislysis.SealingFluidSpecial
1597 1597
 
1598
+		if adminUserInfo.CurrentOrgId == 10375 {
1599
+			tempassessmentAfterDislysis.SystolicBloodPressure = 0
1600
+			tempassessmentAfterDislysis.DiastolicBloodPressure = 0
1601
+		}
1602
+
1598 1603
 	}
1599 1604
 
1600 1605
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)

+ 11 - 7
controllers/drug_stock_api_contorller.go 查看文件

@@ -1171,7 +1171,7 @@ func (c *StockDrugApiController) CreateDrugWarehouseOut() {
1171 1171
 		StorehouseId:            storehouse_id,
1172 1172
 		IsCheck:                 2,
1173 1173
 	}
1174
-	fmt.Println("warehouse_out_id232323322323232323233223", warehouse_out_id)
1174
+
1175 1175
 	if warehouse_out_id == 0 {
1176 1176
 		service.AddSigleDrugWarehouseOut(&warehouseOut)
1177 1177
 	}
@@ -1282,7 +1282,8 @@ func (c *StockDrugApiController) CreateDrugWarehouseOut() {
1282 1282
 					Price:                   price,
1283 1283
 					TotalPrice:              total,
1284 1284
 					Status:                  1,
1285
-					Ctime:                   ctime,
1285
+					Ctime:                   warehousingOutDate.Unix(),
1286
+					Mtime:                   ctime,
1286 1287
 					Remark:                  remark,
1287 1288
 					OrgId:                   adminUserInfo.CurrentOrgId,
1288 1289
 					Type:                    types,
@@ -1683,14 +1684,15 @@ func (c *StockDrugApiController) EditDrugWarehouseOut() {
1683 1684
 						Price:                   price,
1684 1685
 						TotalPrice:              total,
1685 1686
 						Status:                  1,
1686
-						Ctime:                   ctime,
1687
+						Ctime:                   warehouseOut.WarehouseOutTime,
1688
+						Mtime:                   ctime,
1687 1689
 						Remark:                  remark,
1688 1690
 						OrgId:                   adminUserInfo.CurrentOrgId,
1689 1691
 						Type:                    types,
1690 1692
 						Manufacturer:            manufacturer,
1691 1693
 						Dealer:                  dealer,
1692 1694
 						IsSys:                   0,
1693
-						SysRecordTime:           0,
1695
+						SysRecordTime:           warehouseOut.WarehouseOutTime,
1694 1696
 						RetailPrice:             retail_price,
1695 1697
 						RetailTotalPrice:        retail_price_total,
1696 1698
 						BatchNumber:             batch_number,
@@ -1715,7 +1717,8 @@ func (c *StockDrugApiController) EditDrugWarehouseOut() {
1715 1717
 						Count:                   count,
1716 1718
 						Price:                   price,
1717 1719
 						Status:                  1,
1718
-						Ctime:                   ctime,
1720
+						Ctime:                   warehouseOut.WarehouseOutTime,
1721
+						Mtime:                   ctime,
1719 1722
 						UserOrgId:               adminUserInfo.CurrentOrgId,
1720 1723
 						Manufacturer:            manufacturer,
1721 1724
 						Dealer:                  dealer,
@@ -1758,7 +1761,7 @@ func (c *StockDrugApiController) EditDrugWarehouseOut() {
1758 1761
 						Price:                   price,
1759 1762
 						TotalPrice:              total,
1760 1763
 						Status:                  1,
1761
-						Ctime:                   ctime,
1764
+						Ctime:                   warehouseOut.WarehouseOutTime,
1762 1765
 						Remark:                  remark,
1763 1766
 						OrgId:                   adminUserInfo.CurrentOrgId,
1764 1767
 						Mtime:                   time.Now().Unix(),
@@ -1791,7 +1794,8 @@ func (c *StockDrugApiController) EditDrugWarehouseOut() {
1791 1794
 						Count:                   count,
1792 1795
 						Price:                   price,
1793 1796
 						Status:                  1,
1794
-						Ctime:                   ctime,
1797
+						Ctime:                   warehouseOut.WarehouseOutTime,
1798
+						Mtime:                   time.Now().Unix(),
1795 1799
 						UserOrgId:               adminUserInfo.CurrentOrgId,
1796 1800
 						Manufacturer:            manufacturer,
1797 1801
 						Dealer:                  dealer,

+ 1 - 1
controllers/gobal_config_api_controller.go 查看文件

@@ -2387,7 +2387,7 @@ func (c *GobalConfigApiController) GetDrugOutOrderPrint() {
2387 2387
 	warehousing, _ := service.GetExportOutOrderDrugListOne(ids)
2388 2388
 
2389 2389
 	drug_warhouse_out, _ := service.GetDrugWarehouseOutTenty(ids, admin.CurrentOrgId)
2390
-	fmt.Println("drug_warhouse_out9999999", drug_warhouse_out)
2390
+
2391 2391
 	c.ServeSuccessJSON(map[string]interface{}{
2392 2392
 		"info":              info,
2393 2393
 		"warehousing":       warehousing,

+ 11 - 5
controllers/mobile_api_controllers/check_weight_api_controller.go 查看文件

@@ -402,7 +402,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
402 402
 			if adminUserInfo.Org.Id == 10121 {
403 403
 				newprescribe.DialysisDurationHour = 4
404 404
 				newprescribe.DialysisDurationMinute = 0
405
-				newprescribe.BloodAccess = 0
405
+				newprescribe.BloodAccess = dialysisSolution.BloodAccess
406 406
 			}
407 407
 			//插入透析处方
408 408
 			err := service.AddSigleRecord(&newprescribe)
@@ -472,7 +472,12 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
472 472
 				newprescribe.TargetUltrafiltration = dewater_amount
473 473
 				newprescribe.PrescriptionWater = dewater_amount
474 474
 				newprescribe.Status = 1
475
-				newprescribe.Remark = lastDialysisPrescribe.Remark
475
+				if adminUserInfo.Org.Id != 10490 {
476
+					newprescribe.Remark = lastDialysisPrescribe.Remark
477
+				} else {
478
+					newprescribe.Remark = ""
479
+				}
480
+
476 481
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
477 482
 				newprescribe.PrescribingNumber = 1
478 483
 				if adminUserInfo.Org.Id == 10340 {
@@ -481,7 +486,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
481 486
 				if adminUserInfo.Org.Id == 10121 {
482 487
 					newprescribe.DialysisDurationHour = 4
483 488
 					newprescribe.DialysisDurationMinute = 0
484
-					newprescribe.BloodAccess = 0
489
+					newprescribe.BloodAccess = dialysisSolution.BloodAccess
485 490
 				}
486 491
 				err := service.AddSigleRecord(&newprescribe)
487 492
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
@@ -555,7 +560,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
555 560
 				if adminUserInfo.Org.Id == 10121 {
556 561
 					newprescribe.DialysisDurationHour = 4
557 562
 					newprescribe.DialysisDurationMinute = 0
558
-					newprescribe.BloodAccess = 0
563
+					newprescribe.BloodAccess = dialysisSolution.BloodAccess
559 564
 				}
560 565
 				err := service.AddSigleRecord(&newprescribe)
561 566
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
@@ -694,8 +699,9 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
694 699
 				evaluation.Exposed = lastPredialysisEvaluation.Exposed                         // 外漏
695 700
 				evaluation.DialysisCount = lastPredialysisEvaluation.DialysisCount             //呼吸频次
696 701
 				evaluation.Phinholing = lastPredialysisEvaluation.Phinholing                   //针眼
702
+
697 703
 				evaluation.Remark = lastPredialysisEvaluation.Remark
698
-				if adminUserInfo.Org.Id == 10318 {
704
+				if adminUserInfo.Org.Id == 10318 || adminUserInfo.Org.Id == 10490 {
699 705
 					evaluation.Remark = ""
700 706
 				}
701 707
 				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10447 {

+ 41 - 6
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -2490,8 +2490,14 @@ func (c *DialysisAPIController) Finish() {
2490 2490
 		tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
2491 2491
 		tempassessmentAfterDislysis.PulseFrequency = endmonitorRecords.PulseFrequency
2492 2492
 		tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
2493
-		tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
2494
-		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2493
+		if adminUserInfo.Org.Id != 10375 {
2494
+			tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
2495
+			tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2496
+		} else {
2497
+			tempassessmentAfterDislysis.SystolicBloodPressure = 0
2498
+			tempassessmentAfterDislysis.DiastolicBloodPressure = 0
2499
+		}
2500
+
2495 2501
 		if adminUserInfo.Org.Id != 10445 {
2496 2502
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
2497 2503
 		}
@@ -2692,6 +2698,14 @@ func (c *DialysisAPIController) Finish() {
2692 2698
 			tempassessmentAfterDislysis.ActualDisplacement = 0
2693 2699
 		}
2694 2700
 
2701
+		if adminUserInfo.Org.Id != 10375 {
2702
+			tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
2703
+			tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2704
+		} else {
2705
+			tempassessmentAfterDislysis.SystolicBloodPressure = 0
2706
+			tempassessmentAfterDislysis.DiastolicBloodPressure = 0
2707
+		}
2708
+
2695 2709
 	}
2696 2710
 
2697 2711
 	finish := models.XtDialysisFinish{
@@ -3303,7 +3317,7 @@ func (this *DialysisAPIController) StartDialysis() {
3303 3317
 			}
3304 3318
 
3305 3319
 			//针对
3306
-			if adminUserInfo.Org.Id == 10471 || adminUserInfo.Org.Id == 3877 {
3320
+			if adminUserInfo.Org.Id == 10471 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10460 {
3307 3321
 
3308 3322
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3309 3323
 				ultrafiltration_rate = ultrafiltration_rate / 1000
@@ -4216,7 +4230,6 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4216 4230
 		if prescription.TargetUltrafiltration > 0 && prescription.DialysisDurationHour > 0 {
4217 4231
 
4218 4232
 			totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
4219
-			fmt.Println("hahhdahahah", template.TemplateId)
4220 4233
 			if (template.TemplateId == 6 || template.TemplateId == 65 || adminInfo.Org.Id == 10375) && adminInfo.Org.Id != 9538 {
4221 4234
 				fmt.Println("hahhdahahah")
4222 4235
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
@@ -4224,6 +4237,10 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4224 4237
 
4225 4238
 			}
4226 4239
 
4240
+			if adminInfo.Org.Id == 10510 {
4241
+				record.UltrafiltrationRate = 0
4242
+			}
4243
+
4227 4244
 			if template.TemplateId == 32 || template.TemplateId == 34 || template.TemplateId == 36 {
4228 4245
 
4229 4246
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1)
@@ -4278,6 +4295,13 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4278 4295
 
4279 4296
 			}
4280 4297
 
4298
+			if adminInfo.Org.Id == 10460 {
4299
+
4300
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
4301
+				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4302
+
4303
+			}
4304
+
4281 4305
 			//if template.TemplateId == 47 {
4282 4306
 			//	ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
4283 4307
 			//	record.UltrafiltrationRate = ultrafiltration_rate
@@ -4308,7 +4332,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4308 4332
 
4309 4333
 		if ultrafiltration_rate > 0 {
4310 4334
 			ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4311
-			fmt.Println("ultrafiltration_volume", ultrafiltration_volume)
4335
+
4312 4336
 			record.UltrafiltrationVolume = ultrafiltration_volume
4313 4337
 		}
4314 4338
 
@@ -4317,7 +4341,14 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4317 4341
 	if adminInfo.Org.Id == 10471 {
4318 4342
 
4319 4343
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4320
-		fmt.Println("ultrafiltration_volume", ultrafiltration_volume)
4344
+
4345
+		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
4346
+	}
4347
+
4348
+	if adminInfo.Org.Id == 10460 {
4349
+
4350
+		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4351
+
4321 4352
 		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
4322 4353
 	}
4323 4354
 	//长沙南雅累计血容量自动计算
@@ -4329,6 +4360,10 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4329 4360
 		record.DisplacementQuantity = record.DisplacementQuantity + record.DisplacementQuantity
4330 4361
 	}
4331 4362
 
4363
+	if adminInfo.Org.Id == 10510 {
4364
+		record.UltrafiltrationVolume = 0
4365
+	}
4366
+
4332 4367
 	this.ServeSuccessJSON(map[string]interface{}{
4333 4368
 		"monitor": record,
4334 4369
 	})

+ 19 - 0
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

@@ -655,7 +655,17 @@ func (c *PatientApiController) ExecDoctorAdvice() {
655 655
 
656 656
 		if groupno > 0 {
657 657
 			advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
658
+
658 659
 			for _, item := range advices {
660
+				//恒泰中医院
661
+				if item.UserOrgId == 10490 {
662
+					if item.DrugId == 0 || item.DrugNameId == 0 {
663
+						//从字典里面查找
664
+						drug, _ := service.GetBaseDrugByName(item.AdviceName, item.UserOrgId)
665
+						service.UpdateDoctorAdviceByGoroupNo(item.ID, drug.ID)
666
+
667
+					}
668
+				}
659 669
 				if item.ExecutionState == 2 {
660 670
 					advice = item
661 671
 				}
@@ -663,6 +673,15 @@ func (c *PatientApiController) ExecDoctorAdvice() {
663 673
 		} else {
664 674
 			advices, _ := service.FindDoctorAdviceByIds(adminUserInfo.Org.Id, ids)
665 675
 			for _, item := range advices {
676
+				//恒泰中医院
677
+				if item.UserOrgId == 10490 {
678
+					if item.DrugId == 0 || item.DrugNameId == 0 {
679
+						//从字典里面查找
680
+						drug, _ := service.GetBaseDrugByName(item.AdviceName, item.UserOrgId)
681
+						service.UpdateDoctorAdviceByGoroupNo(item.ID, drug.ID)
682
+
683
+					}
684
+				}
666 685
 				if item.ExecutionState == 2 {
667 686
 					advice = item
668 687
 				}

+ 2 - 0
controllers/schedule_api_controller.go 查看文件

@@ -4149,6 +4149,8 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
4149 4149
 	}
4150 4150
 
4151 4151
 	orgId := this.GetAdminUserInfo().CurrentOrgId
4152
+
4153
+	fmt.Println("weekt_ywppwepwpwwep", week_type)
4152 4154
 	if week_type > 0 {
4153 4155
 		list, err := service.GetWeekDayScheduleByIdThee(orgId, targetDay.Unix(), week_time, zone)
4154 4156
 		for _, item := range list {

+ 1 - 1
controllers/self_drug_api_congtroller.go 查看文件

@@ -3499,7 +3499,7 @@ func (this *SelfDrugApiController) GetSendGoodInformation() {
3499 3499
 
3500 3500
 	orgId := this.GetAdminUserInfo().CurrentOrgId
3501 3501
 	fmt.Println("orgid", orgId)
3502
-	list, _ := service.GetWarehouseOutInfo(10489)
3502
+	list, _ := service.GetWarehouseOutInfo(10485)
3503 3503
 
3504 3504
 	for _, it := range list {
3505 3505
 		service.UpdateWarehosueOutInfo(it.ID, it.WarehouseOutTime)

+ 81 - 63
controllers/sign_api_controller.go 查看文件

@@ -35,8 +35,17 @@ func SignApiRegistRouters() {
35 35
 	//添加合同签署人
36 36
 	beego.Router("/api/sign/addcontractsignatory", &SignApiController{}, "Get:AddContractSignatory")
37 37
 
38
-	//beego.Router("/api/sign/contractsignatory", &SignApiController{}, "Get:CreateSignTest")
39
-	beego.Router("/api/sign/contractsignatory", &SignApiController{}, "Get:CreateContractsignatory")
38
+	//获取短信验证
39
+	beego.Router("/api/sign/getverificationcode", &SignApiController{}, "Get:GetVerificationCode")
40
+
41
+	//后台签署(返回签署文件)
42
+	beego.Router("/api/sign/createbackstagesign", &SignApiController{}, "Get:CreateBackStageSign")
43
+
44
+	//创建企业印章并添加授权用户
45
+	beego.Router("/api/sign/totestelment", &SignApiController{}, "Get:CreateEnterprise")
46
+
47
+	//测试PDF
48
+	beego.Router("/api/sign/totestthrityment", &SignApiController{}, "Get:GetTestThrityMent")
40 49
 }
41 50
 
42 51
 // 短信服务接口
@@ -191,6 +200,7 @@ func (this *SignApiController) CreateEnterPriseRealName() {
191 200
 	return
192 201
 }
193 202
 
203
+// 添加合同签署人
194 204
 func (this *SignApiController) AddContractSignatory() {
195 205
 
196 206
 	contractId := this.GetString("contractId")
@@ -199,91 +209,99 @@ func (this *SignApiController) AddContractSignatory() {
199 209
 
200 210
 	var newContract models.NewContract
201 211
 
202
-	newContract.ContractId = "153497878806048027"
212
+	newContract.ContractId = "156001444267295949"
203 213
 
204
-	service.AddContractSignatory(contractId, signers, newContract)
214
+	sign := service.AddContractSignatory(contractId, signers, newContract)
205 215
 
206
-	maprequest := make(map[string]interface{})
216
+	this.ServeSuccessJSON(map[string]interface{}{
217
+		"sign": sign,
218
+	})
219
+	return
207 220
 
208
-	maprequest["contractId"] = "153497878806048027"
221
+}
209 222
 
210
-	//maprequestOne := make(map[string]interface{})
223
+type Struct2401 struct {
224
+	someTimestampStyle []someTimestampStyle
225
+}
211 226
 
212
-	maprequestTwo := make(map[string]interface{})
227
+type someTimestampStyle struct {
228
+	ControlsKey string
229
+	Pattern     string
230
+	Color       string
231
+}
213 232
 
214
-	var signFiles models.SignFiles
215
-	var sig []*models.Signers
216
-	signFiles.DocId = 343465645
233
+func (this *SignApiController) CreateBackStageSign() {
217 234
 
218
-	inputDataArrOne := make([]map[string]interface{}, 0)
219
-	inputDataArrTwo := make([]map[string]interface{}, 0)
235
+	contractId := this.GetString("contractId")
220 236
 
221
-	inputDataArrThree := make([]map[string]interface{}, 0)
222
-	for _, item := range signFiles.XySignControls {
223
-		fmt.Println(item)
224
-		inputDataThree := make(map[string]interface{})
225
-		inputDataThree["key"] = 11
226
-		inputDataThree["type"] = 222
227
-		inputDataThree["pageNum"] = 333
228
-		inputDataThree["positionX"] = 444
229
-		inputDataThree["positionY"] = 555
230
-
231
-		fmt.Println("2O2332O23O23O23", inputDataArrThree)
232
-		inputDataArrOne = append(inputDataArrOne, inputDataThree)
233
-	}
237
+	signers := this.GetString("signers")
238
+	sign := service.CreateBackStageSign(contractId, signers)
239
+	sealTimestampFiles := make(map[string]interface{})
240
+	inputDataArr := make([]map[string]interface{}, 0)
241
+	signFiles := make(map[string]interface{})
234 242
 
235
-	fmt.Println("inputDataArrOne", inputDataArrOne)
243
+	keywordSignControls := make(map[string]interface{})
244
+	keywordSignControls["controlsKey"] = "2"
245
+	keywordSignControls["pattern"] = 1
246
+	keywordSignControls["color"] = "#FF0000"
247
+	inputDataArr = append(inputDataArr, keywordSignControls)
236 248
 
237
-	for _, item := range signFiles.KeywordSignControls {
238
-		fmt.Println(item)
239
-		inputDataFour := make(map[string]interface{})
240
-		inputDataFour["key"] = 666
241
-		inputDataFour["type"] = 888
242
-		inputDataFour["pageNum"] = 9999
243
-		inputDataFour["keyword"] = 6666
244
-		inputDataFour["positionX"] = 77777
245
-		inputDataFour["positionY"] = 8888
249
+	sealTimestampFiles["allAddTimestamp"] = false
250
+	sealTimestampFiles["someTimestampStyle"] = inputDataArr
246 251
 
247
-		inputDataArrTwo = append(inputDataArrTwo, inputDataFour)
248
-	}
252
+	inputDataArrOne := make([]map[string]interface{}, 0)
249 253
 
250
-	for _, item := range sig {
251
-		fmt.Println(item)
252
-		inputDataFive := make(map[string]interface{})
253
-		inputDataFive["userId"] = 233232
254
-		inputDataFive["signerType"] = 454545
255
-		inputDataFive["enterpriseId"] = 45455
256
-		inputDataFive["sequence"] = 44545
257
-		inputDataFive["sendMsg"] = 4545
258
-		inputDataFive["signFiles"] = 45455
254
+	keySignControls := make(map[string]interface{})
255
+	keySignControls["controlsKey"] = "1"
256
+	keySignControls["fontType"] = 1
257
+	keySignControls["fontSize"] = 8.5
258
+	keySignControls["fontColor"] = "#56600F"
259
+	keySignControls["alignment"] = 1
260
+	inputDataArrOne = append(inputDataArrOne, keySignControls)
261
+
262
+	signFiles["fonts"] = inputDataArrOne
263
+	signFiles["showTimestamp"] = false
264
+	signFiles["sealTimestamp"] = sealTimestampFiles
265
+	signControl := make(map[string]interface{})
266
+	signControl["1"] = "123456"
267
+	signFiles["signControl"] = signControl
268
+	signFiles["docId"] = "156190809375377646"
269
+	inputDataArrThree := make([]map[string]interface{}, 0)
270
+	inputDataArrThree = append(inputDataArrThree, signFiles)
259 271
 
260
-	}
272
+	signer := make(map[string]interface{})
261 273
 
262
-	maprequestTwo["xySignControls"] = inputDataArrOne
263
-	maprequestTwo["keywordSignControls"] = inputDataArrTwo
264
-	maprequestTwo["docId"] = 1234555
274
+	signer["signerId"] = "156002269974758623"
275
+	signer["isUserWishes"] = true
276
+	signer["userWishesWay"] = 1
277
+	signer["codeNumber"] = "msg202308111444501897422"
278
+	signer["verifyCode"] = "978176"
279
+	signer["signFiles"] = inputDataArrThree
280
+	maprequest := make(map[string]interface{})
281
+	maprequest["contractId"] = "156190809375377645"
282
+	maprequest["signer"] = signer
265 283
 
266
-	maprequest["contractId"] = newContract.ContractId
284
+	this.ServeSuccessJSON(map[string]interface{}{
285
+		"sign":       sign,
286
+		"maprequest": maprequest,
287
+	})
288
+	return
289
+}
267 290
 
268
-	maprequest["signers"] = inputDataArrThree
291
+func (this *SignApiController) GetVerificationCode() {
269 292
 
293
+	sign := service.GetVerificationCode()
270 294
 	this.ServeSuccessJSON(map[string]interface{}{
271
-		"inputDataArrOne": inputDataArrOne,
272
-		"maprequestOne":   maprequest,
273
-		"maprequestTwo":   maprequestTwo,
295
+		"sign": sign,
274 296
 	})
275 297
 	return
276 298
 }
277 299
 
278
-func (this *SignApiController) CreateContractsignatory() {
300
+func (this *SignApiController) CreateEnterprise() {
279 301
 
280
-	list, _ := service.GetHisDoctorAdviceInfoList(10215)
281
-
282
-	for _, item := range list {
283
-		service.UpdatePatietPrice(item.ID, item.RetailPrice)
284
-	}
302
+	sign := service.CreateEnterprise()
285 303
 	this.ServeSuccessJSON(map[string]interface{}{
286
-		"sign": "msg",
304
+		"sign": sign,
287 305
 	})
288 306
 	return
289 307
 }

+ 5 - 4
controllers/stock_in_api_controller.go 查看文件

@@ -1356,6 +1356,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1356 1356
 					StockCount:              stock_count,
1357 1357
 					IsCheck:                 2,
1358 1358
 					RegisterNumber:          register_number,
1359
+					SysRecordTime:           warehouseOut.WarehouseOutTime,
1359 1360
 				}
1360 1361
 				warehousingOutInfo = append(warehousingOutInfo, warehouseOutInfo)
1361 1362
 
@@ -1605,7 +1606,6 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1605 1606
 		return
1606 1607
 	}
1607 1608
 
1608
-	ctime := time.Now().Unix()
1609 1609
 	mtime := time.Now().Unix()
1610 1610
 	adminUserInfo := c.GetAdminUserInfo()
1611 1611
 
@@ -1742,12 +1742,13 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1742 1742
 						Price:                   price,
1743 1743
 						TotalPrice:              total,
1744 1744
 						Status:                  1,
1745
-						Ctime:                   ctime,
1745
+						Ctime:                   warehouseOut.WarehouseOutTime,
1746
+						Mtime:                   time.Now().Unix(),
1746 1747
 						Remark:                  remark,
1747 1748
 						OrgId:                   adminUserInfo.CurrentOrgId,
1748 1749
 						Type:                    types,
1749 1750
 						IsSys:                   0,
1750
-						SysRecordTime:           0,
1751
+						SysRecordTime:           warehouseOut.WarehouseOutTime,
1751 1752
 						Number:                  number,
1752 1753
 						ExpiryDate:              expiryDate,
1753 1754
 						ProductDate:             productDate,
@@ -1788,7 +1789,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1788 1789
 						Price:                   price,
1789 1790
 						TotalPrice:              total,
1790 1791
 						Status:                  1,
1791
-						Ctime:                   ctime,
1792
+						Ctime:                   warehouseOut.WarehouseOutTime,
1792 1793
 						Remark:                  remark,
1793 1794
 						OrgId:                   adminUserInfo.CurrentOrgId,
1794 1795
 						Mtime:                   time.Now().Unix(),

+ 1 - 0
models/drug.go 查看文件

@@ -94,6 +94,7 @@ type BaseDrugLibSeven struct {
94 94
 	SumCount   int64  `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
95 95
 	IsUse      int64  `gorm:"column:is_user" json:"is_user" form:"is_user"`
96 96
 	IsPharmacy int64  `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
97
+	OrgId      int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
97 98
 }
98 99
 
99 100
 func (BaseDrugLibSeven) TableName() string {

+ 16 - 12
models/new_stock_models.go 查看文件

@@ -262,18 +262,21 @@ func (VmNewStockFlowTwenty) TableName() string {
262 262
 }
263 263
 
264 264
 type GoodInfoTwenty struct {
265
-	ID                     int64                   `gorm:"column:id" json:"id" form:"id"`
266
-	SpecificationName      string                  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
267
-	GoodTypeId             int64                   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
268
-	BuyPrice               float64                 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
269
-	Manufacturer           int64                   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
270
-	Status                 int64                   `gorm:"column:status" json:"status" form:"status"`
271
-	OrgId                  int64                   `gorm:"column:org_id" json:"org_id" form:"org_id"`
272
-	GoodName               string                  `gorm:"column:good_name" json:"good_name" form:"good_name"`
273
-	RetailPrice            float64                 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
274
-	PackingUnit            string                  `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
275
-	PackingPrice           float64                 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
276
-	StWarehousingInfo      []*StWarehousingInfo    `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
265
+	ID                int64                `gorm:"column:id" json:"id" form:"id"`
266
+	SpecificationName string               `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
267
+	GoodTypeId        int64                `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
268
+	BuyPrice          float64              `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
269
+	Manufacturer      int64                `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
270
+	Dealer            int64                `gorm:"column:dealer" json:"dealer" form:"dealer"`
271
+	Status            int64                `gorm:"column:status" json:"status" form:"status"`
272
+	OrgId             int64                `gorm:"column:org_id" json:"org_id" form:"org_id"`
273
+	GoodName          string               `gorm:"column:good_name" json:"good_name" form:"good_name"`
274
+	RetailPrice       float64              `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
275
+	PackingUnit       string               `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
276
+	PackingPrice      float64              `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
277
+	GoodNumber        string               `gorm:"column:good_number" json:"good_number" form:"good_number"`
278
+	StWarehousingInfo []*StWarehousingInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"xt_warehouse_info"`
279
+
277 280
 	WarehousingInfoOne     []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
278 281
 	WarehousingInfoStart   []*StartWarehousingInfo `gorm:"json:"warehouse_info_start"`
279 282
 	WarehousingInfoEnd     []*StartWarehousingInfo `gorm:"json:"warehouse_info_end"`
@@ -399,6 +402,7 @@ type VmBaseDrugTwenty struct {
399 402
 	MinPrice                         float64           `gorm:"column:min_price" json:"min_price" form:"min_price"`
400 403
 	LastPrice                        float64           `gorm:"column:last_price" json:"last_price" form:"last_price"`
401 404
 	Manufacturer                     int64             `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
405
+	Dealer                           int64             `gorm:"column:dealer" json:"dealer" form:"dealer"`
402 406
 	Status                           int64             `gorm:"column:status" json:"status" form:"status"`
403 407
 	Ctime                            int64             `gorm:"column:ctime" json:"ctime" form:"ctime"`
404 408
 	Mtime                            int64             `gorm:"column:mtime" json:"mtime" form:"mtime"`

+ 36 - 36
models/self_drug_models.go 查看文件

@@ -40,42 +40,42 @@ type XtBaseDrug struct {
40 40
 	DrugDoseUnit           int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
41 41
 	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
42 42
 	ProvincesCode          string  `gorm:"column:provinces_code" json:"provinces_code" form:"provinces_code"`
43
-
44
-	Manufacturer          int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
45
-	PharmacologyCategory  int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
46
-	StatisticsCategory    int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
47
-	Code                  string  `gorm:"column:code" json:"code" form:"code"`
48
-	IsSpecialDiseases     int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
49
-	IsRecord              int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
50
-	Agent                 string  `gorm:"column:agent" json:"agent" form:"agent"`
51
-	DrugStatus            string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
52
-	LimitRemark           string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
53
-	DeliveryWay           string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
54
-	ExecutionFrequency    string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
55
-	SingleDose            float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
56
-	PrescribingNumber     float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
57
-	Label                 int64   `gorm:"column:label" json:"label" form:"label"`
58
-	Sort                  int64   `gorm:"column:sort" json:"sort" form:"sort"`
59
-	IsUseDoctorAdvice     int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
60
-	IsDefault             int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
61
-	IsChargePredict       int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
62
-	IsStatisticsWork      int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
63
-	IsChargeUse           int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
64
-	Status                int64   `gorm:"column:status" json:"status" form:"status"`
65
-	Ctime                 int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
66
-	Mtime                 int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
67
-	OrgId                 int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
68
-	HospApprFlag          int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
69
-	LmtUsedFlag           int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
70
-	Total                 float64 `gorm:"column:total" json:"total" form:"total"`
71
-	PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
72
-	MinNumber             int64   `gorm:"column:min_number" json:"min_number" form:"min_number"`
73
-	Dose                  string  `gorm:"column:dose" json:"dose" form:"dose"`
74
-	DoseUnit              string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
75
-	DrugDay               string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
76
-	MinPrice              float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
77
-	IsUse                 int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
78
-	IsPharmacy            int64   `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
43
+	Dealer                 int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
44
+	Manufacturer           int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
45
+	PharmacologyCategory   int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
46
+	StatisticsCategory     int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
47
+	Code                   string  `gorm:"column:code" json:"code" form:"code"`
48
+	IsSpecialDiseases      int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
49
+	IsRecord               int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
50
+	Agent                  string  `gorm:"column:agent" json:"agent" form:"agent"`
51
+	DrugStatus             string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
52
+	LimitRemark            string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
53
+	DeliveryWay            string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
54
+	ExecutionFrequency     string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
55
+	SingleDose             float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
56
+	PrescribingNumber      float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
57
+	Label                  int64   `gorm:"column:label" json:"label" form:"label"`
58
+	Sort                   int64   `gorm:"column:sort" json:"sort" form:"sort"`
59
+	IsUseDoctorAdvice      int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
60
+	IsDefault              int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
61
+	IsChargePredict        int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
62
+	IsStatisticsWork       int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
63
+	IsChargeUse            int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
64
+	Status                 int64   `gorm:"column:status" json:"status" form:"status"`
65
+	Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
66
+	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
67
+	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
68
+	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
69
+	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
70
+	Total                  float64 `gorm:"column:total" json:"total" form:"total"`
71
+	PrescribingNumberUnit  string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
72
+	MinNumber              int64   `gorm:"column:min_number" json:"min_number" form:"min_number"`
73
+	Dose                   string  `gorm:"column:dose" json:"dose" form:"dose"`
74
+	DoseUnit               string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
75
+	DrugDay                string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
76
+	MinPrice               float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
77
+	IsUse                  int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
78
+	IsPharmacy             int64   `gorm:"column:is_pharmacy" json:"is_pharmacy" form:"is_pharmacy"`
79 79
 }
80 80
 
81 81
 func (XtBaseDrug) TableName() string {

+ 1 - 1
service/dialysis_service.go 查看文件

@@ -639,7 +639,7 @@ func FindPunctureNurse(adminid int64, appid int64, orgid int64) (models.App_Role
639 639
 	role := models.App_Roles{}
640 640
 	//err := UserReadDB().Where("admin_user_id = ? and app_id = ? and org_id = ?", adminid, appid, orgid).Find(&role).Error
641 641
 	//return role, err
642
-	db := UserReadDB().Table("sgj_user_admin_role as r").Where("r.status =1")
642
+	db := UserReadDB().Table("sgj_user_admin_role as r")
643 643
 	err := db.Select("r.id,r.admin_user_id,r.org_id,r.role_id,r.user_name,r.avatar,r.user_type,r.user_title,r.intro,r.status,r.ctime,e.url").Joins("left join sgj_user_admin_electronic_signature as e on e.creator = r.admin_user_id").Where("r.admin_user_id = ? and r.app_id = ? and r.org_id = ?", adminid, appid, orgid).Find(&role).Error
644 644
 	return role, err
645 645
 }

+ 2 - 2
service/doctor_schedule_service.go 查看文件

@@ -607,7 +607,7 @@ func GetPatientScheduleByPd(schedule_date int64, zoneid int64, orgid int64, clas
607 607
 		err = db.Select("x.id,x.org_id,x.name,x.type,x.sort").Preload("DeviceNumber", func(db *gorm.DB) *gorm.DB {
608 608
 			return XTReadDB().Model(&models.DeviceNumber{}).Where("status = 1").Preload("Schedule", func(db *gorm.DB) *gorm.DB {
609 609
 				return XTReadDB().Model(&models.BlodSchedule{}).Where("status = 1 AND user_org_id = ? and schedule_date = ? and schedule_type = ?", orgid, schedule_date, class_type).Preload("VmBloodPatients", "status = 1 and user_org_id = ?", orgid).Preload("BloodDialysisOrder", "status = 1 and dialysis_date = ?", schedule_date).Preload("BloodDialysisPrescription", "status = 1 and record_date = ?", schedule_date).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
610
-					return db.Where("user_org_id = ? and status = 1", orgid).Group("patient_id,mode_id").Order("created_time asc")
610
+					return db.Where("user_org_id = ? and status = 1 and solution_status =1", orgid).Group("patient_id,mode_id").Order("created_time asc")
611 611
 				})
612 612
 			})
613 613
 		}).Find(&list).Error
@@ -615,7 +615,7 @@ func GetPatientScheduleByPd(schedule_date int64, zoneid int64, orgid int64, clas
615 615
 		err = db.Select("x.id,x.org_id,x.name,x.type,x.sort").Preload("DeviceNumber", func(db *gorm.DB) *gorm.DB {
616 616
 			return XTReadDB().Model(&models.DeviceNumber{}).Where("status = 1").Preload("Schedule", func(db *gorm.DB) *gorm.DB {
617 617
 				return XTReadDB().Model(&models.BlodSchedule{}).Where("status = 1 AND user_org_id = ? and schedule_date = ?", orgid, schedule_date).Preload("VmBloodPatients", "status = 1 and user_org_id = ?", orgid).Preload("BloodDialysisOrder", "status = 1 and dialysis_date = ?", schedule_date).Preload("BloodDialysisPrescription", "status = 1 and record_date = ?", schedule_date).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
618
-					return db.Where("user_org_id = ? and status = 1", orgid).Group("patient_id,mode_id").Order("created_time asc")
618
+					return db.Where("user_org_id = ? and status = 1 and solution_status =1", orgid).Group("patient_id,mode_id").Order("created_time asc")
619 619
 				})
620 620
 			})
621 621
 		}).Find(&list).Error

+ 2 - 2
service/new_stock_service.go 查看文件

@@ -574,7 +574,7 @@ func AddCountFlowOne(warehouse_info_id int64, good_id int64, user_org_id int64,
574 574
 
575 575
 func GetWarehouseOutInfo(user_org_id int64) (info []*models.WarehouseOut, err error) {
576 576
 
577
-	err = XTReadDB().Where("org_id = ? and status =1", 10489).Find(&info).Error
577
+	err = XTReadDB().Where("org_id = ? and status =1", 10485).Find(&info).Error
578 578
 
579 579
 	return info, err
580 580
 }
@@ -583,7 +583,7 @@ func UpdateWarehosueOutInfo(id int64, sys_record_time int64) (models.WarehouseOu
583 583
 
584 584
 	info := models.WarehouseOutInfo{}
585 585
 
586
-	err := XTWriteDB().Model(&info).Where("warehouse_out_id = ? and org_id = ? ", id, 10489).Updates(map[string]interface{}{"sys_record_time": sys_record_time, "ctime": sys_record_time}).Error
586
+	err := XTWriteDB().Model(&info).Where("warehouse_out_id = ? and org_id = ? ", id, 10485).Updates(map[string]interface{}{"sys_record_time": sys_record_time, "ctime": sys_record_time}).Error
587 587
 
588 588
 	return info, err
589 589
 }

+ 80 - 49
service/new_warehouse_service.go 查看文件

@@ -813,6 +813,7 @@ func BloodDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *
813 813
 		}
814 814
 
815 815
 		//如果本次出库数据大于历史出库数据 新增1条流水
816
+
816 817
 		if deliver_number > (out_count - cancel_count) {
817 818
 			drugflow := models.DrugFlow{
818 819
 				WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
@@ -1262,7 +1263,7 @@ func BloodDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *
1262 1263
 }
1263 1264
 
1264 1265
 // 药品自动出库 递归方式
1265
-func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *models.DrugWarehouseOut, drup *models.BaseDrugLib, advice *models.HisDoctorAdviceInfo) (err error) {
1266
+func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *models.DrugWarehouseOut, drup *models.BaseDrugLib, advice *models.HisDoctorAdviceInfo, hisprescribingNumber float64) (err error) {
1266 1267
 
1267 1268
 	drugError := models.XtDrugError{
1268 1269
 		UserOrgId:             orgID,
@@ -1280,11 +1281,15 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1280 1281
 	CreateDrugError(drugError)
1281 1282
 	// 判断处方里药品单位是拆零单位还是包装单位,	如果是包装单位,则根据规格,将包装数量转为拆零数量
1282 1283
 	var deliver_number int64 = 0
1284
+	var deliver_number_one int64 = 0
1283 1285
 	var stock_number int64 = 0
1284 1286
 
1285 1287
 	prescribingNumber_temp := strconv.FormatFloat(math.Abs(prescribingNumber), 'f', 0, 64)
1286 1288
 	count, _ := strconv.ParseInt(prescribingNumber_temp, 10, 64)
1287 1289
 
1290
+	prescribingNumber_temp_one := strconv.FormatFloat(math.Abs(hisprescribingNumber), 'f', 0, 64)
1291
+	countone, _ := strconv.ParseInt(prescribingNumber_temp_one, 10, 64)
1292
+
1288 1293
 	var drug_price float64
1289 1294
 	if advice.PrescribingNumberUnit == drup.MaxUnit {
1290 1295
 		deliver_number = count * drup.MinNumber
@@ -1294,6 +1299,16 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1294 1299
 
1295 1300
 	}
1296 1301
 
1302
+	if advice.PrescribingNumberUnit == drup.MaxUnit {
1303
+		deliver_number_one = countone * drup.MinNumber
1304
+
1305
+	} else {
1306
+		deliver_number_one = countone
1307
+
1308
+	}
1309
+
1310
+	fmt.Println(deliver_number_one)
1311
+
1297 1312
 	if advice.PrescribingNumberUnit == drup.MaxUnit {
1298 1313
 		drug_price = drup.RetailPrice
1299 1314
 	}
@@ -1320,6 +1335,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1320 1335
 
1321 1336
 			ChangeMaxNumber(lastWarehouse.ID, stockMax)
1322 1337
 			UpdateMinNumber(lastWarehouse.ID, stockMin)
1338
+
1323 1339
 		}
1324 1340
 	}
1325 1341
 
@@ -1493,7 +1509,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1493 1509
 			WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1494 1510
 			WarehouseOutId:          warehouseout.ID,
1495 1511
 			Status:                  1,
1496
-			Ctime:                   time.Now().Unix(),
1512
+			Ctime:                   advice.RecordDate,
1513
+			Mtime:                   time.Now().Unix(),
1497 1514
 			Remark:                  warehouse.Remark,
1498 1515
 			OrgId:                   orgID,
1499 1516
 			Type:                    1,
@@ -1542,33 +1559,41 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1542 1559
 			}
1543 1560
 		}
1544 1561
 		if lastDrugOutInfo.ID > 0 {
1545
-			var his_count int64
1546
-			if lastDrugOutInfo.CountUnit == drup.MaxUnit {
1547
-				his_count = lastDrugOutInfo.Count * drup.MinNumber
1548
-			}
1549
-			if lastDrugOutInfo.CountUnit == drup.MinUnit {
1550
-				his_count = lastDrugOutInfo.Count
1551
-			}
1552
-			if deliver_number != his_count {
1553
-				errThree := UpdateSigleDrugWarehouseOutInfo(lastDrugOutInfo.ID, warehouseOutInfo)
1554
-				if errThree != nil {
1555
-					drugError := models.XtDrugError{
1556
-						UserOrgId:             orgID,
1557
-						DrugId:                advice.DrugId,
1558
-						RecordDate:            advice.AdviceDate,
1559
-						PatientId:             advice.PatientId,
1560
-						Remark:                "更新出库单失败",
1561
-						Status:                1,
1562
-						Ctime:                 time.Now().Unix(),
1563
-						Mtime:                 0,
1564
-						SumCount:              0,
1565
-						Prescribingnumber:     advice.PrescribingNumber,
1566
-						PrescribingNumberUnit: advice.PrescribingNumberUnit,
1567
-					}
1568
-					CreateDrugError(drugError)
1569
-					return errThree
1570
-				}
1571
-			}
1562
+
1563
+			//删除在新增
1564
+			UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1565
+
1566
+			AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1567
+
1568
+			//var his_count int64
1569
+			//if lastDrugOutInfo.CountUnit == drup.MaxUnit {
1570
+			//	his_count = lastDrugOutInfo.Count * drup.MinNumber
1571
+			//}
1572
+			//if lastDrugOutInfo.CountUnit == drup.MinUnit {
1573
+			//	his_count = lastDrugOutInfo.Count
1574
+			//}
1575
+			//fmt.Println("deliver_number", deliver_number)
1576
+			//fmt.Println("his_countwowowoowow", his_count)
1577
+			//if deliver_number != his_count {
1578
+			//	errThree := UpdateSigleDrugWarehouseOutInfo(lastDrugOutInfo.ID, warehouseOutInfo)
1579
+			//	if errThree != nil {
1580
+			//		drugError := models.XtDrugError{
1581
+			//			UserOrgId:             orgID,
1582
+			//			DrugId:                advice.DrugId,
1583
+			//			RecordDate:            advice.AdviceDate,
1584
+			//			PatientId:             advice.PatientId,
1585
+			//			Remark:                "更新出库单失败",
1586
+			//			Status:                1,
1587
+			//			Ctime:                 time.Now().Unix(),
1588
+			//			Mtime:                 0,
1589
+			//			SumCount:              0,
1590
+			//			Prescribingnumber:     advice.PrescribingNumber,
1591
+			//			PrescribingNumberUnit: advice.PrescribingNumberUnit,
1592
+			//		}
1593
+			//		CreateDrugError(drugError)
1594
+			//		return errThree
1595
+			//	}
1596
+			//}
1572 1597
 		}
1573 1598
 
1574 1599
 		var out_count int64
@@ -1585,11 +1610,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1585 1610
 			cancel_count += item.Count
1586 1611
 		}
1587 1612
 
1588
-		//如果本次出库数据大于历史出库数据 新增1条流水
1589
-		//fmt.Println("deliver_number233233223232wi", deliver_number)
1590
-		//fmt.Println("out_coutn23333333333333333", out_count)
1591
-		//fmt.Println("cancel_coutn099992ow", cancel_count)
1592
-		if deliver_number >= (out_count - cancel_count) {
1613
+		if deliver_number_one-(out_count-cancel_count) >= 0 {
1593 1614
 			if (deliver_number - out_count - cancel_count) != 0 {
1594 1615
 				drugflow := models.DrugFlow{
1595 1616
 					WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
@@ -1598,10 +1619,11 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1598 1619
 					Number:                  warehouse.Number,
1599 1620
 					ProductDate:             warehouse.ProductDate,
1600 1621
 					ExpireDate:              warehouse.ExpiryDate,
1601
-					Count:                   deliver_number - (out_count - cancel_count), //按最小单位计算,
1622
+					Count:                   deliver_number_one - (out_count - cancel_count), //按最小单位计算,
1602 1623
 					Price:                   warehouse.RetailPrice,
1603 1624
 					Status:                  1,
1604
-					Ctime:                   time.Now().Unix(),
1625
+					Ctime:                   advice.AdviceDate,
1626
+					Mtime:                   time.Now().Unix(),
1605 1627
 					UserOrgId:               orgID,
1606 1628
 					Manufacturer:            warehouse.Manufacturer,
1607 1629
 					Dealer:                  warehouse.Dealer,
@@ -1665,7 +1687,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1665 1687
 		}
1666 1688
 
1667 1689
 		//如果本次出库数据小于历史出库数据 新增1条退库流水
1668
-		if deliver_number < (out_count - cancel_count) {
1690
+		if deliver_number_one-(out_count-cancel_count) < 0 {
1669 1691
 
1670 1692
 			operation_time := time.Now().Unix()
1671 1693
 
@@ -1721,7 +1743,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1721 1743
 				DrugId:           advice.DrugId,
1722 1744
 				Count:            (out_count - cancel_count) - deliver_number,
1723 1745
 				Status:           1,
1724
-				Ctime:            ctime,
1746
+				Ctime:            advice.AdviceDate,
1747
+				Mtime:            time.Now().Unix(),
1725 1748
 				OrgId:            advice.UserOrgId,
1726 1749
 				Type:             1,
1727 1750
 				Manufacturer:     manufactureName.ManufacturerName,
@@ -1779,8 +1802,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1779 1802
 				Creator:                 advice.ExecutionStaff,
1780 1803
 				UpdateCreator:           0,
1781 1804
 				Status:                  1,
1782
-				Ctime:                   time.Now().Unix(),
1783
-				Mtime:                   0,
1805
+				Ctime:                   advice.AdviceDate,
1806
+				Mtime:                   time.Now().Unix(),
1784 1807
 				Price:                   warehouse.RetailPrice,
1785 1808
 				WarehousingDetailId:     warehouse.ID,
1786 1809
 				WarehouseOutDetailId:    0,
@@ -1852,7 +1875,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1852 1875
 			WarehouseOutId:          warehouseout.ID,
1853 1876
 			WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1854 1877
 			PatientId:               advice.PatientId,
1855
-			Ctime:                   time.Now().Unix(),
1878
+			Ctime:                   advice.RecordDate,
1856 1879
 			Mtime:                   time.Now().Unix(),
1857 1880
 			Status:                  1,
1858 1881
 			RecordTime:              advice.RecordDate,
@@ -1952,7 +1975,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1952 1975
 			WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1953 1976
 			WarehouseOutId:          warehouseout.ID,
1954 1977
 			Status:                  1,
1955
-			Ctime:                   time.Now().Unix(),
1978
+			Ctime:                   advice.RecordDate,
1979
+			Mtime:                   time.Now().Unix(),
1956 1980
 			Remark:                  warehouse.Remark,
1957 1981
 			OrgId:                   orgID,
1958 1982
 			Type:                    1,
@@ -2035,7 +2059,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2035 2059
 			WarehouseOutId:          warehouseout.ID,
2036 2060
 			WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
2037 2061
 			PatientId:               advice.PatientId,
2038
-			Ctime:                   time.Now().Unix(),
2062
+			Ctime:                   advice.AdviceDate,
2039 2063
 			Mtime:                   time.Now().Unix(),
2040 2064
 			Status:                  1,
2041 2065
 			RecordTime:              advice.RecordDate,
@@ -2117,7 +2141,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2117 2141
 				Count:                   stock_number,
2118 2142
 				Price:                   warehouse.RetailPrice,
2119 2143
 				Status:                  1,
2120
-				Ctime:                   time.Now().Unix(),
2144
+				Ctime:                   advice.AdviceDate,
2145
+				Mtime:                   time.Now().Unix(),
2121 2146
 				UserOrgId:               orgID,
2122 2147
 				Manufacturer:            warehouse.Manufacturer,
2123 2148
 				Dealer:                  warehouse.Dealer,
@@ -2198,7 +2223,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2198 2223
 				DrugId:           advice.DrugId,
2199 2224
 				Count:            (out_count - cancel_count) - deliver_number,
2200 2225
 				Status:           1,
2201
-				Ctime:            ctime,
2226
+				Ctime:            advice.AdviceDate,
2227
+				Mtime:            time.Now().Unix(),
2202 2228
 				OrgId:            advice.UserOrgId,
2203 2229
 				Type:             1,
2204 2230
 				Manufacturer:     manufactureName.ManufacturerName,
@@ -2256,8 +2282,8 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2256 2282
 				Creator:                 advice.ExecutionStaff,
2257 2283
 				UpdateCreator:           0,
2258 2284
 				Status:                  1,
2259
-				Ctime:                   time.Now().Unix(),
2260
-				Mtime:                   0,
2285
+				Ctime:                   advice.AdviceDate,
2286
+				Mtime:                   time.Now().Unix(),
2261 2287
 				Price:                   warehouse.RetailPrice,
2262 2288
 				WarehousingDetailId:     warehouse.ID,
2263 2289
 				WarehouseOutDetailId:    0,
@@ -2334,7 +2360,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
2334 2360
 		advice.PrescribingNumber = float64(prescribingNumber_two_temp)
2335 2361
 		advice.PrescribingNumberUnit = drup.MinUnit
2336 2362
 
2337
-		BloodHisDrugDeliverInfo(orgID, overPlusNumber, warehouseout, drup, advice)
2363
+		BloodHisDrugDeliverInfo(orgID, overPlusNumber, warehouseout, drup, advice, hisprescribingNumber)
2338 2364
 	}
2339 2365
 
2340 2366
 	return
@@ -3929,7 +3955,6 @@ func ConsumablesGoodDeliveryNew(orgID int64, patient_id int64, record_time int64
3929 3955
 		utils.ErrorLog("事务失败,原因为: %v", err)
3930 3956
 		tx.Rollback()
3931 3957
 	} else {
3932
-		fmt.Println("err-----------------------", err)
3933 3958
 		tx.Commit()
3934 3959
 	}
3935 3960
 	var deliver_number int64 = 0
@@ -4507,3 +4532,9 @@ func ConsumablesGoodDeliveryNew(orgID int64, patient_id int64, record_time int64
4507 4532
 
4508 4533
 	return nil
4509 4534
 }
4535
+
4536
+func UpdateDrugWarehouseOutInfoTen(patient_id int64, sys_record_time int64, advice_id int64) error {
4537
+
4538
+	err := XTWriteDB().Model(&models.DrugWarehouseOutInfo{}).Where("patient_id = ? and sys_record_time  = ? and status=1 and advice_id = ?", patient_id, sys_record_time, advice_id).Updates(map[string]interface{}{"status": 0}).Error
4539
+	return err
4540
+}

+ 15 - 0
service/patient_service.go 查看文件

@@ -1654,6 +1654,12 @@ func FindAllDoctorAdviceByGoroupNo(orgID int64, groupno int64) (advice []models.
1654 1654
 	return
1655 1655
 }
1656 1656
 
1657
+func UpdateDoctorAdviceByGoroupNo(id int64, drug_id int64) error {
1658
+
1659
+	err := XTWriteDB().Model(&models.DoctorAdvice{}).Where("id = ? and status =1", id).Updates(map[string]interface{}{"drug_id": drug_id, "drug_name_id": drug_id, "way": 1}).Error
1660
+	return err
1661
+}
1662
+
1657 1663
 func FindAllDoctorAdviceByGoroupNoTwety(orgID int64, groupno int64) (advice []models.DoctorAdvice, err error) {
1658 1664
 	err = readDb.Model(&models.DoctorAdvice{}).Where("user_org_id=?  AND groupno = ? AND status = 1 and (drug_id >0 or drug_name_id >0)", orgID, groupno).Find(&advice).Error
1659 1665
 	return
@@ -3052,3 +3058,12 @@ func GetNewAllMonitorList(orgID int64, scheduleDate int64, pat_type int64) (moni
3052 3058
 	}
3053 3059
 	return monitor, err
3054 3060
 }
3061
+
3062
+func GetBaseDrugByName(drug_name string, org_id int64) (models.BaseDrugLibSeven, error) {
3063
+
3064
+	libSeven := models.BaseDrugLibSeven{}
3065
+
3066
+	err := XTReadDB().Where("drug_name= ? and org_id = ? and status=1", drug_name, org_id).First(&libSeven).Error
3067
+
3068
+	return libSeven, err
3069
+}

+ 1 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go 查看文件

@@ -107,7 +107,7 @@ type AdminUserListTwo struct {
107 107
 
108 108
 func GetAllAdminUsers(orgId int64, appid int64) (list []*AdminUserList, err error) {
109 109
 	db := p_service.UserReadDB()
110
-	err = db.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =? and ua.status=1", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
110
+	err = db.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =?", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
111 111
 	return
112 112
 }
113 113
 

+ 3 - 3
service/schedule_service.go 查看文件

@@ -900,7 +900,7 @@ func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64,
900 900
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
901 901
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
902 902
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
903
-		return db.Where("status =1").Order("id asc")
903
+		return db.Where("status =1 and solution_status =1").Order("id asc")
904 904
 	}).Find(&list).Error
905 905
 
906 906
 	return list, err
@@ -925,7 +925,7 @@ func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType in
925 925
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1 and dialysis_date = ?", scheduleDate).Preload("XtAssessmentBeforeDislysis", "status = 1 and assessment_date =?", scheduleDate).Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
926 926
 		return db.Where("status =1 and parent_id = 0 and advice_date = ?", scheduleDate).Preload("ChildDoctorAdvice", "status = 1")
927 927
 	}).Preload("HisDoctorAdviceInfo", "status = 1 and advice_date = ? and user_org_id = ? ", scheduleDate, orgid).Preload("DialysisPrescription", "status = 1 and record_date =? and user_org_id = ?", scheduleDate, orgid).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
928
-		return db.Where("status =1").Order("id asc")
928
+		return db.Where("status =1 and solution_status = 1").Order("id asc")
929 929
 	}).Preload("LastAfterWeight", func(db *gorm.DB) *gorm.DB {
930 930
 		return db.Where("user_org_id = ? and status = 1 and assessment_date < ?", orgid, scheduleDate)
931 931
 	}).Find(&list).Error
@@ -952,7 +952,7 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
952 952
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export,x.mode_id").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1 and dialysis_date =?", scheduleDate).Preload("XtAssessmentBeforeDislysis", "status = 1 and assessment_date =?", scheduleDate).Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
953 953
 		return db.Where("status =1 and parent_id = 0 and advice_date = ?", scheduleDate).Preload("ChildDoctorAdvice", "status = 1")
954 954
 	}).Preload("HisDoctorAdviceInfo", "status = 1 and advice_date = ?", scheduleDate).Preload("DialysisPrescription", "status = 1 and record_date = ?", scheduleDate).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
955
-		return db.Where("status =1").Order("id asc")
955
+		return db.Where("status =1 and solution_status =1").Order("id asc")
956 956
 	}).Preload("LastAfterWeight", func(db *gorm.DB) *gorm.DB {
957 957
 		return db.Where("user_org_id = ? and status = 1 and assessment_date < ?", orgid, scheduleDate)
958 958
 	}).Find(&list).Error

+ 219 - 52
service/sign_service.go 查看文件

@@ -110,11 +110,11 @@ func CreateUserName(phone string, disPlayName string) (string, string) {
110 110
 	url = "http://demo.itruscloud.com/apigate/contractpaasapi/user/createUserRealName"
111 111
 	var phoneOne string
112 112
 
113
-	phoneOne = "13318464649"
113
+	phoneOne = "13318464642"
114 114
 
115 115
 	var disPlayNameOne string
116 116
 
117
-	disPlayNameOne = "王老师"
117
+	disPlayNameOne = "马云的朋友"
118 118
 
119 119
 	var authentication string
120 120
 	//测试环境用true
@@ -206,11 +206,11 @@ func CreatePersionSeal(user_id string, person_seal_type int64, person_seal_name
206 206
 
207 207
 	maprequest := make(map[string]interface{})
208 208
 
209
-	maprequest["userId"] = "DVVZ65G1JTC1BH3AHYY2KYAE"
209
+	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
210 210
 
211 211
 	maprequest["personSealType"] = 1
212 212
 
213
-	maprequest["personSealName"] = "测试印章"
213
+	maprequest["personSealName"] = "马云朋友的印章"
214 214
 
215 215
 	var url string
216 216
 
@@ -275,11 +275,11 @@ func CreateUploadPact(contractcode string, contractname string, signcount int64,
275 275
 
276 276
 	//maprequest["contractCode"] = "102020620701056856"
277 277
 
278
-	maprequest["contractName"] = "汽车购买交易合同"
278
+	maprequest["contractName"] = "电脑购买交易合同"
279 279
 
280 280
 	maprequest["signCount"] = 10
281 281
 
282
-	maprequest["docName"] = "员工保密协议"
282
+	maprequest["docName"] = "电脑员工保密协议"
283 283
 
284 284
 	file := "C:/Users/28169/Desktop/打印单.pdf"
285 285
 	fileBytes, err := ioutil.ReadFile(file) // 读取file
@@ -289,7 +289,7 @@ func CreateUploadPact(contractcode string, contractname string, signcount int64,
289 289
 	maprequest["contractBase64"] = contractBase64
290 290
 
291 291
 	//添加企业成员 里面的USERID
292
-	maprequest["creator"] = "DCBCD8QR2TU6B83XFF3FOHJL"
292
+	maprequest["creator"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
293 293
 
294 294
 	maprequest["enterpriseId"] = "BRWAABXW3RUD4PGCYEQWRRK8"
295 295
 
@@ -347,7 +347,7 @@ func CreateEnterPriseRealName(enterprisename string) string {
347 347
 	customerReq["idCardType"] = "N"
348 348
 	customerReq["idCardNum"] = "430526199408156511"
349 349
 
350
-	maprequest["enterpriseName"] = "深圳益森科技有限公司"
350
+	maprequest["enterpriseName"] = "深圳德马西科技有限公司"
351 351
 	maprequest["authentication"] = true
352 352
 	maprequest["customerAuthReq"] = customerReq
353 353
 
@@ -398,7 +398,7 @@ func CreateUserId(userId string, displayName string) string {
398 398
 	maprequest := make(map[string]interface{})
399 399
 
400 400
 	maprequest["enterpriseId"] = "BRWAABXW3RUD4PGCYEQWRRK8"
401
-	maprequest["userId"] = "DCBCD8QR2TU6B83XFF3FOHJL"
401
+	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
402 402
 
403 403
 	byterequest, _ := json.Marshal(maprequest)
404 404
 	reader := bytes.NewReader(byterequest)
@@ -477,59 +477,188 @@ func AddContractSignatory(contractId string, signers string, contract models.New
477 477
 
478 478
 	serviceCode := beego.AppConfig.String("serviceCode")
479 479
 
480
+	signFiles := make(map[string]interface{})
481
+
482
+	signFiles["docId"] = "156190809375377646"
483
+
484
+	inputDataArr := make([]map[string]interface{}, 0)
485
+
486
+	for _, item := range signFiles {
487
+		fmt.Println("item", item)
488
+		xySignControls := make(map[string]interface{})
489
+		xySignControls["key"] = "1"
490
+		xySignControls["type"] = "autograph"
491
+		xySignControls["pageNum"] = 1
492
+		xySignControls["positionX"] = 100
493
+		xySignControls["positionY"] = 100
494
+		inputDataArr = append(inputDataArr, xySignControls)
495
+	}
496
+	inputDataArrTwo := make([]map[string]interface{}, 0)
497
+	for _, item := range signFiles {
498
+		fmt.Println(item)
499
+		keywordSignControls := make(map[string]interface{})
500
+		keywordSignControls["key"] = "2"
501
+		keywordSignControls["type"] = "autograph"
502
+		keywordSignControls["pageNum"] = 1
503
+		keywordSignControls["keyword"] = "盖章"
504
+		keywordSignControls["offsetX"] = 100
505
+		keywordSignControls["offsetY"] = 100
506
+		inputDataArrTwo = append(inputDataArrTwo, keywordSignControls)
507
+	}
508
+	signFiles["xySignControls"] = inputDataArr
509
+	signFiles["keywordSignControls"] = inputDataArrTwo
510
+	inputDataArrThree := make([]map[string]interface{}, 0)
511
+	inputDataArrThree = append(inputDataArrThree, signFiles)
512
+
513
+	signersFiles := make(map[string]interface{})
514
+
515
+	signersFiles["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
516
+	signersFiles["signerType"] = "1"
517
+	signersFiles["enterpriseId"] = "BRWAABXW3RUD4PGCYEQWRRK8"
518
+	signersFiles["sequence"] = "8"
519
+	signersFiles["sendMsg"] = false
520
+	signersFiles["signFiles"] = inputDataArrThree
521
+
522
+	inputDataArrFour := make([]map[string]interface{}, 0)
523
+
524
+	inputDataArrFour = append(inputDataArrFour, signersFiles)
525
+
480 526
 	maprequest := make(map[string]interface{})
527
+	maprequest["contractId"] = "156190809375377645"
528
+	maprequest["signers"] = inputDataArrFour
529
+
530
+	byterequest, _ := json.Marshal(maprequest)
531
+	reader := bytes.NewReader(byterequest)
532
+
533
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
534
+
535
+	request, err := http.NewRequest("POST", url, reader)
536
+	if err != nil {
537
+		fmt.Println(err.Error())
538
+	}
539
+
540
+	request.Header.Set("appId", appId)
541
+	request.Header.Set("serviceCode", serviceCode)
542
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
543
+	request.Header.Set("Content-Signature", signatureStr)
544
+	client := http.Client{}
545
+
546
+	resp, err := client.Do(request)
547
+	if err != nil {
548
+		fmt.Println(err.Error())
549
+
550
+	}
551
+	respBytes, err := ioutil.ReadAll(resp.Body)
552
+	if err != nil {
553
+		fmt.Println(err.Error())
554
+
555
+	}
556
+	str := string(respBytes)
557
+
558
+	return str
559
+}
560
+
561
+func CreateBackStageSign(contractId string, signers string) string {
562
+
563
+	var url string
481 564
 
482
-	maprequest["contractId"] = "153497878806048027"
565
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/contract/signByFile"
566
+	appId := beego.AppConfig.String("sign_appid")
567
+
568
+	serviceKye := beego.AppConfig.String("serviceKye")
569
+
570
+	serviceCode := beego.AppConfig.String("serviceCode")
483 571
 
484
-	maprequestOne := make(map[string]interface{})
572
+	sealTimestampFiles := make(map[string]interface{})
573
+	inputDataArr := make([]map[string]interface{}, 0)
574
+	signFiles := make(map[string]interface{})
485 575
 
486
-	maprequestTwo := make(map[string]interface{})
576
+	keywordSignControls := make(map[string]interface{})
577
+	keywordSignControls["controlsKey"] = "2"
578
+	keywordSignControls["pattern"] = 1
579
+	keywordSignControls["color"] = "#FF0000"
580
+	inputDataArr = append(inputDataArr, keywordSignControls)
487 581
 
488
-	var signFiles models.SignFiles
489
-	signFiles.DocId = 343465645
582
+	sealTimestampFiles["allAddTimestamp"] = false
583
+	sealTimestampFiles["someTimestampStyle"] = inputDataArr
490 584
 
491 585
 	inputDataArrOne := make([]map[string]interface{}, 0)
492
-	inputDataArrTwo := make([]map[string]interface{}, 0)
493
-	for _, item := range signFiles.XySignControls {
494 586
 
495
-		inputDataThree := make(map[string]interface{})
496
-		inputDataThree["key"] = item.Key
497
-		inputDataThree["type"] = item.Type
498
-		inputDataThree["pageNum"] = item.PageNum
499
-		inputDataThree["positionX"] = item.PositionX
500
-		inputDataThree["positionY"] = item.PositionY
587
+	keySignControls := make(map[string]interface{})
588
+	keySignControls["controlsKey"] = "1"
589
+	keySignControls["fontType"] = 1
590
+	keySignControls["fontSize"] = 8.5
591
+	keySignControls["fontColor"] = "#56600F"
592
+	keySignControls["alignment"] = 1
593
+	inputDataArrOne = append(inputDataArrOne, keySignControls)
594
+
595
+	signFiles["fonts"] = inputDataArrOne
596
+	signFiles["showTimestamp"] = false
597
+	signFiles["sealTimestamp"] = sealTimestampFiles
598
+	signControl := make(map[string]interface{})
599
+	signControl["1"] = "autograph"
600
+	signFiles["signControl"] = signControl
601
+	signFiles["docId"] = "156190809375377646"
602
+	inputDataArrThree := make([]map[string]interface{}, 0)
603
+	inputDataArrThree = append(inputDataArrThree, signFiles)
604
+
605
+	signer := make(map[string]interface{})
606
+
607
+	signer["signerId"] = "156190965067942129"
608
+	signer["isUserWishes"] = true
609
+	signer["userWishesWay"] = 1
610
+	signer["codeNumber"] = "msg202308111745462623789"
611
+	signer["verifyCode"] = "930788"
612
+	signer["signFiles"] = inputDataArrThree
613
+	maprequest := make(map[string]interface{})
614
+	maprequest["contractId"] = "156190809375377645"
615
+	maprequest["signer"] = signer
501 616
 
502
-		inputDataArrOne = append(inputDataArrOne, inputDataThree)
617
+	byterequest, _ := json.Marshal(maprequest)
618
+	reader := bytes.NewReader(byterequest)
619
+
620
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
621
+
622
+	request, err := http.NewRequest("POST", url, reader)
623
+	if err != nil {
624
+		fmt.Println(err.Error())
503 625
 	}
504 626
 
505
-	for _, item := range signFiles.KeywordSignControls {
506
-		inputDataFour := make(map[string]interface{})
507
-		inputDataFour["key"] = item.Key
508
-		inputDataFour["type"] = item.Type
509
-		inputDataFour["pageNum"] = item.PageNum
510
-		inputDataFour["keyword"] = item.KeyWord
511
-		inputDataFour["positionX"] = item.PositionX
512
-		inputDataFour["positionY"] = item.PositionY
627
+	request.Header.Set("appId", appId)
628
+	request.Header.Set("serviceCode", serviceCode)
629
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
630
+	request.Header.Set("Content-Signature", signatureStr)
631
+	client := http.Client{}
632
+
633
+	resp, err := client.Do(request)
634
+	if err != nil {
635
+		fmt.Println(err.Error())
513 636
 
514
-		inputDataArrTwo = append(inputDataArrTwo, inputDataFour)
515 637
 	}
638
+	respBytes, err := ioutil.ReadAll(resp.Body)
639
+	if err != nil {
640
+		fmt.Println(err.Error())
641
+
642
+	}
643
+	str := string(respBytes)
516 644
 
517
-	maprequestTwo["xySignControls"] = inputDataArrOne
518
-	maprequestTwo["keywordSignControls"] = inputDataArrTwo
519
-	maprequestTwo["docId"] = 1234555
645
+	return str
646
+}
520 647
 
521
-	maprequestOne["userId"] = ""
522
-	maprequestOne["signerType"] = ""
523
-	maprequestOne["enterpriseId"] = ""
524
-	maprequestOne["sequence"] = ""
525
-	maprequestOne["sendMsg"] = false
526
-	maprequestOne["signFiles"] = maprequestTwo
648
+func GetVerificationCode() string {
649
+
650
+	var url string
527 651
 
528
-	maprequestOne["signers"] = maprequestOne
652
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/contract/sendSmsCode"
653
+	appId := beego.AppConfig.String("sign_appid")
529 654
 
530
-	maprequest["contractId"] = contract.ContractId
655
+	serviceKye := beego.AppConfig.String("serviceKye")
531 656
 
532
-	maprequest["signers"] = maprequestOne
657
+	serviceCode := beego.AppConfig.String("serviceCode")
658
+
659
+	maprequest := make(map[string]interface{})
660
+	maprequest["contractId"] = "156190809375377645"
661
+	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
533 662
 
534 663
 	byterequest, _ := json.Marshal(maprequest)
535 664
 	reader := bytes.NewReader(byterequest)
@@ -562,16 +691,54 @@ func AddContractSignatory(contractId string, signers string, contract models.New
562 691
 	return str
563 692
 }
564 693
 
565
-func GetHisDoctorAdviceInfoList(user_org_id int64) (advice []*models.XtDrugWarehouseInfo, err error) {
694
+func CreateEnterprise() string {
566 695
 
567
-	err = XTReadDB().Where("status= 1 and is_check= 1").Find(&advice).Error
696
+	var url string
568 697
 
569
-	return advice, err
570
-}
698
+	url = "http://demo.itruscloud.com/apigate/contractpaasapi/contract/sendSmsCode"
699
+	appId := beego.AppConfig.String("sign_appid")
700
+
701
+	serviceKye := beego.AppConfig.String("serviceKye")
702
+
703
+	serviceCode := beego.AppConfig.String("serviceCode")
704
+
705
+	maprequest := make(map[string]interface{})
706
+	maprequest["contractId"] = "156190809375377645"
707
+	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
708
+	maprequest["sealType"] = 1
709
+	maprequest["sealName"] = "测试用章"
710
+	maprequest["sealBase64"] = ""
711
+	maprequest["color"] = 1
712
+	maprequest["width"] = 40
713
+	maprequest["authUserId"] = ""
714
+	maprequest["sealCreateType"] = false
715
+	byterequest, _ := json.Marshal(maprequest)
716
+	reader := bytes.NewReader(byterequest)
717
+
718
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
719
+
720
+	request, err := http.NewRequest("POST", url, reader)
721
+	if err != nil {
722
+		fmt.Println(err.Error())
723
+	}
724
+
725
+	request.Header.Set("appId", appId)
726
+	request.Header.Set("serviceCode", serviceCode)
727
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
728
+	request.Header.Set("Content-Signature", signatureStr)
729
+	client := http.Client{}
571 730
 
572
-func UpdatePatietPrice(id int64, retail_price float64) (models.DrugFlow, error) {
731
+	resp, err := client.Do(request)
732
+	if err != nil {
733
+		fmt.Println(err.Error())
573 734
 
574
-	flow := models.DrugFlow{}
575
-	err := XTWriteDB().Model(&flow).Where("warehousing_detail_id = ? and status=1", id).Updates(map[string]interface{}{"price": retail_price}).Error
576
-	return flow, err
735
+	}
736
+	respBytes, err := ioutil.ReadAll(resp.Body)
737
+	if err != nil {
738
+		fmt.Println(err.Error())
739
+
740
+	}
741
+	str := string(respBytes)
742
+
743
+	return str
577 744
 }

+ 1 - 1
service/stock_service.go 查看文件

@@ -6109,7 +6109,7 @@ func GetInventoryDetailList(keyword string, limit int64, page int64, orgid int64
6109 6109
 	if storehouse_id > 0 {
6110 6110
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
6111 6111
 	}
6112
-	err = db.Select("x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.expire_date,x.product_date,t.packing_unit,x.last_stock_count,x.type,x.inventory_type,x.stock_count,x.storehouse_id,x.ctime").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
6112
+	err = db.Select("x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.expire_date,x.product_date,t.packing_unit,x.last_stock_count,x.type,x.inventory_type,x.stock_count,x.storehouse_id,x.ctime").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Order("x.id desc").Scan(&list).Error
6113 6113
 	return list, total, err
6114 6114
 }
6115 6115
 

+ 1 - 1
service/user_service.go 查看文件

@@ -90,7 +90,7 @@ func GetAllDoctorAndNurseSeven(orgId int64) (doctors []AdminUserList, nurses []A
90 90
 
91 91
 func GetAllAdminUsers(orgId, appid int64) (list []*AdminUserList, err error) {
92 92
 
93
-	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =? and ua.status=1", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
93
+	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =?", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
94 94
 	//err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1  and ua.status=1").Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
95 95
 	return
96 96
 }

+ 37 - 25
service/warhouse_service.go 查看文件

@@ -619,7 +619,7 @@ func HisDrugsDelivery(orgID int64, creater int64, advice *models.HisDoctorAdvice
619 619
 		if drup.ID > 0 {
620 620
 			prescribingNumber := advice.PrescribingNumber
621 621
 
622
-			BloodHisDrugDeliverInfo(orgID, prescribingNumber, &out, &drup, advice)
622
+			BloodHisDrugDeliverInfo(orgID, prescribingNumber, &out, &drup, advice, prescribingNumber)
623 623
 
624 624
 		} else {
625 625
 			return errors.New("药品信息不存在")
@@ -1488,7 +1488,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1488 1488
 			WarehouseOutId:          warehouseOut.ID,
1489 1489
 			WarehouseInfotId:        warehouse.ID,
1490 1490
 			Status:                  1,
1491
-			Ctime:                   time.Now().Unix(),
1491
+			Ctime:                   record_time,
1492
+			Mtime:                   time.Now().Unix(),
1492 1493
 			Remark:                  warehouse.Remark,
1493 1494
 			OrgId:                   orgID,
1494 1495
 			Type:                    1,
@@ -1525,7 +1526,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1525 1526
 			WarehouseOutId:          warehouseOutInfo.ID,
1526 1527
 			WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
1527 1528
 			PatientId:               patient_id,
1528
-			Ctime:                   time.Now().Unix(),
1529
+			Ctime:                   record_time,
1529 1530
 			Mtime:                   time.Now().Unix(),
1530 1531
 			Status:                  1,
1531 1532
 			RecordTime:              record_time,
@@ -1554,7 +1555,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1554 1555
 				Count:                   deliver_number,
1555 1556
 				Price:                   warehouse.PackingPrice,
1556 1557
 				Status:                  1,
1557
-				Ctime:                   time.Now().Unix(),
1558
+				Ctime:                   record_time,
1559
+				Mtime:                   time.Now().Unix(),
1558 1560
 				UserOrgId:               orgID,
1559 1561
 				Manufacturer:            warehouse.Manufacturer,
1560 1562
 				Dealer:                  warehouse.Dealer,
@@ -1595,7 +1597,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1595 1597
 					Count:                   exsit.Count + goods.Count,
1596 1598
 					Price:                   warehouse.PackingPrice,
1597 1599
 					Status:                  1,
1598
-					Ctime:                   time.Now().Unix(),
1600
+					Ctime:                   record_time,
1601
+					Mtime:                   time.Now().Unix(),
1599 1602
 					UserOrgId:               orgID,
1600 1603
 					Manufacturer:            warehouse.Manufacturer,
1601 1604
 					Dealer:                  warehouse.Dealer,
@@ -1631,7 +1634,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1631 1634
 				Count:                   deliver_number,
1632 1635
 				Price:                   warehouse.PackingPrice,
1633 1636
 				Status:                  1,
1634
-				Ctime:                   time.Now().Unix(),
1637
+				Ctime:                   record_time,
1638
+				Mtime:                   time.Now().Unix(),
1635 1639
 				UserOrgId:               orgID,
1636 1640
 				Manufacturer:            warehouse.Manufacturer,
1637 1641
 				Dealer:                  warehouse.Dealer,
@@ -1669,7 +1673,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1669 1673
 					Count:                   exsit.Count + goods.Count,
1670 1674
 					Price:                   warehouse.PackingPrice,
1671 1675
 					Status:                  1,
1672
-					Ctime:                   time.Now().Unix(),
1676
+					Ctime:                   record_time,
1677
+					Mtime:                   time.Now().Unix(),
1673 1678
 					UserOrgId:               orgID,
1674 1679
 					Manufacturer:            warehouse.Manufacturer,
1675 1680
 					Dealer:                  warehouse.Dealer,
@@ -1715,7 +1720,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1715 1720
 			WarehouseOutId:          warehouseOut.ID,
1716 1721
 			WarehouseInfotId:        warehouse.ID,
1717 1722
 			Status:                  1,
1718
-			Ctime:                   time.Now().Unix(),
1723
+			Ctime:                   record_time,
1724
+			Mtime:                   time.Now().Unix(),
1719 1725
 			Remark:                  warehouse.Remark,
1720 1726
 			OrgId:                   orgID,
1721 1727
 			Type:                    1,
@@ -1757,7 +1763,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1757 1763
 				Count:                   stock_number,
1758 1764
 				Price:                   warehouse.PackingPrice,
1759 1765
 				Status:                  1,
1760
-				Ctime:                   time.Now().Unix(),
1766
+				Ctime:                   record_time,
1767
+				Mtime:                   time.Now().Unix(),
1761 1768
 				UserOrgId:               orgID,
1762 1769
 				Manufacturer:            warehouse.Manufacturer,
1763 1770
 				Dealer:                  warehouse.Dealer,
@@ -1793,7 +1800,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1793 1800
 					Count:                   exsit.Count + goods.Count,
1794 1801
 					Price:                   warehouse.PackingPrice,
1795 1802
 					Status:                  1,
1796
-					Ctime:                   time.Now().Unix(),
1803
+					Ctime:                   record_time,
1804
+					Mtime:                   time.Now().Unix(),
1797 1805
 					UserOrgId:               orgID,
1798 1806
 					Manufacturer:            warehouse.Manufacturer,
1799 1807
 					Dealer:                  warehouse.Dealer,
@@ -1835,7 +1843,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1835 1843
 				Count:                   stock_number,
1836 1844
 				Price:                   warehouse.PackingPrice,
1837 1845
 				Status:                  1,
1838
-				Ctime:                   time.Now().Unix(),
1846
+				Ctime:                   record_time,
1847
+				Mtime:                   time.Now().Unix(),
1839 1848
 				UserOrgId:               orgID,
1840 1849
 				Manufacturer:            warehouse.Manufacturer,
1841 1850
 				Dealer:                  warehouse.Dealer,
@@ -1871,7 +1880,8 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1871 1880
 					Count:                   exsit.Count + goods.Count,
1872 1881
 					Price:                   warehouse.PackingPrice,
1873 1882
 					Status:                  1,
1874
-					Ctime:                   time.Now().Unix(),
1883
+					Ctime:                   record_time,
1884
+					Mtime:                   time.Now().Unix(),
1875 1885
 					UserOrgId:               orgID,
1876 1886
 					Manufacturer:            warehouse.Manufacturer,
1877 1887
 					Dealer:                  warehouse.Dealer,
@@ -1941,7 +1951,8 @@ func ConsumablesDeliveryDelete(orgID int64, patient_id int64, record_time int64,
1941 1951
 			WarehouseOutId:          warehouseOut.ID,
1942 1952
 			//WarehouseInfoId:		 warehouse.ID,
1943 1953
 			Status:        1,
1944
-			Ctime:         time.Now().Unix(),
1954
+			Ctime:         record_time,
1955
+			Mtime:         time.Now().Unix(),
1945 1956
 			Remark:        "",
1946 1957
 			OrgId:         orgID,
1947 1958
 			Type:          1,
@@ -1966,7 +1977,7 @@ func ConsumablesDeliveryDelete(orgID int64, patient_id int64, record_time int64,
1966 1977
 				WarehouseOutId:          warehouseOutInfo.ID,
1967 1978
 				WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
1968 1979
 				PatientId:               patient_id,
1969
-				Ctime:                   time.Now().Unix(),
1980
+				Ctime:                   record_time,
1970 1981
 				Mtime:                   time.Now().Unix(),
1971 1982
 				Status:                  1,
1972 1983
 				RecordTime:              record_time,
@@ -2035,7 +2046,8 @@ func ConsumablesDeliveryDelete(orgID int64, patient_id int64, record_time int64,
2035 2046
 			Total:           0,
2036 2047
 			ProductDate:     ware.ProductDate,
2037 2048
 			ExpiryDate:      ware.ExpiryDate,
2038
-			Ctime:           time.Now().Unix(),
2049
+			Ctime:           record_time,
2050
+			Mtime:           time.Now().Unix(),
2039 2051
 			Status:          1,
2040 2052
 			OrgId:           good_yc.UserOrgId,
2041 2053
 			OrderNumber:     cancel.OrderNumber,
@@ -2081,8 +2093,8 @@ func ConsumablesDeliveryDelete(orgID int64, patient_id int64, record_time int64,
2081 2093
 			Creator:                 warehouseOut.Creater,
2082 2094
 			UpdateCreator:           0,
2083 2095
 			Status:                  1,
2084
-			Ctime:                   time.Now().Unix(),
2085
-			Mtime:                   0,
2096
+			Ctime:                   record_time,
2097
+			Mtime:                   time.Now().Unix(),
2086 2098
 			Price:                   ware.Price,
2087 2099
 			WarehousingDetailId:     ware.WarehouseInfotId,
2088 2100
 			WarehouseOutDetailId:    ware.ID,
@@ -5522,8 +5534,8 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5522 5534
 			Creator:                 creator,
5523 5535
 			UpdateCreator:           0,
5524 5536
 			Status:                  1,
5525
-			Ctime:                   time.Now().Unix(),
5526
-			Mtime:                   0,
5537
+			Ctime:                   record_time,
5538
+			Mtime:                   time.Now().Unix(),
5527 5539
 			Price:                   warehouse.PackingPrice, //零售价
5528 5540
 			WarehousingDetailId:     warehouse.ID,
5529 5541
 			WarehouseOutDetailId:    goods.ID,
@@ -5670,8 +5682,8 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5670 5682
 			Creator:                 creator,
5671 5683
 			UpdateCreator:           0,
5672 5684
 			Status:                  1,
5673
-			Ctime:                   time.Now().Unix(),
5674
-			Mtime:                   0,
5685
+			Ctime:                   record_time,
5686
+			Mtime:                   time.Now().Unix(),
5675 5687
 			Price:                   warehouse.PackingPrice, //零售价
5676 5688
 			WarehousingDetailId:     warehouse.ID,
5677 5689
 			WarehouseOutDetailId:    goods.ID,
@@ -5755,8 +5767,6 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5755 5767
 // 药品手动出库 递归方式
5756 5768
 func AutoDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, warehouseout *models.DrugWarehouseOut, drup *models.BaseDrugLib, advice *models.DrugWarehouseOutInfo) (err error) {
5757 5769
 
5758
-	fmt.Println("出库数量", prescribingNumber)
5759
-
5760 5770
 	// 判断处方里药品单位是拆零单位还是包装单位,	如果是包装单位,则根据规格,将包装数量转为拆零数量
5761 5771
 	var deliver_number int64 = 0
5762 5772
 	var stock_number int64 = 0
@@ -5917,7 +5927,8 @@ func AutoDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, warehous
5917 5927
 			Count:                   deliver_number,
5918 5928
 			Price:                   warehouse.RetailPrice,
5919 5929
 			Status:                  1,
5920
-			Ctime:                   time.Now().Unix(),
5930
+			Ctime:                   advice.SysRecordTime,
5931
+			Mtime:                   time.Now().Unix(),
5921 5932
 			UserOrgId:               advice.OrgId,
5922 5933
 			Manufacturer:            advice.Manufacturer,
5923 5934
 			Dealer:                  advice.Dealer,
@@ -5985,7 +5996,8 @@ func AutoDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, warehous
5985 5996
 			Count:                   stock_number,
5986 5997
 			Price:                   warehouse.RetailPrice,
5987 5998
 			Status:                  1,
5988
-			Ctime:                   time.Now().Unix(),
5999
+			Ctime:                   advice.SysRecordTime,
6000
+			Mtime:                   time.Now().Unix(),
5989 6001
 			UserOrgId:               advice.OrgId,
5990 6002
 			Manufacturer:            advice.Manufacturer,
5991 6003
 			Dealer:                  advice.Dealer,