|
@@ -112,7 +112,7 @@ public class TaCompanySealController extends BaseController {
|
112
|
112
|
ResponseBean responseBean = new ResponseBean();
|
113
|
113
|
try {
|
114
|
114
|
TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
115
|
|
- String result = taCompanySealUtil.addSignaTrue(taCompany.getFadadaCode(), taCompanySeal.getSealImg());
|
|
115
|
+ String result = taCompanySealUtil.addSignaTure(taCompany.getFadadaCode(), taCompanySeal.getSealImg());
|
116
|
116
|
JSONObject params = JSONObject.parseObject(result);
|
117
|
117
|
if (!String.valueOf(CommConstant.STATUS_NORMAL).equals(params.get("code"))){
|
118
|
118
|
responseBean.addError(params.get("msg").toString());
|
|
@@ -122,6 +122,7 @@ public class TaCompanySealController extends BaseController {
|
122
|
122
|
String data = params.getString("data");
|
123
|
123
|
taCompanySeal.setCreateDate(LocalDateTime.now());
|
124
|
124
|
taCompanySeal.setStatus(CommConstant.STATUS_NORMAL);
|
|
125
|
+ taCompanySeal.setSignatureId(JSONObject.parseObject(data).getString("signature_id"));
|
125
|
126
|
if (iTaCompanySealService.save(taCompanySeal)){
|
126
|
127
|
responseBean.addSuccess(taCompanySeal);
|
127
|
128
|
}else {
|
|
@@ -140,11 +141,24 @@ public class TaCompanySealController extends BaseController {
|
140
|
141
|
* @param id 实体ID
|
141
|
142
|
*/
|
142
|
143
|
@ResponseBody
|
143
|
|
- @RequestMapping(value="/taCompanySeal/{id}", method= RequestMethod.DELETE)
|
|
144
|
+ @RequestMapping(value="/channel/delCompanySeal/{id}", method= RequestMethod.PUT)
|
144
|
145
|
public ResponseBean taCompanySealDelete(@PathVariable Integer id){
|
145
|
146
|
ResponseBean responseBean = new ResponseBean();
|
146
|
147
|
try {
|
147
|
|
- if(iTaCompanySealService.removeById(id)){
|
|
148
|
+ TaCompanySeal taCompanySeal = iTaCompanySealService.getById(id);
|
|
149
|
+ TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
|
150
|
+ iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
|
151
|
+ String res = taCompanySealUtil.delSignature(taCompany.getFadadaCode(), taCompanySeal.getSignatureId());
|
|
152
|
+ JSONObject params = JSONObject.parseObject(res);
|
|
153
|
+ if (!String.valueOf(params.get("code")).equals(CommConstant.STATUS_NORMAL)){
|
|
154
|
+ responseBean.addError(params.getString("msg"));
|
|
155
|
+ return responseBean;
|
|
156
|
+ }
|
|
157
|
+
|
|
158
|
+ TaCompanySeal delInfo = new TaCompanySeal();
|
|
159
|
+ taCompanySeal.setSealId(id);
|
|
160
|
+ taCompanySeal.setStatus(CommConstant.STATUS_DELETE);
|
|
161
|
+ if(iTaCompanySealService.updateById(delInfo)){
|
148
|
162
|
responseBean.addSuccess("success");
|
149
|
163
|
}else {
|
150
|
164
|
responseBean.addError("fail");
|
|
@@ -163,11 +177,20 @@ public class TaCompanySealController extends BaseController {
|
163
|
177
|
* @param taCompanySeal 实体对象
|
164
|
178
|
* @return
|
165
|
179
|
*/
|
166
|
|
- @RequestMapping(value="/taCompanySeal/{id}",method= RequestMethod.PUT)
|
|
180
|
+ @RequestMapping(value="/channel/taCompanySeal/{id}",method= RequestMethod.PUT)
|
167
|
181
|
public ResponseBean taCompanySealUpdate(@PathVariable Integer id,
|
168
|
182
|
@RequestBody TaCompanySeal taCompanySeal){
|
169
|
183
|
ResponseBean responseBean = new ResponseBean();
|
170
|
184
|
try {
|
|
185
|
+ TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
|
186
|
+ String res = taCompanySealUtil.replaceSignature(taCompany.getFadadaCode(), taCompanySeal.getSealImg());
|
|
187
|
+ JSONObject params = JSONObject.parseObject(res);
|
|
188
|
+ Integer code = (Integer) params.get("code");
|
|
189
|
+ if (code != 1){
|
|
190
|
+ responseBean.addError(params.getString("msg"));
|
|
191
|
+ return responseBean;
|
|
192
|
+ }
|
|
193
|
+ taCompanySeal.setSealId(id);
|
171
|
194
|
if (iTaCompanySealService.updateById(taCompanySeal)){
|
172
|
195
|
responseBean.addSuccess(taCompanySeal);
|
173
|
196
|
}else {
|
|
@@ -185,7 +208,7 @@ public class TaCompanySealController extends BaseController {
|
185
|
208
|
* 根据id查询对象
|
186
|
209
|
* @param id 实体ID
|
187
|
210
|
*/
|
188
|
|
- @RequestMapping(value="/taCompanySeal/{id}",method= RequestMethod.GET)
|
|
211
|
+ @RequestMapping(value="/channel/taCompanySeal/{id}",method= RequestMethod.GET)
|
189
|
212
|
public ResponseBean taCompanySealGet(@PathVariable Integer id){
|
190
|
213
|
ResponseBean responseBean = new ResponseBean();
|
191
|
214
|
try {
|
|
@@ -197,4 +220,21 @@ public class TaCompanySealController extends BaseController {
|
197
|
220
|
}
|
198
|
221
|
return responseBean;
|
199
|
222
|
}
|
|
223
|
+
|
|
224
|
+ /**
|
|
225
|
+ * 根据id查询公司授权对象信息
|
|
226
|
+ * @param id 实体ID
|
|
227
|
+ */
|
|
228
|
+ @RequestMapping(value = "/channel/companySignInfo/id")
|
|
229
|
+ public ResponseBean companySignInfoByCompanyId(@PathVariable Integer id){
|
|
230
|
+ ResponseBean responseBean = new ResponseBean();
|
|
231
|
+ try {
|
|
232
|
+
|
|
233
|
+ }catch (Exception e){
|
|
234
|
+ e.printStackTrace();
|
|
235
|
+ logger.error("taCompanySealDelete -=- {}",e.toString());
|
|
236
|
+ responseBean.addError(e.getMessage());
|
|
237
|
+ }
|
|
238
|
+ return responseBean;
|
|
239
|
+ }
|
200
|
240
|
}
|