|
@@ -52,12 +52,11 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
|
|
private UploadImage uploadImage;
|
|
private UploadImage uploadImage;
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = RuntimeException.class)
|
|
@Transactional(rollbackFor = RuntimeException.class)
|
|
- public synchronized Result addTransaction(HttpServletRequest httpServletRequest, MultipartFile buyImage1, MultipartFile buyImage2, MultipartFile buyImage3, MultipartFile buyImage4, MultipartFile buyImage5, MultipartFile image2, MultipartFile image3, String inspectionNum, String seller, String buyer, String num, String eartags,String buyerPhone) throws IOException {
|
|
|
|
|
|
+ public synchronized Result addTransaction(HttpServletRequest httpServletRequest, MultipartFile buyImage1, MultipartFile buyImage2, MultipartFile buyImage3, MultipartFile buyImage4, MultipartFile buyImage5, MultipartFile image1, MultipartFile image2, String inspectionNum, String seller, String buyer, String num, String eartags,String buyerPhone) throws IOException {
|
|
BillBuyInfo billBuyInfo1 = billBuyInfoMapper.selectOne(new QueryWrapper<BillBuyInfo>().eq("create_user", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("bill_buy_status",1));
|
|
BillBuyInfo billBuyInfo1 = billBuyInfoMapper.selectOne(new QueryWrapper<BillBuyInfo>().eq("create_user", TokenSign.getMemberIdByJwtToken(httpServletRequest)).eq("bill_buy_status",1));
|
|
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().eq("phone", buyerPhone));
|
|
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().eq("phone", buyerPhone));
|
|
BillLandingInspection billLandingInspection = billLandingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", inspectionNum));
|
|
BillLandingInspection billLandingInspection = billLandingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", inspectionNum));
|
|
int total = Integer.parseInt(num);
|
|
int total = Integer.parseInt(num);
|
|
- String content = null;
|
|
|
|
if (ObjectUtil.isNotEmpty(sysUser)){
|
|
if (ObjectUtil.isNotEmpty(sysUser)){
|
|
if (!sysUser.getUserName().equals(buyer)){
|
|
if (!sysUser.getUserName().equals(buyer)){
|
|
return new Result(10001,"买家手机号和姓名不匹配",false);
|
|
return new Result(10001,"买家手机号和姓名不匹配",false);
|
|
@@ -89,13 +88,14 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
|
|
baseAnimal.setBuyTime(DateTime.now());
|
|
baseAnimal.setBuyTime(DateTime.now());
|
|
baseAnimalMapper.updateById(baseAnimal);
|
|
baseAnimalMapper.updateById(baseAnimal);
|
|
}
|
|
}
|
|
- content = BuyImageUtil.getUrl(content,buyImage1);
|
|
|
|
- content = BuyImageUtil.getUrl(content,buyImage2);
|
|
|
|
- content = BuyImageUtil.getUrl(content,buyImage3);
|
|
|
|
- content = BuyImageUtil.getUrl(content,buyImage4);
|
|
|
|
- content = BuyImageUtil.getUrl(content,buyImage5);
|
|
|
|
|
|
+ String content3 = "";
|
|
|
|
+ String content = uploadImage.getImageCom(image1);
|
|
String content2 = uploadImage.getImageCom(image2);
|
|
String content2 = uploadImage.getImageCom(image2);
|
|
- String content3 = uploadImage.getImageCom(image3);
|
|
|
|
|
|
+ content3 = getUrl(content3,buyImage1);
|
|
|
|
+ content3 = getUrl(content3,buyImage2);
|
|
|
|
+ content3 = getUrl(content3,buyImage3);
|
|
|
|
+ content3 = getUrl(content3,buyImage4);
|
|
|
|
+ content3 = getUrl(content3,buyImage5);
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(billBuyInfo1)){
|
|
if (ObjectUtil.isEmpty(billBuyInfo1)){
|
|
@@ -138,6 +138,17 @@ public class BillBuyInfoServiceImpl extends ServiceImpl<BillBuyInfoMapper, BillB
|
|
return Result.SUCCESS();
|
|
return Result.SUCCESS();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String getUrl(String content, MultipartFile image) throws IOException {
|
|
|
|
+ if (ObjectUtil.isNotEmpty(image)){
|
|
|
|
+ if ( !"".equals(content)){
|
|
|
|
+ content = content +","+uploadImage.getImageCom(image);
|
|
|
|
+ }else {
|
|
|
|
+ content = content +uploadImage.getImageCom(image);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return content;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public Result saveTransaction(HttpServletRequest httpServletRequest,Map<String, String> paramsMap) {
|
|
public Result saveTransaction(HttpServletRequest httpServletRequest,Map<String, String> paramsMap) {
|