|
@@ -2,18 +2,21 @@ package com.bofeng.service;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
|
|
+import com.bofeng.dao.MsReportMapper;
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
-import com.bofeng.dao.UserOpenMapper;
|
|
|
|
|
|
+import com.bofeng.entity.MsReport;
|
|
import com.bofeng.entity.MsSuspected;
|
|
import com.bofeng.entity.MsSuspected;
|
|
-import com.bofeng.entity.Owner;
|
|
|
|
-import com.bofeng.entity.UptownHome;
|
|
|
|
-import com.bofeng.entity.UserRole;
|
|
|
|
|
|
+import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Author: xielianghe
|
|
* @Author: xielianghe
|
|
* @Date: 2020/2/4 15:44
|
|
* @Date: 2020/2/4 15:44
|
|
@@ -25,22 +28,50 @@ public class MsSuspectedService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MsReportMapper msReportMapper;
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
- public void addRibao(Long userId, Integer userType, String linkman, String phone) {
|
|
|
|
|
|
+ public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks) {
|
|
|
|
+ Long reportId=0L;
|
|
|
|
+ //如果是当前日期 已经添加
|
|
|
|
+ Date t = new Date();
|
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String reportDate=df.format(t);
|
|
|
|
+ List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate);
|
|
|
|
+ if (listReport == null|| listReport.size()==0) {
|
|
|
|
+ MsReport msReport = new MsReport();
|
|
|
|
+ msReport.setReportId(IdWorker.getId());
|
|
|
|
+ msReport.setHouseId(0L);
|
|
|
|
+ msReport.setSafetyNum(0);
|
|
|
|
+ msReport.setSuspectedNum(0);
|
|
|
|
+ msReport.setRemarks("");
|
|
|
|
+ msReport.setReportDate(DateTime.now().toDate());
|
|
|
|
+ msReport.setMsStatus(0);
|
|
|
|
+ msReport.setUserCreate(0L);
|
|
|
|
+ msReport.setTimeCreate(DateTime.now());
|
|
|
|
+ msReport.setUserUpdate(0L);
|
|
|
|
+ msReport.setTimeUpdate(DateTime.now());
|
|
|
|
+ msReportMapper.insert(msReport);
|
|
|
|
+ reportId=msReport.getReportId();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ reportId=listReport.get(0).getReportId();
|
|
|
|
+
|
|
|
|
+ //添加家人
|
|
MsSuspected msSuspected = new MsSuspected();
|
|
MsSuspected msSuspected = new MsSuspected();
|
|
msSuspected.setSuspectedId(IdWorker.getId());
|
|
msSuspected.setSuspectedId(IdWorker.getId());
|
|
- msSuspected.setReportId(userId);
|
|
|
|
- msSuspected.setFamilyRelative(userType);
|
|
|
|
- msSuspected.setConditionStatus(0);
|
|
|
|
- msSuspected.setMedical(0);
|
|
|
|
- msSuspected.setRemarks("测试");
|
|
|
|
- msSuspected.setUserCreate(userId);
|
|
|
|
|
|
+ msSuspected.setReportId(reportId);
|
|
|
|
+ msSuspected.setUserName(userName);
|
|
|
|
+ msSuspected.setFamilyRelative(1);//默认为家人
|
|
|
|
+ msSuspected.setConditionStatus(conditionStatus);
|
|
|
|
+ msSuspected.setMedical(medical);
|
|
|
|
+ msSuspected.setRemarks(remarks);
|
|
|
|
+ msSuspected.setUserCreate(0L);
|
|
msSuspected.setTimeCreate(DateTime.now());
|
|
msSuspected.setTimeCreate(DateTime.now());
|
|
- msSuspected.setUserUpdate(userId);
|
|
|
|
|
|
+ msSuspected.setUserUpdate(0L);
|
|
msSuspected.setTimeUpdate(DateTime.now());
|
|
msSuspected.setTimeUpdate(DateTime.now());
|
|
msSuspectedMapper.insert(msSuspected);
|
|
msSuspectedMapper.insert(msSuspected);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|