|
@@ -4,16 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.huimv.receive.common.token.TokenSign;
|
|
import com.huimv.receive.common.token.TokenSign;
|
|
|
|
+import com.huimv.receive.common.utils.DataUill;
|
|
|
|
+import com.huimv.receive.common.utils.Print;
|
|
import com.huimv.receive.common.utils.Result;
|
|
import com.huimv.receive.common.utils.Result;
|
|
import com.huimv.receive.common.utils.ResultCode;
|
|
import com.huimv.receive.common.utils.ResultCode;
|
|
import com.huimv.receive.entity.BillIsolate;
|
|
import com.huimv.receive.entity.BillIsolate;
|
|
|
|
+import com.huimv.receive.entity.BillPersonnelAdmission;
|
|
|
|
+import com.huimv.receive.entity.vo.IsolateVo;
|
|
import com.huimv.receive.mapper.BillIsolateMapper;
|
|
import com.huimv.receive.mapper.BillIsolateMapper;
|
|
import com.huimv.receive.service.IBillIsolateService;
|
|
import com.huimv.receive.service.IBillIsolateService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
-import java.util.Map;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -37,4 +42,77 @@ public class BillIsolateServiceImpl extends ServiceImpl<BillIsolateMapper, BillI
|
|
queryWrapper.eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("isolate_start_date");
|
|
queryWrapper.eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("isolate_start_date");
|
|
return new Result(ResultCode.SUCCESS,billIsolateMapper.selectPage(page,new QueryWrapper<BillIsolate>().eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("isolate_start_date")),billIsolateMapper.selectCount(queryWrapper));
|
|
return new Result(ResultCode.SUCCESS,billIsolateMapper.selectPage(page,new QueryWrapper<BillIsolate>().eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("isolate_start_date")),billIsolateMapper.selectCount(queryWrapper));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result Isolate(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
|
+ String type = paramsMap.get("type");//0全部 1为人员二级洗消站 2为生产区
|
|
|
|
+ if ("".equals(type) || null == type) {
|
|
|
|
+ type = "0";
|
|
|
|
+ }
|
|
|
|
+ String dateType = paramsMap.get("dateType");
|
|
|
|
+ if ("".equals(dateType) || null == dateType) {
|
|
|
|
+ dateType = "3";
|
|
|
|
+ }
|
|
|
|
+ List<IsolateVo> isolateVos = null;
|
|
|
|
+ QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if ("0".equals(type)) {
|
|
|
|
+ queryWrapper.in("isolate_location_id", 3, 4);
|
|
|
|
+ } else if ("1".equals(type)) {
|
|
|
|
+ queryWrapper.eq("isolate_location_id", 3);
|
|
|
|
+ }else if ("2".equals(type)) {
|
|
|
|
+ queryWrapper.eq("isolate_location_id", 4);
|
|
|
|
+ }
|
|
|
|
+ //今日
|
|
|
|
+ if ("1".equals(dateType)) {
|
|
|
|
+ Date timesmorning = DataUill.getTimesmorning();
|
|
|
|
+ queryWrapper.ge("sub_date", timesmorning);
|
|
|
|
+
|
|
|
|
+ } else if ("2".equals(type)) {
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
|
+ queryWrapper.ge("sub_date", calendar.getTime());
|
|
|
|
+
|
|
|
|
+ } else if ("3".equals(type)) {
|
|
|
|
+ Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
|
+ queryWrapper.ge("sub_date", timesMonthmorning);
|
|
|
|
+ }
|
|
|
|
+ isolateVos = billIsolateMapper.Isolate(queryWrapper);
|
|
|
|
+ return new Result(ResultCode.SUCCESS, isolateVos);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result IsolateSelect(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
|
|
+ String type = paramsMap.get("type");//隔离状态
|
|
|
|
+ String locationId = paramsMap.get("locationId");//隔离地点
|
|
|
|
+ String startTime = paramsMap.get("startTime");
|
|
|
|
+ String endTime = paramsMap.get("endTime");
|
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
|
|
+ String pageNum = paramsMap.get("pageNum");
|
|
|
|
+ String pageSize = paramsMap.get("pageSize");
|
|
|
|
+ if ("".equals(pageNum) || null == pageNum) {
|
|
|
|
+ pageNum = "1";
|
|
|
|
+ }
|
|
|
|
+ if ("".equals(pageSize) || null == pageSize) {
|
|
|
|
+ pageSize = "10";
|
|
|
|
+ }
|
|
|
|
+ QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("farm_id", farmId);
|
|
|
|
+ queryWrapper.eq("isolate_location_id", locationId);
|
|
|
|
+ queryWrapper.eq("bill_status", type);
|
|
|
|
+ queryWrapper.between("sub_date", startTime, endTime);
|
|
|
|
+ Page<BillIsolate> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
|
+ return new Result(ResultCode.SUCCESS, billIsolateMapper.selectPage(page, queryWrapper));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void printIsolate(HttpServletResponse httpServletRequest, Map<String, String> paramsMap) throws Exception {
|
|
|
|
+ String ids = paramsMap.get("ids");
|
|
|
|
+ String[] split = ids.split(",");
|
|
|
|
+ List<BillIsolate> list = new ArrayList<>();
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ BillIsolate admission = billIsolateMapper.selectById(s);
|
|
|
|
+ list.add(admission);
|
|
|
|
+ }
|
|
|
|
+ Print.printIsolate(list);
|
|
|
|
+ }
|
|
}
|
|
}
|