f36974064af7fc191078e07e6614759a114bac65.svn-base 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. package cn.com.goldenwater.dcproj.service.impl.system;
  2. import cn.com.goldenwater.dcproj.dao.BisInspLogDao;
  3. import cn.com.goldenwater.dcproj.model.BisInspLog;
  4. import cn.com.goldenwater.dcproj.service.BisInspLogService;
  5. import cn.com.goldenwater.id.util.UuidUtil;
  6. import net.sf.json.JSONObject;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Service;
  9. import java.util.Date;
  10. @Service
  11. public class RedisReceiver {
  12. @Autowired
  13. private BisInspLogService bisInspLogService;
  14. public void receiveMessage(String message) {
  15. JSONObject jsonObject = JSONObject.fromObject(message);
  16. jsonObject.remove("intm");
  17. BisInspLog bisInspLog = (BisInspLog) JSONObject.toBean(jsonObject, BisInspLog.class);
  18. bisInspLog.setIntm(new Date());
  19. if(bisInspLog.getPath().contains("del")||bisInspLog.getPath().contains("clean")){
  20. bisInspLogService.insertDelLog(bisInspLog);
  21. }else {
  22. bisInspLogService.insert(bisInspLog);
  23. }
  24. }
  25. }