|
@@ -4332,14 +4332,14 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
|
4332
|
4332
|
}
|
4333
|
4333
|
|
4334
|
4334
|
good_id := int64(items["good_id"].(float64))
|
4335
|
|
- fmt.Println("goood_id2222222222222222", good_id)
|
|
4335
|
+
|
4336
|
4336
|
if items["good_type_id"] == nil || reflect.TypeOf(items["good_type_id"]).String() != "float64" {
|
4337
|
4337
|
utils.ErrorLog("good_type_id")
|
4338
|
4338
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
4339
|
4339
|
return
|
4340
|
4340
|
}
|
4341
|
4341
|
good_type_id := int64(items["good_type_id"].(float64))
|
4342
|
|
- fmt.Println("goood_id2222222222222222", good_type_id)
|
|
4342
|
+
|
4343
|
4343
|
if items["count"] == nil || reflect.TypeOf(items["count"]).String() != "string" {
|
4344
|
4344
|
utils.ErrorLog("count")
|
4345
|
4345
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -4347,7 +4347,7 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
|
4347
|
4347
|
}
|
4348
|
4348
|
|
4349
|
4349
|
count, _ := strconv.ParseInt(items["count"].(string), 10, 64)
|
4350
|
|
- fmt.Println("count22222222", count)
|
|
4350
|
+
|
4351
|
4351
|
adminUser := c.GetMobileAdminUserInfo()
|
4352
|
4352
|
prepare := &models.DialysisBeforePrepare{
|
4353
|
4353
|
UserOrgId: adminUser.Org.Id,
|
|
@@ -4679,18 +4679,22 @@ func (c *DialysisAPIController) BathDeleteAdviceList() {
|
4679
|
4679
|
|
4680
|
4680
|
dataBody := make(map[string]interface{}, 0)
|
4681
|
4681
|
err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
4682
|
|
- idsInt := dataBody["ids"].([]interface{})
|
4683
|
|
- ids := make([]int64, 0)
|
4684
|
|
- for _, item := range idsInt {
|
4685
|
|
- id, _ := strconv.ParseInt(item.(string), 10, 64)
|
4686
|
|
- ids = append(ids, id)
|
|
4682
|
+ ids := c.GetString("ids")
|
|
4683
|
+ fmt.Println("dis22222222", ids)
|
|
4684
|
+ idArray := strings.Split(ids, ",")
|
|
4685
|
+ origin, _ := c.GetInt64("origin")
|
|
4686
|
+ if origin == 1 {
|
|
4687
|
+ err = service.BatchDeleteAdvice(idArray)
|
|
4688
|
+ fmt.Print("err", err)
|
|
4689
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
4690
|
+ "msg": "批量删除成功",
|
|
4691
|
+ })
|
|
4692
|
+ return
|
|
4693
|
+ }
|
|
4694
|
+
|
|
4695
|
+ if origin == 2 {
|
|
4696
|
+ service.BatchDeleteHisAdvice(idArray)
|
4687
|
4697
|
}
|
4688
|
|
- err = service.BatchDeleteAdvice(ids)
|
4689
|
|
- fmt.Print("err", err)
|
4690
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
4691
|
|
- "msg": "批量删除成功",
|
4692
|
|
- })
|
4693
|
|
- return
|
4694
|
4698
|
}
|
4695
|
4699
|
|
4696
|
4700
|
func (c *DialysisAPIController) UpdateAutoReduceDetail() {
|
|
@@ -4718,3 +4722,61 @@ func (c *DialysisAPIController) DeleteAutoReduceDetail() {
|
4718
|
4722
|
})
|
4719
|
4723
|
return
|
4720
|
4724
|
}
|
|
4725
|
+
|
|
4726
|
+func (c *DialysisAPIController) BatchAdviceCheck() {
|
|
4727
|
+
|
|
4728
|
+ ids := c.GetString("ids")
|
|
4729
|
+ fmt.Println("dis22222222", ids)
|
|
4730
|
+ idArray := strings.Split(ids, ",")
|
|
4731
|
+ creator, _ := c.GetInt64("creator")
|
|
4732
|
+ origin, _ := c.GetInt64("origin")
|
|
4733
|
+ if origin == 1 {
|
|
4734
|
+ err := service.BatchAdviceCheck(idArray, creator)
|
|
4735
|
+ fmt.Println(err)
|
|
4736
|
+ list, _ := service.GetAdviceExecutionById(idArray)
|
|
4737
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
4738
|
+ "list": list,
|
|
4739
|
+ })
|
|
4740
|
+ return
|
|
4741
|
+ }
|
|
4742
|
+ if origin == 2 {
|
|
4743
|
+ service.BatchHisAdviceCheck(idArray, creator)
|
|
4744
|
+ }
|
|
4745
|
+
|
|
4746
|
+}
|
|
4747
|
+
|
|
4748
|
+func (c *DialysisAPIController) BatchAdviceExecution() {
|
|
4749
|
+
|
|
4750
|
+ ids := c.GetString("ids")
|
|
4751
|
+ fmt.Println("dis22222222", ids)
|
|
4752
|
+ idArray := strings.Split(ids, ",")
|
|
4753
|
+ executionTime := c.GetString("execution_time")
|
|
4754
|
+ fmt.Println("333333333", executionTime)
|
|
4755
|
+ creator, _ := c.GetInt64("creator")
|
|
4756
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
4757
|
+ loc, _ := time.LoadLocation("Local")
|
|
4758
|
+
|
|
4759
|
+ theTime, _ := time.ParseInLocation(timeLayout, executionTime, loc)
|
|
4760
|
+
|
|
4761
|
+ orgin, _ := c.GetInt64("origin")
|
|
4762
|
+ if orgin == 1 {
|
|
4763
|
+ err := service.BatchAdviceExecution(idArray, creator, theTime.Unix())
|
|
4764
|
+ list, _ := service.GetAdviceExecutionById(idArray)
|
|
4765
|
+ fmt.Println(err)
|
|
4766
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
4767
|
+ "list": list,
|
|
4768
|
+ })
|
|
4769
|
+ return
|
|
4770
|
+ }
|
|
4771
|
+
|
|
4772
|
+ if orgin == 2 {
|
|
4773
|
+ err := service.BatchAdviceExecution(idArray, creator, theTime.Unix())
|
|
4774
|
+ list, _ := service.GetHisAdviceExecutionById(idArray)
|
|
4775
|
+ fmt.Println(err)
|
|
4776
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
4777
|
+ "list": list,
|
|
4778
|
+ })
|
|
4779
|
+ return
|
|
4780
|
+ }
|
|
4781
|
+
|
|
4782
|
+}
|