Browse Source

Merge branch 'cr' of http://219.151.181.73:3000/zhuwei/bladex into dev-test-merge

# Conflicts:
#	blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeContractService.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java
lvy 3 weeks ago
parent
commit
a2fdcf19e7

+ 40 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/AlbumDTO.java

@@ -0,0 +1,40 @@
+/*
+ *      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.manager.dto;
+
+import org.springblade.manager.entity.Album;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AlbumDTO extends Album {
+	private static final long serialVersionUID = 1L;
+
+	private List<String> margePdfUrls;
+
+	private String dateValue;
+
+}

+ 77 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/Album.java

@@ -0,0 +1,77 @@
+/*
+ *      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.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.time.LocalDate;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+@Data
+@TableName("m_album")
+@EqualsAndHashCode(callSuper = true)
+public class Album extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 项目ID
+	*/
+		private Long projectId;
+	/**
+	* 合同段ID
+	*/
+		private Long contractId;
+	/**
+	* 分类ID (m_image_classification_config)
+	*/
+		private Long classifyId;
+	/**
+	* 相册文件题名
+	*/
+		private String imagesName;
+	/**
+	* 主要拍摄人
+	*/
+		private String photographer;
+	/**
+	* 分组号
+	*/
+		private String groupNumber;
+	/**
+	* 开始日期
+	*/
+		private String startDate;
+	/**
+	* 结束日期
+	*/
+		private String endDate;
+	/**
+	* 相册PDF
+	*/
+		private String imagesPdf;
+
+
+}

+ 38 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/AlbumVO.java

@@ -0,0 +1,38 @@
+/*
+ *      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.manager.vo;
+
+import org.springblade.manager.entity.Album;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AlbumVO extends Album {
+	private static final long serialVersionUID = 1L;
+
+	private String classifyName;
+
+	private String dateValue;
+
+}

+ 179 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/AlbumController.java

@@ -0,0 +1,179 @@
+/*
+ *      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.manager.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.oss.model.BladeFile;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.AlbumDTO;
+import org.springblade.manager.utils.FileUtils;
+import org.springblade.resource.feign.NewIOSSClient;
+import org.springblade.system.cache.ParamCache;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.manager.entity.Album;
+import org.springblade.manager.vo.AlbumVO;
+import org.springblade.manager.wrapper.AlbumWrapper;
+import org.springblade.manager.service.IAlbumService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/album")
+@Api(value = "", tags = "接口")
+public class AlbumController extends BladeController {
+
+	private final IAlbumService albumService;
+
+	private final NewIOSSClient newIOSSClient;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入album")
+	public R<AlbumVO> detail(Album album) {
+		Album detail = albumService.getOne(Condition.getQueryWrapper(album));
+		return R.data(AlbumWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 
+	 */
+	@PostMapping("/page")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入album")
+	public R<IPage<AlbumVO>> page(Long projectId,Long contractId,Query query) {
+		IPage<AlbumVO> pages = albumService.selectPage1(projectId,contractId,Condition.getPage(query));
+		return R.data(pages);
+	}
+
+
+//	/**
+//	 * 自定义分页
+//	 */
+//	@GetMapping("/page")
+//	@ApiOperationSupport(order = 3)
+//	@ApiOperation(value = "分页", notes = "传入album")
+//	public R<IPage<AlbumVO>> page(AlbumVO album, Query query) {
+//		IPage<AlbumVO> pages = albumService.selectAlbumPage(Condition.getPage(query), album);
+//		return R.data(pages);
+//	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入album")
+	public R save(@Valid @RequestBody AlbumDTO albumDTO) {
+		if(albumDTO.getMargePdfUrls().isEmpty()){
+			throw new ServiceException("相册不能为空");
+		}
+		Album album=new Album();
+		BeanUtil.copy(albumDTO,album);
+		String dateValue = albumDTO.getDateValue();
+		String[] strings = dateValue.split("~");
+		album.setStartDate(strings[0]);
+		album.setEndDate(strings[1]);
+		if(albumDTO.getMargePdfUrls().size()>1){
+			String file_path = FileUtils.getSysLocalFileUrl();
+			Long id = SnowFlakeUtil.getId();
+			String mergeName=id+".pdf";
+			String mergeUrl = file_path + "/nodePDF/"+id+".pdf";;
+			FileUtils.mergePdfPublicMethods(albumDTO.getMargePdfUrls(), mergeUrl);
+			BladeFile bladeFile = this.newIOSSClient.uploadFile(mergeName, mergeUrl);
+			if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
+				album.setImagesPdf(bladeFile.getLink());
+			}
+		}else {
+			album.setImagesPdf(albumDTO.getMargePdfUrls().get(0));
+		}
+
+		return R.status(albumService.save(album));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入album")
+	public R update(@Valid @RequestBody AlbumDTO albumDTO) {
+		Album album=new Album();
+		BeanUtil.copy(albumDTO,album);
+		String dateValue = albumDTO.getDateValue();
+		String[] strings = dateValue.split("~");
+		album.setStartDate(strings[0]);
+		album.setEndDate(strings[1]);
+		return R.status(albumService.updateById(album));
+	}
+
+//	/**
+//	 * 新增或修改
+//	 */
+//	@PostMapping("/submit")
+//	@ApiOperationSupport(order = 6)
+//	@ApiOperation(value = "新增或修改", notes = "传入album")
+//	public R submit(@Valid @RequestBody Album album) {
+//		return R.status(albumService.saveOrUpdate(album));
+//	}
+
+	
+//	/**
+//	 * 删除
+//	 */
+//	@PostMapping("/remove")
+//	@ApiOperationSupport(order = 7)
+//	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+//	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+//		return R.status(albumService.deleteLogic(Func.toLongList(ids)));
+//	}
+
+
+
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) {
+		return R.status(albumService.removeById(id));
+	}
+
+	
+}

+ 37 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/AlbumMapper.java

@@ -0,0 +1,37 @@
+/*
+ *      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.manager.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.manager.entity.Album;
+import org.springblade.manager.vo.AlbumVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+public interface AlbumMapper extends BaseMapper<Album> {
+
+
+
+    List<AlbumVO> selectAlbumPages(@Param("projectId") Long projectId, @Param("contractId")Long contractId, @Param("current")long current, @Param("size")long size);
+}

+ 35 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/AlbumMapper.xml

@@ -0,0 +1,35 @@
+<?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.manager.mapper.AlbumMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="albumResultMap" type="org.springblade.manager.entity.Album">
+        <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="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="classify_id" property="classifyId"/>
+        <result column="images_name" property="imagesName"/>
+        <result column="photographer" property="photographer"/>
+        <result column="group_number" property="groupNumber"/>
+        <result column="start_date" property="startDate"/>
+        <result column="end_date" property="endDate"/>
+        <result column="images_pdf" property="imagesPdf"/>
+    </resultMap>
+
+
+
+    <select id="selectAlbumPages" resultType="org.springblade.manager.vo.AlbumVO">
+        select a.*,m.classf_name as classifyName,
+               CONCAT(a.start_date, '~', a.end_date) as dateValue
+        from m_album a left join m_image_classification_config m on a.classify_id=m.id
+        where a.project_id=#{projectId} and a.contract_id=#{contractId} and a.is_deleted = 0
+            limit #{current},#{size}
+    </select>
+</mapper>

+ 43 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IAlbumService.java

@@ -0,0 +1,43 @@
+/*
+ *      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.manager.service;
+
+import org.springblade.manager.entity.Album;
+import org.springblade.manager.vo.AlbumVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+public interface IAlbumService extends BaseService<Album> {
+
+//	/**
+//	 * 自定义分页
+//	 *
+//	 * @param page
+//	 * @param album
+//	 * @return
+//	 */
+//	IPage<AlbumVO> selectAlbumPage(IPage<AlbumVO> page, AlbumVO album);
+
+
+	IPage<AlbumVO> selectPage1(Long projectId, Long contractId, IPage<AlbumVO> page);
+}

+ 54 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/AlbumServiceImpl.java

@@ -0,0 +1,54 @@
+/*
+ *      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.manager.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springblade.manager.entity.Album;
+import org.springblade.manager.vo.AlbumVO;
+import org.springblade.manager.mapper.AlbumMapper;
+import org.springblade.manager.service.IAlbumService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+@Service
+public class AlbumServiceImpl extends BaseServiceImpl<AlbumMapper, Album> implements IAlbumService {
+
+//	@Override
+//	public IPage<AlbumVO> selectAlbumPage(IPage<AlbumVO> page, AlbumVO album) {
+//		return page.setRecords(baseMapper.selectAlbumPage(page, album));
+//	}
+
+	@Override
+	public IPage<AlbumVO> selectPage1(Long projectId, Long contractId, IPage<AlbumVO> page) {
+		Long count = baseMapper.selectCount(new LambdaQueryWrapper<>(Album.class).eq(Album::getProjectId, projectId).eq(Album::getContractId, contractId));
+		page.setTotal(count);
+		List<AlbumVO> albumVOS = baseMapper.selectAlbumPages(projectId, contractId, (page.getCurrent()-1)*page.getSize(),page.getSize());
+		page.setRecords(albumVOS);
+		return page;
+	}
+
+
+}

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeSynchronousRecordServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.redisson.api.RedissonClient;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.common.utils.SystemUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.SecureUtil;
@@ -236,6 +237,9 @@ public class WbsTreeSynchronousRecordServiceImpl extends ServiceImpl<WbsTreeSync
      */
     @Scheduled(fixedDelay = 10000)
     public void syncInit() {
+        if(SystemUtils.isWindows()){
+            return;
+        }
         // 本地环境跳过执行(可添加日志输出)
         if (!schedulerEnabled) return;
 

+ 49 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/AlbumWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      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.manager.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.manager.entity.Album;
+import org.springblade.manager.vo.AlbumVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2025-07-15
+ */
+public class AlbumWrapper extends BaseEntityWrapper<Album, AlbumVO>  {
+
+	public static AlbumWrapper build() {
+		return new AlbumWrapper();
+ 	}
+
+	@Override
+	public AlbumVO entityVO(Album album) {
+		AlbumVO albumVO = Objects.requireNonNull(BeanUtil.copy(album, AlbumVO.class));
+
+		//User createUser = UserCache.getUser(album.getCreateUser());
+		//User updateUser = UserCache.getUser(album.getUpdateUser());
+		//albumVO.setCreateUserName(createUser.getName());
+		//albumVO.setUpdateUserName(updateUser.getName());
+
+		return albumVO;
+	}
+
+}