|
@@ -13,11 +13,15 @@ import com.sooka.sponest.data.emergency.domain.TBusLog;
|
|
|
import com.sooka.sponest.data.emergency.domain.TBusPatrolstation;
|
|
|
import com.sooka.sponest.data.emergency.domain.TBusTrack;
|
|
|
import com.sooka.sponest.data.emergency.mapper.*;
|
|
|
+import com.sooka.sponest.data.other.patrolpoint.domain.CenterdataTEmergencyPatrolpoint;
|
|
|
+import com.sooka.sponest.data.other.patrolpoint.service.ICenterdataTEmergencyPatrolpointService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class AppXungengServiceImpl extends BaseServiceImpl implements AppXungengService {
|
|
@@ -26,70 +30,44 @@ public class AppXungengServiceImpl extends BaseServiceImpl implements AppXungeng
|
|
|
TBusLogMapper logMapper;
|
|
|
|
|
|
@Resource
|
|
|
- TBusPatrolstationMapper tBusPatrolstationMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
- TBusTrackMapper tBusTrackMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
TBusDeptMapper tBusDeptMapper;
|
|
|
|
|
|
@Resource
|
|
|
- TBusEnterpriseMapper tBusEnterpriseMapper;
|
|
|
-
|
|
|
-
|
|
|
+ ICenterdataTEmergencyPatrolpointService patrolpointService;
|
|
|
|
|
|
@Override
|
|
|
- public AjaxResult doXungeng(AppXungengVO vo) {
|
|
|
- try {
|
|
|
- TBusLog tBusLog = new TBusLog();
|
|
|
- String logId = UUID.fastUUID().toString();
|
|
|
- tBusLog.setBusLogId(logId);
|
|
|
- tBusLog.setBusLogType("log_type_1");
|
|
|
- tBusLog.setLogSource("log_source_0");
|
|
|
- tBusLog.setIsRisk("0");
|
|
|
-
|
|
|
- TBusPatrolstation tBusPatrolstation = tBusPatrolstationMapper.selectTBusPatrolstationByBusPatrolstationId(vo.getBusPatrolstationId());
|
|
|
- tBusLog.setBusPatrolstationId(tBusPatrolstation.getBusPatrolstationId());
|
|
|
- tBusLog.setBusPatrolstationName(tBusPatrolstation.getBusPatrolstationName());
|
|
|
- tBusLog.setBusEnterpriseId(tBusPatrolstation.getBusEnterpriseId());
|
|
|
-
|
|
|
- setSookaDataBase(tBusPatrolstation);
|
|
|
- tBusLog.setBusEnterpriseName(tBusEnterpriseMapper.selectTBusEnterpriseByBusEnterpriseId(tBusPatrolstation).getBusinessName());
|
|
|
- tBusLog.setBusPatrolstationName(tBusPatrolstation.getBusEnterpriseName());
|
|
|
- tBusLog.setCreateTime(new Date());
|
|
|
- logMapper.insertTBusLog(tBusLog);
|
|
|
-
|
|
|
- TBusTrack tBusTrack = new TBusTrack();
|
|
|
- tBusTrack.setBusTrackId(UUID.fastUUID().toString());
|
|
|
- tBusTrack.setBusLogId(logId);
|
|
|
- LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
- tBusTrack.setDeptId(loginUser.getSysUser().getDeptId());
|
|
|
- tBusTrack.setUserId(loginUser.getUserid());
|
|
|
- tBusTrack.setCreateTime(new Date());
|
|
|
- tBusTrackMapper.insertTBusTrack(tBusTrack);
|
|
|
-
|
|
|
-
|
|
|
- //取得登录人信息
|
|
|
- LoginUser sysUser = SecurityUtils.getLoginUser();
|
|
|
- //写业务部门表
|
|
|
- TBusDept tBusDept = new TBusDept();
|
|
|
- tBusDept.setBusDeptId(UUID.fastUUID().toString());
|
|
|
- tBusDept.setBusLogId(logId);
|
|
|
- tBusDept.setDeptId(sysUser.getSysUser().getDeptId());
|
|
|
- tBusDept.setUserId(sysUser.getUserid());
|
|
|
- tBusDept.setCreateTime(new Date());
|
|
|
- tBusDept.setDeptType(sysUser.getSysUser().getDept().getDeptType());
|
|
|
- tBusDeptMapper.insertTBusDept(tBusDept);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return AjaxResult.success("巡更成功");
|
|
|
- } catch (Exception e) {
|
|
|
- return AjaxResult.error("巡更失败");
|
|
|
- }
|
|
|
-
|
|
|
+ public Map<String,Object> doXungeng(AppXungengVO vo) {
|
|
|
+ TBusLog tBusLog = new TBusLog();
|
|
|
+ String logId = UUID.fastUUID().toString();
|
|
|
+ tBusLog.setBusLogId(logId);
|
|
|
+ tBusLog.setBusLogType("log_type_1");
|
|
|
+ tBusLog.setLogSource("log_source_0");
|
|
|
+ tBusLog.setIsRisk("0");
|
|
|
+ tBusLog.setBusEnterpriseId(vo.getBusEnterpriseId());
|
|
|
+ tBusLog.setBusEnterpriseName(vo.getBusEnterpriseName());
|
|
|
+ tBusLog.setCreateTime(new Date());
|
|
|
+ tBusLog.setCreateBy(SecurityUtils.getUserId().toString());
|
|
|
+ logMapper.insertTBusLog(tBusLog);
|
|
|
+
|
|
|
+ //取得登录人信息
|
|
|
+ LoginUser sysUser = SecurityUtils.getLoginUser();
|
|
|
+ //写业务部门表
|
|
|
+ TBusDept tBusDept = new TBusDept();
|
|
|
+ tBusDept.setBusDeptId(UUID.fastUUID().toString());
|
|
|
+ tBusDept.setBusLogId(logId);
|
|
|
+ tBusDept.setDeptId(sysUser.getSysUser().getDeptId());
|
|
|
+ tBusDept.setUserId(sysUser.getUserid());
|
|
|
+ tBusDept.setCreateTime(new Date());
|
|
|
+ tBusDept.setDeptType(sysUser.getSysUser().getDepts().get(0).getDeptType());
|
|
|
+ tBusDeptMapper.insertTBusDept(tBusDept);
|
|
|
+
|
|
|
+ //修改巡更点最后一次巡更时间
|
|
|
+ CenterdataTEmergencyPatrolpoint patrolpoint = new CenterdataTEmergencyPatrolpoint();
|
|
|
+ patrolpoint.setEnterpriseId(vo.getBusEnterpriseId());
|
|
|
+ patrolpointService.editXungengTime(patrolpoint);
|
|
|
+ Map<String,Object> map = new HashMap<String,Object>();
|
|
|
+ map.put("logId", logId);
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
@Override
|