|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.huimv.cattle.pojo.IndustryOutput;
|
|
import com.huimv.cattle.pojo.IndustryOutput;
|
|
import com.huimv.cattle.mapper.IndustryOutputMapper;
|
|
import com.huimv.cattle.mapper.IndustryOutputMapper;
|
|
|
|
+import com.huimv.cattle.pojo.SubsidyCount;
|
|
import com.huimv.cattle.service.IndustryOutputService;
|
|
import com.huimv.cattle.service.IndustryOutputService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.huimv.cattle.token.TokenSign;
|
|
import com.huimv.cattle.token.TokenSign;
|
|
@@ -17,8 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -69,6 +69,12 @@ public class IndustryOutputServiceImpl extends ServiceImpl<IndustryOutputMapper,
|
|
industryOutputMapper.deleteAll(farmCode);
|
|
industryOutputMapper.deleteAll(farmCode);
|
|
String list = paramsMap.get("list");
|
|
String list = paramsMap.get("list");
|
|
JSONArray listJa = JSONArray.parseArray(list);
|
|
JSONArray listJa = JSONArray.parseArray(list);
|
|
|
|
+ List<IndustryOutput> industryOutputList = listJa.toJavaList(IndustryOutput.class);
|
|
|
|
+ if (checkRepeat(industryOutputList)) {
|
|
|
|
+ return new Result(10001,"有重复年份",false);
|
|
|
|
+ }else {
|
|
|
|
+ industryOutputMapper.deleteAll(farmCode);
|
|
|
|
+ }
|
|
for (int a = listJa.size()-1; a >= 0 ; a--){
|
|
for (int a = listJa.size()-1; a >= 0 ; a--){
|
|
JSONObject jsonObject = listJa.getJSONObject(a);
|
|
JSONObject jsonObject = listJa.getJSONObject(a);
|
|
IndustryOutput industryOutput = new IndustryOutput();
|
|
IndustryOutput industryOutput = new IndustryOutput();
|
|
@@ -79,4 +85,13 @@ public class IndustryOutputServiceImpl extends ServiceImpl<IndustryOutputMapper,
|
|
}
|
|
}
|
|
return new Result(ResultCode.SUCCESS);
|
|
return new Result(ResultCode.SUCCESS);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private Boolean checkRepeat(List<IndustryOutput> list){
|
|
|
|
+ List<Integer> collectionOptionList = new ArrayList<>();
|
|
|
|
+ for (IndustryOutput a : list){
|
|
|
|
+ collectionOptionList.add(a.getYear());
|
|
|
|
+ }
|
|
|
|
+ Set<Integer> set = new HashSet<>(collectionOptionList);
|
|
|
|
+ return collectionOptionList.size()!= set.size();
|
|
|
|
+ }
|
|
}
|
|
}
|