Commit e7687d8f authored by 赵啸非's avatar 赵啸非

添加启动日志

parent 9145a8e9
......@@ -16,6 +16,7 @@ import com.mortals.xhx.busiz.req.ApiThirdPartyReq;
import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.MessageTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
......@@ -162,7 +163,7 @@ public class MessageServiceImpl implements MessageService {
try {
Map<String, String> header = new HashMap<>();
header.put(HEADER_CONTENT_TYPE, "application/json");
log.info("thirdPartyUrl:{} req:{}",sendUrl,JSON.toJSONString(deviceReqApiReq));
log.info("thirdPartyUrl=>{}\n reqbody=>{} \n type=>{}",sendUrl,JSON.toJSONString(deviceReqApiReq), DeviceMethodEnum.getByValue(deviceReq.getDeviceStatus()).getDesc());
resp = HttpUtil.doPost(sendUrl, header, JSON.toJSONString(deviceReqApiReq));
return JSON.parseObject(resp, ApiResp.class);
} catch (Exception e) {
......
......@@ -35,6 +35,7 @@ import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.queue.TbQueueMsgHeaders;
import com.mortals.xhx.queue.TopicPartitionInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
......@@ -54,6 +55,7 @@ import java.util.stream.Stream;
*/
@RestController
@RequestMapping("device")
@Slf4j
public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceService, DeviceEntity, Long> {
@Autowired
......@@ -92,7 +94,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
@Override
protected void doListBefore(DeviceEntity query, Map<String, Object> model, Context context) throws AppException {
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("createTime",OrderCol.DESCENDING));
orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING));
query.setOrderColList(orderColList);
super.doListBefore(query, model, context);
}
......@@ -156,11 +158,11 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
*/
@PostMapping(value = "active")
public Rest<Void> deviceActive(@RequestBody DeviceEntity deviceEntity) {
log.info("设备激活:{}", deviceEntity.getDeviceCode());
String busiDesc = this.getModuleDesc() + "设备激活";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
this.service.active(deviceEntity.getDeviceCode(), getContext());
;
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("设备激活消息", e);
......@@ -178,7 +180,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "设备启用停用";
try {
this.service.deviceEnabled(deviceEntity.getId(),deviceEntity.getEnabled(), getContext());
this.service.deviceEnabled(deviceEntity.getId(), deviceEntity.getEnabled(), getContext());
//this.init(request, response, null, model, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, model);
......@@ -220,7 +222,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
jsonObject.put(KEY_RESULT_MSG, "");
try {
jsonObject.put(KEY_RESULT_DATA, model);
recordSysLog(request, "首页统计 【成功】");
recordSysLog(request, "首页统计 【成功】");
} catch (Exception e) {
log.error("异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
......@@ -233,8 +235,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
@Override
public void doImportDataBefore(List<DeviceEntity> list, boolean updateSupport, Context context) throws AppException {
String siteId = request.getParameter("siteId");
if(!ObjectUtils.isEmpty(siteId)){
list.stream().forEach(item->item.setSiteId(Convert.toLong(siteId,0L)));
if (!ObjectUtils.isEmpty(siteId)) {
list.stream().forEach(item -> item.setSiteId(Convert.toLong(siteId, 0L)));
}
list.stream().peek(item -> {
if (!ObjectUtils.isEmpty(item.getPicObj())) {
......
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