|
@@ -38,7 +38,8 @@ func (s *BodyCheckServ) GetCheckByUser() (map[string]interface{}, error) {
|
38
|
38
|
return nil, err
|
39
|
39
|
}
|
40
|
40
|
if len(bodyCheck) == 0 {
|
41
|
|
- return nil, errors.New("没有查询到数据")
|
|
41
|
+ utils.LogError("没有查询到数据:" + err.Error())
|
|
42
|
+ return nil, errors.New("log-error-没有查询到数据")
|
42
|
43
|
}
|
43
|
44
|
presentations, err := s.dao.GetPresentationByCheckID(bodyCheck[0].Id)
|
44
|
45
|
if err != nil {
|
|
@@ -90,6 +91,9 @@ func (s *BodyCheckServ) PostCheckResult(formVal map[string]interface{}) error {
|
90
|
91
|
if customer == nil || customer.CustomerId == "" {
|
91
|
92
|
return errors.New("没有当前用户信息!")
|
92
|
93
|
}
|
|
94
|
+ beego.Error("—————————————————————————用户——————————————————————————")
|
|
95
|
+ beego.Error(customer)
|
|
96
|
+ beego.Error("+++++++++++++++++++++++++++++++++++++++++++++++++++++++")
|
93
|
97
|
userid := customer.CustomerId
|
94
|
98
|
checkinfo, err := s.dao.GetCheckByUserAndEquipmentID(userid, result.EquipmentId)
|
95
|
99
|
if err != nil {
|
|
@@ -106,6 +110,9 @@ func (s *BodyCheckServ) PostCheckResult(formVal map[string]interface{}) error {
|
106
|
110
|
if caseEquipment == nil || caseEquipment.EquipmentId == "" {
|
107
|
111
|
return errors.New("设备未维护!")
|
108
|
112
|
}
|
|
113
|
+ beego.Error("___________________设备——————————————————————————")
|
|
114
|
+ beego.Error(caseEquipment)
|
|
115
|
+ beego.Error("________________________________________________")
|
109
|
116
|
|
110
|
117
|
var checkNew = model.TaBodyCheck{}
|
111
|
118
|
checkNew.CaseId = caseEquipment.CaseId
|
|
@@ -113,12 +120,20 @@ func (s *BodyCheckServ) PostCheckResult(formVal map[string]interface{}) error {
|
113
|
120
|
checkNew.UserId = userid
|
114
|
121
|
checkNew.ReportUrl = result.HMSReportUrl
|
115
|
122
|
checkNew.CreateDate = result.CheckDate
|
|
123
|
+ beego.Error("______checkNew___________________")
|
|
124
|
+ beego.Error(checkNew)
|
|
125
|
+ beego.Error("+++++++++++++++++++++++++++++++++")
|
116
|
126
|
checkinfo, err = s.dao.SaveBodyCheckInfo(checkNew)
|
117
|
|
-
|
|
127
|
+ beego.Error("____________checkInfo____________")
|
|
128
|
+ beego.Error(checkinfo)
|
|
129
|
+ beego.Error("__________________________________")
|
118
|
130
|
wxconf, _ := config.NewConfig("ini", "conf/wechat.conf")
|
119
|
131
|
messageTplID := wxconf.String("messageTplID")
|
120
|
132
|
|
121
|
133
|
org := s.ctx.Get("org").(model.SysOrg)
|
|
134
|
+ beego.Error("***************ORG******************")
|
|
135
|
+ beego.Error(org)
|
|
136
|
+ beego.Error("************************************")
|
122
|
137
|
|
123
|
138
|
utils.WxClientFor(org.OrgId).SendTplMessage(result.WechatAccount, messageTplID, beego.AppConfig.String("resultURL"), map[string]wx.TplMessageData{
|
124
|
139
|
"first": wx.TplMessageData{
|
|
@@ -141,7 +156,10 @@ func (s *BodyCheckServ) PostCheckResult(formVal map[string]interface{}) error {
|
141
|
156
|
utils.LogError("获取报告明细失败:", err)
|
142
|
157
|
return errors.New("获取报告明细失败")
|
143
|
158
|
}
|
144
|
|
- if presentation == nil || presentation.Id != "" {
|
|
159
|
+ beego.Error("________________presentation___________")
|
|
160
|
+ beego.Error(presentation)
|
|
161
|
+ beego.Error("_______________________________________")
|
|
162
|
+ if presentation == nil || presentation.Id == "" {
|
145
|
163
|
// 新增
|
146
|
164
|
var preNew = model.TaPresentation{}
|
147
|
165
|
preNew.CheckId = checkinfo.Id
|
|
@@ -177,6 +195,9 @@ func (s *BodyCheckServ) PostCheckResult(formVal map[string]interface{}) error {
|
177
|
195
|
utils.LogError("获取spec信息失败:", err)
|
178
|
196
|
return errors.New("获取spec信息失败")
|
179
|
197
|
}
|
|
198
|
+ beego.Error("_________checkSpec___________")
|
|
199
|
+ beego.Error(specs)
|
|
200
|
+ beego.Error("____________________________")
|
180
|
201
|
|
181
|
202
|
if len(formVal) > 0 {
|
182
|
203
|
var details []model.TaPresentationDetail
|