|
@@ -18,11 +18,14 @@ import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.fire.service.PatrolInspectionPersonnelService;
|
|
|
import com.usky.fire.service.PatrolInspectionTypeService;
|
|
|
|
|
|
+import com.usky.fire.service.config.rabbitmq.RabbitMQConfig;
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
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 javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
@@ -59,6 +62,12 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
@Value("${agBox.push}")
|
|
|
private Integer pushFlag;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RabbitMQConfig rabbitMQConfig;
|
|
|
+
|
|
|
@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);
|
|
@@ -144,16 +153,18 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
jsonObj.put("triggerTime", formattedTime);
|
|
|
Integer eventCode = 17;
|
|
|
if(patrolInspectionAttendance.getSignInType().equals(0)){
|
|
|
- eventCode=1;
|
|
|
+ eventCode=31;
|
|
|
}else {
|
|
|
- eventCode=2;
|
|
|
+ eventCode=32;
|
|
|
}
|
|
|
jsonObj.put("eventCode", eventCode);
|
|
|
jsonObj.put("name", SecurityUtils.getUsername());
|
|
|
jsonObj.put("certifiedNo", patrolInspectionAttendance.getIdentificationNumber());
|
|
|
- if (pushFlag.equals(1)){
|
|
|
- JSONObject a = remotePatrolAgboxService.addEvent(jsonObj.toJSONString());
|
|
|
- }
|
|
|
+
|
|
|
+ rabbitTemplate.convertAndSend(rabbitMQConfig.patrolFEventExchange,"",jsonObj.toJSONString());
|
|
|
+// if (pushFlag.equals(1)){
|
|
|
+// JSONObject a = remotePatrolAgboxService.addEvent(jsonObj.toJSONString());
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|