正在显示
1 个修改的文件
包含
10 行增加
和
11 行删除
@@ -40,7 +40,7 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | @@ -40,7 +40,7 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | ||
40 | PartnerType int `json:"partnerType"` | 40 | PartnerType int `json:"partnerType"` |
41 | Area string `json:"area"` | 41 | Area string `json:"area"` |
42 | Account string `json:"account"` | 42 | Account string `json:"account"` |
43 | - State string `json:"state"` | 43 | + State int `json:"state"` |
44 | CooperationTime string `json:"cooperationTime"` | 44 | CooperationTime string `json:"cooperationTime"` |
45 | SalesmanName string `json:"salesmanName"` | 45 | SalesmanName string `json:"salesmanName"` |
46 | Phone string `json:"phone"` | 46 | Phone string `json:"phone"` |
@@ -55,10 +55,9 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | @@ -55,10 +55,9 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | ||
55 | return | 55 | return |
56 | } | 56 | } |
57 | defaultPwd := fmt.Sprintf("%x", sha1.Sum([]byte("123456"))) | 57 | defaultPwd := fmt.Sprintf("%x", sha1.Sum([]byte("123456"))) |
58 | - state, _ := strconv.Atoi(param.State) | ||
59 | cooperateTime, err := time.ParseInLocation("2006-01-02", param.CooperationTime, time.Local) | 58 | cooperateTime, err := time.ParseInLocation("2006-01-02", param.CooperationTime, time.Local) |
60 | if err != nil { | 59 | if err != nil { |
61 | - e := lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) | 60 | + e := lib.ThrowError(lib.ARG_ERROR, err.Error()) |
62 | c.ResponseError(e) | 61 | c.ResponseError(e) |
63 | return | 62 | return |
64 | } | 63 | } |
@@ -66,7 +65,7 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | @@ -66,7 +65,7 @@ func (c *PartnerInfoController) CreatePartnerInfo() { | ||
66 | PartnerName: param.PartnerName, | 65 | PartnerName: param.PartnerName, |
67 | Account: param.Account, | 66 | Account: param.Account, |
68 | Password: defaultPwd, | 67 | Password: defaultPwd, |
69 | - Status: state, | 68 | + Status: param.State, |
70 | PartnerCategory: param.PartnerType, | 69 | PartnerCategory: param.PartnerType, |
71 | CooperateTime: cooperateTime, | 70 | CooperateTime: cooperateTime, |
72 | RegionInfo: &domain.RegionInfo{ | 71 | RegionInfo: &domain.RegionInfo{ |
@@ -96,7 +95,7 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | @@ -96,7 +95,7 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | ||
96 | ID int64 `json:"id"` | 95 | ID int64 `json:"id"` |
97 | PartnerType int `json:"partnerType"` | 96 | PartnerType int `json:"partnerType"` |
98 | Area string `json:"area"` | 97 | Area string `json:"area"` |
99 | - State string `json:"state"` | 98 | + State int `json:"state"` |
100 | CooperationTime string `json:"cooperationTime"` | 99 | CooperationTime string `json:"cooperationTime"` |
101 | SalesmanName string `json:"salesmanName"` | 100 | SalesmanName string `json:"salesmanName"` |
102 | Phone string `json:"phone"` | 101 | Phone string `json:"phone"` |
@@ -110,7 +109,6 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | @@ -110,7 +109,6 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | ||
110 | c.ResponseError(errors.New("json数据解析失败")) | 109 | c.ResponseError(errors.New("json数据解析失败")) |
111 | return | 110 | return |
112 | } | 111 | } |
113 | - state, _ := strconv.Atoi(param.State) | ||
114 | cooperateTime, err := time.ParseInLocation("2006-01-02", param.CooperationTime, time.Local) | 112 | cooperateTime, err := time.ParseInLocation("2006-01-02", param.CooperationTime, time.Local) |
115 | if err != nil { | 113 | if err != nil { |
116 | e := lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) | 114 | e := lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error()) |
@@ -118,7 +116,7 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | @@ -118,7 +116,7 @@ func (c *PartnerInfoController) UpdatePartnerInfo() { | ||
118 | return | 116 | return |
119 | } | 117 | } |
120 | cmd := partnerInfoCmd.UpdatePartnerInfoCommand{ | 118 | cmd := partnerInfoCmd.UpdatePartnerInfoCommand{ |
121 | - Status: state, | 119 | + Status: param.State, |
122 | PartnerCategory: param.PartnerType, | 120 | PartnerCategory: param.PartnerType, |
123 | CooperateTime: cooperateTime, | 121 | CooperateTime: cooperateTime, |
124 | RegionInfo: &domain.RegionInfo{ | 122 | RegionInfo: &domain.RegionInfo{ |
@@ -168,13 +166,13 @@ func (c *PartnerInfoController) GetPartnerInfo() { | @@ -168,13 +166,13 @@ func (c *PartnerInfoController) GetPartnerInfo() { | ||
168 | rspResult := map[string]interface{}{ | 166 | rspResult := map[string]interface{}{ |
169 | "account": partnerInfo.Account, | 167 | "account": partnerInfo.Account, |
170 | "partnerName": partnerInfo.PartnerName, | 168 | "partnerName": partnerInfo.PartnerName, |
171 | - "partnertype": partnerInfo.PartnerCategory, | 169 | + "partnerType": partnerInfo.PartnerCategory, |
172 | "area": partnerInfo.RegionInfo.RegionName, | 170 | "area": partnerInfo.RegionInfo.RegionName, |
173 | "salesmanName": "", | 171 | "salesmanName": "", |
174 | "phone": "", | 172 | "phone": "", |
175 | "createTime": partnerInfo.CreateAt.Format("2006-01-02 15:04:05"), | 173 | "createTime": partnerInfo.CreateAt.Format("2006-01-02 15:04:05"), |
176 | "cooperationTime": partnerInfo.CooperateTime.Format("2006-01-02"), | 174 | "cooperationTime": partnerInfo.CooperateTime.Format("2006-01-02"), |
177 | - "state": fmt.Sprint(partnerInfo.Status), | 175 | + "state": partnerInfo.Status, |
178 | "id": partnerInfo.Id, | 176 | "id": partnerInfo.Id, |
179 | } | 177 | } |
180 | if len(partnerInfo.Salesman) > 0 { | 178 | if len(partnerInfo.Salesman) > 0 { |
@@ -185,7 +183,7 @@ func (c *PartnerInfoController) GetPartnerInfo() { | @@ -185,7 +183,7 @@ func (c *PartnerInfoController) GetPartnerInfo() { | ||
185 | return | 183 | return |
186 | } | 184 | } |
187 | 185 | ||
188 | -//GetPartnerInfo 移除合伙人 | 186 | +//PartnerInfoSetState 合伙人禁用启用 |
189 | func (c *PartnerInfoController) PartnerInfoSetState() { | 187 | func (c *PartnerInfoController) PartnerInfoSetState() { |
190 | //用与适配前端定义的数据结构 | 188 | //用与适配前端定义的数据结构 |
191 | type Parameter struct { | 189 | type Parameter struct { |
@@ -274,7 +272,8 @@ func (c *PartnerInfoController) ListPartnerInfo() { | @@ -274,7 +272,8 @@ func (c *PartnerInfoController) ListPartnerInfo() { | ||
274 | "area": partners[i].RegionInfo.RegionName, | 272 | "area": partners[i].RegionInfo.RegionName, |
275 | "createTime": partners[i].CreateAt.Format("2006-01-02 15:04:05"), | 273 | "createTime": partners[i].CreateAt.Format("2006-01-02 15:04:05"), |
276 | "cooperationTime": partners[i].CooperateTime.Format("2006-01-02"), | 274 | "cooperationTime": partners[i].CooperateTime.Format("2006-01-02"), |
277 | - "state": fmt.Sprint(partners[i].Status), | 275 | + "state": partners[i].Status, |
276 | + "partnerType": partners[i].PartnerCategory, | ||
278 | "salesmanName": "", | 277 | "salesmanName": "", |
279 | "phone": "", | 278 | "phone": "", |
280 | } | 279 | } |
-
请 注册 或 登录 后发表评论