|
@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.szwl.constant.ResponseCodesEnum;
|
|
|
import com.szwl.model.bo.R;
|
|
|
import com.szwl.model.bo.ResponseModel;
|
|
|
import com.szwl.model.entity.TAdmin;
|
|
|
import com.szwl.model.entity.TEquipment;
|
|
|
import com.szwl.model.entity.TJoinpayMch;
|
|
|
import com.szwl.model.entity.TJoinpayMchCheck;
|
|
|
+import com.szwl.model.param.mchParam;
|
|
|
import com.szwl.service.TAdminService;
|
|
|
import com.szwl.service.TJoinpayMchCheckService;
|
|
|
import com.szwl.service.TJoinpayMchService;
|
|
@@ -23,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.xml.crypto.Data;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -110,7 +114,12 @@ public class TJoinpayMchController {
|
|
|
tJoinpayMch.setStep("0");
|
|
|
|
|
|
String result = tJoinpayMchService.createMch(tJoinpayMch);
|
|
|
- return R.ok(tJoinpayMch);
|
|
|
+ if(result.equals("ok")){
|
|
|
+ return R.ok(tJoinpayMch);
|
|
|
+ }else {
|
|
|
+ return R.fail(ResponseCodesEnum.C0001,result);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
@ApiOperation(value = "签约")
|
|
@@ -123,26 +132,41 @@ public class TJoinpayMchController {
|
|
|
}
|
|
|
@ApiOperation(value = "上传图片")
|
|
|
@PostMapping("/sentImage")
|
|
|
- public ResponseModel<?> sentImage(String id,String cardPositive,String cardNegative,String tradeLicence,String openAccountLicence,String type,String status) {
|
|
|
- TJoinpayMch mch = tJoinpayMchService.getById(id);
|
|
|
- if(type.equals("0")){
|
|
|
+// public ResponseModel<?> sentImage(String id,String cardPositive,String cardNegative,String tradeLicence,String openAccountLicence,String type,String status) {
|
|
|
+ public ResponseModel<?> sentImage(@RequestBody mchParam tJoinpayMch) {
|
|
|
+ TJoinpayMch mch = tJoinpayMchService.getById(tJoinpayMch.getId());
|
|
|
+ if(tJoinpayMch.getType().equals("0")){
|
|
|
//对公
|
|
|
- if(cardPositive==null||cardNegative==null||tradeLicence==null){
|
|
|
+ if(StringUtils.isEmpty(tJoinpayMch.getCardPositive())||StringUtils.isEmpty(tJoinpayMch.getCardNegative())||StringUtils.isEmpty(tJoinpayMch.getTradeLicence())){
|
|
|
return R.fail("图片不能为空");
|
|
|
}
|
|
|
- String str = tJoinpayMchService.sendCardBusiness(mch,cardPositive,cardNegative,tradeLicence,openAccountLicence,status);
|
|
|
- R.ok(str);
|
|
|
+ String str = tJoinpayMchService.sendCardBusiness(mch,tJoinpayMch.getCardPositive(),tJoinpayMch.getCardNegative(),tJoinpayMch.getTradeLicence(),tJoinpayMch.getOpenAccountLicence(),tJoinpayMch.getStatus());
|
|
|
+ return R.ok(str);
|
|
|
}
|
|
|
- if(type.equals("1")){
|
|
|
+ if(tJoinpayMch.getType().equals("1")){
|
|
|
//个人
|
|
|
- if(cardPositive==null||cardNegative==null){
|
|
|
+ if(StringUtils.isEmpty(tJoinpayMch.getCardPositive())||StringUtils.isEmpty(tJoinpayMch.getCardNegative())){
|
|
|
return R.fail("图片不能为空");
|
|
|
}
|
|
|
- String str = tJoinpayMchService.sendCard(mch,cardPositive,cardNegative,status);
|
|
|
- R.ok(str);
|
|
|
+// String cardNegative = replit(tJoinpayMch.getCardNegative());
|
|
|
+// String cardPositive = replit(tJoinpayMch.getCardPositive());
|
|
|
+ String str = tJoinpayMchService.sendCard(mch,tJoinpayMch.getCardPositive(),tJoinpayMch.getCardNegative(),tJoinpayMch.getStatus());
|
|
|
+ return R.ok(str);
|
|
|
}
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
+ private String replit(String cardNegative) {
|
|
|
+ Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
|
|
+ /*\n 回车(\u000a)
|
|
|
+ \t 水平制表符(\u0009)
|
|
|
+ \s 空格(\u0008)
|
|
|
+ \r 换行(\u000d)*/
|
|
|
+ Matcher m = p.matcher(cardNegative);
|
|
|
+ cardNegative = m.replaceAll("");
|
|
|
+ return cardNegative;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "获取提现信息")
|
|
|
@GetMapping("/getMch")
|
|
|
public ResponseModel<TJoinpayMch> getMch(@RequestParam String id) {
|
|
@@ -224,5 +248,7 @@ public class TJoinpayMchController {
|
|
|
return R.ok(joinpayMchCheck);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|