|
@@ -22,13 +22,15 @@ import java.util.List;
|
|
|
* @Date: 2020/2/4 15:44
|
|
|
*/
|
|
|
@Service
|
|
|
-@Transactional(readOnly = true)
|
|
|
+@Transactional()
|
|
|
public class MsReportService {
|
|
|
|
|
|
@Autowired
|
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
|
@Autowired
|
|
|
private MsReportMapper msReportMapper;
|
|
|
+ @Autowired
|
|
|
+ private MsReportService msReportService;
|
|
|
|
|
|
public List<MsSuspected> getByReportId(Long reportId) {
|
|
|
return msSuspectedMapper.selectByReportId(reportId);
|
|
@@ -47,6 +49,8 @@ public class MsReportService {
|
|
|
|
|
|
//获取今天数据
|
|
|
public MsReport getReportByDateNow(Long userCreate) {
|
|
|
+ //根据昨天的获取今天的
|
|
|
+ msReportService.getNowByYesterday(userCreate);
|
|
|
Date t = new Date();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String reportDate = df.format(t);
|
|
@@ -90,6 +94,7 @@ public class MsReportService {
|
|
|
if (listReport != null && listReport.size() > 0) {
|
|
|
//添加到今天日报
|
|
|
MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
|
+ Long reportId=0L;
|
|
|
if (msReport != null) {
|
|
|
MsReport msReport1 = new MsReport();
|
|
|
msReport1.setReportId(IdWorker.getId());
|
|
@@ -106,7 +111,8 @@ public class MsReportService {
|
|
|
msReport1.setTimeCreate(DateTime.now());
|
|
|
msReport1.setUserUpdate(userCreate);
|
|
|
msReport1.setTimeUpdate(DateTime.now());
|
|
|
- msReportMapper.insert(msReport);
|
|
|
+ msReportMapper.insert(msReport1);
|
|
|
+ reportId=msReport1.getReportId();
|
|
|
}
|
|
|
//添加今日家庭
|
|
|
List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
@@ -115,7 +121,7 @@ public class MsReportService {
|
|
|
|
|
|
MsSuspected msSuspected1 = new MsSuspected();
|
|
|
msSuspected1.setSuspectedId(IdWorker.getId());
|
|
|
- msSuspected1.setReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
|
|
|
+ msSuspected1.setReportId(reportId);
|
|
|
msSuspected1.setUserName(msSuspected.getUserName());
|
|
|
msSuspected1.setGrender(msSuspected.getGrender());
|
|
|
msSuspected1.setAge(msSuspected.getAge());
|
|
@@ -134,7 +140,7 @@ public class MsReportService {
|
|
|
msSuspected1.setTimeCreate(DateTime.now());
|
|
|
msSuspected1.setUserUpdate(userCreate);
|
|
|
msSuspected1.setTimeUpdate(DateTime.now());
|
|
|
- msSuspectedMapper.insert(msSuspected);
|
|
|
+ msSuspectedMapper.insert(msSuspected1);
|
|
|
}
|
|
|
}
|
|
|
}
|