Procházet zdrojové kódy

资料查询接口

huangjn před 3 roky
rodič
revize
50d9453321
12 změnil soubory, kde provedl 369 přidání a 25 odebrání
  1. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/ContractTreeDrawingsDTO.java
  2. 31 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/ContractTreeDrawings.java
  3. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ContractTreeDrawingsVO.java
  4. 7 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  5. 59 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java
  6. 4 4
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  7. 42 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.java
  8. 24 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractTreeDrawingsMapper.xml
  9. 38 21
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  10. 41 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IContractTreeDrawingsService.java
  11. 41 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractTreeDrawingsServiceImpl.java
  12. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

+ 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;
+
+}

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

@@ -0,0 +1,31 @@
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @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;
+
+
+}

+ 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;
+
 }

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

@@ -0,0 +1,59 @@
+/*
+ *      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 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.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.business.service.IContractTreeDrawingsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  节点图纸控制器
+ *
+ * @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)
+	})
+	public R<Boolean> saveOrUpdateContractTreeDrawings(@RequestParam String primaryKeyId, @RequestParam String fileUrl){
+		return null;
+	}
+	
+}

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

@@ -79,10 +79,10 @@ public class InformationWriteQueryController extends BladeController {
 	@ApiOperationSupport(order = 13)
 	@ApiOperation(value = "修改节点信息")
 	@ApiImplicitParam(name = "node", value = "节点信息(目前只允许修改名称)")
-	public R<Boolean> updateContractNodeParameter(@RequestBody WbsTreeContract node){
+	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));
 	}
@@ -136,7 +136,7 @@ public class InformationWriteQueryController extends BladeController {
 	}
 
 	/**
-	 * 懒加载项目级工程划分树
+		 * 懒加载项目级工程划分树
 	 * @param projectId 项目ID
 	 * @param id 节点ID
 	 * @return 结果集

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

@@ -0,0 +1,42 @@
+/*
+ *      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.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> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param contractTreeDrawings
+	 * @return
+	 */
+	List<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage page, ContractTreeDrawingsVO contractTreeDrawings);
+
+}

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

@@ -0,0 +1,24 @@
+<?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="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>

+ 41 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IContractTreeDrawingsService.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.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> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param contractTreeDrawings
+	 * @return
+	 */
+	IPage<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage<ContractTreeDrawingsVO> page, ContractTreeDrawingsVO contractTreeDrawings);
+
+}

+ 41 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractTreeDrawingsServiceImpl.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.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 IPage<ContractTreeDrawingsVO> selectContractTreeDrawingsPage(IPage<ContractTreeDrawingsVO> page, ContractTreeDrawingsVO contractTreeDrawings) {
+		return page.setRecords(baseMapper.selectContractTreeDrawingsPage(page, contractTreeDrawings));
+	}
+
+}

+ 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