|
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -58,13 +59,19 @@ public class SuperviseServiceImpl extends ServiceImpl<SuperviseMapper, Supervise
|
|
|
|
|
|
private String superviseGatValue(String farmCode,String key) {
|
|
|
QueryWrapper<Supervise> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("farm_code",farmCode);
|
|
|
wrapper.eq("supervise_code",key);
|
|
|
- Supervise supervise = superviseMapper.selectOne(wrapper);
|
|
|
- if (ObjectUtil.isEmpty(supervise)){
|
|
|
+
|
|
|
+ String[] split = farmCode.split(",");
|
|
|
+ wrapper.in("farm_code",split);
|
|
|
+ List<Supervise> supervises = superviseMapper.selectList(wrapper);
|
|
|
+ if (ObjectUtil.isEmpty(supervises)){
|
|
|
return "0";
|
|
|
}else {
|
|
|
- return supervise.getSuperviseData();
|
|
|
+ Integer superviseValue =0;
|
|
|
+ for (Supervise supervise : supervises) {
|
|
|
+ superviseValue += Integer.parseInt(supervise.getSuperviseData());
|
|
|
+ }
|
|
|
+ return superviseValue+"";
|
|
|
}
|
|
|
}
|
|
|
|