|
@@ -10,6 +10,7 @@ import com.huimv.admin.common.utils.Result;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.entity.ProtData;
|
|
import com.huimv.admin.entity.ProtData;
|
|
import com.huimv.admin.entity.ProtWarningInfo;
|
|
import com.huimv.admin.entity.ProtWarningInfo;
|
|
|
|
+import com.huimv.admin.entity.dto.ProCountDto;
|
|
import com.huimv.admin.entity.vo.ProDataVo;
|
|
import com.huimv.admin.entity.vo.ProDataVo;
|
|
import com.huimv.admin.mapper.ProtDataMapper;
|
|
import com.huimv.admin.mapper.ProtDataMapper;
|
|
import com.huimv.admin.mapper.ProtWarningInfoMapper;
|
|
import com.huimv.admin.mapper.ProtWarningInfoMapper;
|
|
@@ -19,9 +20,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.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -57,36 +56,84 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("farm_id", farmId);
|
|
queryWrapper.eq("farm_id", farmId);
|
|
|
|
|
|
-
|
|
|
|
List<ProtData> protDataList = null;
|
|
List<ProtData> protDataList = null;
|
|
|
|
+ ProCountDto proCountDto = new ProCountDto();
|
|
|
|
+ //ph
|
|
if ("1".equals(dataType)) {
|
|
if ("1".equals(dataType)) {
|
|
if ("4".equals(type)) {
|
|
if ("4".equals(type)) {
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listPh(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // protDataList=endList;
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listPh(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listPh(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listPh(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//cod
|
|
//cod
|
|
@@ -95,29 +142,73 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listCod(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listCod(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listCod(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listCod(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//NH3N
|
|
//NH3N
|
|
@@ -126,29 +217,73 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listNh3n(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listNh3n(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listNh3n(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listNh3n(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//TP
|
|
//TP
|
|
@@ -157,29 +292,73 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listTp(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listTp(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listTp(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listTp(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//TN
|
|
//TN
|
|
@@ -188,29 +367,73 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listTn(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listTn(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listTn(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listTn(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//FLOW
|
|
//FLOW
|
|
@@ -219,42 +442,85 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
startTime = startTime + " 00:00:00";
|
|
startTime = startTime + " 00:00:00";
|
|
endTime = endTime + " 23:59:59";
|
|
endTime = endTime + " 23:59:59";
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
- List<ProtData> protData = protDataMapper.listFlow(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listFlow(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本月
|
|
//本月
|
|
else if ("2".equals(type)) {
|
|
else if ("2".equals(type)) {
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
- List<ProtData> protData = protDataMapper.listFlow(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
//本周
|
|
//本周
|
|
else if ("1".equals(type)) {
|
|
else if ("1".equals(type)) {
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
DateTime dateTime = DateUtil.beginOfWeek(new Date());
|
|
queryWrapper.ge("create_date", dateTime);
|
|
queryWrapper.ge("create_date", dateTime);
|
|
- List<ProtData> protData = protDataMapper.listFlow(queryWrapper);
|
|
|
|
- protDataList=protData;
|
|
|
|
|
|
+ queryWrapper.eq("loction_type" ,1);
|
|
|
|
+ List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protData1);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,2);
|
|
|
|
+ List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protData2);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("loction_type" ,3);
|
|
|
|
+ List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protData3);
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return new Result(ResultCode.SUCCESS,protDataList);
|
|
|
|
|
|
+ return new Result(ResultCode.SUCCESS, proCountDto);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result listProt(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listProt(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
- ProDataVo proDataVo = new ProDataVo();
|
|
|
|
|
|
+
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
QueryWrapper<ProtWarningInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProtWarningInfo> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("farm_id", farmId);
|
|
queryWrapper.eq("farm_id", farmId);
|
|
List<ProtWarningInfo> protWarningInfos = protWarningInfoMapper.selectList(queryWrapper);
|
|
List<ProtWarningInfo> protWarningInfos = protWarningInfoMapper.selectList(queryWrapper);
|
|
- JSONArray jsonArray = new JSONArray();
|
|
|
|
//今日
|
|
//今日
|
|
Date timesmorning = DataUill.getTimesmorning();
|
|
Date timesmorning = DataUill.getTimesmorning();
|
|
Integer dayCount = 0;
|
|
Integer dayCount = 0;
|
|
@@ -264,10 +530,11 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
//本月
|
|
//本月
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
Integer monthCount = 0;
|
|
Integer monthCount = 0;
|
|
|
|
+ List<ProDataVo> voList = new LinkedList<>();
|
|
for (int i = 0; i < protWarningInfos.size(); i++) {
|
|
for (int i = 0; i < protWarningInfos.size(); i++) {
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
|
- jsonObject.put("content",protWarningInfos.get(i).getWarningContent());
|
|
|
|
- jsonObject.put("time",protWarningInfos.get(i).getDate());
|
|
|
|
|
|
+ ProDataVo proDataVo = new ProDataVo();
|
|
|
|
+ proDataVo.setContent(protWarningInfos.get(i).getWarningContent());
|
|
|
|
+ proDataVo.setTime(protWarningInfos.get(i).getDate());
|
|
if (protWarningInfos.get(i).getDate().after(timesmorning)) {
|
|
if (protWarningInfos.get(i).getDate().after(timesmorning)) {
|
|
dayCount++;
|
|
dayCount++;
|
|
}
|
|
}
|
|
@@ -277,29 +544,40 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
if (protWarningInfos.get(i).getDate().after(timesMonthmorning)) {
|
|
if (protWarningInfos.get(i).getDate().after(timesMonthmorning)) {
|
|
monthCount++;
|
|
monthCount++;
|
|
}
|
|
}
|
|
- jsonArray.add(jsonObject);
|
|
|
|
|
|
+ voList.add(proDataVo);
|
|
}
|
|
}
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("dayCount", dayCount);
|
|
jsonObject.put("dayCount", dayCount);
|
|
jsonObject.put("weekCount", weekCount);
|
|
jsonObject.put("weekCount", weekCount);
|
|
jsonObject.put("monthCount", monthCount);
|
|
jsonObject.put("monthCount", monthCount);
|
|
jsonObject.put("count", protWarningInfos.size());
|
|
jsonObject.put("count", protWarningInfos.size());
|
|
- jsonArray.add(jsonObject);
|
|
|
|
|
|
+ jsonObject.put("data", voList);
|
|
|
|
|
|
- return new Result(ResultCode.SUCCESS,proDataVo);
|
|
|
|
|
|
+
|
|
|
|
+ return new Result(ResultCode.SUCCESS,jsonObject);
|
|
}
|
|
}
|
|
|
|
|
|
- /*@Override
|
|
|
|
|
|
+ @Override
|
|
public Result listType(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listType(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
- String type = paramsMap.get("type");
|
|
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.eq("farm_id", farmId);
|
|
|
|
|
|
+ ProCountDto proCountDto = new ProCountDto();
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("loction_type", 1);
|
|
|
|
+ List<ProtData> protDataList = protDataMapper.selectList(queryWrapper);
|
|
|
|
+ proCountDto.setInList(protDataList);
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("loction_type", 2);
|
|
|
|
+ List<ProtData> protDataList2 = protDataMapper.selectList(queryWrapper);
|
|
|
|
+ proCountDto.setDealList(protDataList2);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("loction_type", 3);
|
|
|
|
+ List<ProtData> protDataList3 = protDataMapper.selectList(queryWrapper);
|
|
|
|
+ proCountDto.setOutList(protDataList3);
|
|
|
|
+
|
|
|
|
+ return new Result(ResultCode.SUCCESS,proCountDto);
|
|
|
|
+ }
|
|
|
|
|
|
- //ph
|
|
|
|
- if ("1".equals(type)) {
|
|
|
|
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
- }*/
|
|
|
|
}
|
|
}
|