Przeglądaj źródła

牧场流程初始化

wwh 1 rok temu
rodzic
commit
360dcc9ff6

+ 29 - 1
huimv-receive/src/main/java/com/huimv/receive/controller/BaseWashoutPointController.java

@@ -1,13 +1,24 @@
 package com.huimv.receive.controller;
 package com.huimv.receive.controller;
 
 
 
 
+import com.huimv.receive.common.utils.Result;
+import com.huimv.receive.entity.dto.GetWashoutPointDto;
+import com.huimv.receive.service.IBaseWashoutPointService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import javax.servlet.http.HttpServletRequest;
+import java.awt.*;
+import java.util.List;
+import java.util.Map;
+
 /**
 /**
  * <p>
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  * </p>
  *
  *
  * @author author
  * @author author
@@ -15,6 +26,23 @@ import org.springframework.web.bind.annotation.RestController;
  */
  */
 @RestController
 @RestController
 @RequestMapping("/base-washout-point")
 @RequestMapping("/base-washout-point")
+@CrossOrigin
 public class BaseWashoutPointController {
 public class BaseWashoutPointController {
+    @Autowired
+    private IBaseWashoutPointService washoutPointService;
+
+    @RequestMapping("/add")
+    public Result add(HttpServletRequest httpServletRequest, @RequestBody List<GetWashoutPointDto> list) {
+        return washoutPointService.add(httpServletRequest, list);
+    }
+
+    @RequestMapping("/list")
+    public Result add(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return washoutPointService.list(httpServletRequest, paramsMap);
+    }
 
 
+    @RequestMapping("/delete")
+    public Result delete(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
+        return washoutPointService.delete(httpServletRequest, paramsMap);
+    }
 }
 }

+ 5 - 1
huimv-receive/src/main/java/com/huimv/receive/entity/BaseWashoutPoint.java

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.io.Serializable;
 import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
@@ -58,7 +61,8 @@ public class BaseWashoutPoint implements Serializable {
      */
      */
     private Integer pointLevel;
     private Integer pointLevel;
 
 
-    private LocalDateTime createTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
 
 
     /**
     /**
      * 创建人
      * 创建人

+ 8 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/dto/GetFlowListDto.java

@@ -0,0 +1,8 @@
+package com.huimv.receive.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class GetFlowListDto {
+    private Integer flowIds;
+}

+ 20 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/dto/GetWashoutPointDto.java

@@ -0,0 +1,20 @@
+package com.huimv.receive.entity.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class GetWashoutPointDto {
+    /*访问类型*/
+    private Integer visitingType;
+
+    /*洗消站个数*/
+    private Integer number;
+
+    /*牧场编码*/
+    private String farmIds;
+
+    /*洗消点集合*/
+    private List<WashListDto> washListDtos;
+}

+ 20 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/dto/WashListDto.java

@@ -0,0 +1,20 @@
+package com.huimv.receive.entity.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WashListDto {
+    /*洗消点位置id*/
+    private Integer addressId;
+
+    /*洗消点对应的后面的目的地名称*/
+    private String nextName;
+
+    /*pcr有效时长*/
+    private Integer pcrTime;
+
+    /*洗消流程列表*/
+    private String flowLists;
+}

+ 10 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBaseWashoutPointService.java

@@ -1,7 +1,13 @@
 package com.huimv.receive.service;
 package com.huimv.receive.service;
 
 
+import com.huimv.receive.common.utils.Result;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.receive.entity.dto.GetWashoutPointDto;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -12,5 +18,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2024-03-06
  * @since 2024-03-06
  */
  */
 public interface IBaseWashoutPointService extends IService<BaseWashoutPoint> {
 public interface IBaseWashoutPointService extends IService<BaseWashoutPoint> {
+    Result list(HttpServletRequest httpServletRequest,Map<String,String> paramsMap);
+
+    Result add(HttpServletRequest httpServletRequest, List<GetWashoutPointDto> washoutPointDtos);
 
 
+    Result delete(HttpServletRequest httpServletRequest,Map<String,String> paramsMap);
 }
 }

+ 91 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseWashoutPointServiceImpl.java

@@ -1,11 +1,26 @@
 package com.huimv.receive.service.impl;
 package com.huimv.receive.service.impl;
 
 
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.huimv.receive.common.token.TokenSign;
+import com.huimv.receive.common.utils.Result;
+import com.huimv.receive.common.utils.ResultCode;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.entity.BaseWashoutPoint;
+import com.huimv.receive.entity.dto.GetFlowListDto;
+import com.huimv.receive.entity.dto.GetWashoutPointDto;
+import com.huimv.receive.entity.dto.WashListDto;
 import com.huimv.receive.mapper.BaseWashoutPointMapper;
 import com.huimv.receive.mapper.BaseWashoutPointMapper;
 import com.huimv.receive.service.IBaseWashoutPointService;
 import com.huimv.receive.service.IBaseWashoutPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
 /**
 /**
  * <p>
  * <p>
  *  服务实现类
  *  服务实现类
@@ -17,4 +32,80 @@ import org.springframework.stereotype.Service;
 @Service
 @Service
 public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMapper, BaseWashoutPoint> implements IBaseWashoutPointService {
 public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMapper, BaseWashoutPoint> implements IBaseWashoutPointService {
 
 
+    @Autowired
+    private BaseWashoutPointMapper washoutPointMapper;
+
+    @Override
+    public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
+        String type = paramsMap.get("type");//访问类型
+        List<BaseWashoutPoint> list = washoutPointMapper.selectList(new QueryWrapper<BaseWashoutPoint>()
+                .like("farm_ids", farmId).eq("visiting_type", type));
+        List<GetWashoutPointDto> washoutPointDtos = new ArrayList<>();
+        List<WashListDto> washListDtos = new ArrayList<>();
+        if (list.size() != 0) {
+            for (BaseWashoutPoint point : list) {
+                WashListDto washListDto = new WashListDto();
+                washListDto.setAddressId(point.getLocationId());
+                washListDto.setFlowLists(point.getFlowList());
+                washListDto.setNextName(point.getTailLocationName());
+                washListDto.setPcrTime(point.getPcrTime());
+                washListDtos.add(washListDto);
+            }
+            GetWashoutPointDto getWashoutPointDto = new GetWashoutPointDto();
+            getWashoutPointDto.setFarmIds(farmId);
+            getWashoutPointDto.setNumber(list.size());
+            getWashoutPointDto.setVisitingType(Integer.parseInt(type));
+            getWashoutPointDto.setWashListDtos(washListDtos);
+            washoutPointDtos.add(getWashoutPointDto);
+        }
+        return new Result(ResultCode.SUCCESS, washoutPointDtos);
+    }
+
+    @Override
+    public Result add(HttpServletRequest httpServletRequest, List<GetWashoutPointDto> washoutPointDtos) {
+        String farmIds = TokenSign.getFarmIds(httpServletRequest);
+        //访问类型集合
+        for (GetWashoutPointDto washoutPointDto : washoutPointDtos) {
+            //流程集合
+            List<WashListDto> washListDtos = washoutPointDto.getWashListDtos();
+            int i = 1;
+            for (WashListDto washListDto : washListDtos) {
+                BaseWashoutPoint washoutPoint = new BaseWashoutPoint();
+                washoutPoint.setCreateTime(new Date());
+                washoutPoint.setCreateUser(TokenSign.getMemberIdByJwtToken(httpServletRequest));
+                washoutPoint.setFlowList(washListDto.getFlowLists());
+                washoutPoint.setLocationId(washListDto.getAddressId());
+                washoutPoint.setPcrTime(washListDto.getPcrTime());
+                washoutPoint.setVisitingType(washoutPointDto.getVisitingType());
+                washoutPoint.setTailLocationName(washListDto.getNextName());
+                washoutPoint.setFarmIds(farmIds);
+                washoutPoint.setPointLevel(i);
+                QueryWrapper<BaseWashoutPoint> queryWrapper = new QueryWrapper<>();
+                queryWrapper.like("farm_ids",farmIds)
+                        .eq("visiting_type", washoutPointDto.getVisitingType())
+                        .eq("location_id", washListDto.getAddressId());
+                BaseWashoutPoint point = washoutPointMapper.selectOne(queryWrapper);
+                if (ObjectUtil.isEmpty(point)) {
+                    washoutPointMapper.insert(washoutPoint);
+                } else {
+                    washoutPointMapper.updateById(washoutPoint);
+                }
+
+                i++;
+            }
+        }
+        return new Result(10000, "添加成功!", true);
+    }
+
+    @Override
+    public Result delete(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
+        String type = paramsMap.get("type");//访问类型
+        String level = paramsMap.get("level");//洗消站等级
+        washoutPointMapper.delete(new QueryWrapper<BaseWashoutPoint>().like("farm_ids", farmId)
+                .eq("visiting_type", type).eq("point_level", level));
+        return new Result(10000, "删除成功!", true);
+    }
+
 }
 }

+ 175 - 175
huimv-receive/src/main/java/com/huimv/receive/timer/SafeTimer.java

@@ -1,175 +1,175 @@
-package com.huimv.receive.timer;
-
-
-import cn.hutool.core.date.DateUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-import com.huimv.receive.common.token.TokenSign;
-import com.huimv.receive.entity.*;
-import com.huimv.receive.service.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-@Configuration
-@EnableScheduling
-public class SafeTimer {
-
-
-    @Autowired
-    private IBillPcrService pcrService;
-    @Autowired
-    private IBillIsolateService isolateService;
-    @Autowired
-    private IConfigurationService configurationService;
-
-    @Autowired
-    private ISysUserService sysUserService;
-    @Autowired
-    private IBaseProcessService processService;
-    @Autowired
-    private IBaseLocationService locationService;
-    @Autowired
-    private IBillCleanService cleanService;
-
-
-    @Scheduled(cron = "0 0/1 * * * ? ")
-    private void getShenChan() throws Exception {
-        QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("bill_status", 1);
-        List<BillIsolate> isolates = isolateService.list(queryWrapper);
-        Date date = new Date();
-        for (BillIsolate billIsolate : isolates) {
-            if (billIsolate.getIsolateEndDate().getTime() <= date.getTime()) {
-                billIsolate.setIsolateRealEndDate(date);
-                billIsolate.setIsolateRealDayNum(billIsolate.getIsolateDayNum());
-                billIsolate.setBillStatus(2);
-                billIsolate.setPassUserName("自然解除隔离");
-                billIsolate.setPassDate(date);
-                BaseProcess baseProcess = processService.getById(billIsolate.getProcessId());
-                QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
-                locationQueryWrapper.eq("id", billIsolate.getIsolateLocationId());
-                BaseLocation baseLocation = locationService.getOne(locationQueryWrapper);//当前隔离所在的位置
-
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                String end = sdf.format(billIsolate.getIsolateEndDate());
-                String start = sdf.format(billIsolate.getIsolateStartDate());
-                String now = sdf.format(new Date());
-                if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId()) || baseProcess.getDestId() >= 13) {
-                    //目的地就是当前隔离地点
-                    baseProcess.setProcessType(1);
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
-                } else {
-                    baseProcess.setProcessType(0);
-                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
-                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
-                }
-                if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
-                    //通过生成洗消记录
-                    BillClean billClean = new BillClean();
-                    billClean.setVistitType(billIsolate.getVistitType());
-                    billClean.setDestName(billIsolate.getDestName());
-                    billClean.setDestId(billIsolate.getDestId());
-                    billClean.setAdmissionUserName(billIsolate.getAdmissionUserName());
-                    billClean.setAdmissionUserId(billIsolate.getAdmissionUserId());
-                    billClean.setVistitDate(billIsolate.getVistitDate());
-                    billClean.setSubDate(LocalDateTime.now());
-                    billClean.setFarmId(billIsolate.getFarmId());
-                    billClean.setPassUserName(billIsolate.getPassUserName());
-                    billClean.setPassDate(billIsolate.getPassDate());
-                    billClean.setPassUserId(billIsolate.getPassUserId());
-                    billClean.setProcessId(billIsolate.getProcessId());
-                    billClean.setTestLocation("场内");
-                    billClean.setTestLocationId(4);
-                    billClean.setPhone(billIsolate.getPhone());
-                    cleanService.save(billClean);
-
-                    String status = baseProcess.getAllLocationStatus();
-                    String[] split = status.split(",");
-                    split[0] = "2";
-                    split[1] = "2";
-                    split[2] = "2";
-                    split[3] = "2";
-                    split[4] = "1";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3]+"," +split[4]+ status.substring(9));
-                }
-
-                billIsolate.setIsolateRealEndDate(new Date());
-                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
-                Calendar cal1 = Calendar.getInstance();
-                Calendar cal2 = Calendar.getInstance();
-                Date startDate = sdf1.parse(start);
-                Date endDate = sdf1.parse(now);
-                cal1.setTime(startDate);
-                cal2.setTime(endDate);
-                long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
-                billIsolate.setIsolateRealDayNum(Long.toString(days));
-                billIsolate.setBillStatus(2);
-
-                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
-
-                String status = baseProcess.getCurrentStatus();
-                String substring = status.substring(0, status.length() - 1);
-                baseProcess.setCurrentStatus(substring + "1," + 0);
-
-                if (billIsolate.getIsolateLocationId() == 5) {
-                    baseProcess.setAllLocationStatus("2,2,2,2,2,2");
-                }
-                if (billIsolate.getIsolateLocationId() == 3) {
-                    String status1 = baseProcess.getAllLocationStatus();
-                    String[] split = status1.split(",");
-                    split[0] = "2";
-                    split[1] = "2";
-                    split[2] = "2";
-                    split[3] = "2";
-                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3]  + status1.substring(7));
-                }
-
-                isolateService.updateById(billIsolate);
-                processService.updateById(baseProcess);
-            }
-        }
-    }
-
-    @Scheduled(cron = "0 0/1 * * * ? ")
-    private void pcr() throws Exception {
-        QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("bill_status", 1);
-        List<BillPcr> pcrs = pcrService.list(queryWrapper);
-        Date date = new Date();
-        for (BillPcr pcr : pcrs) {
-            Date subDate = pcr.getCheckDate();
-            // 将LocalDateTime转换为Date
-
-            if ((subDate.getTime() + pcr.getQualifiedDate() * 60 * 60 * 1000) <= date.getTime()) {
-                pcr.setBillStatus(3);
-                pcrService.updateById(pcr);
-            }
-        }
-    }
-
-    //计算年龄
-    @Scheduled(cron = "0 0 0 * * ? ")
-    private void getAge()   {
-        System.out.println("开始");
-        List<SysUser> sysUsers = sysUserService.list();
-        for (SysUser sysUser : sysUsers) {
-            int i = DateUtil.ageOfNow(sysUser.getBirthday());
-            if (i !=sysUser.getAge() ){
-                sysUser.setAge(i);
-                sysUserService.updateById(sysUser);
-            }
-        }
-    }
-
-}
+//package com.huimv.receive.timer;
+//
+//
+//import cn.hutool.core.date.DateUtil;
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+//import com.huimv.receive.common.token.TokenSign;
+//import com.huimv.receive.entity.*;
+//import com.huimv.receive.service.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.scheduling.annotation.EnableScheduling;
+//import org.springframework.scheduling.annotation.Scheduled;
+//
+//import java.text.ParseException;
+//import java.text.SimpleDateFormat;
+//import java.time.LocalDateTime;
+//import java.time.ZoneId;
+//import java.util.Calendar;
+//import java.util.Date;
+//import java.util.List;
+//
+//@Configuration
+//@EnableScheduling
+//public class SafeTimer {
+//
+//
+//    @Autowired
+//    private IBillPcrService pcrService;
+//    @Autowired
+//    private IBillIsolateService isolateService;
+//    @Autowired
+//    private IConfigurationService configurationService;
+//
+//    @Autowired
+//    private ISysUserService sysUserService;
+//    @Autowired
+//    private IBaseProcessService processService;
+//    @Autowired
+//    private IBaseLocationService locationService;
+//    @Autowired
+//    private IBillCleanService cleanService;
+//
+//
+//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    private void getShenChan() throws Exception {
+//        QueryWrapper<BillIsolate> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("bill_status", 1);
+//        List<BillIsolate> isolates = isolateService.list(queryWrapper);
+//        Date date = new Date();
+//        for (BillIsolate billIsolate : isolates) {
+//            if (billIsolate.getIsolateEndDate().getTime() <= date.getTime()) {
+//                billIsolate.setIsolateRealEndDate(date);
+//                billIsolate.setIsolateRealDayNum(billIsolate.getIsolateDayNum());
+//                billIsolate.setBillStatus(2);
+//                billIsolate.setPassUserName("自然解除隔离");
+//                billIsolate.setPassDate(date);
+//                BaseProcess baseProcess = processService.getById(billIsolate.getProcessId());
+//                QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
+//                locationQueryWrapper.eq("id", billIsolate.getIsolateLocationId());
+//                BaseLocation baseLocation = locationService.getOne(locationQueryWrapper);//当前隔离所在的位置
+//
+//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                String end = sdf.format(billIsolate.getIsolateEndDate());
+//                String start = sdf.format(billIsolate.getIsolateStartDate());
+//                String now = sdf.format(new Date());
+//                if (baseProcess.getDestId().equals(billIsolate.getIsolateLocationId()) || baseProcess.getDestId() >= 13) {
+//                    //目的地就是当前隔离地点
+//                    baseProcess.setProcessType(1);
+//                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation());
+//                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId());
+//                } else {
+//                    baseProcess.setProcessType(0);
+//                    baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
+//                    baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
+//                }
+//                if (billIsolate.getIsolateLocationId() == 3 && baseProcess.getDestId() >= 4) {
+//                    //通过生成洗消记录
+//                    BillClean billClean = new BillClean();
+//                    billClean.setVistitType(billIsolate.getVistitType());
+//                    billClean.setDestName(billIsolate.getDestName());
+//                    billClean.setDestId(billIsolate.getDestId());
+//                    billClean.setAdmissionUserName(billIsolate.getAdmissionUserName());
+//                    billClean.setAdmissionUserId(billIsolate.getAdmissionUserId());
+//                    billClean.setVistitDate(billIsolate.getVistitDate());
+//                    billClean.setSubDate(LocalDateTime.now());
+//                    billClean.setFarmId(billIsolate.getFarmId());
+//                    billClean.setPassUserName(billIsolate.getPassUserName());
+//                    billClean.setPassDate(billIsolate.getPassDate());
+//                    billClean.setPassUserId(billIsolate.getPassUserId());
+//                    billClean.setProcessId(billIsolate.getProcessId());
+//                    billClean.setTestLocation("场内");
+//                    billClean.setTestLocationId(4);
+//                    billClean.setPhone(billIsolate.getPhone());
+//                    cleanService.save(billClean);
+//
+//                    String status = baseProcess.getAllLocationStatus();
+//                    String[] split = status.split(",");
+//                    split[0] = "2";
+//                    split[1] = "2";
+//                    split[2] = "2";
+//                    split[3] = "2";
+//                    split[4] = "1";
+//                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3]+"," +split[4]+ status.substring(9));
+//                }
+//
+//                billIsolate.setIsolateRealEndDate(new Date());
+//                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
+//                Calendar cal1 = Calendar.getInstance();
+//                Calendar cal2 = Calendar.getInstance();
+//                Date startDate = sdf1.parse(start);
+//                Date endDate = sdf1.parse(now);
+//                cal1.setTime(startDate);
+//                cal2.setTime(endDate);
+//                long days = (cal2.getTimeInMillis() - cal1.getTimeInMillis()) / (1000 * 3600 * 24);
+//                billIsolate.setIsolateRealDayNum(Long.toString(days));
+//                billIsolate.setBillStatus(2);
+//
+//                baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + now);
+//
+//                String status = baseProcess.getCurrentStatus();
+//                String substring = status.substring(0, status.length() - 1);
+//                baseProcess.setCurrentStatus(substring + "1," + 0);
+//
+//                if (billIsolate.getIsolateLocationId() == 5) {
+//                    baseProcess.setAllLocationStatus("2,2,2,2,2,2");
+//                }
+//                if (billIsolate.getIsolateLocationId() == 3) {
+//                    String status1 = baseProcess.getAllLocationStatus();
+//                    String[] split = status1.split(",");
+//                    split[0] = "2";
+//                    split[1] = "2";
+//                    split[2] = "2";
+//                    split[3] = "2";
+//                    baseProcess.setAllLocationStatus(split[0] + "," + split[1] + "," + split[2] + "," + split[3]  + status1.substring(7));
+//                }
+//
+//                isolateService.updateById(billIsolate);
+//                processService.updateById(baseProcess);
+//            }
+//        }
+//    }
+//
+//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    private void pcr() throws Exception {
+//        QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("bill_status", 1);
+//        List<BillPcr> pcrs = pcrService.list(queryWrapper);
+//        Date date = new Date();
+//        for (BillPcr pcr : pcrs) {
+//            Date subDate = pcr.getCheckDate();
+//            // 将LocalDateTime转换为Date
+//
+//            if ((subDate.getTime() + pcr.getQualifiedDate() * 60 * 60 * 1000) <= date.getTime()) {
+//                pcr.setBillStatus(3);
+//                pcrService.updateById(pcr);
+//            }
+//        }
+//    }
+//
+//    //计算年龄
+//    @Scheduled(cron = "0 0 0 * * ? ")
+//    private void getAge()   {
+//        System.out.println("开始");
+//        List<SysUser> sysUsers = sysUserService.list();
+//        for (SysUser sysUser : sysUsers) {
+//            int i = DateUtil.ageOfNow(sysUser.getBirthday());
+//            if (i !=sysUser.getAge() ){
+//                sysUser.setAge(i);
+//                sysUserService.updateById(sysUser);
+//            }
+//        }
+//    }
+//
+//}