|
@@ -19,10 +19,12 @@ import com.usky.fire.service.PatrolInspectionPersonnelService;
|
|
|
import com.usky.fire.service.PatrolInspectionTypeService;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.usky.system.RemoteDeptService;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -53,6 +55,10 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
|
|
|
@Autowired
|
|
|
private RemotePatrolAgBoxService remotePatrolAgboxService;
|
|
|
+
|
|
|
+ @Value("${agBox.push}")
|
|
|
+ private Integer pushFlag;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<Map<String, Object>> pageList(Integer pageNum, Integer pageSize, String operateCode, String operator, LocalDateTime startTime, LocalDateTime endTime) {
|
|
|
IPage<PatrolInspectionAttendance> page = new Page<>(pageNum, pageSize);
|
|
@@ -132,7 +138,10 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
patrolInspectionPersonnelService.updateSignStatus(patrolInspectionAttendance.getSignInType());
|
|
|
JSONObject jsonObj = new JSONObject();
|
|
|
jsonObj.put("deviceId", patrolInspectionAttendance.getDeviceCode());
|
|
|
- jsonObj.put("triggerTime", LocalDateTime.now());
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String formattedTime = now.format(formatter);
|
|
|
+ jsonObj.put("triggerTime", formattedTime);
|
|
|
Integer eventCode = 17;
|
|
|
if(patrolInspectionAttendance.getSignInType().equals(0)){
|
|
|
eventCode=1;
|
|
@@ -142,7 +151,9 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
jsonObj.put("eventCode", eventCode);
|
|
|
jsonObj.put("name", SecurityUtils.getUsername());
|
|
|
jsonObj.put("certifiedNo", patrolInspectionAttendance.getIdentificationNumber());
|
|
|
- JSONObject a = remotePatrolAgboxService.addEvent(jsonObj.toJSONString());
|
|
|
+ if (pushFlag.equals(1)){
|
|
|
+ JSONObject a = remotePatrolAgboxService.addEvent(jsonObj.toJSONString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|