|
|
@@ -1,7 +1,9 @@
|
|
|
package register
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/oilrtx"
|
|
|
"encoding/json"
|
|
|
+ "io/ioutil"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
@@ -291,6 +293,29 @@ func (this *OilCorporateInfoController) ComAudit() {
|
|
|
//插入更新数据
|
|
|
_, err3 := svcRegister.InsertEntityBytbl(OilCorporateInfoName, &model)
|
|
|
if err3 == nil {
|
|
|
+ //编辑短信内容
|
|
|
+ toMobile:=model.UserTelephone
|
|
|
+ msg:="恭喜您!市场管理信息系统账号注册成功,系统登录用户名为: "+model.UserName
|
|
|
+
|
|
|
+ //调用短信接口发送短信
|
|
|
+ rtxSvc := oilrtx.GetRtxService(utils.DBE)
|
|
|
+ resp:=rtxSvc.HandleSendMsg("", toMobile, msg)
|
|
|
+ jsonBlob, _ := ioutil.ReadAll(resp.Body)
|
|
|
+ var rtxRespToken oilrtx.RtxRespToken
|
|
|
+ json.Unmarshal(jsonBlob, &rtxRespToken)
|
|
|
+
|
|
|
+ //如果发送返回代码存入短信信息记录表
|
|
|
+ var resultMsg oilrtx.BaseMsg
|
|
|
+ resultMsg.Type="1-1"
|
|
|
+ resultMsg.UserName=model.UserName
|
|
|
+ resultMsg.UserRealName=model.UserRealName
|
|
|
+ resultMsg.UserId=strconv.Itoa(model.UserId)
|
|
|
+ resultMsg.ToMobile=toMobile
|
|
|
+ resultMsg.Msg=msg
|
|
|
+ resultMsg.ToTime=time.Now().Format("2006-01-02 15:04:05")
|
|
|
+ resultMsg.Status=strconv.Itoa(rtxRespToken.Code)
|
|
|
+ svcRegister.InsertEntityBytbl("Base_Msg", &resultMsg)
|
|
|
+
|
|
|
errinfo.Message = "审核通过!"
|
|
|
errinfo.Code = 0
|
|
|
errinfo.Item = model.Id
|
|
|
@@ -315,11 +340,36 @@ func (this *OilCorporateInfoController) ComAudit() {
|
|
|
this.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
}else {
|
|
|
upmodel.Remark = Remark
|
|
|
upmodel.CheckStatus = -1 //未通过审核
|
|
|
cols := []string{"Remark", "CheckStatus"}
|
|
|
err = svc.UpdateEntityBytbl(OilCorporateInfoName, model.Id, &upmodel, cols)
|
|
|
+
|
|
|
+ //编辑短信内容
|
|
|
+ toMobile:=model.UserTelephone
|
|
|
+ msg:="市场管理信息系统账号注册失败,因“"+Remark+"”,请按照要求重新注册,联系人:"+model.CheckUserName+",联系电话:**"
|
|
|
+
|
|
|
+ //调用短信接口发送短信
|
|
|
+ rtxSvc := oilrtx.GetRtxService(utils.DBE)
|
|
|
+ resp:=rtxSvc.HandleSendMsg("", toMobile, msg)
|
|
|
+ jsonBlob, _ := ioutil.ReadAll(resp.Body)
|
|
|
+ var rtxRespToken oilrtx.RtxRespToken
|
|
|
+ json.Unmarshal(jsonBlob, &rtxRespToken)
|
|
|
+
|
|
|
+ //如果发送返回代码存入短信信息记录表
|
|
|
+ var resultMsg oilrtx.BaseMsg
|
|
|
+ resultMsg.Type="1-2"
|
|
|
+ resultMsg.UserName=model.UserName
|
|
|
+ resultMsg.UserRealName=model.UserRealName
|
|
|
+ resultMsg.UserId=strconv.Itoa(model.UserId)
|
|
|
+ resultMsg.ToMobile=toMobile
|
|
|
+ resultMsg.Msg=msg
|
|
|
+ resultMsg.ToTime=time.Now().Format("2006-01-02 15:04:05")
|
|
|
+ resultMsg.Status=strconv.Itoa(rtxRespToken.Code)
|
|
|
+ svc.InsertEntityBytbl("Base_Msg", &resultMsg)
|
|
|
+
|
|
|
if err == nil {
|
|
|
errinfo.Message = "审核未通过!"
|
|
|
errinfo.Code = 0
|