|
@@ -158,8 +158,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result addApplication(HttpServletRequest httpServletRequest, String inspectionNum, String cargoOwner, String ownerPhone, String animalType, String animalNumberUp, String useTo, String startTran, String reachTran, String veter, String eartags, MultipartFile image1,MultipartFile image2,MultipartFile image3,MultipartFile image4,MultipartFile image5) throws IOException {
|
|
|
-
|
|
|
+ public Result addApplication(HttpServletRequest httpServletRequest, String inspectionNum, String cargoOwner, String ownerPhone, String animalType, String animalNumberUp, String useTo, String startTran, String reachTran, String veter, String eartags, MultipartFile quarantineImage, MultipartFile image1,MultipartFile image2,MultipartFile image3,MultipartFile image4,MultipartFile image5) throws IOException {
|
|
|
QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
|
|
|
landingInspectionQueryWrapper.eq("inspection_num", inspectionNum).ne("inspection_sch",5);
|
|
|
if (this.count(landingInspectionQueryWrapper) != 0) {
|
|
@@ -173,87 +172,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
}
|
|
|
String content = "";
|
|
|
int total = Integer.parseInt(animalNumberUp);
|
|
|
- /* int sum = 0;
|
|
|
- eartags = eartags.replace(",",",");
|
|
|
- eartags = eartags.replace(", ",",");
|
|
|
- eartags = eartags.replace(", ",",");
|
|
|
- List eartagList = new ArrayList();
|
|
|
- if (eartags.contains(",")){
|
|
|
- String[] eartag = eartags.split(",");
|
|
|
- for (String input : eartag) {
|
|
|
- if (input.contains("-")){
|
|
|
- String start = input.substring(0, input.indexOf("-"));
|
|
|
- String base = eartags.substring(0, eartags.indexOf("-")-3);
|
|
|
- System.out.println("落地检耳标号:"+start);
|
|
|
- if (start.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
- }
|
|
|
- String end = input.substring(input.indexOf("-") + 1);
|
|
|
- if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误,-后需输入3位数字",false);
|
|
|
- }
|
|
|
- String substring1 = input.substring(start.length() - end.length(), start.length());
|
|
|
- if (Integer.parseInt(substring1) >=Integer.parseInt(end) ){
|
|
|
- return new Result(10001,"耳标号格式错误,包含-号耳标号需递增",false);
|
|
|
- }
|
|
|
- for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
- String s = String.valueOf(i);
|
|
|
- while (s.length() < 3) {
|
|
|
- s = "0".concat(s);
|
|
|
- }
|
|
|
- s = base.concat(s);
|
|
|
- eartagList.add(s);
|
|
|
- sum++;
|
|
|
- }
|
|
|
- }else {
|
|
|
- if (input.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
- }
|
|
|
- eartagList.add(input);
|
|
|
- sum++;
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- if (eartags.contains("-")){
|
|
|
- String start = eartags.substring(0, eartags.indexOf("-"));
|
|
|
- String base = eartags.substring(0, eartags.indexOf("-")-3);
|
|
|
- System.out.println("落地检耳标号:"+start);
|
|
|
- if (start.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
- }
|
|
|
- String end = eartags.substring(eartags.indexOf("-") + 1);
|
|
|
- if (end.length() != 3){
|
|
|
- return new Result(10001,"耳标号格式错误,-后需输入3位数字",false);
|
|
|
- }
|
|
|
- String substring1 = eartags.substring(start.length() - end.length(), start.length());
|
|
|
- if (Integer.parseInt(substring1) >= Integer.parseInt(end)){
|
|
|
- return new Result(10001,"耳标号格式错误,包含-号耳标号需递增",false);
|
|
|
- }
|
|
|
- for (int i = Integer.valueOf(substring1) ; i <= Integer.valueOf(end); i++){
|
|
|
- String s = String.valueOf(i);
|
|
|
- while (s.length() < 3) {
|
|
|
- s = "0".concat(s);
|
|
|
- }
|
|
|
- s = base.concat(s);
|
|
|
- eartagList.add(s);
|
|
|
- sum++;
|
|
|
- }
|
|
|
- }else {
|
|
|
- System.out.println("落地检耳标号:"+eartags);
|
|
|
- if (eartags.length() != 15){
|
|
|
- return new Result(10001,"耳标号格式错误需输入15位数字",false);
|
|
|
- }
|
|
|
- eartagList.add(eartags);
|
|
|
- sum++;
|
|
|
- }
|
|
|
- }
|
|
|
- HashSet set = new HashSet(eartagList);
|
|
|
- if (set.size() != eartagList.size()){
|
|
|
- return new Result(10001,"存在重复耳标号!",false);
|
|
|
- }
|
|
|
- if (sum != total){
|
|
|
- return new Result(10001,"实际耳标数量和填写数量不符!",false);
|
|
|
- }*/
|
|
|
+
|
|
|
EartagResult eartagResult = EartagUtil.getEartagCollection(eartags);
|
|
|
if (!eartagResult.getSuccess()){
|
|
|
return new Result(10001,eartagResult.getMsg(),false);
|
|
@@ -270,7 +189,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
content = getUrl(content,image3);
|
|
|
content = getUrl(content,image4);
|
|
|
content = getUrl(content,image5);
|
|
|
-
|
|
|
+ String imageCom = uploadImage.getImageCom(quarantineImage);
|
|
|
BillLandingInspection billLandingInspection = new BillLandingInspection();
|
|
|
billLandingInspection.setInspectionNum(inspectionNum);
|
|
|
billLandingInspection.setCargoOwner(cargoOwner);
|
|
@@ -281,6 +200,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
|
|
|
billLandingInspection.setStartTran(startTran);
|
|
|
billLandingInspection.setReachTran(reachTran);
|
|
|
billLandingInspection.setVeterId(Integer.parseInt(veter));
|
|
|
+ billLandingInspection.setQuarantineCertificatePic(imageCom);
|
|
|
billLandingInspection.setEartags(eartags);
|
|
|
billLandingInspection.setJcbgImgUrl(content);
|
|
|
billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest) + "的落地检疫申请");
|