Explorar el Código

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

 Conflicts:
	blade-service/blade-business/src/main/java/org/springblade/business/utils/FunctionMain.java
liuyc hace 3 años
padre
commit
06e5475b16
Se han modificado 21 ficheros con 509 adiciones y 67 borrados
  1. 3 0
      blade-ops/blade-swagger/src/main/resources/application-dev.yml
  2. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractTreeDrawingsDTO.java
  3. 42 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractTreeDrawings.java
  4. 3 3
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/DatumPoint.java
  5. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractTreeDrawingsVO.java
  6. 7 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  7. 9 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java
  8. 0 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ConstructionLedgerController.java
  9. 75 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java
  10. 33 18
      blade-service/blade-business/src/main/java/org/springblade/business/controller/DatumPointController.java
  11. 21 4
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  12. 41 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.java
  13. 27 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.xml
  14. 38 21
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  15. 45 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IContractTreeDrawingsService.java
  16. 46 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractTreeDrawingsServiceImpl.java
  17. 19 12
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/DatumPointService.java
  18. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  19. 15 4
      blade-service/blade-business/src/main/java/org/springblade/business/utils/FunctionMain.java
  20. 2 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java
  21. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

+ 3 - 0
blade-ops/blade-swagger/src/main/resources/application-dev.yml

@@ -16,3 +16,6 @@ knife4j:
       - name: 后台接口
         uri: 127.0.0.1
         location: /blade-manager/v2/api-docs
+      - name: 业务接口
+        uri: 127.0.0.1
+        location: /blade-business/v2/api-docs

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractTreeDrawingsDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.ContractTreeDrawings;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractTreeDrawingsDTO extends ContractTreeDrawings {
+	private static final long serialVersionUID = 1L;
+
+}

+ 42 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractTreeDrawings.java

@@ -0,0 +1,42 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+@Data
+@TableName("u_contract_tree_drawings")
+@EqualsAndHashCode(callSuper = true)
+public class ContractTreeDrawings extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 上传图纸的工程划分节点
+     */
+    private Long processId;
+    /**
+     * 文件url
+     */
+    private String fileUrl;
+
+    public ContractTreeDrawings(String primaryKeyId, String fileUrl, Long createUser, String createDept){
+        this.processId = Long.parseLong(primaryKeyId);
+        this.fileUrl = fileUrl;
+        this.setCreateUser(createUser);
+        this.setCreateDept(createDept.contains(",") ? Long.parseLong(createDept.split(",")[0]) : Long.parseLong(createDept));
+        this.setCreateTime(new Date());
+    }
+
+    public ContractTreeDrawings(){}
+
+}

+ 3 - 3
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/DatumPoint.java

@@ -15,9 +15,9 @@ import org.springblade.core.tenant.mp.TenantEntity;
 @EqualsAndHashCode(callSuper = true)
 public class DatumPoint  extends TenantEntity {
     private String name;
-    private Double x=0.0;
-    private Double y=0.0;
-    private Double h=0.0;
+    private Double x;
+    private Double y;
+    private Double h;
     private String level;
     private String remark;
     private Integer type;

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractTreeDrawingsVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.ContractTreeDrawings;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractTreeDrawingsVO extends ContractTreeDrawings {
+	private static final long serialVersionUID = 1L;
+
+}

+ 7 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java

@@ -48,4 +48,11 @@ public class InformationQueryVO extends InformationQuery {
 	@ApiModelProperty("输入框内容查询")
 	private String queryValue;
 
+	@ApiModelProperty("时间查询,起止间隔符用~")
+	private String betweenTime;
+
+	private String startTime;
+
+	private String endTime;
+
 }

+ 9 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractTreeVOS.java

@@ -37,7 +37,16 @@ public class WbsTreeContractTreeVOS {
     @ApiModelProperty("是否是工序 true为工序")
     private Boolean leaf;
 
+    @ApiModelProperty("节点类型")
+    private Integer deptCategory;
+
     @ApiModelProperty("子节点")
     private List<WbsTreeContractTreeVOS> children = new ArrayList<>();
 
+    @ApiModelProperty("节点上传图纸主键")
+    private Long drawingsId;
+
+    @ApiModelProperty("节点上传图纸URL")
+    private String fileUrl;
+
 }

+ 0 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ConstructionLedgerController.java

@@ -88,7 +88,6 @@ public class ConstructionLedgerController extends BladeController {
 		Query query = new Query();
 		query.setCurrent(vo.getCurrent());
 		query.setSize(vo.getSize());
-
 		IPage<ConstructionLedger> pages;
 		if(vo.getSiteStartTime() != null && vo.getSiteEndTime() != null){
 			pages = this.constructionLedgerService.page(Condition.getPage(query), Condition.getQueryWrapper(ledger).lambda().in(ConstructionLedger::getWbsId, vo.getWbsIds()).between(ConstructionLedger::getSiteStartTime, ledger.getSiteStartTime(), ledger.getSiteEndTime()));
@@ -129,7 +128,6 @@ public class ConstructionLedgerController extends BladeController {
 			constructionLedger.setDetectionStartTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[0], "yyyy-MM-dd")));
 			constructionLedger.setDetectionEndTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[1], "yyyy-MM-dd")));
 		}
-
 		setUserData(constructionLedger, false);
 		return R.status(this.constructionLedgerService.updateById(constructionLedger));
 	}

+ 75 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java

@@ -0,0 +1,75 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.business.service.IContractTreeDrawingsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.Date;
+
+/**
+ *  节点图纸控制器
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/contractTreeDrawings")
+public class ContractTreeDrawingsController extends BladeController {
+
+	private final IContractTreeDrawingsService contractTreeDrawingsService;
+
+	/**
+	 * 保存或修改节点上传的图纸记录
+	 * @param primaryKeyId 节点primaryKeyId
+	 * @param fileUrl 文件url
+	 * @return 保存结果
+	 */
+	@PostMapping("/saveContractTreeDrawings")
+	@ApiOperationSupport(order = 14)
+	@ApiOperation(value = "保存或修改节点上传的图纸记录")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "primaryKeyId", value = "节点primaryKeyId", required = true),
+			@ApiImplicitParam(name = "fileUrl", value = "文件url", required = true),
+			@ApiImplicitParam(name = "id", value = "文件url")
+	})
+	public R<Boolean> saveOrUpdateContractTreeDrawings(@RequestParam String primaryKeyId, @RequestParam String fileUrl, @RequestParam String id){
+		//当前提交用户
+		BladeUser user = AuthUtil.getUser();
+		return StringUtils.isNotEmpty(id) ?
+				R.data(this.contractTreeDrawingsService.update(Wrappers.<ContractTreeDrawings>lambdaUpdate()
+						.set(ContractTreeDrawings::getFileUrl, fileUrl).set(ContractTreeDrawings::getUpdateUser, user.getUserId())
+						.set(ContractTreeDrawings::getUpdateTime, new Date())
+						.eq(ContractTreeDrawings::getId, id)))
+				:
+				R.data(this.contractTreeDrawingsService.save(new ContractTreeDrawings(primaryKeyId, fileUrl, user.getUserId(), user.getDeptId())));
+	}
+	
+}

+ 33 - 18
blade-service/blade-business/src/main/java/org/springblade/business/controller/DatumPointController.java

@@ -1,8 +1,7 @@
 package org.springblade.business.controller;
 
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.Api;
@@ -22,11 +21,11 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.io.PrintWriter;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -45,13 +44,19 @@ public class DatumPointController {
     private final DatumPointService service;
 
 
-    @PostMapping("/list")
+    @GetMapping("/list")
     public R<IPage<DatumPoint>>  list( String contractId, Query page, String type, String name){
         Map<String, Object> param = new HashMap<>(10);
-        param.put("contractId",contractId);
-        param.put("type",type);
-        param.put("name",name);
-        param.put("remark",name);
+        if(StringUtil.isNotBlank(contractId)){
+            param.put("contractId",contractId);
+        }
+        if(StringUtil.isNotBlank(type)){
+            param.put("type",type);
+        }
+        if(StringUtil.isNotBlank(contractId)){
+            param.put("name",name);
+            param.put("remark",name);
+        }
         return R.data(service.page(Condition.getPage(page),Condition.getQueryWrapper(param,DatumPoint.class)));
     }
 
@@ -70,8 +75,11 @@ public class DatumPointController {
 
 
     @PostMapping("/del")
-    public R del(String id){
-          return R.status(this.service.removeById(id));
+    public R del(String ids){
+          if(StringUtil.isNotBlank(ids)){
+              return R.status(this.service.removeByIds(Func.toLongList(ids)));
+          }
+          return R.status(false);
     }
 
 
@@ -83,26 +91,27 @@ public class DatumPointController {
     }
 
     @ResponseBody
-    @RequestMapping(value = "/queryData",method=RequestMethod.POST)
-    public R<DatumPointVo> queryData(HttpServletRequest request,String queryName,String contractId ,Integer type){
+    @GetMapping("/queryData")
+    public R<DatumPointVo> queryData(String queryName,String contractId ,Integer type){
         if(StringUtil.isEmpty(queryName)||StringUtil.isEmpty(contractId)||StringUtil.isEmpty(type)){
             return R.fail("缺少参数");
         }
-
        LambdaQueryWrapper<DatumPoint> wrapper = Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getName,queryName).eq(DatumPoint::getContractId,contractId).eq(DatumPoint::getType,type);
         DatumPoint dap = this.service.getOne(wrapper);
         DatumPointVo vo = new DatumPointVo();
-        BeanUtils.copyProperties(dap,vo);
+        if(dap!=null) {
+            BeanUtils.copyProperties(dap, vo);
+        }
         return R.data(vo);
     }
 
 
     @PostMapping("/import")
-    public R<String> importXy(@RequestParam("file") MultipartFile file, Integer type , Long contractId) throws Exception {
-        if(file != null&& type!=null && contractId!=null) {
+    public R importXy(@RequestParam("file") MultipartFile file, Integer type , Long contractId, Long projectId) throws Exception {
+        if(file != null&& type!=null && contractId!=null&&projectId!=null) {
             String fileName = Objects.requireNonNull(file.getOriginalFilename());
-            if(Pattern.matches(".(\\.xls)x?$",fileName.toLowerCase(Locale.ROOT))) {
-                return R.success(this.service.importData(file,contractId,type));
+            if(Pattern.matches(".+(\\.xls)x?$",fileName.toLowerCase(Locale.ROOT))) {
+                return this.service.importData(file,contractId,projectId,type);
             } else {
                 R.fail("文件格式不正确,请上传Excel文件");
             }
@@ -174,6 +183,12 @@ public class DatumPointController {
             response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
             wb.write(output);
             output.close();
+        }else {
+            response.setContentType("application/json;charset=UTF-8");
+            PrintWriter out = response.getWriter();
+            out.println(JSON.toJSONString(R.fail("没有查到到相关数据")));
+            out.flush();
+            out.close();
         }
 
     }

+ 21 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -24,6 +24,8 @@ import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.business.service.IContractTreeDrawingsService;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.core.mp.support.Condition;
@@ -70,6 +72,8 @@ public class InformationWriteQueryController extends BladeController {
 
 	private final IDictBizClient dictBizClient;
 
+	private final IContractTreeDrawingsService contractTreeDrawingsService;
+
 	/**
 	 * 修改节点信息
 	 * @param node 节点信息
@@ -78,11 +82,11 @@ public class InformationWriteQueryController extends BladeController {
 	@PostMapping("/updateContractNodeParameter")
 	@ApiOperationSupport(order = 13)
 	@ApiOperation(value = "修改节点信息")
-	@ApiImplicitParam(name = "node", value = "节点信息(目前只允许修改名称)")
-	public R<Boolean> updateContractNodeParameter(@RequestBody WbsTreeContract node){
+	@ApiImplicitParam(name = "node", value = "节点信息(目前只允许修改名称),需要将pKeyId传入")
+	public R<Boolean> updateContractNodeParameter(@Valid @RequestBody WbsTreeContract node){
 		//只允许修改节点名称
-		if(StringUtils.isEmpty(node.getDeptName())){
-			return R.data(false);
+		if(StringUtils.isEmpty(node.getDeptName()) || "null".equals(String.valueOf(node.getPKeyId())) || StringUtils.isNotEmpty(String.valueOf(node.getPKeyId()))){
+			return R.data(-1, false , "缺少参数");
 		}
 		return R.data(this.wbsTreeContractClient.updateContractNodeParameter(node));
 	}
@@ -277,6 +281,19 @@ public class InformationWriteQueryController extends BladeController {
 			rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
 		}
 
+		//获取上传的图纸
+		if(rootTreeNode != null && rootTreeNode.size() != 0){
+			rootTreeNode.forEach(vo -> {
+				ContractTreeDrawings drawings = this.contractTreeDrawingsService.queryCurrentNodeDrawings(vo.getPrimaryKeyId());
+				if(drawings != null){
+					//主键
+					vo.setDrawingsId(drawings.getId());
+					//文件路径
+					vo.setFileUrl(drawings.getFileUrl());
+				}
+			});
+		}
+
 		return R.data(rootTreeNode);
 	}
 

+ 41 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.business.vo.ContractTreeDrawingsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+public interface ContractTreeDrawingsMapper extends BaseMapper<ContractTreeDrawings> {
+
+	ContractTreeDrawings queryCurrentNodeDrawings(@Param("primaryKeyId") String primaryKeyId);
+
+	/**
+	 * 自定义分页
+	 */
+	List<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage page, ContractTreeDrawingsVO contractTreeDrawings);
+
+}

+ 27 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.ContractTreeDrawingsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="contractTreeDrawingsResultMap" type="org.springblade.business.entity.ContractTreeDrawings">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="process_id" property="processId"/>
+        <result column="file_url" property="fileUrl"/>
+    </resultMap>
+
+    <select id="queryCurrentNodeDrawings" resultMap="contractTreeDrawingsResultMap">
+        select id, file_url from u_contract_tree_drawings where is_deleted = 0 and process_id = #{primaryKeyId}
+    </select>
+
+    <select id="selectContractTreeDrawingsPage" resultMap="contractTreeDrawingsResultMap">
+        select * from u_contract_tree_drawings where is_deleted = 0
+    </select>
+
+</mapper>

+ 38 - 21
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -66,28 +66,45 @@
 
     <select id="selectInformationQueryPage" resultMap="informationQueryResultMap">
         select
-            id,
-            name,
-            number,
-            create_time,
-            task_status,
-            report_number,
-            file_user_name
-        from u_information_query
+            query.id,
+            query.name,
+            query.number,
+            query.create_time,
+            query.task_status,
+            query.report_number,
+            query.file_user_name
+        from
+        (
+            select
+                id,
+                name,
+                number,
+                create_time,
+                task_status,
+                report_number,
+                file_user_name,
+                date_format(create_time,'%Y-%m-%d') as createTimes
+            from u_information_query
+            where
+                is_deleted = 0
+                and classify = #{query.classify}
+                and contract_id = #{query.contractId}
+            <if test="query.taskStatus != null and query.taskStatus != ''"> and task_status = #{query.taskStatus} </if>
+            <if test="query.sourceType != null and query.sourceType != ''"> and source_type = #{query.sourceType} </if>
+            <if test="query.reportNumber != null and query.reportNumber != ''"> and report_number = #{query.reportNumber} </if>
+            <if test="query.fileUserIdAndName != null and query.fileUserIdAndName != ''"> and file_user_id_and_name like concat('%',#{query.fileUserIdAndName},'%') </if>
+            <if test="query.queryValue != null and query.queryValue != ''"> and (name like concat('%',#{query.queryValue},'%') OR number like concat('%',#{query.queryValue},'%')) </if>
+            <if test="query.wbsIds != null">
+                and wbs_id in
+                <foreach collection="query.wbsIds" item="wbsId" open="(" separator="," close=")">
+                    #{wbsId}
+                </foreach>
+            </if>
+        ) AS query
         where
-            is_deleted = 0
-        and classify = #{query.classify}
-        and contract_id = #{query.contractId}
-        <if test="query.taskStatus != null and query.taskStatus != ''"> and task_status = #{query.taskStatus} </if>
-        <if test="query.sourceType != null and query.sourceType != ''"> and source_type = #{query.sourceType} </if>
-        <if test="query.reportNumber != null and query.reportNumber != ''"> and report_number = #{query.reportNumber} </if>
-        <if test="query.fileUserIdAndName != null and query.fileUserIdAndName != ''"> and file_user_id_and_name like concat('%',#{query.fileUserIdAndName},'%') </if>
-        <if test="query.queryValue != null and query.queryValue != ''"> and (name like concat('%',#{query.queryValue},'%') OR number like concat('%',#{query.queryValue},'%')) </if>
-        <if test="query.wbsIds != null">
-            and wbs_id in
-            <foreach collection="query.wbsIds" item="wbsId" open="(" separator="," close=")">
-                #{wbsId}
-            </foreach>
+          1 = 1
+        <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
+            and query.createTimes between #{query.startTime} and #{query.endTime}
         </if>
         limit #{current}, #{size}
     </select>

+ 45 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IContractTreeDrawingsService.java

@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.business.vo.ContractTreeDrawingsVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+public interface IContractTreeDrawingsService extends BaseService<ContractTreeDrawings> {
+
+	/**
+	 * 根据节点ID获取其上传的图纸
+	 * @param primaryKeyId 节点ID
+	 * @return 结果
+	 */
+	ContractTreeDrawings queryCurrentNodeDrawings(String primaryKeyId);
+
+	/**
+	 * 自定义分页
+	 *
+	 */
+	IPage<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage<ContractTreeDrawingsVO> page, ContractTreeDrawingsVO contractTreeDrawings);
+
+}

+ 46 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractTreeDrawingsServiceImpl.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.springblade.business.entity.ContractTreeDrawings;
+import org.springblade.business.vo.ContractTreeDrawingsVO;
+import org.springblade.business.mapper.ContractTreeDrawingsMapper;
+import org.springblade.business.service.IContractTreeDrawingsService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-06-14
+ */
+@Service
+public class ContractTreeDrawingsServiceImpl extends BaseServiceImpl<ContractTreeDrawingsMapper, ContractTreeDrawings> implements IContractTreeDrawingsService {
+
+	@Override
+	public ContractTreeDrawings queryCurrentNodeDrawings(String primaryKeyId) {
+		return this.baseMapper.queryCurrentNodeDrawings(primaryKeyId);
+	}
+
+	@Override
+	public IPage<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage<ContractTreeDrawingsVO> page, ContractTreeDrawingsVO contractTreeDrawings) {
+		return page.setRecords(baseMapper.selectContractTreeDrawingsPage(page, contractTreeDrawings));
+	}
+
+}

+ 19 - 12
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/DatumPointService.java

@@ -7,6 +7,7 @@ import org.springblade.business.entity.DatumPoint;
 import org.springblade.business.mapper.DatumPointMapper;
 import org.springblade.business.utils.ExcelUtil;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -25,7 +26,7 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
 
 
 
-    public String importData(MultipartFile file,  Long contractId, Integer dataType) throws Exception {
+    public R importData(MultipartFile file, Long contractId, Long projectId, Integer dataType) throws Exception {
         List<String> level=new ArrayList<>();
         level.add("一级");
         level.add("二级");
@@ -40,14 +41,14 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                 String dengji= ExcelUtil.getValue(row1.getCell(2)).toString();
                 String beizhu=ExcelUtil.getValue(row1.getCell(3)).toString();
                 if( !"等级".equals(dengji)||!"备注".equals(beizhu)){
-                    return "导入的数据格式有错,请对准导入模板确认!";
+                    return  R.fail("导入的数据格式有错,请对准导入模板确认!");
                 }
             }
             if(dataType==1){
                 String dengji=ExcelUtil.getValue(row1.getCell(4)).toString();
                 String beizhu=ExcelUtil.getValue(row1.getCell(5)).toString();
                 if( !"等级".equals(dengji)||!"备注".equals(beizhu)){
-                    return "导入的数据格式有错,请对准导入模板确认!";
+                    return  R.fail("导入的数据格式有错,请对准导入模板确认!");
                 }
             }
 
@@ -68,12 +69,12 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                         String name=(String)ExcelUtil.getValue(row.getCell(0));
                         if(StringUtil.isEmpty(name)){
                             msg="第"+i+"行,测站点名称为空,请输入!";
-                            return msg;
+                            return  R.fail(msg);
                         }
                         //判断,同一合同段下,测站点名称是否重复
                         if(this.count(Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getName,name).eq(DatumPoint::getContractId,contractId).eq(DatumPoint::getType,dataType))>0){
                             msg="第"+i+"行,测站点:"+name+"已存在,请修改";
-                            return msg;
+                            return  R.fail(msg);
                         }
                         switch (j) {
                             case 0:
@@ -87,7 +88,7 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                                 if(StringUtil.isNotBlank((String) ExcelUtil.getValue(row.getCell(j)))) {
                                     if(!level.contains(value)){
                                         msg="第"+i+"行,等级应该为:一级、二级、三级 或 四级,请修改!";
-                                        return msg;
+                                        return  R.fail(msg);
                                     }
                                     obj.setLevel(value);
                                 }
@@ -101,6 +102,7 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
 
                     }
                     obj.setContractId(contractId);
+                    obj.setProjectId(projectId);
                     obj.setCreateTime(new Date());
                     obj.setType(dataType);
                     importList.add(obj);
@@ -117,12 +119,12 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                         String name=(String)ExcelUtil.getValue(row.getCell(0));
                         if(StringUtil.isEmpty(name)){
                             msg="第"+i+"行,测站点名称为空,请输入!";
-                            return msg;
+                            return  R.fail(msg);
                         }
                         //判断,同一合同段下,测站点名称是否重复
                         if(this.count(Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getName,name).eq(DatumPoint::getContractId,contractId).eq(DatumPoint::getType,dataType))>0){
                             msg="第"+i+"行,测站点:"+name+"已存在,请修改";
-                            return msg;
+                            return  R.fail(msg);
                         }
                         switch (j) {
                             case 0:
@@ -142,7 +144,7 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                                 if(StringUtil.isNotBlank((String) ExcelUtil.getValue(row.getCell(j)))) {
                                     if(!level.contains(value)){
                                         msg="第"+i+"行,等级应该为:一级、二级、三级 或 四级,请修改!";
-                                        return msg;
+                                        return  R.fail(msg);
                                     }
                                     obj.setLevel(value);
                                 }
@@ -156,6 +158,7 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
 
                     }
                     obj.setContractId(contractId);
+                    obj.setProjectId(projectId);
                     obj.setCreateTime(new Date());
                     obj.setType(dataType);
                     importList.add(obj);
@@ -163,16 +166,20 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
             }
             //批量保存
             this.saveBatch(importList);
-            return  "导入成功";
+            return   R.success("导入成功");
         } catch (Exception e){
             e.printStackTrace();
         }
-        return "执行异常";
+        return  R.fail("执行异常");
     }
 
     //导出数据
     public List<DatumPoint>  exportExcel( String contractId , Integer type, String search){
-      return   this.list(Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getType,type).and(e->e.like(DatumPoint::getName,search).or().like(DatumPoint::getRemark,search)));
+        if(StringUtil.isBlank(search)){
+            search="";
+        }
+        String finalSearch = search;
+        return   this.list(Wrappers.<DatumPoint>lambdaQuery().eq(DatumPoint::getType,type).eq(DatumPoint::getContractId,contractId).and(e->e.like(DatumPoint::getName, finalSearch).or().like(DatumPoint::getRemark, finalSearch)));
     }
 
 }

+ 14 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
+import org.apache.http.client.utils.DateUtils;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
@@ -126,6 +127,19 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 		if(vo.getWbsId() != null){
 			vo.setWbsIds(JSONArray.parseArray(JSONObject.toJSONString(String.valueOf(vo.getWbsId()).split(",")), String.class));
 		}
+
+		if(StringUtils.isNotEmpty(vo.getBetweenTime())){
+			String[] betweenTime;
+			if(vo.getBetweenTime().contains("~")){
+				String[] between = vo.getBetweenTime().split("~");
+				betweenTime = new String[]{between[0], between[1]};
+			} else {
+				betweenTime = new String[]{vo.getBetweenTime(), DateUtils.formatDate(new Date(), "yyyy-MM-dd")};
+			}
+			vo.setStartTime(betweenTime[0]);
+			vo.setEndTime(betweenTime[1]);
+		}
+
 		//获取数据
 		List<InformationQuery> result = this.baseMapper.selectInformationQueryPage(current, page.getSize(), vo);
 		//转换VO

+ 15 - 4
blade-service/blade-business/src/main/java/org/springblade/business/utils/FunctionMain.java

@@ -171,11 +171,22 @@ public class FunctionMain {
           System.out.println(sql);
     }
 
-//    public static void main(String[] args)  {
-////        createTable(Formula.class,"公式配置");
-////        System.out.println(builder(Formula.class));
+    public static void main(String[] args)  {
+//        createTable(Formula.class,"公式配置");
+//        System.out.println(builder(Formula.class));
 //          getToken();
-//    }
+         DatumPoint dap = new DatumPoint();
+         dap.setH(1.0);
+         dap.setY(2.0);
+         dap.setX(3.0);
+         dap.setType(1);
+         dap.setName("测试");
+         dap.setLevel("一级");
+         dap.setContractId(1L);
+         dap.setProjectId(2L);
+         dap.setRemark("导线点");
+        System.out.println(JSON.toJSONString(dap));
+    }
 
 
 }

+ 2 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -49,11 +49,10 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
     @Override
     public List<WbsTreeContractTreeVOS> queryContractWbsTreeByContractIdAndType(String contractId, Integer wbsType, String parentId) {
         List<WbsTreeContractTreeVO> vo = this.contractInfoService.queryContractWbsTreeByContractIdAndType(contractId, wbsType, parentId);
+
         //不知道为什么通过远程调用时实体字段不是想要的,所以中间用字段相同且不继承其它实体的类转换一次
         List<WbsTreeContractTreeVOS> vos = JSONArray.parseArray(JSONObject.toJSONString(vo), WbsTreeContractTreeVOS.class);
-        vos.forEach(voData -> {
-            voData.setLeaf(new Integer("6").equals(voData.getType()));
-        });
+        vos.forEach(voData -> voData.setLeaf(new Integer("6").equals(voData.getDeptCategory())));
         return vos;
     }
 }

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

@@ -157,6 +157,7 @@
         parent_id,
         dept_name AS title,
         type AS "type",
+        dept_category AS deptCategory,
         id AS "value",
         id AS "key"
         FROM