|
@@ -13,11 +13,14 @@ import com.huiju.estateagents.eContract.entity.TaCompanySeal;
|
13
|
13
|
import com.huiju.estateagents.eContract.service.ITaCompanySealService;
|
14
|
14
|
import com.huiju.estateagents.eContract.service.ITaCompanyService;
|
15
|
15
|
import com.huiju.estateagents.eContract.service.impl.TaCompanySealUtil;
|
|
16
|
+import com.huiju.estateagents.entity.TaMiniapp;
|
|
17
|
+import com.huiju.estateagents.service.impl.TaMiniappServiceImpl;
|
16
|
18
|
import org.slf4j.Logger;
|
17
|
19
|
import org.slf4j.LoggerFactory;
|
18
|
20
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
21
|
import org.springframework.web.bind.annotation.*;
|
20
|
22
|
|
|
23
|
+import javax.servlet.http.HttpServletRequest;
|
21
|
24
|
import java.time.LocalDateTime;
|
22
|
25
|
|
23
|
26
|
/**
|
|
@@ -43,6 +46,9 @@ public class TaCompanySealController extends BaseController {
|
43
|
46
|
@Autowired
|
44
|
47
|
private TaCompanySealUtil taCompanySealUtil;
|
45
|
48
|
|
|
49
|
+ @Autowired
|
|
50
|
+ private TaMiniappServiceImpl taMiniappService;
|
|
51
|
+
|
46
|
52
|
/**
|
47
|
53
|
* 分页查询列表
|
48
|
54
|
* @param pageNum
|
|
@@ -110,11 +116,14 @@ public class TaCompanySealController extends BaseController {
|
110
|
116
|
* @return
|
111
|
117
|
*/
|
112
|
118
|
@RequestMapping(value="/channel/taCompanySeal",method= RequestMethod.POST)
|
113
|
|
- public ResponseBean taCompanySealAdd(@RequestBody TaCompanySeal taCompanySeal){
|
|
119
|
+ public ResponseBean taCompanySealAdd(@RequestBody TaCompanySeal taCompanySeal, HttpServletRequest request){
|
114
|
120
|
ResponseBean responseBean = new ResponseBean();
|
115
|
121
|
try {
|
|
122
|
+ QueryWrapper<TaMiniapp> taMiniappQueryWrapper = new QueryWrapper<>();
|
|
123
|
+ taMiniappQueryWrapper.eq("org_id", getOrgId(request));
|
|
124
|
+ TaMiniapp taMiniapp = taMiniappService.getOne(taMiniappQueryWrapper);
|
116
|
125
|
TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
117
|
|
- String result = taCompanySealUtil.addSignaTure(taCompany.getFadadaCode(), taCompanySeal.getSealImg());
|
|
126
|
+ String result = taCompanySealUtil.addSignaTure(taCompany.getFadadaCode(), taCompanySeal.getSealImg(), taMiniapp.getMiniappId());
|
118
|
127
|
JSONObject params = JSONObject.parseObject(result);
|
119
|
128
|
if ((Integer) params.get("code") != 1){
|
120
|
129
|
responseBean.addError(params.get("msg").toString());
|
|
@@ -144,13 +153,17 @@ public class TaCompanySealController extends BaseController {
|
144
|
153
|
*/
|
145
|
154
|
@ResponseBody
|
146
|
155
|
@RequestMapping(value="/channel/delCompanySeal/{id}", method= RequestMethod.PUT)
|
147
|
|
- public ResponseBean taCompanySealDelete(@PathVariable Integer id){
|
|
156
|
+ public ResponseBean taCompanySealDelete(@PathVariable Integer id, HttpServletRequest request){
|
148
|
157
|
ResponseBean responseBean = new ResponseBean();
|
149
|
158
|
try {
|
|
159
|
+ QueryWrapper<TaMiniapp> taMiniappQueryWrapper = new QueryWrapper<>();
|
|
160
|
+ taMiniappQueryWrapper.eq("org_id", getOrgId(request));
|
|
161
|
+ TaMiniapp taMiniapp = taMiniappService.getOne(taMiniappQueryWrapper);
|
|
162
|
+
|
150
|
163
|
TaCompanySeal taCompanySeal = iTaCompanySealService.getById(id);
|
151
|
164
|
TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
152
|
165
|
iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
153
|
|
- String res = taCompanySealUtil.delSignature(taCompany.getFadadaCode(), taCompanySeal.getSignatureId());
|
|
166
|
+ String res = taCompanySealUtil.delSignature(taCompany.getFadadaCode(), taCompanySeal.getSignatureId(), taMiniapp.getMiniappId());
|
154
|
167
|
JSONObject params = JSONObject.parseObject(res);
|
155
|
168
|
Integer code = (Integer) params.get("code");
|
156
|
169
|
if (code != 1){
|
|
@@ -182,12 +195,16 @@ public class TaCompanySealController extends BaseController {
|
182
|
195
|
*/
|
183
|
196
|
@RequestMapping(value="/channel/taCompanySeal/{id}",method= RequestMethod.PUT)
|
184
|
197
|
public ResponseBean taCompanySealUpdate(@PathVariable Integer id,
|
185
|
|
- @RequestBody TaCompanySeal taCompanySeal){
|
|
198
|
+ @RequestBody TaCompanySeal taCompanySeal, HttpServletRequest request){
|
186
|
199
|
ResponseBean responseBean = new ResponseBean();
|
187
|
200
|
try {
|
|
201
|
+ QueryWrapper<TaMiniapp> taMiniappQueryWrapper = new QueryWrapper<>();
|
|
202
|
+ taMiniappQueryWrapper.eq("org_id", getOrgId(request));
|
|
203
|
+ TaMiniapp taMiniapp = taMiniappService.getOne(taMiniappQueryWrapper);
|
|
204
|
+
|
188
|
205
|
TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
189
|
206
|
TaCompanySeal sealInfo = iTaCompanySealService.getById(id);
|
190
|
|
- String res = taCompanySealUtil.replaceSignature(taCompany.getFadadaCode(), sealInfo.getSignatureId(), taCompanySeal.getSealImg());
|
|
207
|
+ String res = taCompanySealUtil.replaceSignature(taCompany.getFadadaCode(), sealInfo.getSignatureId(), taCompanySeal.getSealImg(), taMiniapp.getMiniappId());
|
191
|
208
|
JSONObject params = JSONObject.parseObject(res);
|
192
|
209
|
Integer code = (Integer) params.get("code");
|
193
|
210
|
if (code != 1){
|