Quellcode durchsuchen

物品申购台账

dzx vor 1 Jahr
Ursprung
Commit
54ef18a5d0
21 geänderte Dateien mit 1153 neuen und 0 gelöschten Zeilen
  1. 89 0
      src/main/java/com/xjrsoft/module/ledger/controller/WfSubscriptionController.java
  2. 54 0
      src/main/java/com/xjrsoft/module/ledger/dto/AddWfSubscriptionDto.java
  3. 72 0
      src/main/java/com/xjrsoft/module/ledger/dto/AddWfSubscriptionListDto.java
  4. 24 0
      src/main/java/com/xjrsoft/module/ledger/dto/UpdateWfSubscriptionDto.java
  5. 25 0
      src/main/java/com/xjrsoft/module/ledger/dto/WfSubscriptionListDto.java
  6. 43 0
      src/main/java/com/xjrsoft/module/ledger/dto/WfSubscriptionPageDto.java
  7. 69 0
      src/main/java/com/xjrsoft/module/ledger/entity/WfSubscription.java
  8. 83 0
      src/main/java/com/xjrsoft/module/ledger/entity/WfSubscriptionList.java
  9. 16 0
      src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionListMapper.java
  10. 42 0
      src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionMapper.java
  11. 63 0
      src/main/java/com/xjrsoft/module/ledger/service/IWfSubscriptionService.java
  12. 140 0
      src/main/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImpl.java
  13. 58 0
      src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionExcelVo.java
  14. 59 0
      src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionListInfoVo.java
  15. 69 0
      src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionListVo.java
  16. 65 0
      src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionPageVo.java
  17. 56 0
      src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionVo.java
  18. 33 0
      src/main/java/com/xjrsoft/module/ledger/vo/WorkflowRecordVo.java
  19. 7 0
      src/main/java/com/xjrsoft/module/workflow/controller/WorkflowExecuteController.java
  20. 47 0
      src/main/resources/mapper/ledger/WfSubscriptionMapper.xml
  21. 39 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 89 - 0
src/main/java/com/xjrsoft/module/ledger/controller/WfSubscriptionController.java

@@ -0,0 +1,89 @@
+package com.xjrsoft.module.ledger.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.ledger.dto.AddWfSubscriptionDto;
+import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
+import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.io.ByteArrayOutputStream;
+import java.util.List;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/ledger" + "/wfSubscription")
+@Api(value = "/ledger"  + "/wfSubscription",tags = "物品申购代码")
+@AllArgsConstructor
+public class WfSubscriptionController {
+
+
+    private final IWfSubscriptionService wfSubscriptionService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="物品申购台账列表(分页)")
+    @SaCheckPermission("wfsubscription:detail")
+    public RT<PageOutput<WfSubscriptionPageVo>> page(@Valid WfSubscriptionPageDto dto){
+        IPage<WfSubscriptionPageVo> page = wfSubscriptionService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<WfSubscriptionPageVo> pageOutput = ConventPage.getPageOutput(page, WfSubscriptionPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/subscription-list")
+    @ApiOperation(value="查看物品清单")
+    @SaCheckPermission("wfsubscription:detail")
+    public RT<WfSubscriptionListInfoVo> subscriptionPage(@RequestParam Long id){
+        WfSubscriptionListInfoVo wfSubscription = wfSubscriptionService.getSubscriptionList(id);
+        if (wfSubscription == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(wfSubscription);
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增物品申购")
+    @SaCheckPermission("wfsubscription:add")
+    public RT<Boolean> add(@Valid @RequestBody AddWfSubscriptionDto dto){
+        WfSubscription wfSubscription = BeanUtil.toBean(dto, WfSubscription.class);
+        boolean isSuccess = wfSubscriptionService.add(wfSubscription);
+    return RT.ok(isSuccess);
+    }
+
+
+    @GetMapping("/export")
+    @ApiOperation(value = "导出")
+    public ResponseEntity<byte[]> exportData(@Valid WfSubscriptionPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
+        List<WfSubscriptionExcelVo> customerList = wfSubscriptionService.getList(dto);
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, WfSubscriptionExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+
+        return RT.fileStream(bot.toByteArray(), "WfSubscription" + ExcelTypeEnum.XLSX.getValue());
+    }
+}

+ 54 - 0
src/main/java/com/xjrsoft/module/ledger/dto/AddWfSubscriptionDto.java

@@ -0,0 +1,54 @@
+package com.xjrsoft.module.ledger.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class AddWfSubscriptionDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 申请部门
+    */
+    @ApiModelProperty("申请部门")
+    private String applicationDepartment;
+    /**
+    * 申请日期
+    */
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private String userId;
+    /**
+    * 预估总额(元)
+    */
+    @ApiModelProperty("预估总额(元)")
+    private Double totalAmount;
+    /**
+    * 附件
+    */
+    @ApiModelProperty("附件")
+    private String annex;
+
+    /**
+    * wfSubscriptionList
+    */
+    @ApiModelProperty("wfSubscriptionList子表")
+    private List<AddWfSubscriptionListDto> wfSubscriptionListList;
+}

+ 72 - 0
src/main/java/com/xjrsoft/module/ledger/dto/AddWfSubscriptionListDto.java

@@ -0,0 +1,72 @@
+package com.xjrsoft.module.ledger.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+
+/**
+* @title: 物品申购子表
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class AddWfSubscriptionListDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 申购物品名称
+    */
+    @ApiModelProperty("申购物品名称")
+    private String nameOfThePurchasedItem;
+    /**
+    * 品牌
+    */
+    @ApiModelProperty("品牌")
+    private String brand;
+    /**
+    * 规格型号
+    */
+    @ApiModelProperty("规格型号")
+    private String specificationAndModel;
+    /**
+    * 估计单价
+    */
+    @ApiModelProperty("估计单价")
+    private Double estimatedUnitPrice;
+    /**
+    * 申购物品数量
+    */
+    @ApiModelProperty("申购物品数量")
+    private Double amount;
+    /**
+    * 单位
+    */
+    @ApiModelProperty("单位")
+    private String unit;
+    /**
+    * 合计金额
+    */
+    @ApiModelProperty("合计金额")
+    private Double totalAmount;
+    /**
+    * 物品类型
+    */
+    @ApiModelProperty("物品类型")
+    private String itemType;
+    /**
+    * 用途
+    */
+    @ApiModelProperty("用途")
+    private String yongTu8748;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long parentId;
+
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/ledger/dto/UpdateWfSubscriptionDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.ledger.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class UpdateWfSubscriptionDto extends AddWfSubscriptionDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/ledger/dto/WfSubscriptionListDto.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.ledger.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 物品申购分页查询入参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class WfSubscriptionListDto extends PageInput {
+
+    /**
+     * 物品申购id
+     */
+    @ApiModelProperty("物品申购id")
+    private Long parentId;
+
+}

+ 43 - 0
src/main/java/com/xjrsoft/module/ledger/dto/WfSubscriptionPageDto.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.ledger.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 物品申购分页查询入参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class WfSubscriptionPageDto extends PageInput {
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty("开始时间")
+    private String startDate;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty("结束时间")
+    private String endDate;
+
+    /**
+     * 部门id
+     */
+    @ApiModelProperty("部门id")
+    private Long orgId;
+
+    /**
+     * 申请人
+     */
+    @ApiModelProperty("申请人")
+    private String userName;
+
+}

+ 69 - 0
src/main/java/com/xjrsoft/module/ledger/entity/WfSubscription.java

@@ -0,0 +1,69 @@
+package com.xjrsoft.module.ledger.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+@TableName("wf_subscription")
+@ApiModel(value = "wf_subscription", description = "物品申购")
+public class WfSubscription implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 申请部门
+    */
+    @ApiModelProperty("申请部门")
+    private String applicationDepartment;
+    /**
+    * 申请日期
+    */
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private String userId;
+    /**
+    * 预估总额(元)
+    */
+    @ApiModelProperty("预估总额(元)")
+    private Double totalAmount;
+    /**
+    * 附件
+    */
+    @ApiModelProperty("附件")
+    private String folderId;
+
+    /**
+    * wfSubscriptionList
+    */
+    @ApiModelProperty("wfSubscriptionList子表")
+    @TableField(exist = false)
+    @EntityMapping(thisField = "id", joinField = "parentId")
+    private List<WfSubscriptionList> wfSubscriptionListList;
+
+}

+ 83 - 0
src/main/java/com/xjrsoft/module/ledger/entity/WfSubscriptionList.java

@@ -0,0 +1,83 @@
+package com.xjrsoft.module.ledger.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+* @title: 物品申购子表
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+@TableName("wf_subscription_list")
+@ApiModel(value = "wf_subscription_list", description = "物品申购子表")
+public class WfSubscriptionList implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 申购物品名称
+    */
+    @ApiModelProperty("申购物品名称")
+    private String nameOfThePurchasedItem;
+    /**
+    * 品牌
+    */
+    @ApiModelProperty("品牌")
+    private String brand;
+    /**
+    * 规格型号
+    */
+    @ApiModelProperty("规格型号")
+    private String specificationAndModel;
+    /**
+    * 估计单价
+    */
+    @ApiModelProperty("估计单价")
+    private Double estimatedUnitPrice;
+    /**
+    * 申购物品数量
+    */
+    @ApiModelProperty("申购物品数量")
+    private Double amount;
+    /**
+    * 单位
+    */
+    @ApiModelProperty("单位")
+    private String unit;
+    /**
+    * 合计金额
+    */
+    @ApiModelProperty("合计金额")
+    private Double totalAmount;
+    /**
+    * 物品类型
+    */
+    @ApiModelProperty("物品类型")
+    private String itemType;
+    /**
+    * 用途
+    */
+    @ApiModelProperty("用途")
+    private String yongTu8748;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long parentId;
+
+
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionListMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.ledger.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.ledger.entity.WfSubscriptionList;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 物品申购子表
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Mapper
+public interface WfSubscriptionListMapper extends MPJBaseMapper<WfSubscriptionList> {
+
+}

+ 42 - 0
src/main/java/com/xjrsoft/module/ledger/mapper/WfSubscriptionMapper.java

@@ -0,0 +1,42 @@
+package com.xjrsoft.module.ledger.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
+import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Mapper
+public interface WfSubscriptionMapper extends MPJBaseMapper<WfSubscription> {
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     * @return
+     */
+    Page<WfSubscriptionPageVo> getPage(Page<WfSubscriptionPageVo> page, WfSubscriptionPageDto dto);
+
+    /**
+     * 根据id查询详情信息
+     * @param id
+     * @return
+     */
+    WfSubscriptionListInfoVo getInfoById(Long id);
+
+    /**
+     * 列表查询
+     */
+    List<WfSubscriptionExcelVo> getList(WfSubscriptionPageDto dto);
+}

+ 63 - 0
src/main/java/com/xjrsoft/module/ledger/service/IWfSubscriptionService.java

@@ -0,0 +1,63 @@
+package com.xjrsoft.module.ledger.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
+import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
+
+import java.util.List;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+
+public interface IWfSubscriptionService extends MPJBaseService<WfSubscription> {
+    /**
+    * 新增
+    *
+    * @param wfSubscription
+    * @return
+    */
+    Boolean add(WfSubscription wfSubscription);
+
+    /**
+    * 更新
+    *
+    * @param wfSubscription
+    * @return
+    */
+    Boolean update(WfSubscription wfSubscription);
+
+    /**
+    * 删除
+    *
+    * @param ids
+    * @return
+    */
+    Boolean delete(List<Long> ids);
+
+    /**
+     * 列表查询
+     * @param page
+     * @param dto
+     */
+    Page<WfSubscriptionPageVo> getPage(Page<WfSubscriptionPageVo> page, WfSubscriptionPageDto dto);
+
+    /**
+     * 物品清单列表查询
+     * @param id
+     */
+    WfSubscriptionListInfoVo getSubscriptionList(Long id);
+
+    /**
+     * 列表查询
+     */
+    List<WfSubscriptionExcelVo> getList(WfSubscriptionPageDto dto);
+}

+ 140 - 0
src/main/java/com/xjrsoft/module/ledger/service/impl/WfSubscriptionServiceImpl.java

@@ -0,0 +1,140 @@
+package com.xjrsoft.module.ledger.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto;
+import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.ledger.entity.WfSubscriptionList;
+import com.xjrsoft.module.ledger.mapper.WfSubscriptionListMapper;
+import com.xjrsoft.module.ledger.mapper.WfSubscriptionMapper;
+import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionListVo;
+import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
+import com.xjrsoft.module.ledger.vo.WorkflowRecordVo;
+import com.xjrsoft.module.system.entity.File;
+import com.xjrsoft.module.system.service.IFileService;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
+import com.xjrsoft.module.workflow.entity.WorkflowRecord;
+import com.xjrsoft.module.workflow.mapper.WorkflowRecordMapper;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+* @title: 物品申购
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscriptionMapper, WfSubscription> implements IWfSubscriptionService {
+    private final WfSubscriptionMapper wfSubscriptionMapper;
+
+    private final WfSubscriptionListMapper wfSubscriptionListMapper;
+
+    private IFileService fileService;
+
+    private WorkflowRecordMapper workflowRecordMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean add(WfSubscription wfSubscription) {
+        wfSubscriptionMapper.insert(wfSubscription);
+        for (WfSubscriptionList wfSubscriptionList : wfSubscription.getWfSubscriptionListList()) {
+            wfSubscriptionList.setParentId(wfSubscription.getId());
+            wfSubscriptionListMapper.insert(wfSubscriptionList);
+        }
+
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean update(WfSubscription wfSubscription) {
+        wfSubscriptionMapper.updateById(wfSubscription);
+        //********************************* WfSubscriptionList  增删改  开始 *******************************************/
+        {
+            // 查出所有子级的id
+            List<WfSubscriptionList> wfSubscriptionListList = wfSubscriptionListMapper.selectList(Wrappers.lambdaQuery(WfSubscriptionList.class).eq(WfSubscriptionList::getParentId, wfSubscription.getId()).select(WfSubscriptionList::getId));
+            List<Long> wfSubscriptionListIds = wfSubscriptionListList.stream().map(WfSubscriptionList::getId).collect(Collectors.toList());
+            //原有子表单 没有被删除的主键
+            List<Long> wfSubscriptionListOldIds = wfSubscription.getWfSubscriptionListList().stream().map(WfSubscriptionList::getId).filter(Objects::nonNull).collect(Collectors.toList());
+            //找到需要删除的id
+            List<Long> wfSubscriptionListRemoveIds = wfSubscriptionListIds.stream().filter(item -> !wfSubscriptionListOldIds.contains(item)).collect(Collectors.toList());
+
+            for (WfSubscriptionList wfSubscriptionList : wfSubscription.getWfSubscriptionListList()) {
+                //如果不等于空则修改
+                if (wfSubscriptionList.getId() != null) {
+                    wfSubscriptionListMapper.updateById(wfSubscriptionList);
+                }
+                //如果等于空 则新增
+                else {
+                    //已经不存在的id 删除
+                    wfSubscriptionList.setParentId(wfSubscription.getId());
+                    wfSubscriptionListMapper.insert(wfSubscriptionList);
+                }
+            }
+            //已经不存在的id 删除
+            if(wfSubscriptionListRemoveIds.size() > 0){
+                wfSubscriptionListMapper.deleteBatchIds(wfSubscriptionListRemoveIds);
+            }
+        }
+        //********************************* WfSubscriptionList  增删改  结束 *******************************************/
+
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(List<Long> ids) {
+        wfSubscriptionMapper.deleteBatchIds(ids);
+        wfSubscriptionListMapper.delete(Wrappers.lambdaQuery(WfSubscriptionList.class).in(WfSubscriptionList::getParentId, ids));
+
+        return true;
+    }
+
+    @Override
+    public Page<WfSubscriptionPageVo> getPage(Page<WfSubscriptionPageVo> page, WfSubscriptionPageDto dto) {
+        Page<WfSubscriptionPageVo> voPage = wfSubscriptionMapper.getPage(page, dto);
+        for (WfSubscriptionPageVo record : voPage.getRecords()) {
+            List<File> list = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, record.getFolderId()));
+            record.setFileInfos(list);
+        }
+        return voPage;
+    }
+
+    @Override
+    public WfSubscriptionListInfoVo getSubscriptionList(Long id) {
+        WfSubscriptionListInfoVo info = wfSubscriptionMapper.getInfoById(id);
+        List<WfSubscriptionList> subscriptionListList = wfSubscriptionListMapper.selectList(
+            new QueryWrapper<WfSubscriptionList>().lambda().eq(WfSubscriptionList::getParentId, id)
+        );
+        info.setSubscriptionList(BeanUtil.copyToList(subscriptionListList, WfSubscriptionListVo.class));
+
+        List<WorkflowRecord> recordList = workflowRecordMapper.selectList(
+            new MPJLambdaWrapper<WorkflowRecord>()
+            .select(WorkflowRecord.class, x -> VoToColumnUtil.fieldsToColumns(WorkflowRecordVo.class).contains(x.getProperty()))
+            .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getProcessId, WorkflowRecord::getProcessId)
+            .eq(WorkflowFormRelation::getFormKeyValue, id)
+        );
+        info.setWorkflowRecordList(BeanUtil.copyToList(recordList, WorkflowRecordVo.class));
+        return info;
+    }
+
+    @Override
+    public List<WfSubscriptionExcelVo> getList(WfSubscriptionPageDto dto) {
+        return wfSubscriptionMapper.getList(dto);
+    }
+}

+ 58 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionExcelVo.java

@@ -0,0 +1,58 @@
+package com.xjrsoft.module.ledger.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.module.system.entity.File;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 物品申购分页列表出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WfSubscriptionExcelVo {
+
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("主键编号")
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 申请部门
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请部门")
+    @ApiModelProperty("申请部门")
+    private String orgName;
+    /**
+    * 申请日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请日期")
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+    * 申请人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请人")
+    @ApiModelProperty("申请人")
+    private String userName;
+    /**
+    * 附件
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("编号")
+    @ApiModelProperty("编号")
+    private String number;
+
+
+}

+ 59 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionListInfoVo.java

@@ -0,0 +1,59 @@
+package com.xjrsoft.module.ledger.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.module.system.entity.File;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 物品申购子表表单出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WfSubscriptionListInfoVo {
+
+    /**
+     * 申请部门
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请部门")
+    @ApiModelProperty("申请部门")
+    private String orgName;
+    /**
+     * 申请日期
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请日期")
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+     * 申请人
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请人")
+    @ApiModelProperty("申请人")
+    private String userName;
+    /**
+     * 附件
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("附件")
+    @ApiModelProperty("附件")
+    private String folderId;
+
+    @ApiModelProperty("附件列表")
+    private List<File> fileInfos;
+
+    @ApiModelProperty("物品清单")
+    private List<WfSubscriptionListVo> subscriptionList;
+
+    @ApiModelProperty("流程信息")
+    private List<WorkflowRecordVo> workflowRecordList;
+
+}

+ 69 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionListVo.java

@@ -0,0 +1,69 @@
+package com.xjrsoft.module.ledger.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 物品申购子表表单出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WfSubscriptionListVo {
+
+
+    /**
+    * 申购物品名称
+    */
+    @ApiModelProperty("申购物品名称")
+    private String nameOfThePurchasedItem;
+    /**
+    * 品牌
+    */
+    @ApiModelProperty("品牌")
+    private String brand;
+    /**
+    * 规格型号
+    */
+    @ApiModelProperty("规格型号")
+    private String specificationAndModel;
+    /**
+    * 估计单价
+    */
+    @ApiModelProperty("估计单价")
+    private Double estimatedUnitPrice;
+    /**
+    * 申购物品数量
+    */
+    @ApiModelProperty("申购物品数量")
+    private Double amount;
+    /**
+    * 单位
+    */
+    @ApiModelProperty("单位")
+    private String unit;
+    /**
+    * 合计金额
+    */
+    @ApiModelProperty("合计金额")
+    private Double totalAmount;
+    /**
+    * 物品类型
+    */
+    @ApiModelProperty("物品类型")
+    private String itemType;
+    /**
+    * 用途
+    */
+    @ApiModelProperty("用途")
+    private String yongTu8748;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long parentId;
+
+
+
+}

+ 65 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionPageVo.java

@@ -0,0 +1,65 @@
+package com.xjrsoft.module.ledger.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.module.system.entity.File;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 物品申购分页列表出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WfSubscriptionPageVo {
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("主键编号")
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 申请部门
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请部门")
+    @ApiModelProperty("申请部门")
+    private String orgName;
+    /**
+    * 申请日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请日期")
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+    * 申请人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("申请人")
+    @ApiModelProperty("申请人")
+    private String userName;
+    /**
+    * 附件
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("附件")
+    @ApiModelProperty("附件")
+    private String folderId;
+
+    @ApiModelProperty("附件列表")
+    private List<File> fileInfos;
+
+    /**
+     * 申请人
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("编号")
+    @ApiModelProperty("编号")
+    private String number;
+
+}

+ 56 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WfSubscriptionVo.java

@@ -0,0 +1,56 @@
+package com.xjrsoft.module.ledger.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 物品申购表单出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WfSubscriptionVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 申请部门
+    */
+    @ApiModelProperty("申请部门")
+    private String applicationDepartment;
+    /**
+    * 申请日期
+    */
+    @ApiModelProperty("申请日期")
+    private Date shenQingRiQi4752;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("申请人")
+    private String userId;
+    /**
+    * 预估总额(元)
+    */
+    @ApiModelProperty("预估总额(元)")
+    private Double totalAmount;
+    /**
+    * 附件
+    */
+    @ApiModelProperty("附件")
+    private String annex;
+
+
+    /**
+    * wfSubscriptionList
+    */
+    @ApiModelProperty("wfSubscriptionList子表")
+    private List<WfSubscriptionListVo> wfSubscriptionListList;
+
+}

+ 33 - 0
src/main/java/com/xjrsoft/module/ledger/vo/WorkflowRecordVo.java

@@ -0,0 +1,33 @@
+package com.xjrsoft.module.ledger.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 物品申购表单出参
+* @Author dzx
+* @Date: 2024-02-19
+* @Version 1.0
+*/
+@Data
+public class WorkflowRecordVo {
+
+    /**
+    * 申请部门
+    */
+    @ApiModelProperty("节点名称")
+    private String nodeName;
+    /**
+    * 申请日期
+    */
+    @ApiModelProperty("操作信息")
+    private String message;
+    /**
+    * 申请人
+    */
+    @ApiModelProperty("操作时间")
+    private Date recordTime;
+
+}

+ 7 - 0
src/main/java/com/xjrsoft/module/workflow/controller/WorkflowExecuteController.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.workflow.controller;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.model.result.R;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.module.workflow.dto.AddOrSubSignDto;
 import com.xjrsoft.module.workflow.dto.ApproveDto;
 import com.xjrsoft.module.workflow.dto.ApproveMultiDto;
@@ -348,5 +349,11 @@ public class WorkflowExecuteController {
         return R.ok(workflowExecuteService.getCount());
     }
 
+    @GetMapping("/my-examine")
+    @ApiOperation(value = "我的审批")
+    public RT myExamine(){
+        return RT.ok();
+    }
+
 
 }

+ 47 - 0
src/main/resources/mapper/ledger/WfSubscriptionMapper.xml

@@ -0,0 +1,47 @@
+<?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="com.xjrsoft.module.ledger.mapper.WfSubscriptionMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo">
+        select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752,t1.folder_id,t1.number from wf_subscription t1
+        left join xjr_department t2 on t1.application_department = t2.id
+        left join xjr_user t3 on t1.user_id = t3.id
+        where 1 = 1
+        <if test="dto.orgId != null">
+            and t2.id = #{dto.orgId}
+        </if>
+        <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
+            and t2.shen_qing_ri_qi4752 between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.userName != null and dto.userName != ''">
+            and t3.name like concat('%', #{dto.userName}, '%')
+        </if>
+        order by t1.shen_qing_ri_qi4752 desc
+    </select>
+
+    <select id="getList" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionExcelVo">
+        select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752,t1.folder_id,t1.number from wf_subscription t1
+        left join xjr_department t2 on t1.application_department = t2.id
+        left join xjr_user t3 on t1.user_id = t3.id
+        where 1 = 1
+        <if test="dto.orgId != null">
+            and t2.id = #{dto.orgId}
+        </if>
+        <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
+            and t2.shen_qing_ri_qi4752 between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.userName != null and dto.userName != ''">
+            and t3.name like concat('%', #{dto.userName}, '%')
+        </if>
+        order by t1.shen_qing_ri_qi4752 desc
+    </select>
+
+    <select id="getInfoById" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionListInfoVo">
+        select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752,t1.folder_id from wf_subscription t1
+        left join xjr_department t2 on t1.application_department = t2.id
+        left join xjr_user t3 on t1.user_id = t3.id
+        where t1.id = #{id}
+    </select>
+
+</mapper>

+ 39 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -2215,4 +2215,43 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+    /**
+     * 评价项
+     * @throws IOException
+     */
+    @Test
+    public void gcWfSubscription() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("wf_subscription");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("wf_subscription_list");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("parent_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("ledger");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(true);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+
+    }
 }