瀏覽代碼

优化客户管理导出功能,编码物管接口功能

wanghaicheng 5 年之前
父節點
當前提交
10cc69fca4

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/BusinessApplication.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.CrossOrigin;
  * @create 2019/11/4
  */
 @Slf4j
-@CrossOrigin
+//@CrossOrigin
 @EnableJms
 @EnableFeignClients
 @MapperScan("cn.com.ty.**.mapper")

+ 27 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/controller/PropertyMaintenanceController.java

@@ -0,0 +1,27 @@
+package cn.com.ty.lift.business.maintenance.controller;
+
+import cn.com.ty.lift.business.maintenance.dao.entity.model.request.PropertyMtRequest;
+import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenancePlanMapper;
+import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenanceRecordMapper;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("property")
+public class PropertyMaintenanceController {
+    private final MaintenancePlanMapper maintenancePlanMapper;
+    private final MaintenanceRecordMapper maintenanceRecordMapper;
+
+    @PostMapping("maintenance")
+    public RestResponse maintenance(@RequestBody PropertyMtRequest propertyMtRequest) {
+        //todo
+        return RestResponse.success("待实现");
+    }
+
+
+}

+ 23 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/request/PropertyMtRequest.java

@@ -0,0 +1,23 @@
+package cn.com.ty.lift.business.maintenance.dao.entity.model.request;
+
+import lombok.Data;
+
+@Data
+public class PropertyMtRequest {
+
+    /**
+     * 列表数据类型
+     * 1、待保养
+     * 2、保养中
+     * 3、已完成
+     * 4、计划超期
+     * 5、法规超期
+     */
+    private Integer type;
+
+    /**
+     * 分页
+     */
+    private Long pageNum;
+    private Long pageSize;
+}

+ 2 - 5
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/custom/service/impl/PropertyCompanyServiceImpl.java

@@ -115,7 +115,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
         rows.add(CollUtil.newArrayList("甲方公司id", "名称", "通讯地址", "状态"));
         companies.forEach(company -> {
             List<?> row = CollUtil.newArrayList(
-                    company.getId()
+                    company.getId().toString()
                     , company.getName()
                     , null != company.getMailingAddress() ? company.getMailingAddress() : "无"
                     , company.getStatus() == 1 ? "无关联项目" : "有关联项目");
@@ -124,15 +124,12 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
 
         ExcelWriter writer = ExcelUtil.getWriter(true);
         //设置列宽
-        writer.setColumnWidth(0, 25);
-        writer.setColumnWidth(1, 35);
-        writer.setColumnWidth(2, 40);
-        writer.setColumnWidth(3, 25);
 
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
         response.setHeader("Content-Disposition", "attachment;filename=" + LocalDate.now().toString() + ".xlsx");
         try (ServletOutputStream out = response.getOutputStream()) {
             writer.write(rows);
+            writer.autoSizeColumnAll();
             writer.flush(out, true);
             writer.close();
         } catch (IOException e) {