|
@@ -32,14 +32,14 @@ public class MsSuspectedService {
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
- public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks,Long userCreate) {
|
|
|
+ public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks, Long userCreate) {
|
|
|
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,userCreate);
|
|
|
- Long houseId=msReportMapper.selectHouseIdByUserId(userCreate);
|
|
|
+ List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
|
|
|
+ Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
|
|
|
if (listReport == null || listReport.size() == 0) {
|
|
|
MsReport msReport = new MsReport();
|
|
|
msReport.setReportId(IdWorker.getId());
|
|
@@ -55,7 +55,7 @@ public class MsSuspectedService {
|
|
|
msReport.setTimeUpdate(DateTime.now());
|
|
|
msReportMapper.insert(msReport);
|
|
|
reportId = msReport.getReportId();
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
reportId = listReport.get(0).getReportId();
|
|
|
}
|
|
|
|
|
@@ -75,12 +75,12 @@ public class MsSuspectedService {
|
|
|
msSuspectedMapper.insert(msSuspected);
|
|
|
|
|
|
//确证人数
|
|
|
- Integer isTrue=msReportMapper.selectSuspectedNum(reportId,medical);
|
|
|
- MsReport msReport=msReportMapper.selectById(reportId);
|
|
|
- if(msReport!=null){
|
|
|
- if(medical==0)
|
|
|
+ Integer isTrue = msReportMapper.selectSuspectedNum(reportId, medical);
|
|
|
+ MsReport msReport = msReportMapper.selectById(reportId);
|
|
|
+ if (msReport != null) {
|
|
|
+ if (medical == 0)
|
|
|
msReport.setSuspectedNum(isTrue);
|
|
|
- if(medical==1)
|
|
|
+ if (medical == 1)
|
|
|
msReport.setSureNum(isTrue);
|
|
|
msReport.setUserUpdate(userCreate);
|
|
|
msReport.setTimeUpdate(DateTime.now());
|
|
@@ -91,6 +91,23 @@ public class MsSuspectedService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public void deleteSuspected(Long suspectedId) {
|
|
|
- msSuspectedMapper.deleteById(suspectedId);
|
|
|
+
|
|
|
+
|
|
|
+ MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
|
|
|
+ if (msSuspected != null) {
|
|
|
+ msSuspectedMapper.deleteById(suspectedId);
|
|
|
+ //确证人数
|
|
|
+ Integer isTrue = msReportMapper.selectSuspectedNum(msSuspected.getReportId(), msSuspected.getMedical());
|
|
|
+ MsReport msReport = msReportMapper.selectById(msSuspected.getReportId());
|
|
|
+ if (msReport != null) {
|
|
|
+ if (msSuspected.getMedical() == 0)
|
|
|
+ msReport.setSuspectedNum(isTrue);
|
|
|
+ if (msSuspected.getMedical() == 1)
|
|
|
+ msReport.setSureNum(isTrue);
|
|
|
+ msReport.setUserUpdate(msReport.getUserCreate());
|
|
|
+ msReport.setTimeUpdate(DateTime.now());
|
|
|
+ msReportMapper.updateById(msReport);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|