|
@@ -22,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -168,7 +169,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
if (!IntegerUtil.isInteger(animalNumberUp)){
|
|
|
return new Result(10001, "头数应为整数!", false);
|
|
|
}
|
|
|
- String content = null;
|
|
|
+ String content = "";
|
|
|
int total = Integer.parseInt(animalNumberUp);
|
|
|
int sum = 0;
|
|
|
eartags = eartags.replace(",",",");
|
|
@@ -230,11 +231,11 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
if (sum != total){
|
|
|
return new Result(10001,"实际耳标数量和填写数量不符!",false);
|
|
|
}
|
|
|
- content = BuyImageUtil.getUrl(content,image1);
|
|
|
- content = BuyImageUtil.getUrl(content,image2);
|
|
|
- content = BuyImageUtil.getUrl(content,image3);
|
|
|
- content = BuyImageUtil.getUrl(content,image4);
|
|
|
- content = BuyImageUtil.getUrl(content,image5);
|
|
|
+ content = getUrl(content,image1);
|
|
|
+ content = getUrl(content,image2);
|
|
|
+ content = getUrl(content,image3);
|
|
|
+ content = getUrl(content,image4);
|
|
|
+ content = getUrl(content,image5);
|
|
|
|
|
|
BillLandingInspection billLandingInspection = new BillLandingInspection();
|
|
|
billLandingInspection.setInspectionNum(inspectionNum);
|
|
@@ -261,6 +262,18 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ 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
|
|
|
public Result cancelApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
String id = paramsMap.get("id");
|
|
@@ -280,7 +293,6 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
SysUser user = sysUserMapper.selectOne(new QueryWrapper<SysUser>().eq("id", userName));
|
|
|
Integer userType = user.getUserType();
|
|
|
|
|
|
-
|
|
|
QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
|
|
|
if (userType == 2 || userType == 3){
|
|
|
landingInspectionQueryWrapper.eq("create_user",userName);
|
|
@@ -297,12 +309,23 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
Page<BillLandingInspection> page = new Page(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
Page<BillLandingInspection> billLandingInspectionPage = billLandingInspectionMapper.selectPage(page, landingInspectionQueryWrapper);
|
|
|
Page<BillLandingImageVo> billLandingImageVoPage = new Page<>();
|
|
|
+ List billLandingImageVoList = new ArrayList<>();
|
|
|
+ for (BillLandingInspection record : billLandingInspectionPage.getRecords()) {
|
|
|
+ BillLandingImageVo billLandingImageVo = new BillLandingImageVo();
|
|
|
+ BeanUtil.copyProperties(record,billLandingImageVo);
|
|
|
+ if (ObjectUtil.isNotEmpty(record.getJcbgImgUrl())){
|
|
|
+ billLandingImageVo.setPages(record.getJcbgImgUrl().split(","));
|
|
|
+ }
|
|
|
+ billLandingImageVoList.add(billLandingImageVo);
|
|
|
+ }
|
|
|
+ billLandingImageVoPage.setRecords(billLandingImageVoList);
|
|
|
+ /* billLandingImageVoPage.setRecords(billLandingImageVoList);
|
|
|
BeanUtil.copyProperties(billLandingInspectionPage,billLandingImageVoPage);
|
|
|
for (BillLandingImageVo record : billLandingImageVoPage.getRecords()) {
|
|
|
if (ObjectUtil.isNotEmpty(record.getJcbgImgUrl())){
|
|
|
record.setPages(record.getJcbgImgUrl().split(","));
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
return new Result(ResultCode.SUCCESS, billLandingImageVoPage);
|
|
|
}
|
|
|
|