package cn.com.goldenwater.dcproj.service.impl.system; import cn.com.goldenwater.dcproj.dao.BisInspLogDao; import cn.com.goldenwater.dcproj.model.BisInspLog; import cn.com.goldenwater.dcproj.service.BisInspLogService; import cn.com.goldenwater.id.util.UuidUtil; import net.sf.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; @Service public class RedisReceiver { @Autowired private BisInspLogService bisInspLogService; public void receiveMessage(String message) { JSONObject jsonObject = JSONObject.fromObject(message); jsonObject.remove("intm"); BisInspLog bisInspLog = (BisInspLog) JSONObject.toBean(jsonObject, BisInspLog.class); bisInspLog.setIntm(new Date()); if(bisInspLog.getPath().contains("del")||bisInspLog.getPath().contains("clean")){ bisInspLogService.insertDelLog(bisInspLog); }else { bisInspLogService.insert(bisInspLog); } } }