Browse Source

Merge remote-tracking branch 'origin/master'

guoyujia 10 months ago
parent
commit
a51eccea4c
25 changed files with 1271 additions and 341 deletions
  1. 2 2
      src/main/java/cn/ezhizao/framework/web/domain/BaseEntity.java
  2. 30 21
      src/main/java/cn/ezhizao/project/business/processCompletion/controller/BizProcessCompletionController.java
  3. 73 3
      src/main/java/cn/ezhizao/project/business/processCompletion/domain/BizProcessCompletion.java
  4. 15 0
      src/main/java/cn/ezhizao/project/business/processCompletion/domain/CompleteStatistics.java
  5. 12 0
      src/main/java/cn/ezhizao/project/business/processCompletion/mapper/CompleteStatisticsMapper.java
  6. 16 0
      src/main/java/cn/ezhizao/project/business/processCompletion/service/ICompleteStatisticsService.java
  7. 23 0
      src/main/java/cn/ezhizao/project/business/processCompletion/service/impl/CompleteStatisticsServiceImpl.java
  8. 141 287
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/controller/BizTechnologicalProcessDetailDrawingController.java
  9. 52 22
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/domain/BizTechnologicalProcessDetailDrawing.java
  10. 2 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/mapper/BizTechnologicalProcessDetailDrawingMapper.java
  11. 15 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/service/IBizTechnologicalProcessDetailDrawingService.java
  12. 509 2
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/service/impl/BizTechnologicalProcessDetailDrawingServiceImpl.java
  13. 109 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/controller/BizTechnologicalProcessDetailDrawingUserController.java
  14. 74 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/domain/BizTechnologicalProcessDetailDrawingUser.java
  15. 31 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/mapper/BizTechnologicalProcessDetailDrawingUserMapper.java
  16. 32 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/service/IBizTechnologicalProcessDetailDrawingUserService.java
  17. 44 0
      src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/service/impl/BizTechnologicalProcessDetailDrawingUserServiceImpl.java
  18. 2 0
      src/main/java/cn/ezhizao/project/system/mapper/SysUserMapper.java
  19. 2 0
      src/main/java/cn/ezhizao/project/system/service/ISysUserService.java
  20. 6 0
      src/main/java/cn/ezhizao/project/system/service/impl/SysUserServiceImpl.java
  21. 3 3
      src/main/resources/application-dev.yml
  22. 21 0
      src/main/resources/mybatis/business/processCompletion/CompleteStatisticsMapper.xml
  23. 10 1
      src/main/resources/mybatis/business/technologicalProcessDetailDrawing/BizTechnologicalProcessDetailDrawingMapper.xml
  24. 34 0
      src/main/resources/mybatis/business/technologicalProcessDetailDrawingUser/BizTechnologicalProcessDetailDrawingUserMapper.xml
  25. 13 0
      src/main/resources/mybatis/system/SysUserMapper.xml

+ 2 - 2
src/main/java/cn/ezhizao/framework/web/domain/BaseEntity.java

@@ -60,7 +60,7 @@ public class BaseEntity implements Serializable {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField(value = "create_time", fill = FieldFill.INSERT)
-    @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 6)
+//    @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 6)
     private Date createTime;
 
     /**
@@ -105,7 +105,7 @@ public class BaseEntity implements Serializable {
     /**
      * 备注
      */
-    @Excel(name = "备注")
+//    @Excel(name = "备注")
     @TableField(exist = false)
     private String remark;
 

+ 30 - 21
src/main/java/cn/ezhizao/project/business/processCompletion/controller/BizProcessCompletionController.java

@@ -1,5 +1,7 @@
 package cn.ezhizao.project.business.processCompletion.controller;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.List;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -11,7 +13,9 @@ import cn.ezhizao.framework.web.controller.BaseController;
 import cn.ezhizao.framework.web.domain.AjaxResult;
 import cn.ezhizao.framework.web.page.TableDataInfo;
 import cn.ezhizao.project.business.processCompletion.domain.BizProcessCompletion;
+import cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics;
 import cn.ezhizao.project.business.processCompletion.service.IBizProcessCompletionService;
+import cn.ezhizao.project.business.processCompletion.service.ICompleteStatisticsService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -30,32 +34,41 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequestMapping("/business/completion")
-public class BizProcessCompletionController extends BaseController
-{
+public class BizProcessCompletionController extends BaseController {
     @Resource
     private IBizProcessCompletionService bizProcessCompletionService;
+    @Resource
+    private ICompleteStatisticsService completeStatisticsService;
 
     /**
      * 查询企业租户列表
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:list')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:list')")
     @GetMapping("/list")
-    public TableDataInfo list(BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException
-    {
+    public TableDataInfo list(BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(bizProcessCompletion);
         startPage();
         List<BizProcessCompletion> list = bizProcessCompletionService.getList(bizProcessCompletion);
         return getDataTable(list);
     }
 
+//    @PreAuthorize("@ss.hasPermi('business:completion:list')")
+    @GetMapping("/listStatistics")
+    public TableDataInfo listStatistics(CompleteStatistics completeStatistics) throws NoSuchFieldException, IllegalAccessException {
+        List<CompleteStatistics> list = completeStatisticsService.getList(completeStatistics);
+        list.forEach(l -> {
+            l.setRatio(l.getFinishedNum().equals(0) ? BigDecimal.ZERO : BigDecimal.valueOf(l.getFinishedInTimeNum()).divide(BigDecimal.valueOf(l.getFinishedNum()), 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)));
+        });
+        return getDataTable(list);
+    }
+
     /**
      * 导出企业租户列表
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:export')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:export')")
     @Log(title = "企业租户", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException
-    {
+    public void export(HttpServletResponse response, BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(bizProcessCompletion);
         List<BizProcessCompletion> list = bizProcessCompletionService.getList(bizProcessCompletion);
         ExcelUtil<BizProcessCompletion> util = new ExcelUtil<BizProcessCompletion>(BizProcessCompletion.class);
@@ -65,21 +78,19 @@ public class BizProcessCompletionController extends BaseController
     /**
      * 获取企业租户详细信息
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:query')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(bizProcessCompletionService.getById(id));
     }
 
     /**
      * 新增企业租户
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:add')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:add')")
     @Log(title = "企业租户", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException
-    {
+    public AjaxResult add(@RequestBody BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(bizProcessCompletion);
         return toAjax(bizProcessCompletionService.save(bizProcessCompletion));
     }
@@ -87,11 +98,10 @@ public class BizProcessCompletionController extends BaseController
     /**
      * 修改企业租户
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:edit')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:edit')")
     @Log(title = "企业租户", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException
-    {
+    public AjaxResult edit(@RequestBody BizProcessCompletion bizProcessCompletion) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(bizProcessCompletion);
         return toAjax(bizProcessCompletionService.updateById(bizProcessCompletion));
     }
@@ -99,11 +109,10 @@ public class BizProcessCompletionController extends BaseController
     /**
      * 删除企业租户
      */
-    @PreAuthorize("@ss.hasPermi('business:completion:remove')")
+//    @PreAuthorize("@ss.hasPermi('business:completion:remove')")
     @Log(title = "企业租户", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable List<Long> ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids) {
         return toAjax(bizProcessCompletionService.removeBatchByIds(ids));
     }
 }

+ 73 - 3
src/main/java/cn/ezhizao/project/business/processCompletion/domain/BizProcessCompletion.java

@@ -1,7 +1,10 @@
 package cn.ezhizao.project.business.processCompletion.domain;
 
+import java.util.Date;
+
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty;
  * 企业租户对象 biz_process_completion
  *
  * @author ezhizao
- * @date 2024-08-01
+ * @date 2024-08-02
  */
 @Data
 @TableName(value = "biz_process_completion")
@@ -18,6 +21,43 @@ public class BizProcessCompletion extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    /** 下达日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "下达日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "下达日期")
+    private Date releaseDate;
+
+    /** 计划完成日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "计划完成日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "计划完成日期")
+    private Date planDate;
+
+    /** 产品id */
+    @ApiModelProperty(value = "计划完成日期")
+    private Long productId;
+
+    /** 产品描述 */
+    @Excel(name = "产品描述")
+    @ApiModelProperty(value = "产品描述")
+    private String productDescription;
+
+    /** 产品产品编码 */
+    @Excel(name = "产品产品编码")
+    @ApiModelProperty(value = "产品产品编码")
+    private String productCode;
+
+    /** 实际完成日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "实际完成日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "实际完成日期")
+    private Date actualDate;
+
+    /** 是否超期 0 未开始 1未超期 2 已超期 */
+    @Excel(name = "是否超期 0 未开始 1未超期 2 已超期")
+    @ApiModelProperty(value = "是否超期 0 未开始 1未超期 2 已超期")
+    private Integer isOverdue;
+
     /** 年 */
     @Excel(name = "年")
     @ApiModelProperty(value = "年")
@@ -31,11 +71,41 @@ public class BizProcessCompletion extends BaseEntity
     /** 计划数量 */
     @Excel(name = "计划数量")
     @ApiModelProperty(value = "计划数量")
-    private Integer planNum;
+    private Long planNum;
 
     /** 实际数量 */
     @Excel(name = "实际数量")
     @ApiModelProperty(value = "实际数量")
-    private Integer actualNum;
+    private Long actualNum;
+
+    /** 客户id */
+    @ApiModelProperty(value = "实际数量")
+    private Long companyId;
+
+    /** 客户代号 */
+    @Excel(name = "客户代号")
+    @ApiModelProperty(value = "客户代号")
+    private String companyCode;
+
+    /** 客户集团简称,产品描述用 */
+    @Excel(name = "客户集团简称,产品描述用")
+    @ApiModelProperty(value = "客户集团简称,产品描述用")
+    private String companyAlias;
+
+    /** 规格,不允许出现下划线_ */
+    @Excel(name = "规格,不允许出现下划线_")
+    @ApiModelProperty(value = "规格,不允许出现下划线_")
+    private String specification;
+
+    /** 图号,不允许出现下划线_ */
+    @Excel(name = "图号,不允许出现下划线_")
+    @ApiModelProperty(value = "图号,不允许出现下划线_")
+    private String drawingNumber;
+
+    @ApiModelProperty(value = "未及时原因")
+    private String reason;
 
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
 }

+ 15 - 0
src/main/java/cn/ezhizao/project/business/processCompletion/domain/CompleteStatistics.java

@@ -0,0 +1,15 @@
+package cn.ezhizao.project.business.processCompletion.domain;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class CompleteStatistics {
+    private String year;
+    private String month;
+    private String yearMonth;
+    private Integer finishedNum;
+    private Integer finishedInTimeNum;
+    private BigDecimal ratio;
+}

+ 12 - 0
src/main/java/cn/ezhizao/project/business/processCompletion/mapper/CompleteStatisticsMapper.java

@@ -0,0 +1,12 @@
+package cn.ezhizao.project.business.processCompletion.mapper;
+
+import cn.ezhizao.project.business.processCompletion.domain.BizProcessCompletion;
+import cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+public interface CompleteStatisticsMapper  extends BaseMapper<CompleteStatistics> {
+
+    public List<CompleteStatistics> getList(CompleteStatistics completeStatistics);
+}

+ 16 - 0
src/main/java/cn/ezhizao/project/business/processCompletion/service/ICompleteStatisticsService.java

@@ -0,0 +1,16 @@
+package cn.ezhizao.project.business.processCompletion.service;
+
+import cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+public interface ICompleteStatisticsService extends IService<CompleteStatistics> {
+    /**
+     * 查询企业租户列表
+     *
+     * @param completeStatistics 企业租户
+     * @return 企业租户集合
+     */
+    public List<CompleteStatistics> getList(CompleteStatistics completeStatistics);
+}

+ 23 - 0
src/main/java/cn/ezhizao/project/business/processCompletion/service/impl/CompleteStatisticsServiceImpl.java

@@ -0,0 +1,23 @@
+package cn.ezhizao.project.business.processCompletion.service.impl;
+
+import cn.ezhizao.project.business.processCompletion.domain.BizProcessCompletion;
+import cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics;
+import cn.ezhizao.project.business.processCompletion.mapper.BizProcessCompletionMapper;
+import cn.ezhizao.project.business.processCompletion.mapper.CompleteStatisticsMapper;
+import cn.ezhizao.project.business.processCompletion.service.IBizProcessCompletionService;
+import cn.ezhizao.project.business.processCompletion.service.ICompleteStatisticsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class CompleteStatisticsServiceImpl  extends ServiceImpl<CompleteStatisticsMapper, CompleteStatistics> implements ICompleteStatisticsService {
+    @Resource
+    private CompleteStatisticsMapper completeStatisticsMapper;
+    @Override
+    public List<CompleteStatistics> getList(CompleteStatistics completeStatistics) {
+        return completeStatisticsMapper.getList(completeStatistics);
+    }
+}

+ 141 - 287
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/controller/BizTechnologicalProcessDetailDrawingController.java

@@ -17,6 +17,10 @@ import cn.ezhizao.project.business.technologicalProcessDetailDrawing.domain.BizT
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.service.IBizTechnologicalProcessDetailDrawingService;
 import cn.ezhizao.project.business.technologicalProcessDetailDrawingRecords.domain.BizTechnologicalProcessDetailDrawingRecords;
 import cn.ezhizao.project.business.technologicalProcessDetailDrawingRecords.service.IBizTechnologicalProcessDetailDrawingRecordsService;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.service.IBizTechnologicalProcessDetailDrawingUserService;
+import cn.ezhizao.project.system.domain.SysUser;
+import cn.ezhizao.project.system.service.ISysUserService;
 import org.apache.pdfbox.exceptions.COSVisitorException;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -30,6 +34,7 @@ import com.itextpdf.text.pdf.PdfContentByte;
 import com.itextpdf.text.pdf.PdfGState;
 import com.itextpdf.text.pdf.PdfReader;
 import com.itextpdf.text.pdf.PdfStamper;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.ByteArrayOutputStream;
 import java.io.FileOutputStream;
@@ -41,6 +46,7 @@ import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -62,6 +68,110 @@ public class BizTechnologicalProcessDetailDrawingController extends BaseControll
     private IBizPersonalSealService bizPersonalSealService ;
     @Resource
     private IBizPublicSealService bizPublicSealService;
+    @Resource
+    private ISysUserService userService;
+
+    @Resource
+    private IBizTechnologicalProcessDetailDrawingUserService bizTechnologicalProcessDetailDrawingUserService;
+
+
+    @Log(title = "电子图纸", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void exportDrawing(HttpServletResponse response){
+
+
+        BizTechnologicalProcessDetailDrawing item = new BizTechnologicalProcessDetailDrawing();
+        List<BizTechnologicalProcessDetailDrawing> list = bizTechnologicalProcessDetailDrawingService.getDrawingList(item);
+        for (BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing : list) {
+
+
+
+
+            bizTechnologicalProcessDetailDrawing.setCompanyAlias(bizTechnologicalProcessDetailDrawing.getProduct().getCompanyAlias());
+            bizTechnologicalProcessDetailDrawing.setSpecification(bizTechnologicalProcessDetailDrawing.getProduct().getSpecification());
+            bizTechnologicalProcessDetailDrawing.setDescription(bizTechnologicalProcessDetailDrawing.getProduct().getDescription());
+        }
+
+        ExcelUtil<BizTechnologicalProcessDetailDrawing> util = new ExcelUtil<BizTechnologicalProcessDetailDrawing>(BizTechnologicalProcessDetailDrawing.class);
+        util.exportExcel(response, list, "电子图纸数据");
+    }
+
+    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('business:workpiece:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<BizTechnologicalProcessDetailDrawing> util = new ExcelUtil<>(BizTechnologicalProcessDetailDrawing.class);
+        List<BizTechnologicalProcessDetailDrawing> bizTechnologicalProcessDetailDrawings = util.importExcel(file.getInputStream());
+
+        for(BizTechnologicalProcessDetailDrawing item : bizTechnologicalProcessDetailDrawings){
+            SysUser userParam = new SysUser();
+            SysUser user = new SysUser();
+            userParam.setUserName(item.getProducerCode());
+            userParam.setNickName(item.getProducer());
+            List<SysUser> userList = userService.getListByUserName(userParam);
+            if (userList.isEmpty()){
+                return error("未查到人员");
+            }else {
+                user = userList.get(0);
+            }
+
+            BizPersonalSeal person = new BizPersonalSeal();
+            person.setUserId(user.getUserId());
+            String filePath = RuoYiConfig.getProfile();
+            List<BizPersonalSeal> personList = bizPersonalSealService.getList(person);
+            // 获取当前日期
+            LocalDate currentDate = LocalDate.now();
+            // 定义日期格式
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+            // 格式化日期
+            String formattedDate = currentDate.format(formatter);
+            if(personList.isEmpty()){
+                return error(user.getUserId() + "该人员没有个人章");
+            }
+            String personalSeal = personList.get(0).getUrl().substring("/profile".length());
+
+
+
+            String url = "";
+            url = item.getUrl();
+            url = url.substring("/profile".length());
+            item.setProducerId(user.getUserId());
+            item.setProducer(user.getNickName());
+            item.setStatus(0);
+
+            item.setPattern("新产品");
+            //上传调整尺寸
+
+
+            PdfUtils.reSized(filePath + url,filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),100,"height");
+            bizTechnologicalProcessDetailDrawingService.addText(filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),"制定人:",550,75,12,270);
+            bizTechnologicalProcessDetailDrawingService.addText(filePath +url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),formattedDate,500,75,12,270);
+            bizTechnologicalProcessDetailDrawingService.addImage(filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4),filePath+personalSeal,515,40,30,30,270,1);
+            item.setUrl("/profile/"+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4));
+            bizTechnologicalProcessDetailDrawingService.updateById(item);
+            //添加用户记录
+            BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+            drawingUser.setDrawingId(item.getId());
+            drawingUser.setProcessCode(item.getProcessCode());
+            drawingUser.setDrawingName(item.getDrawingName());
+            drawingUser.setType(0);
+            drawingUser.setUserId(user.getUserId());
+            drawingUser.setNickName(user.getNickName());
+            drawingUser.setProductId(item.getProductId());
+            drawingUser.setProductVersion(item.getProductVersion());
+            drawingUser.setRecordTime(new Date());
+            bizTechnologicalProcessDetailDrawingUserService.save(drawingUser);
+            List<BizTechnologicalProcessDetailDrawing>itemList = new ArrayList<>();
+            itemList.add(item);
+            //开始正是走审核流程
+            bizTechnologicalProcessDetailDrawingService.saveData(itemList,item.getReviewerCode(),item.getReviewer());
+            //批准流程
+            bizTechnologicalProcessDetailDrawingService.saveData(itemList,item.getIssuerCode(),item.getIssuer());
+        }
+
+        return success(bizTechnologicalProcessDetailDrawings);
+    }
 
     /**
      * 查询电子图纸列表
@@ -125,16 +235,16 @@ public class BizTechnologicalProcessDetailDrawingController extends BaseControll
     /**
      * 导出电子图纸列表
      */
-    @PreAuthorize("@ss.hasPermi('business:drawing:export')")
-    @Log(title = "电子图纸", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing) throws NoSuchFieldException, IllegalAccessException
-    {
-        setTenantId(bizTechnologicalProcessDetailDrawing);
-        List<BizTechnologicalProcessDetailDrawing> list = bizTechnologicalProcessDetailDrawingService.getList(bizTechnologicalProcessDetailDrawing);
-        ExcelUtil<BizTechnologicalProcessDetailDrawing> util = new ExcelUtil<BizTechnologicalProcessDetailDrawing>(BizTechnologicalProcessDetailDrawing.class);
-        util.exportExcel(response, list, "电子图纸数据");
-    }
+//    @PreAuthorize("@ss.hasPermi('business:drawing:export')")
+//    @Log(title = "电子图纸", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing) throws NoSuchFieldException, IllegalAccessException
+//    {
+//        setTenantId(bizTechnologicalProcessDetailDrawing);
+//        List<BizTechnologicalProcessDetailDrawing> list = bizTechnologicalProcessDetailDrawingService.getList(bizTechnologicalProcessDetailDrawing);
+//        ExcelUtil<BizTechnologicalProcessDetailDrawing> util = new ExcelUtil<BizTechnologicalProcessDetailDrawing>(BizTechnologicalProcessDetailDrawing.class);
+//        util.exportExcel(response, list, "电子图纸数据");
+//    }
 
     /**
      * 获取电子图纸详细信息
@@ -158,160 +268,20 @@ public class BizTechnologicalProcessDetailDrawingController extends BaseControll
     @PostMapping("/save")
 
     public AjaxResult save(@RequestBody List<BizTechnologicalProcessDetailDrawing> bizTechnologicalProcessDetailDrawing) throws NoSuchFieldException, IllegalAccessException, COSVisitorException, DocumentException, IOException {
-        BizPersonalSeal person = new BizPersonalSeal();
-        person.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
-        String filePath = RuoYiConfig.getProfile();
-        List<BizPersonalSeal> personList = bizPersonalSealService.getList(person);
-        // 获取当前日期
-        LocalDate currentDate = LocalDate.now();
-        // 定义日期格式
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-        // 格式化日期
-        String formattedDate = currentDate.format(formatter);
-        if(personList.isEmpty()){
-            return error("请先上传个人章");
-        }
-        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
-        for(BizTechnologicalProcessDetailDrawing item: bizTechnologicalProcessDetailDrawing){
-            String url = "";
-            url = item.getUrl();
-            url = url.substring("/profile".length());
-            if (item.getStatus() == null){
-                // 默认情况下执行新增的代码
-                item.setProducerId(SecurityUtils.getLoginUser().getUser().getUserId());
-                item.setProducer(SecurityUtils.getLoginUser().getUser().getNickName());
-                item.setStatus(0);
-                item.setPattern("新产品");
-                //上传调整尺寸
-
-
-                PdfUtils.reSized(filePath + url,filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),100,"height");
-                addText(filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),"制定人:",550,75,12,270);
-                addText(filePath +url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),formattedDate,500,75,12,270);
-                addImage(filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4),filePath+personalSeal,515,40,30,30,270,1);
-                item.setUrl("/profile/"+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4));
-                bizTechnologicalProcessDetailDrawingService.save(item);
-                break;
-            }else {
-                switch (item.getStatus()) {
-                    //0:待审核,1待批准
-                    case 0:
-                        item.setReviewerId(SecurityUtils.getLoginUser().getUser().getUserId());
-                        item.setReviewer(SecurityUtils.getLoginUser().getUser().getNickName());
-                        item.setStatus(1);
-                        addText(filePath+ url,filePath +url.substring(0, url.length()-4) + "审核" + url.substring(url.length()-4),"审核人:",470,75,12,270);
-                        addText(filePath +url.substring(0, url.length()-4) + "审核" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "审核时间" + url.substring(url.length()-4),formattedDate,420,75,12,270);
-                        addImage(filePath +url.substring(0, url.length()-4) + "审核时间" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "审核完成" + url.substring(url.length()-4),filePath+personalSeal,435,40,30,30,270,1);
-                        item.setUrl("/profile/"+url.substring(0, url.length()-4) + "审核完成" + url.substring(url.length()-4));
-                        bizTechnologicalProcessDetailDrawingService.updateById(item);
-                        break;
-                    case 1:
-                        issuer(item,personalSeal);
-                        break;
-                }
-            }
 
-        }
-
-            return success();
-    }
 
-    /**
-     * 批准逻辑
-     * @param item
-     */
-    @Transactional
-    public void issuer (BizTechnologicalProcessDetailDrawing item,String personalSeal) throws DocumentException, IOException {
-        item.setIssuerId(SecurityUtils.getLoginUser().getUser().getUserId());
-        item.setIssuer(SecurityUtils.getLoginUser().getUser().getNickName());
-        item.setStatus(2);
-        String url = "";
-        url = item.getUrl();
-        url = url.substring("/profile".length());
-        String filePath = RuoYiConfig.getProfile();
-        //查询公共章
-        String reviewer = getPublicSeal("受控");
-        String D = getPublicSeal("D章");
-        String heavy = getPublicSeal("重章");
-        String isu = getPublicSeal("发行章");
-        String rem = getPublicSeal("废弃章");
-        // 获取当前日期
-        LocalDate currentDate = LocalDate.now();
-        // 定义日期格式
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-        // 格式化日期
-        String formattedDate = currentDate.format(formatter);
-
-        //替换图纸将旧图纸废弃
-        if (item.getParentId()!=0){
-            BizTechnologicalProcessDetailDrawing byId = bizTechnologicalProcessDetailDrawingService.query().eq("id", item.getParentId()).one();
-            String urlItem = "";
-            urlItem = byId.getUrl();
-            urlItem = urlItem.substring("/profile".length());
-            byId.setStatus(2);
-            byId.setAbandoned(1);
-            byId.setVoided(SecurityUtils.getLoginUser().getUser().getNickName());
-            byId.setVoidedId(SecurityUtils.getLoginUser().getUser().getUserId());
-            byId.setPattern("作废产品");
-            addImage(filePath+ urlItem,filePath +urlItem.substring(0, urlItem.length()-4) + "zf" + urlItem.substring(urlItem.length()-4),filePath+rem,290,880,40,15,300,0.8F);
-            addText(filePath +urlItem.substring(0, urlItem.length()-4) + "zf" + urlItem.substring(urlItem.length()-4),filePath +urlItem.substring(0, urlItem.length()-4) + "zfr" + urlItem.substring(urlItem.length()-4),"作废申请人:",310,75,12,270);
-            addText(filePath +urlItem.substring(0, urlItem.length()-4) + "zfr" + urlItem.substring(urlItem.length()-4),filePath+urlItem.substring(0, urlItem.length()-4) + "zfdate" + urlItem.substring(urlItem.length()-4),formattedDate,500,75,12,270);
-
-            addImage(filePath +urlItem.substring(0, urlItem.length()-4) + "zfdate" + urlItem.substring(urlItem.length()-4),filePath +urlItem.substring(0, urlItem.length()-4) + "zfover" + urlItem.substring(urlItem.length()-4),filePath+personalSeal,275,40,30,30,270,1);
-           byId.setUrl("/profile/" +urlItem.substring(0, urlItem.length()-4) + "zfover" + urlItem.substring(urlItem.length()-4));
-            bizTechnologicalProcessDetailDrawingService.updateById(byId);
-        }
-        //判断盖章逻辑
-        if (item.getAbandoned() ==1){
-            //加盖废弃章,不需要盖其他章
-            addImage(filePath+ url,filePath +url.substring(0, url.length()-4) + "zf" + url.substring(url.length()-4),filePath+rem,290,880,40,15,300,0.8F);
-            addText(filePath +url.substring(0, url.length()-4) + "zf" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),"作废批准人:",230,75,12,270);
-            addText(filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),formattedDate,180,75,12,270);
-
-            addImage(filePath +url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4),filePath+personalSeal,195,40,30,30,270,1);
-            item.setUrl("/profile/"+url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4));
-            bizTechnologicalProcessDetailDrawingService.updateById(item);
-            return;
-        }
-        //盖批准和审核章还有批准日期
-        addText(filePath+ url,filePath +url.substring(0, url.length()-4) + "pz" + url.substring(url.length()-4),"批准人:",390,75,12,270);
-        //批准章
-        addImage(filePath +url.substring(0, url.length()-4) + "pz" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzz" + url.substring(url.length()-4),filePath+isu,400,860,60,55,300,0.8F);
-        //批准章上的日期
-        addText(filePath +url.substring(0, url.length()-4) + "pzz" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzdate" + url.substring(url.length()-4),formattedDate,427,913,8,300);
-        //个人章
-        addImage(filePath +url.substring(0, url.length()-4) + "pzdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzr" + url.substring(url.length()-4),filePath+personalSeal,355,40,30,30,270,1);
-        //批准日期
-        addText(filePath +url.substring(0, url.length()-4) + "pzr" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzrdate" + url.substring(url.length()-4),formattedDate,340,75,12,270);
-
-        //受控章
-        addImage(filePath +url.substring(0, url.length()-4) + "pzrdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath+reviewer,465,870,45,28,300,0.8F);
-        item.setUrl("/profile/" +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4));
-        if (item.getIdentification()){
-            //盖重章
-            addImage(filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4),filePath+heavy,320,870,40,40,300,0.8F);
-            item.setUrl("/profile" +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4));
-        }
-        if (item.getMarkD() ){
-            //因为地址不同判断重章有没有盖到
-            //盖D章
-            if (!item.getIdentification()){
-                addImage(filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4),filePath+D,365,870,40,40,300,0.8F);
-            }else {
-                addImage(filePath +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4),filePath+D,365,870,40,40,300,0.8F);
-            }
-            item.setUrl("/profile/" +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4));
 
+        int i = bizTechnologicalProcessDetailDrawingService.saveData(bizTechnologicalProcessDetailDrawing,SecurityUtils.getLoginUser().getUser().getUserName(),SecurityUtils.getLoginUser().getUser().getNickName());
+        if (i == 3) {
+            return error("请先上传个人章");
+        } else if (i ==4) {
+            return error("未查询到当前员工");
+        } else {
+            return success();
         }
-        bizTechnologicalProcessDetailDrawingService.updateById(item);
     }
 
-/**
- * 公共章查村
- */
-public String getPublicSeal(String code) {
-    return bizPublicSealService.query().eq("code", code).one().getUrl().substring("/profile".length());
-}
+
     /**
      * 电子图纸作废
      */
@@ -319,53 +289,23 @@ public String getPublicSeal(String code) {
     @PutMapping("/drawingNG")
     @Transactional
     public AjaxResult drawingNG(@RequestBody List<BizTechnologicalProcessDetailDrawing> processDetailDrawing) throws NoSuchFieldException, IllegalAccessException, IOException {
-        for(BizTechnologicalProcessDetailDrawing  item: processDetailDrawing){
-            item.setStatus(3);
-            item.setNgUser(SecurityUtils.getLoginUser().getUser().getNickName());
-            item.setUserNgId(SecurityUtils.getLoginUser().getUser().getUserId());
-
-            bizTechnologicalProcessDetailDrawingService.updateById(item);
-        }
-
-        return success();
+       return success( bizTechnologicalProcessDetailDrawingService.drawingNG(processDetailDrawing,SecurityUtils.getLoginUser().getUser().getUserName(),SecurityUtils.getLoginUser().getUser().getNickName()));
     }
 
     @Log(title = "电子图纸", businessType = BusinessType.UPDATE)
     @PutMapping("/drawingRemove")
     @Transactional
     public AjaxResult drawingRemove(@RequestBody List<BizTechnologicalProcessDetailDrawing> processDetailDrawing) throws NoSuchFieldException, IllegalAccessException, IOException, DocumentException {
-        BizPersonalSeal person = new BizPersonalSeal();
-        person.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
-        List<BizPersonalSeal> personList = bizPersonalSealService.getList(person);
-        if(personList.isEmpty()){
+        int i = bizTechnologicalProcessDetailDrawingService.drawingRemove(processDetailDrawing,SecurityUtils.getLoginUser().getUser().getUserName(),SecurityUtils.getLoginUser().getUser().getNickName());
+        if (i == 3) {
             return error("请先上传个人章");
+        } else if (i ==4) {
+            return error("未查询到当前员工");
+        } else {
+            return success();
         }
-        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
-        LocalDate currentDate = LocalDate.now();
-        // 定义日期格式
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-        // 格式化日期
-        String formattedDate = currentDate.format(formatter);
-        for(BizTechnologicalProcessDetailDrawing  item: processDetailDrawing){
-            String url = "";
-            url = item.getUrl();
-            url = url.substring("/profile".length());
-            String filePath = RuoYiConfig.getProfile();
-            item.setStatus(1);
-            item.setAbandoned(1);
-            item.setPattern("作废产品");
-            item.setVoided(SecurityUtils.getLoginUser().getUser().getNickName());
-            item.setVoidedId(SecurityUtils.getLoginUser().getUser().getUserId());
-
-            addText(filePath +url.substring(0, url.length()-4) + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),"作废申请人:",310,75,12,270);
-            addText(filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),formattedDate,260,75,12,270);
 
-            addImage(filePath +url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4),filePath+personalSeal,275,40,30,30,270,1);
-            item.setUrl("/profile/"+url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4));
-            bizTechnologicalProcessDetailDrawingService.updateById(item);
-        }
 
-        return success();
     }
     /**
      * 电子图纸替换
@@ -400,46 +340,13 @@ public String getPublicSeal(String code) {
     @PutMapping("/replace")
     @Transactional
     public AjaxResult replaceDrawing(@RequestBody BizTechnologicalProcessDetailDrawing processDetailDrawing) throws NoSuchFieldException, IllegalAccessException, COSVisitorException, DocumentException, IOException {
-        //根据parentId插叙旧图纸
-        BizTechnologicalProcessDetailDrawing id = bizTechnologicalProcessDetailDrawingService.query().eq("id", processDetailDrawing.getParentId()).one();
-//        id.setStatus(1);
-//        id.setAbandoned(1);
-//        id.setPattern("作废产品");
-//        id.setVoided(SecurityUtils.getLoginUser().getUser().getNickName());
-//        id.setVoidedId(SecurityUtils.getLoginUser().getUser().getUserId());
-//        bizTechnologicalProcessDetailDrawingService.updateById(id);
-
-
-
-        BizPersonalSeal person = new BizPersonalSeal();
-        person.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
-        String filePath = RuoYiConfig.getProfile();
-        List<BizPersonalSeal> personList = bizPersonalSealService.getList(person);
-        if(personList.isEmpty()){
+        int i = bizTechnologicalProcessDetailDrawingService.replaceDrawing(processDetailDrawing);
+        if (i == 3 ){
             return error("请先上传个人章");
+        }else {
+            return toAjax(i);
         }
-        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
-        processDetailDrawing.setProducerId(SecurityUtils.getLoginUser().getUser().getUserId());
-        processDetailDrawing.setProducer(SecurityUtils.getLoginUser().getUser().getNickName());
-        String url = "";
-        url = processDetailDrawing.getUrl();
-        url = url.substring("/profile".length());
-
-//        processDetailDrawing.setMarkD(id.getMarkD());
-//        processDetailDrawing.setIdentification(id.getIdentification());
-        processDetailDrawing.setDrawingName(id.getDrawingName());
-        processDetailDrawing.setPattern("替换产品");
-        processDetailDrawing.setProducerId(SecurityUtils.getLoginUser().getUser().getUserId());
-        processDetailDrawing.setProducer(SecurityUtils.getLoginUser().getUser().getNickName());
-        processDetailDrawing.setProductId(id.getProductId());
-        processDetailDrawing.setProcessCode(id.getProcessCode());
-        processDetailDrawing.setProductVersion(id.getProductVersion());
-        PdfUtils.reSized(filePath + url,filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),100,"height");
-        addText(filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),"制定人:",550,75,12,270);
-        addImage(filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4),filePath+personalSeal,530,30,45,15,270,1);
-        processDetailDrawing.setUrl("/profile/"+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4));
 
-        return toAjax(bizTechnologicalProcessDetailDrawingService.save(processDetailDrawing));
 
     }
     /**
@@ -518,26 +425,10 @@ public String getPublicSeal(String code) {
     @Transactional
     public AjaxResult edit(@RequestBody BizTechnologicalProcessDetailDrawing processDetailDrawing) throws NoSuchFieldException, IllegalAccessException
     {
-        BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing = bizTechnologicalProcessDetailDrawingService.query().eq("id", processDetailDrawing.getId()).one();
-        //进行保存操作记录
-        BizTechnologicalProcessDetailDrawingRecords drawingRecords = new BizTechnologicalProcessDetailDrawingRecords();
-        drawingRecords.setTechnologicalProcessDetailDrawingId(bizTechnologicalProcessDetailDrawing.getId());
-        drawingRecords.setProcessCode(bizTechnologicalProcessDetailDrawing.getProcessCode());
-        drawingRecords.setProductId(bizTechnologicalProcessDetailDrawing.getProductId());
-        drawingRecords.setProductVersion(bizTechnologicalProcessDetailDrawing.getProductVersion());
-        drawingRecords.setUserId(SecurityUtils.getUserId());
-        drawingRecords.setType("覆盖");
-        drawingRecords.setDrawingName(bizTechnologicalProcessDetailDrawing.getDrawingName());
-        bizTechnologicalProcessDetailDrawingRecordsService.save(drawingRecords);
-        //覆盖操作
-        BizTechnologicalProcessDetailDrawing item = new BizTechnologicalProcessDetailDrawing();
-        item.setUrl(processDetailDrawing.getUrl());
-        item.setTechnologicalProcessDetailId(bizTechnologicalProcessDetailDrawing.getTechnologicalProcessDetailId());
-        item.setDrawingName(bizTechnologicalProcessDetailDrawing.getDrawingName());
-        bizTechnologicalProcessDetailDrawingService.removeById(bizTechnologicalProcessDetailDrawing.getId());
 
 
-        return toAjax(bizTechnologicalProcessDetailDrawingService.save(item));
+
+        return toAjax(bizTechnologicalProcessDetailDrawingService.edit(processDetailDrawing));
     }
 
 
@@ -623,43 +514,6 @@ public String getPublicSeal(String code) {
 
 
 
-    /**
-     * 放置图片
-     * @param srcPath
-     * @param resultPath
-     * @param imgPath
-     * @param x
-     * @param y
-     * @param width
-     * @param height
-     * @param rotation
-     * @throws DocumentException
-     * @throws IOException
-     */
-    public void addImage(String srcPath,String resultPath,String imgPath,Integer x,Integer y,Integer width,Integer height,Integer rotation,float opacity) throws DocumentException, IOException {
-        ByteArrayOutputStream bos = PdfUtils.addImage(srcPath, imgPath, x, y, width, height,rotation, opacity);
-        FileOutputStream out = new FileOutputStream(resultPath);
-        out.write(bos.toByteArray());
-        out.close();
-    }
 
-    /**
-     * 放置文字
-     * @param srcPath
-     * @param resultPath
-     * @param text
-     * @param x
-     * @param y
-     * @param fontSize
-     * @param rotation
-     * @throws DocumentException
-     * @throws IOException
-     */
-    public void addText(String srcPath,String resultPath,String text,Integer x,Integer y,Integer fontSize,Integer rotation) throws DocumentException, IOException {
-        ByteArrayOutputStream bos = PdfUtils.addText(srcPath, text, fontSize,x, y,rotation);
-        FileOutputStream out = new FileOutputStream(resultPath);
-        out.write(bos.toByteArray());
-        out.close();
-    }
 
 }

+ 52 - 22
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/domain/BizTechnologicalProcessDetailDrawing.java

@@ -22,6 +22,41 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    @Excel(name="id")
+    private Long id;
+
+    @Excel(name = "产品描述")
+    @TableField(exist = false)
+    private String description;
+    @Excel(name = "规格")
+    @TableField(exist = false)
+    private String specification;
+    @Excel(name = "客户")
+    @TableField(exist = false)
+    private String companyAlias;
+    @Excel(name = "工艺版本")
+    @ApiModelProperty(value = "工艺版本编码")
+    private String productVersion;
+    @Excel(name = "工序名称")
+    @TableField(exist = false)
+    private String processAlias;
+    /** 图纸名称 */
+    @Excel(name = "图纸名称")
+    @ApiModelProperty(value = "图纸名称")
+    private String drawingName;
+
+
+
+    /** 制作人id */
+    @ApiModelProperty(value = "${comment}")
+    private Long producerId;
+    @Excel(name = "制作人")
+    @ApiModelProperty(value = "制作人")
+    private String producer;
+    @Excel(name = "制作人编号")
+    @TableField(exist = false)
+    @ApiModelProperty(value = "制作人编号")
+    private String producerCode;
     /** 租户id,厂别或类型1:Ⅰ类2:Ⅱ类 */
     @ApiModelProperty(value = "${comment}")
     private Long tenantId;
@@ -31,8 +66,7 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
 
     @ApiModelProperty(value = "工序编码")
     private String processCode;
-    @ApiModelProperty(value = "工艺版本编码")
-    private String productVersion;
+
     /** 工艺工序id */
     @ApiModelProperty(value = "${comment}")
     private Long technologicalProcessDetailId;
@@ -47,13 +81,18 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
     /** 审核人id */
     @ApiModelProperty(value = "${comment}")
     private Long reviewerId;
-    /** 制作人id */
-    @ApiModelProperty(value = "${comment}")
-    private Long producerId;
+    @Excel(name="审核人")
     @ApiModelProperty(value = "审核人")
     private String reviewer;
-    @ApiModelProperty(value = "制作人")
-    private String producer;
+    @Excel(name="审核人编号")
+    @TableField(exist = false)
+    @ApiModelProperty(value = "审核人")
+    private String reviewerCode;
+    @Excel(name="批准人编号")
+    @TableField(exist = false)
+    @ApiModelProperty(value = "批准人")
+    private String issuerCode;
+    @Excel(name="批准人")
     @ApiModelProperty(value = "批准人")
     private String issuer;
     /** 审核人id */
@@ -64,9 +103,10 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
 
     @ApiModelProperty(value = "图纸状态:0:待审核,1待批准,2:待发行,3:作废")
     private Integer status;
+    @Excel(name = "重标识")
     @ApiModelProperty(value = "标识")
     private Boolean  identification;
-
+    @Excel(name = "D标识")
     @ApiModelProperty(value = "D标识")
     private Boolean  markD;
     @ApiModelProperty(value = "废弃标识")
@@ -80,17 +120,12 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
     @ApiModelProperty(value = "${comment}")
     private Long technologicalProcessId;
     /** 图纸地址 */
-    @Excel(name = "图纸地址")
     @ApiModelProperty(value = "图纸地址")
     private String url;
 
-    /** 图纸名称 */
-    @Excel(name = "图纸名称")
-    @ApiModelProperty(value = "图纸名称")
-    private String drawingName;
+
 
     /** 会签类型 */
-    @Excel(name = "会签类型")
     @ApiModelProperty(value = "会签类型")
     private String pattern;
     //用于查询虚拟字段
@@ -100,19 +135,14 @@ public class BizTechnologicalProcessDetailDrawing extends BaseEntity
 
     @TableField(exist = false)
     private BizProduct product;
-
     @TableField(exist = false)
     private String technologyVersion;
 
     @TableField(exist = false)
-    private String processAlias;
-    @TableField(exist = false)
-    private String companyAlias;
-    @TableField(exist = false)
-    private String description;
+    private String drawingNumber;
     @TableField(exist = false)
-    private String specification;
+    private Integer recordsType;
     @TableField(exist = false)
-    private String drawingNumber;
+    private  Integer recordsAbandoned;
 
 }

+ 2 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/mapper/BizTechnologicalProcessDetailDrawingMapper.java

@@ -3,6 +3,7 @@ package cn.ezhizao.project.business.technologicalProcessDetailDrawing.mapper;
 
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.domain.BizTechnologicalProcessDetailDrawing;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
 
@@ -12,6 +13,7 @@ import java.util.List;
  * @author ezhizao
  * @date 2024-05-30
  */
+@Mapper
 public interface BizTechnologicalProcessDetailDrawingMapper extends BaseMapper<BizTechnologicalProcessDetailDrawing>
 {
     /**

+ 15 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/service/IBizTechnologicalProcessDetailDrawingService.java

@@ -3,7 +3,12 @@ package cn.ezhizao.project.business.technologicalProcessDetailDrawing.service;
 
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.domain.BizTechnologicalProcessDetailDrawing;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.itextpdf.text.DocumentException;
+import org.apache.pdfbox.exceptions.COSVisitorException;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -29,6 +34,7 @@ public interface IBizTechnologicalProcessDetailDrawingService extends IService<B
      */
     public int physicalDelete(BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing);
 
+    public int saveData( List<BizTechnologicalProcessDetailDrawing> bizTechnologicalProcessDetailDrawing,String userName, String nickName) throws COSVisitorException, DocumentException, IOException;
     /**
      * 查询电子图纸列表
      *
@@ -42,4 +48,13 @@ public interface IBizTechnologicalProcessDetailDrawingService extends IService<B
      */
     public Integer getProcuctDrawing();
 
+
+    public int edit(BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing);
+
+    public int replaceDrawing( BizTechnologicalProcessDetailDrawing processDetailDrawing) throws COSVisitorException, DocumentException, IOException;
+    public void addImage(String srcPath,String resultPath,String imgPath,Integer x,Integer y,Integer width,Integer height,Integer rotation,float opacity) throws DocumentException, IOException;
+    public void addText(String srcPath,String resultPath,String text,Integer x,Integer y,Integer fontSize,Integer rotation) throws IOException, DocumentException;
+    public int drawingRemove(List<BizTechnologicalProcessDetailDrawing> processDetailDrawing,String userName,String nickName) throws DocumentException, IOException;
+
+    public int drawingNG(List<BizTechnologicalProcessDetailDrawing> processDetailDrawing,String userName,String nickName);
 }

+ 509 - 2
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawing/service/impl/BizTechnologicalProcessDetailDrawingServiceImpl.java

@@ -1,14 +1,39 @@
 package cn.ezhizao.project.business.technologicalProcessDetailDrawing.service.impl;
 
 
+import cn.ezhizao.common.utils.SecurityUtils;
+import cn.ezhizao.common.utils.pdf.PdfUtils;
+import cn.ezhizao.framework.config.RuoYiConfig;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.project.business.personSeal.domain.BizPersonalSeal;
+import cn.ezhizao.project.business.personSeal.mapper.BizPersonalSealMapper;
+import cn.ezhizao.project.business.publicSeal.domain.BizPublicSeal;
+import cn.ezhizao.project.business.publicSeal.mapper.BizPublicSealMapper;
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.domain.BizTechnologicalProcessDetailDrawing;
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.mapper.BizTechnologicalProcessDetailDrawingMapper;
 import cn.ezhizao.project.business.technologicalProcessDetailDrawing.service.IBizTechnologicalProcessDetailDrawingService;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingRecords.domain.BizTechnologicalProcessDetailDrawingRecords;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingRecords.mapper.BizTechnologicalProcessDetailDrawingRecordsMapper;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.mapper.BizTechnologicalProcessDetailDrawingUserMapper;
+import cn.ezhizao.project.system.domain.SysUser;
+import cn.ezhizao.project.system.mapper.SysUserMapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.itextpdf.text.DocumentException;
+import org.apache.pdfbox.exceptions.COSVisitorException;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.annotation.Resource;
-import java.util.Collections;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,6 +48,22 @@ public class BizTechnologicalProcessDetailDrawingServiceImpl extends ServiceImpl
     @Resource
     private BizTechnologicalProcessDetailDrawingMapper bizTechnologicalProcessDetailDrawingMapper;
 
+    @Resource
+    BizTechnologicalProcessDetailDrawingRecordsMapper bizTechnologicalProcessDetailDrawingRecordsMapper;
+
+    @Resource
+    BizPersonalSealMapper bizPersonalSealMapper;
+
+    @Resource
+    BizPublicSealMapper bizPublicSealService;
+
+    @Resource
+    SysUserMapper sysUserMapper;
+
+    @Resource
+    BizTechnologicalProcessDetailDrawingUserMapper bizTechnologicalProcessDetailDrawingUserMapper;
+
+
     /**
      * 查询电子图纸列表
      *
@@ -53,6 +94,472 @@ public class BizTechnologicalProcessDetailDrawingServiceImpl extends ServiceImpl
         return bizTechnologicalProcessDetailDrawingMapper.getProcuctDrawing();
     }
 
-    ;
 
+
+    @Transactional
+    public int saveData( List<BizTechnologicalProcessDetailDrawing> bizTechnologicalProcessDetailDrawing,String userName, String nickName) throws COSVisitorException, DocumentException, IOException {
+        SysUser userParam = new SysUser();
+        SysUser user = new SysUser();
+        userParam.setUserName(userName);
+        userParam.setNickName(nickName);
+        List<SysUser> userList = sysUserMapper.getListByUserName(userParam);
+        if (userList.isEmpty()){
+            return 4;
+        }else {
+            user = userList.get(0);
+        }
+
+        BizPersonalSeal person = new BizPersonalSeal();
+        person.setUserId(user.getUserId());
+        String filePath = RuoYiConfig.getProfile();
+        List<BizPersonalSeal> personList = bizPersonalSealMapper.getList(person);
+        // 获取当前日期
+        LocalDate currentDate = LocalDate.now();
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+        // 格式化日期
+        String formattedDate = currentDate.format(formatter);
+        if(personList.isEmpty()){
+            return 3;
+        }
+        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
+        for(BizTechnologicalProcessDetailDrawing item: bizTechnologicalProcessDetailDrawing){
+            String url = "";
+            url = item.getUrl();
+            url = url.substring("/profile".length());
+            if (item.getStatus() == null){
+                // 默认情况下执行新增的代码
+                item.setProducerId(user.getUserId());
+                item.setProducer(user.getNickName());
+                item.setStatus(0);
+
+                item.setPattern("新产品");
+                //上传调整尺寸
+
+
+                PdfUtils.reSized(filePath + url,filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),100,"height");
+                addText(filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),"制定人:",550,75,12,270);
+                addText(filePath +url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),formattedDate,500,75,12,270);
+                addImage(filePath+url.substring(0, url.length()-4) + "制作时间" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4),filePath+personalSeal,515,40,30,30,270,1);
+                item.setUrl("/profile/"+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4));
+                bizTechnologicalProcessDetailDrawingMapper.insert(item);
+                //添加用户记录
+                BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+                drawingUser.setDrawingId(item.getId());
+                drawingUser.setProcessCode(item.getProcessCode());
+                drawingUser.setDrawingName(item.getDrawingName());
+                drawingUser.setType(0);
+                drawingUser.setUserId(user.getUserId());
+                drawingUser.setNickName(user.getNickName());
+                drawingUser.setProductId(item.getProductId());
+                drawingUser.setProductVersion(item.getProductVersion());
+                drawingUser.setRecordTime(new Date());
+                bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+                break;
+            }else {
+                switch (item.getStatus()) {
+                    //0:待审核,1待批准
+                    case 0:
+                        item.setReviewerId(user.getUserId());
+                        item.setReviewer(user.getNickName());
+                        item.setStatus(1);
+                        addText(filePath+ url,filePath +url.substring(0, url.length()-4) + "审核" + url.substring(url.length()-4),"审核人:",470,75,12,270);
+                        addText(filePath +url.substring(0, url.length()-4) + "审核" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "审核时间" + url.substring(url.length()-4),formattedDate,420,75,12,270);
+                        addImage(filePath +url.substring(0, url.length()-4) + "审核时间" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "审核完成" + url.substring(url.length()-4),filePath+personalSeal,435,40,30,30,270,1);
+                        item.setUrl("/profile/"+url.substring(0, url.length()-4) + "审核完成" + url.substring(url.length()-4));
+                        bizTechnologicalProcessDetailDrawingMapper.updateById(item);
+                        //添加用户记录
+                        BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+                        drawingUser.setDrawingId(item.getId());
+                        drawingUser.setProcessCode(item.getProcessCode());
+                        drawingUser.setDrawingName(item.getDrawingName());
+                        drawingUser.setType(1);
+                        drawingUser.setUserId(user.getUserId());
+                        drawingUser.setNickName(user.getNickName());
+                        drawingUser.setProductId(item.getProductId());
+                        drawingUser.setProductVersion(item.getProductVersion());
+                        drawingUser.setRecordTime(new Date());
+                        bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+                        break;
+                    case 1:
+                        issuer(item,personalSeal,user);
+                        break;
+                }
+            }
+
+        }
+
+        return 1;
+    }
+
+
+    /**
+     * 批准逻辑
+     * @param item
+     */
+    @Transactional
+    public void issuer (BizTechnologicalProcessDetailDrawing item,String personalSeal,SysUser user) throws DocumentException, IOException {
+        item.setIssuerId(user.getUserId());
+        item.setIssuer(user.getNickName());
+        item.setStatus(2);
+        String url = "";
+        url = item.getUrl();
+        url = url.substring("/profile".length());
+        String filePath = RuoYiConfig.getProfile();
+        //查询公共章
+        String reviewer = getPublicSeal("受控");
+        String D = getPublicSeal("D章");
+        String heavy = getPublicSeal("重章");
+        String isu = getPublicSeal("发行章");
+        String rem = getPublicSeal("废弃章");
+        // 获取当前日期
+        LocalDate currentDate = LocalDate.now();
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+        // 格式化日期
+        String formattedDate = currentDate.format(formatter);
+
+        //替换图纸将旧图纸废弃
+        if (item.getParentId()!=0){
+
+            QueryWrapper<BizTechnologicalProcessDetailDrawing> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("id", item.getParentId());
+            BizTechnologicalProcessDetailDrawing byId = bizTechnologicalProcessDetailDrawingMapper.selectOne(queryWrapper);
+//            BizTechnologicalProcessDetailDrawing byId = bizTechnologicalProcessDetailDrawingService.query().eq("id", item.getParentId()).one();
+            String urlItem = "";
+            urlItem = byId.getUrl();
+            urlItem = urlItem.substring("/profile".length());
+            byId.setStatus(2);
+            byId.setAbandoned(1);
+            byId.setVoided(user.getNickName());
+            byId.setVoidedId(user.getUserId());
+            byId.setPattern("作废产品");
+            addImage(filePath+ urlItem,filePath +urlItem.substring(0, urlItem.length()-4) + "zf" + urlItem.substring(urlItem.length()-4),filePath+rem,290,880,40,15,300,0.8F);
+            addText(filePath +urlItem.substring(0, urlItem.length()-4) + "zf" + urlItem.substring(urlItem.length()-4),filePath +urlItem.substring(0, urlItem.length()-4) + "zfr" + urlItem.substring(urlItem.length()-4),"作废申请人:",310,75,12,270);
+            addText(filePath +urlItem.substring(0, urlItem.length()-4) + "zfr" + urlItem.substring(urlItem.length()-4),filePath+urlItem.substring(0, urlItem.length()-4) + "zfdate" + urlItem.substring(urlItem.length()-4),formattedDate,500,75,12,270);
+
+            addImage(filePath +urlItem.substring(0, urlItem.length()-4) + "zfdate" + urlItem.substring(urlItem.length()-4),filePath +urlItem.substring(0, urlItem.length()-4) + "zfover" + urlItem.substring(urlItem.length()-4),filePath+personalSeal,275,40,30,30,270,1);
+            byId.setUrl("/profile/" +urlItem.substring(0, urlItem.length()-4) + "zfover" + urlItem.substring(urlItem.length()-4));
+            bizTechnologicalProcessDetailDrawingMapper.updateById(byId);
+            BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+            drawingUser.setDrawingId(byId.getId());
+            drawingUser.setProcessCode(byId.getProcessCode());
+            drawingUser.setDrawingName(byId.getDrawingName());
+            drawingUser.setType(4);
+            drawingUser.setUserId(user.getUserId());
+            drawingUser.setNickName(user.getNickName());
+            drawingUser.setProductId(byId.getProductId());
+            drawingUser.setProductVersion(byId.getProductVersion());
+            drawingUser.setRecordTime(new Date());
+            drawingUser.setAbandoned(1);
+            bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+        }
+        //判断盖章逻辑
+        if (item.getAbandoned() ==1){
+            //加盖废弃章,不需要盖其他章
+            addImage(filePath+ url,filePath +url.substring(0, url.length()-4) + "zf" + url.substring(url.length()-4),filePath+rem,290,880,40,15,300,0.8F);
+            addText(filePath +url.substring(0, url.length()-4) + "zf" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),"作废批准人:",230,75,12,270);
+            addText(filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),formattedDate,180,75,12,270);
+
+            addImage(filePath +url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4),filePath+personalSeal,195,40,30,30,270,1);
+            item.setUrl("/profile/"+url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4));
+            bizTechnologicalProcessDetailDrawingMapper.updateById(item);
+            BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+            drawingUser.setDrawingId(item.getId());
+            drawingUser.setProcessCode(item.getProcessCode());
+            drawingUser.setDrawingName(item.getDrawingName());
+            drawingUser.setType(4);
+            drawingUser.setUserId(user.getUserId());
+            drawingUser.setNickName(user.getNickName());
+            drawingUser.setProductId(item.getProductId());
+            drawingUser.setProductVersion(item.getProductVersion());
+            drawingUser.setRecordTime(new Date());
+            drawingUser.setAbandoned(1);
+            bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+            return;
+        }
+        //盖批准和审核章还有批准日期
+        addText(filePath+ url,filePath +url.substring(0, url.length()-4) + "pz" + url.substring(url.length()-4),"批准人:",390,75,12,270);
+        //批准章
+        addImage(filePath +url.substring(0, url.length()-4) + "pz" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzz" + url.substring(url.length()-4),filePath+isu,400,860,60,55,300,0.8F);
+        //批准章上的日期
+        addText(filePath +url.substring(0, url.length()-4) + "pzz" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzdate" + url.substring(url.length()-4),formattedDate,427,913,8,300);
+        //个人章
+        addImage(filePath +url.substring(0, url.length()-4) + "pzdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzr" + url.substring(url.length()-4),filePath+personalSeal,355,40,30,30,270,1);
+        //批准日期
+        addText(filePath +url.substring(0, url.length()-4) + "pzr" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzrdate" + url.substring(url.length()-4),formattedDate,340,75,12,270);
+
+        //受控章
+        addImage(filePath +url.substring(0, url.length()-4) + "pzrdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath+reviewer,465,870,45,28,300,0.8F);
+        item.setUrl("/profile/" +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4));
+        if (item.getIdentification()){
+            //盖重章
+            addImage(filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4),filePath+heavy,320,870,40,40,300,0.8F);
+            item.setUrl("/profile" +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4));
+        }
+        if (item.getMarkD() ){
+            //因为地址不同判断重章有没有盖到
+            //盖D章
+            if (!item.getIdentification()){
+                addImage(filePath +url.substring(0, url.length()-4) + "pzover" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4),filePath+D,365,870,40,40,300,0.8F);
+            }else {
+                addImage(filePath +url.substring(0, url.length()-4) + "z" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4),filePath+D,365,870,40,40,300,0.8F);
+            }
+            item.setUrl("/profile/" +url.substring(0, url.length()-4) + "dover" + url.substring(url.length()-4));
+
+        }
+        bizTechnologicalProcessDetailDrawingMapper.updateById(item);
+        BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+        drawingUser.setDrawingId(item.getId());
+        drawingUser.setProcessCode(item.getProcessCode());
+        drawingUser.setDrawingName(item.getDrawingName());
+        drawingUser.setType(2);
+        drawingUser.setUserId(user.getUserId());
+        drawingUser.setNickName(user.getNickName());
+        drawingUser.setProductId(item.getProductId());
+        drawingUser.setProductVersion(item.getProductVersion());
+        drawingUser.setRecordTime(new Date());
+        bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+    }
+
+
+
+    /**
+     * 公共章查村
+     */
+    public String getPublicSeal(String code) {
+
+
+        QueryWrapper<BizPublicSeal> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("code", code);
+
+        // 使用 MyBatis-Plus 的 getOne 方法执行查询
+        BizPublicSeal seal = bizPublicSealService.selectOne(queryWrapper);
+
+        // 检查 seal 是否为 null
+        if (seal != null && seal.getUrl() != null) {
+            // 从查询结果中获取 URL 并进行字符串操作
+            return seal.getUrl().substring("/profile".length());
+        } else {
+            // 如果没有找到记录或 URL 为空,则返回 null 或抛出异常
+            return null;
+    }
+    }
+
+
+
+
+
+    @Transactional
+    public int drawingNG(List<BizTechnologicalProcessDetailDrawing> processDetailDrawing,String userName,String nickName) {
+        SysUser userParam = new SysUser();
+        SysUser user = new SysUser();
+        userParam.setUserName(userName);
+        userParam.setNickName(nickName);
+        List<SysUser> userList = sysUserMapper.getListByUserName(userParam);
+        if (userList.isEmpty()){
+            return 4;
+        }else {
+            user = userList.get(0);
+        }
+
+        for(BizTechnologicalProcessDetailDrawing  item: processDetailDrawing){
+            item.setStatus(3);
+            item.setNgUser(user.getNickName());
+            item.setUserNgId(user.getUserId());
+
+            bizTechnologicalProcessDetailDrawingMapper.updateById(item);
+            BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+            drawingUser.setDrawingId(item.getId());
+            drawingUser.setProcessCode(item.getProcessCode());
+            drawingUser.setDrawingName(item.getDrawingName());
+            drawingUser.setType(3);
+            drawingUser.setUserId(user.getUserId());
+            drawingUser.setNickName(user.getNickName());
+            drawingUser.setProductId(item.getProductId());
+            drawingUser.setProductVersion(item.getProductVersion());
+            drawingUser.setRecordTime(new Date());
+            bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+        }
+
+        return 1;
+    }
+
+
+    @Transactional
+    public int drawingRemove(List<BizTechnologicalProcessDetailDrawing> processDetailDrawing,String userName,String nickName) throws DocumentException, IOException {
+
+        SysUser userParam = new SysUser();
+        SysUser user = new SysUser();
+        userParam.setUserName(userName);
+        userParam.setNickName(nickName);
+        List<SysUser> userList = sysUserMapper.getListByUserName(userParam);
+        if (userList.isEmpty()){
+            return 4;
+        }else {
+            user = userList.get(0);
+        }
+
+        BizPersonalSeal person = new BizPersonalSeal();
+        person.setUserId(user.getUserId());
+        List<BizPersonalSeal> personList = bizPersonalSealMapper.getList(person);
+        if(personList.isEmpty()){
+            return 3;
+        }
+        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
+        LocalDate currentDate = LocalDate.now();
+        // 定义日期格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+        // 格式化日期
+        String formattedDate = currentDate.format(formatter);
+        for(BizTechnologicalProcessDetailDrawing  item: processDetailDrawing){
+            String url = "";
+            url = item.getUrl();
+            url = url.substring("/profile".length());
+            String filePath = RuoYiConfig.getProfile();
+            item.setStatus(1);
+            item.setAbandoned(1);
+            item.setPattern("作废产品");
+            item.setVoided(user.getNickName());
+            item.setVoidedId(user.getUserId());
+
+            addText(filePath +url.substring(0, url.length()-4) + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),"作废申请人:",310,75,12,270);
+            addText(filePath +url.substring(0, url.length()-4) + "zfr" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),formattedDate,260,75,12,270);
+
+            addImage(filePath +url.substring(0, url.length()-4) + "zfdate" + url.substring(url.length()-4),filePath +url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4),filePath+personalSeal,275,40,30,30,270,1);
+            item.setUrl("/profile/"+url.substring(0, url.length()-4) + "zfover" + url.substring(url.length()-4));
+            bizTechnologicalProcessDetailDrawingMapper.updateById(item);
+            BizTechnologicalProcessDetailDrawingUser drawingUser = new BizTechnologicalProcessDetailDrawingUser();
+            drawingUser.setDrawingId(item.getId());
+            drawingUser.setProcessCode(item.getProcessCode());
+            drawingUser.setDrawingName(item.getDrawingName());
+            drawingUser.setType(1);
+            drawingUser.setAbandoned(1);
+            drawingUser.setUserId(user.getUserId());
+            drawingUser.setNickName(user.getNickName());
+            drawingUser.setProductId(item.getProductId());
+            drawingUser.setProductVersion(item.getProductVersion());
+            drawingUser.setRecordTime(new Date());
+            bizTechnologicalProcessDetailDrawingUserMapper.insert(drawingUser);
+        }
+
+        return 1;
+    }
+
+
+
+    @Transactional
+    public int replaceDrawing( BizTechnologicalProcessDetailDrawing processDetailDrawing) throws COSVisitorException, DocumentException, IOException {
+        //根据parentId插叙旧图纸
+        QueryWrapper<BizTechnologicalProcessDetailDrawing> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id", processDetailDrawing.getParentId());
+        BizTechnologicalProcessDetailDrawing id = bizTechnologicalProcessDetailDrawingMapper.selectOne(queryWrapper);
+//        id.setStatus(1);
+//        id.setAbandoned(1);
+//        id.setPattern("作废产品");
+//        id.setVoided(user.getNickName());
+//        id.setVoidedId(user.getUserId());
+//        bizTechnologicalProcessDetailDrawingService.updateById(id);
+
+
+
+        BizPersonalSeal person = new BizPersonalSeal();
+        person.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
+        String filePath = RuoYiConfig.getProfile();
+        List<BizPersonalSeal> personList = bizPersonalSealMapper.getList(person);
+        if(personList.isEmpty()){
+            return 3;
+        }
+        String personalSeal = personList.get(0).getUrl().substring("/profile".length());
+        processDetailDrawing.setProducerId(SecurityUtils.getLoginUser().getUser().getUserId());
+        processDetailDrawing.setProducer(SecurityUtils.getLoginUser().getUser().getNickName());
+        String url = "";
+        url = processDetailDrawing.getUrl();
+        url = url.substring("/profile".length());
+
+//        processDetailDrawing.setMarkD(id.getMarkD());
+//        processDetailDrawing.setIdentification(id.getIdentification());
+        processDetailDrawing.setDrawingName(id.getDrawingName());
+        processDetailDrawing.setPattern("替换产品");
+        processDetailDrawing.setProducerId(SecurityUtils.getLoginUser().getUser().getUserId());
+        processDetailDrawing.setProducer(SecurityUtils.getLoginUser().getUser().getNickName());
+        processDetailDrawing.setProductId(id.getProductId());
+        processDetailDrawing.setProcessCode(id.getProcessCode());
+        processDetailDrawing.setProductVersion(id.getProductVersion());
+        PdfUtils.reSized(filePath + url,filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),100,"height");
+        addText(filePath +url.substring(0, url.length()-4) + "制作" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),"制定人:",550,75,12,270);
+        addImage(filePath+url.substring(0, url.length()-4) + "制作人" + url.substring(url.length()-4),filePath+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4),filePath+personalSeal,530,30,45,15,270,1);
+        processDetailDrawing.setUrl("/profile/"+url.substring(0, url.length()-4) + "制作完成" + url.substring(url.length()-4));
+
+        return bizTechnologicalProcessDetailDrawingMapper.insert(processDetailDrawing);
+
+    }
+
+    @Transactional
+    public int edit(@RequestBody BizTechnologicalProcessDetailDrawing processDetailDrawing) {
+        QueryWrapper<BizTechnologicalProcessDetailDrawing> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id", processDetailDrawing.getId());
+        BizTechnologicalProcessDetailDrawing bizTechnologicalProcessDetailDrawing = bizTechnologicalProcessDetailDrawingMapper.selectOne(queryWrapper);
+        //进行保存操作记录
+        BizTechnologicalProcessDetailDrawingRecords drawingRecords = new BizTechnologicalProcessDetailDrawingRecords();
+        drawingRecords.setTechnologicalProcessDetailDrawingId(bizTechnologicalProcessDetailDrawing.getId());
+        drawingRecords.setProcessCode(bizTechnologicalProcessDetailDrawing.getProcessCode());
+        drawingRecords.setProductId(bizTechnologicalProcessDetailDrawing.getProductId());
+        drawingRecords.setProductVersion(bizTechnologicalProcessDetailDrawing.getProductVersion());
+        drawingRecords.setUserId(SecurityUtils.getUserId());
+        drawingRecords.setType("覆盖");
+        drawingRecords.setDrawingName(bizTechnologicalProcessDetailDrawing.getDrawingName());
+        bizTechnologicalProcessDetailDrawingRecordsMapper.insert(drawingRecords);
+        //覆盖操作
+        BizTechnologicalProcessDetailDrawing item = new BizTechnologicalProcessDetailDrawing();
+        item.setUrl(processDetailDrawing.getUrl());
+        item.setTechnologicalProcessDetailId(bizTechnologicalProcessDetailDrawing.getTechnologicalProcessDetailId());
+        item.setDrawingName(bizTechnologicalProcessDetailDrawing.getDrawingName());
+        item.setProcessCode(bizTechnologicalProcessDetailDrawing.getProcessCode());
+        item.setProductId(bizTechnologicalProcessDetailDrawing.getProductId());
+        item.setProductVersion(bizTechnologicalProcessDetailDrawing.getProductVersion());
+        bizTechnologicalProcessDetailDrawingMapper.deleteById(bizTechnologicalProcessDetailDrawing.getId());
+
+
+        return bizTechnologicalProcessDetailDrawingMapper.insert(item);
+    }
+
+
+
+    /**
+     * 放置图片
+     * @param srcPath
+     * @param resultPath
+     * @param imgPath
+     * @param x
+     * @param y
+     * @param width
+     * @param height
+     * @param rotation
+     * @throws DocumentException
+     * @throws IOException
+     */
+    public void addImage(String srcPath,String resultPath,String imgPath,Integer x,Integer y,Integer width,Integer height,Integer rotation,float opacity) throws DocumentException, IOException {
+        ByteArrayOutputStream bos = PdfUtils.addImage(srcPath, imgPath, x, y, width, height,rotation, opacity);
+        FileOutputStream out = new FileOutputStream(resultPath);
+        out.write(bos.toByteArray());
+        out.close();
+    }
+
+    /**
+     * 放置文字
+     * @param srcPath
+     * @param resultPath
+     * @param text
+     * @param x
+     * @param y
+     * @param fontSize
+     * @param rotation
+     */
+    public void addText(String srcPath,String resultPath,String text,Integer x,Integer y,Integer fontSize,Integer rotation) throws IOException, DocumentException {
+        ByteArrayOutputStream bos = PdfUtils.addText(srcPath, text, fontSize,x, y,rotation);
+        FileOutputStream out = new FileOutputStream(resultPath);
+        out.write(bos.toByteArray());
+        out.close();
+    }
 }

+ 109 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/controller/BizTechnologicalProcessDetailDrawingUserController.java

@@ -0,0 +1,109 @@
+package cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.service.IBizTechnologicalProcessDetailDrawingUserService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 电子图纸操作人员Controller
+ *
+ * @author ezhizao
+ * @date 2024-07-31
+ */
+@RestController
+@RequestMapping("/business/user")
+public class BizTechnologicalProcessDetailDrawingUserController extends BaseController
+{
+    @Resource
+    private IBizTechnologicalProcessDetailDrawingUserService bizTechnologicalProcessDetailDrawingUserService;
+
+    /**
+     * 查询电子图纸操作人员列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTechnologicalProcessDetailDrawingUser);
+        startPage();
+        List<BizTechnologicalProcessDetailDrawingUser> list = bizTechnologicalProcessDetailDrawingUserService.getList(bizTechnologicalProcessDetailDrawingUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出电子图纸操作人员列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:export')")
+    @Log(title = "电子图纸操作人员", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTechnologicalProcessDetailDrawingUser);
+        List<BizTechnologicalProcessDetailDrawingUser> list = bizTechnologicalProcessDetailDrawingUserService.getList(bizTechnologicalProcessDetailDrawingUser);
+        ExcelUtil<BizTechnologicalProcessDetailDrawingUser> util = new ExcelUtil<BizTechnologicalProcessDetailDrawingUser>(BizTechnologicalProcessDetailDrawingUser.class);
+        util.exportExcel(response, list, "电子图纸操作人员数据");
+    }
+
+    /**
+     * 获取电子图纸操作人员详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizTechnologicalProcessDetailDrawingUserService.getById(id));
+    }
+
+    /**
+     * 新增电子图纸操作人员
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:add')")
+    @Log(title = "电子图纸操作人员", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTechnologicalProcessDetailDrawingUser);
+        return toAjax(bizTechnologicalProcessDetailDrawingUserService.save(bizTechnologicalProcessDetailDrawingUser));
+    }
+
+    /**
+     * 修改电子图纸操作人员
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:edit')")
+    @Log(title = "电子图纸操作人员", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTechnologicalProcessDetailDrawingUser);
+        return toAjax(bizTechnologicalProcessDetailDrawingUserService.updateById(bizTechnologicalProcessDetailDrawingUser));
+    }
+
+    /**
+     * 删除电子图纸操作人员
+     */
+    @PreAuthorize("@ss.hasPermi('business:user:remove')")
+    @Log(title = "电子图纸操作人员", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizTechnologicalProcessDetailDrawingUserService.removeBatchByIds(ids));
+    }
+}

+ 74 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/domain/BizTechnologicalProcessDetailDrawingUser.java

@@ -0,0 +1,74 @@
+package cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain;
+
+import java.util.Date;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 电子图纸操作人员对象 biz_technological_process_detail_drawing_user
+ *
+ * @author ezhizao
+ * @date 2024-07-31
+ */
+@Data
+@TableName(value = "biz_technological_process_detail_drawing_user")
+public class BizTechnologicalProcessDetailDrawingUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户id,厂别或类型1:Ⅰ类2:Ⅱ类 */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 人员id */
+    @ApiModelProperty(value = "${comment}")
+    private Long userId;
+
+    /** 操作类型 */
+    @Excel(name = "操作类型")
+    @ApiModelProperty(value = "操作类型")
+    private Integer type;
+    @ApiModelProperty(value = "废弃标识")
+    private Integer  abandoned;
+
+    /** 图纸名称 */
+    @Excel(name = "图纸名称")
+    @ApiModelProperty(value = "图纸名称")
+    private String drawingName;
+
+    /** 图纸id */
+    @ApiModelProperty(value = "图纸名称")
+    private Long drawingId;
+
+    /** 操作时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "操作时间")
+    private Date recordTime;
+
+    /** 产品版本 */
+    @Excel(name = "产品版本")
+    @ApiModelProperty(value = "产品版本")
+    private String productVersion;
+
+    /** 工序编码 */
+    @Excel(name = "工序编码")
+    @ApiModelProperty(value = "工序编码")
+    private String processCode;
+
+    /** 图纸名称 */
+    @Excel(name = "图纸名称")
+    @ApiModelProperty(value = "图纸名称")
+    private String nickName;
+
+    /** 产品id */
+    @ApiModelProperty(value = "图纸名称")
+    private Long productId;
+
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/mapper/BizTechnologicalProcessDetailDrawingUserMapper.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * 电子图纸操作人员Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-07-31
+ */
+public interface BizTechnologicalProcessDetailDrawingUserMapper extends BaseMapper<BizTechnologicalProcessDetailDrawingUser>
+{
+    /**
+     * 查询电子图纸操作人员列表
+     *
+     * @param bizTechnologicalProcessDetailDrawingUser 电子图纸操作人员
+     * @return 电子图纸操作人员集合
+     */
+    public List<BizTechnologicalProcessDetailDrawingUser> getList(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalProcessDetailDrawingUser
+     * @return 删除结果
+    */
+    public int physicalDelete(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser);
+}

+ 32 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/service/IBizTechnologicalProcessDetailDrawingUserService.java

@@ -0,0 +1,32 @@
+package cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+
+/**
+ * 电子图纸操作人员Service接口
+ *
+ * @author ezhizao
+ * @date 2024-07-31
+ */
+public interface IBizTechnologicalProcessDetailDrawingUserService extends IService<BizTechnologicalProcessDetailDrawingUser>
+{
+    /**
+     * 查询电子图纸操作人员列表
+     *
+     * @param bizTechnologicalProcessDetailDrawingUser 电子图纸操作人员
+     * @return 电子图纸操作人员集合
+     */
+    public List<BizTechnologicalProcessDetailDrawingUser> getList(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalProcessDetailDrawingUser
+     * @return 删除结果
+     */
+    public int physicalDelete(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser);
+
+}

+ 44 - 0
src/main/java/cn/ezhizao/project/business/technologicalProcessDetailDrawingUser/service/impl/BizTechnologicalProcessDetailDrawingUserServiceImpl.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.mapper.BizTechnologicalProcessDetailDrawingUserMapper;
+import cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.service.IBizTechnologicalProcessDetailDrawingUserService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 电子图纸操作人员Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-07-31
+ */
+@Service
+public class BizTechnologicalProcessDetailDrawingUserServiceImpl  extends ServiceImpl<BizTechnologicalProcessDetailDrawingUserMapper, BizTechnologicalProcessDetailDrawingUser> implements IBizTechnologicalProcessDetailDrawingUserService
+{
+    @Resource
+    private BizTechnologicalProcessDetailDrawingUserMapper bizTechnologicalProcessDetailDrawingUserMapper;
+
+    /**
+     * 查询电子图纸操作人员列表
+     *
+     * @param bizTechnologicalProcessDetailDrawingUser 电子图纸操作人员
+     * @return 电子图纸操作人员
+     */
+    @Override
+    public List<BizTechnologicalProcessDetailDrawingUser> getList(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser)
+    {
+        return bizTechnologicalProcessDetailDrawingUserMapper.getList(bizTechnologicalProcessDetailDrawingUser);
+    }
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalProcessDetailDrawingUser
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizTechnologicalProcessDetailDrawingUser bizTechnologicalProcessDetailDrawingUser){ return bizTechnologicalProcessDetailDrawingUserMapper.physicalDelete(bizTechnologicalProcessDetailDrawingUser); };
+
+}

+ 2 - 0
src/main/java/cn/ezhizao/project/system/mapper/SysUserMapper.java

@@ -28,6 +28,8 @@ public interface SysUserMapper {
     public List<SysUser> selectTenantList(SysUser sysUser);
     List<SysUser> getUserList(SysUser user);
 
+
+    List<SysUser> getListByUserName(SysUser user);
     /**
      * 根据条件分页查询用户列表
      *

+ 2 - 0
src/main/java/cn/ezhizao/project/system/service/ISysUserService.java

@@ -34,6 +34,8 @@ public interface ISysUserService
     List<SysUser> selectEmployeeList(SysUser user);
     List<SysUser> getUserList(SysUser user);
 
+
+    List<SysUser> getListByUserName(SysUser user);
     /**
      * 根据ids查询用户列表
      *

+ 6 - 0
src/main/java/cn/ezhizao/project/system/service/impl/SysUserServiceImpl.java

@@ -23,6 +23,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Validator;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -86,6 +87,11 @@ public class SysUserServiceImpl implements ISysUserService {
         return userMapper.getUserList(user);
     }
 
+    @Override
+    public List<SysUser> getListByUserName(SysUser user) {
+        return userMapper.getListByUserName(user);
+    }
+
     /**
      * 根据条件分页查询员工列表
      *

+ 3 - 3
src/main/resources/application-dev.yml

@@ -80,11 +80,11 @@ spring:
 # 文件上传
 file:
     upload:
-        path: D:/Ezhizao/dms/upload/  # 实体路径
+        path: D://Ezhizao//dms//upload/  # 实体路径
         url: /upload/** # 映射url
         type: xlsx,xls,txt,jpeg,jpg,doc,ppt,pptx,png,pdf,rar,zip,wps,gif,docx #支持的文件类型
     excelTemplate:
-        url: /home/files/dms/templates/
+        url: D://Ezhizao//dms//templates/
 # 文件上传
 ruoyi:
-    profile: D:/Ezhizao/identity/
+    profile: D:/Ezhizao/dms/

+ 21 - 0
src/main/resources/mybatis/business/processCompletion/CompleteStatisticsMapper.xml

@@ -0,0 +1,21 @@
+<?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="cn.ezhizao.project.business.processCompletion.mapper.CompleteStatisticsMapper">
+
+    <resultMap type="cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics" id="CompleteStatisticsResult">
+    </resultMap>
+
+
+    <select id="getList" parameterType="cn.ezhizao.project.business.processCompletion.domain.CompleteStatistics" resultMap="CompleteStatisticsResult">
+        SELECT year, month, (select count(1) from biz_process_completion t where t.deleted = 0 and t.year = biz_process_completion.year and t.month = biz_process_completion.month and (t.is_overdue = 1 or t.is_overdue = 2)) as finished_num, (select count(1) from biz_process_completion t where t.deleted = 0 and t.year = biz_process_completion.year and t.month = biz_process_completion.month and t.is_overdue = 1) as finished_in_time_num FROM biz_process_completion
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="year != null  and year != ''"> AND year = #{year}</if>
+        </trim>
+        group by year,month
+        order by year,month
+    </select>
+
+</mapper>

+ 10 - 1
src/main/resources/mybatis/business/technologicalProcessDetailDrawing/BizTechnologicalProcessDetailDrawingMapper.xml

@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result column="process_code" property="processCode"/>
         <association property="product" column="product_id"  javaType="cn.ezhizao.project.business.product.domain.BizProduct" select="getProduct"/>
         <association property="processAlias" column="process_code" javaType="java.lang.String" select="getProcessAlias"/>
+        <association property="recordsType" column="id" javaType="java.lang.Integer" select="getRecordsType"/>
+        <association property="recordsAbandoned" column="id" javaType="java.lang.Integer" select="getRecordsAbandoned"/>
     </resultMap>
     <resultMap id="BizProductResult" type="cn.ezhizao.project.business.product.domain.BizProduct">
         <id column="id" property="id"/>
@@ -23,6 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
     </select>
 
+    <select id="getRecordsType" resultType="java.lang.Integer">
+        select type from biz_technological_process_detail_drawing_user where deleted = 0 and drawing_id = #{id} order by create_time desc limit 1
+    </select>
+
+    <select id="getRecordsAbandoned" resultType="java.lang.Integer">
+        select abandoned from biz_technological_process_detail_drawing_user where deleted = 0 and drawing_id = #{id} order by create_time desc limit 1
+    </select>
     <select id="getProduct" resultMap="BizProductResult">
         select * from biz_product where deleted = 0 and id = #{product_id}
     </select>
@@ -45,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT * FROM biz_technological_process_detail_drawing
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             deleted = 0
-            <if test="abandoned != null  and abandoned != ''"> AND abandoned = #{abandoned}</if>
+            <if test="abandoned != null  "> AND abandoned = #{abandoned}</if>
             <if test="url != null  and url != ''"> AND url = #{url}</if>
             <if test="status != null ">AND status = #{status}</if>
             <if test="productId != null">and product_id = #{productId} </if>

+ 34 - 0
src/main/resources/mybatis/business/technologicalProcessDetailDrawingUser/BizTechnologicalProcessDetailDrawingUserMapper.xml

@@ -0,0 +1,34 @@
+<?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="cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.mapper.BizTechnologicalProcessDetailDrawingUserMapper">
+
+    <resultMap type="cn.ezhizao.project.business.technologicalProcessDetailDrawingUser.domain.BizTechnologicalProcessDetailDrawingUser" id="BizTechnologicalProcessDetailDrawingUserResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizTechnologicalProcessDetailDrawingUser" resultMap="BizTechnologicalProcessDetailDrawingUserResult">
+        SELECT * FROM biz_technological_process_detail_drawing_user
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="type != null  and type != ''"> AND type = #{type}</if>
+            <if test="drawingName != null  and drawingName != ''"> AND drawing_name like concat('%', #{drawingName}, '%')</if>
+            <if test="recordTime != null "> AND record_time = #{recordTime}</if>
+            <if test="productVersion != null  and productVersion != ''"> AND product_version = #{productVersion}</if>
+            <if test="processCode != null  and processCode != ''"> AND process_code = #{processCode}</if>
+            <if test="nickName != null  and nickName != ''"> AND nick_name like concat('%', #{nickName}, '%')</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_technological_process_detail_drawing_user
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 13 - 0
src/main/resources/mybatis/system/SysUserMapper.xml

@@ -205,6 +205,19 @@
 			and del_flag = 0 and user_id != 1 and user_id !=2
 		</where>
 	</select>
+
+	<select id="getListByUserName" resultType="cn.ezhizao.project.system.domain.SysUser">
+		select distinct * from sys_user
+		<where>
+			<if test="userName != null and userName != ''">
+				AND user_name =  #{userName}
+			</if>
+			<if test="nickName != null and nickName != ''">
+				AND nick_name = #{nickName}
+			</if>
+			and del_flag = 0
+		</where>
+	</select>
 	<!-- 员工列表 selectEmployeeList -->
 	<select id="selectEmployeeList" parameterType="SysUser" resultMap="SysUserResult">
 		SELECT