AdmModelRelController.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.persagy.proxy.adm.controller;
  2. import cn.hutool.core.collection.CollUtil;
  3. import com.persagy.proxy.adm.constant.AdmCommonConstant;
  4. import com.persagy.proxy.adm.model.AdmLocationPoint;
  5. import com.persagy.proxy.adm.model.AdmModelRel;
  6. import com.persagy.proxy.adm.request.AdmCreateRequest;
  7. import com.persagy.proxy.adm.request.AdmResponse;
  8. import com.persagy.proxy.adm.service.IAdmModelRelService;
  9. import com.persagy.proxy.common.entity.InstanceUrlParam;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.beans.factory.annotation.Value;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import javax.ws.rs.QueryParam;
  18. import java.util.ArrayList;
  19. import java.util.List;
  20. /**
  21. * @ClassName AdmModelRelController
  22. * @Description: 模型修改设备元空间的建筑楼层信息
  23. * @Author linhuili
  24. * @Date 2021/8/31 14:30
  25. * @Version V1.0
  26. **/
  27. @RestController
  28. @RequestMapping("/rel/update")
  29. @Slf4j
  30. public class AdmModelRelController {
  31. @Value("${middleware.group.code}")
  32. private String groupCode;
  33. @Autowired
  34. private IAdmModelRelService service;
  35. /**
  36. * 模型修改设备元空间的建筑楼层信息
  37. * @param admModelRel
  38. * @return
  39. * @throws Exception
  40. */
  41. @PostMapping("/equip-ispace")
  42. public AdmResponse update(@RequestBody AdmModelRel admModelRel, @QueryParam("projectId") String projectId) throws Exception {
  43. // 组装上下文条件
  44. InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
  45. List<AdmModelRel> vos = new ArrayList<>();
  46. vos = service.doUpdateModelInfo(context, AdmModelRel.class,admModelRel);
  47. return AdmResponse.success(vos);
  48. }
  49. }