feat:新增时自动生成商户二维码
This commit is contained in:
1 parent
826610d816
commit
5602f68eff
1 file changed
-16
-16
@@ -87,22 +87,6 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
}
|
||||
baseMapper.insert(dto);
|
||||
getSelf().refreshQrcode(dto.getId());
|
||||
try {
|
||||
MchCollectionCodeVo mchCollectionCode = new MchCollectionCodeVo();
|
||||
BeanUtils.toBean(dto, MchCollectionCodeVo.class);
|
||||
byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(JSON.toJSONString(mchCollectionCode), 1024);
|
||||
MultipartFile multipartFile = new MockMultipartFile("file", mchCollectionCode.getFileName() + ".png", "image/png", new ByteArrayInputStream(bytes));
|
||||
R upload = remoteFileService.innerUpload(multipartFile, null, null, null);
|
||||
Map data = (Map) upload.getData();
|
||||
String url = (String) data.get("url");
|
||||
MchManageEntity merchantInfoEntity = new MchManageEntity();
|
||||
merchantInfoEntity.setCollectionCode(url);
|
||||
merchantInfoEntity.setId(dto.getId());
|
||||
updateById(merchantInfoEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|新增商户,生成收款码错误dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
// walletThirdZyService.syncAllMch(dto.getId(), Boolean.FALSE);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user