Commit 4c3f216b authored by xixinzhao's avatar xixinzhao

修改提交

parent b43628a3
......@@ -39,9 +39,9 @@ public interface IPointDao extends BaseDao<Point, Long> {
@Modifying
@Transactional
@Query(value = "UPDATE p_point SET is_delete = 1 WHERE point_no = (?1)", nativeQuery = true)
void delPointByPointNo(Long id);
@Query(value = "UPDATE p_point SET is_delete = 1 WHERE original_id = (?1)", nativeQuery = true)
void delPointByOriginalId(Long id);
@Query(value = "SELECT id FROM p_point p WHERE is_delete = 0 AND p.point_no = (?1)", nativeQuery = true)
@Query(value = "SELECT id FROM p_point p WHERE is_delete = 0 AND p.original_id = (?1)", nativeQuery = true)
List<Long> findPointByPointNo(String pointNo);
}
......@@ -1187,11 +1187,11 @@ public class PointServiceImpl implements IPointService {
}
@Override
public void delPointByPointNo(Long id) {
List<Long> idLists = new ArrayList<>();
idLists = iPointDao.findPointByPointNo(String.valueOf(id));
iPointInputItemDao.deleteByPointId(idLists);
iPointDao.delPointByPointNo(id);
public void delPointByOriginalId(Long id) {
// List<Long> idLists = new ArrayList<>();
// idLists = iPointDao.findPointByPointNo(String.valueOf(id));
// iPointInputItemDao.deleteByPointId(idLists);
iPointDao.delPointByOriginalId(id);
}
@Override
......
......@@ -325,7 +325,7 @@ public interface IPointService {
*
* @param
*/
void delPointByPointNo(Long id);
void delPointByOriginalId(Long id);
List<Map<String, Object>> queryItemDetailByPointId(Long id, Long routeId, Long planId);
......
......@@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/**
* @author keyong
......@@ -30,12 +29,12 @@ public class AmosMqttListener extends EmqxListener {
@Override
public void processMessage(String topic, MqttMessage message) {
byte[] payload = message.getPayload();
String str = new String(payload, Charset.forName("GBK"));
String str = new String(payload, StandardCharsets.UTF_8);
if ("jcs/company/topic/add".equals(topic)) {
OrgUsrFormDto usrFormDto = JSON.parseObject(str, OrgUsrFormDto.class);
iPointService.syncSavePoint(usrFormDto);
} else {
iPointService.delPointByPointNo(Long.valueOf(str));
iPointService.delPointByOriginalId(Long.valueOf(str));
}
try {
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment