소스 검색

20230327 18:01

wangzhuo 2 년 전
부모
커밋
a46d17460c
18개의 변경된 파일1171개의 추가작업 그리고 81개의 파일을 삭제
  1. 110 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/agreement/TContractManagementController.java
  2. 9 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TFeesController.java
  3. 324 0
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/domain/TContractManagement.java
  4. 84 24
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/domain/TCostManagement.java
  5. 62 0
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/mapper/TContractManagementMapper.java
  6. 8 0
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/mapper/TCostManagementMapper.java
  7. 66 0
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/ITContractManagementService.java
  8. 179 0
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TContractManagementServiceImpl.java
  9. 17 28
      ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TCostManagementServiceImpl.java
  10. 179 0
      ruoyi-anpin/src/main/resources/mapper/anpin/TContractManagementMapper.xml
  11. 13 8
      ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementItemMapper.xml
  12. 68 20
      ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementMapper.xml
  13. 8 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TFeesMapper.java
  14. 8 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITFeesService.java
  15. 12 0
      ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TFeesServiceImpl.java
  16. 13 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TEnclosure.java
  17. 7 0
      ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml
  18. 4 1
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TEnclosureMapper.xml

+ 110 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/agreement/TContractManagementController.java

@@ -0,0 +1,110 @@
+package com.ruoyi.web.controller.agreement;
+
+import java.util.List;
+
+import com.ruoyi.anpin.domain.TContractManagement;
+import com.ruoyi.anpin.service.ITContractManagementService;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.framework.web.service.TokenService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 合同管理Controller
+ * 
+ * @author ruoyi
+ * @date 2023-03-27
+ */
+@RestController
+@RequestMapping("/agreement/contractManagement")
+public class TContractManagementController extends BaseController
+{
+    @Autowired
+    private ITContractManagementService tContractManagementService;
+
+    /**
+     * 查询合同管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TContractManagement tContractManagement)
+    {
+        startPage();
+        List<TContractManagement> list = tContractManagementService.selectTContractManagementList(tContractManagement);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出合同管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:export')")
+    @Log(title = "合同管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TContractManagement tContractManagement)
+    {
+        List<TContractManagement> list = tContractManagementService.selectTContractManagementList(tContractManagement);
+        ExcelUtil<TContractManagement> util = new ExcelUtil<TContractManagement>(TContractManagement.class);
+        return util.exportExcel(list, "contractManagement");
+    }
+
+    /**
+     * 获取合同管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:query')")
+    @GetMapping(value = "/{fId}")
+    public AjaxResult getInfo(@PathVariable("fId") Long fId)
+    {
+        return AjaxResult.success(tContractManagementService.selectTContractManagementById(fId));
+    }
+
+    /**
+     * 新增合同管理
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:add')")
+    @Log(title = "合同管理", businessType = BusinessType.INSERT)
+    @PostMapping("/contractManagementAdd")
+    @RepeatSubmit
+    public AjaxResult contractManagementAdd(@RequestParam("tContractManagement") String tContractManagement,
+                          @RequestParam("tEnclosure") String tEnclosure)
+    {
+        if (StringUtils.isNull(tContractManagement) || "{}".equals(tContractManagement)) {
+            return AjaxResult.error("未找到主表数据,请确认");
+        }
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tContractManagementService.insertTContractManagement(tContractManagement, tEnclosure, loginUser);
+    }
+
+    /**
+     * 修改合同管理
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:edit')")
+    @Log(title = "合同管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TContractManagement tContractManagement)
+    {
+        return toAjax(tContractManagementService.updateTContractManagement(tContractManagement));
+    }
+
+    /**
+     * 删除合同管理
+     */
+    @PreAuthorize("@ss.hasPermi('agreement:contractManagement:remove')")
+    @Log(title = "合同管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{fIds}")
+    public AjaxResult remove(@PathVariable Long[] fIds)
+    {
+        return toAjax(tContractManagementService.deleteTContractManagementByIds(fIds));
+    }
+}

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/basicData/TFeesController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.warehouse.basicData;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.service.ITFeesService;
 import com.ruoyi.common.annotation.Log;
@@ -103,4 +104,12 @@ public class TFeesController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] fIds) {
         return tFeesService.deleteTFeesByIds(fIds);
     }
+
+    /**
+     * 根据物料类别查询查询费用信息列表
+     */
+    @GetMapping("/feesList")
+    public AjaxResult feesList(@RequestParam("feesType") String feesType) {
+        return tFeesService.selectFeesTypeList(feesType);
+    }
 }

+ 324 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/domain/TContractManagement.java

@@ -0,0 +1,324 @@
+package com.ruoyi.anpin.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 合同管理对象 t_contract_management
+ * 
+ * @author ruoyi
+ * @date 2023-03-27
+ */
+public class TContractManagement extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long fId;
+
+    /** 编号 */
+    @Excel(name = "编号")
+    private String fNo;
+
+    /** 合同编号 */
+    @Excel(name = "合同编号")
+    private String contractNo;
+
+    /** 删除状态 */
+    private String delFlag;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private String fStatus;
+
+    /** 档案内容 */
+    @Excel(name = "档案内容")
+    private String content;
+
+    /** 档案份数 */
+    @Excel(name = "档案份数")
+    private Long copies;
+
+    /** 建立日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "建立日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date creationDate;
+
+    /** 文件类型 */
+    @Excel(name = "文件类型")
+    private String fileType;
+
+    /** 提交方式 */
+    @Excel(name = "提交方式")
+    private String submissionMethod;
+
+    /** 提交部门id */
+    @Excel(name = "提交部门id")
+    private Long submittingDepartmentId;
+
+    /** 提交部门名称 */
+    @Excel(name = "提交部门名称")
+    private String submittingDepartmentName;
+
+    /** 签发单位 */
+    @Excel(name = "签发单位")
+    private Long issuingUnitId;
+
+    /** 归档时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "归档时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date archiveTime;
+
+    /** 有效期(月) */
+    @Excel(name = "有效期", readConverterExp = "月=")
+    private Long validityMonth;
+
+    /** 保管期限 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "保管期限", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date storagePeriodTime;
+
+    /** 保管人id */
+    @Excel(name = "保管人id")
+    private Long custodianId;
+
+    /** 保管人名称 */
+    @Excel(name = "保管人名称")
+    private String custodianName;
+
+    /** 保管位置 */
+    @Excel(name = "保管位置")
+    private String storageLocation;
+
+    /**
+     * 建立日期检索区间
+     */
+    private List<String> creationDateList;
+
+    /**
+     * 归档时间检索区间
+     */
+    private List<String> archiveTimeList;
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public List<String> getArchiveTimeList() {
+        return archiveTimeList;
+    }
+
+    public void setArchiveTimeList(List<String> archiveTimeList) {
+        this.archiveTimeList = archiveTimeList;
+    }
+
+    public List<String> getCreationDateList() {
+        return creationDateList;
+    }
+
+    public void setCreationDateList(List<String> creationDateList) {
+        this.creationDateList = creationDateList;
+    }
+
+    public void setfId(Long fId)
+    {
+        this.fId = fId;
+    }
+
+    public Long getfId() 
+    {
+        return fId;
+    }
+    public void setfNo(String fNo) 
+    {
+        this.fNo = fNo;
+    }
+
+    public String getfNo() 
+    {
+        return fNo;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setfStatus(String fStatus) 
+    {
+        this.fStatus = fStatus;
+    }
+
+    public String getfStatus() 
+    {
+        return fStatus;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setCopies(Long copies) 
+    {
+        this.copies = copies;
+    }
+
+    public Long getCopies() 
+    {
+        return copies;
+    }
+    public void setCreationDate(Date creationDate) 
+    {
+        this.creationDate = creationDate;
+    }
+
+    public Date getCreationDate() 
+    {
+        return creationDate;
+    }
+    public void setFileType(String fileType) 
+    {
+        this.fileType = fileType;
+    }
+
+    public String getFileType() 
+    {
+        return fileType;
+    }
+    public void setSubmissionMethod(String submissionMethod) 
+    {
+        this.submissionMethod = submissionMethod;
+    }
+
+    public String getSubmissionMethod() 
+    {
+        return submissionMethod;
+    }
+    public void setSubmittingDepartmentId(Long submittingDepartmentId) 
+    {
+        this.submittingDepartmentId = submittingDepartmentId;
+    }
+
+    public Long getSubmittingDepartmentId() 
+    {
+        return submittingDepartmentId;
+    }
+    public void setSubmittingDepartmentName(String submittingDepartmentName) 
+    {
+        this.submittingDepartmentName = submittingDepartmentName;
+    }
+
+    public String getSubmittingDepartmentName() 
+    {
+        return submittingDepartmentName;
+    }
+    public void setIssuingUnitId(Long issuingUnitId) 
+    {
+        this.issuingUnitId = issuingUnitId;
+    }
+
+    public Long getIssuingUnitId() 
+    {
+        return issuingUnitId;
+    }
+    public void setArchiveTime(Date archiveTime) 
+    {
+        this.archiveTime = archiveTime;
+    }
+
+    public Date getArchiveTime() 
+    {
+        return archiveTime;
+    }
+    public void setValidityMonth(Long validityMonth) 
+    {
+        this.validityMonth = validityMonth;
+    }
+
+    public Long getValidityMonth() 
+    {
+        return validityMonth;
+    }
+    public void setStoragePeriodTime(Date storagePeriodTime) 
+    {
+        this.storagePeriodTime = storagePeriodTime;
+    }
+
+    public Date getStoragePeriodTime() 
+    {
+        return storagePeriodTime;
+    }
+    public void setCustodianId(Long custodianId) 
+    {
+        this.custodianId = custodianId;
+    }
+
+    public Long getCustodianId() 
+    {
+        return custodianId;
+    }
+    public void setCustodianName(String custodianName) 
+    {
+        this.custodianName = custodianName;
+    }
+
+    public String getCustodianName() 
+    {
+        return custodianName;
+    }
+    public void setStorageLocation(String storageLocation) 
+    {
+        this.storageLocation = storageLocation;
+    }
+
+    public String getStorageLocation() 
+    {
+        return storageLocation;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("fId", getfId())
+            .append("fNo", getfNo())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .append("delFlag", getDelFlag())
+            .append("fStatus", getfStatus())
+            .append("content", getContent())
+            .append("copies", getCopies())
+            .append("creationDate", getCreationDate())
+            .append("fileType", getFileType())
+            .append("submissionMethod", getSubmissionMethod())
+            .append("submittingDepartmentId", getSubmittingDepartmentId())
+            .append("submittingDepartmentName", getSubmittingDepartmentName())
+            .append("issuingUnitId", getIssuingUnitId())
+            .append("archiveTime", getArchiveTime())
+            .append("validityMonth", getValidityMonth())
+            .append("storagePeriodTime", getStoragePeriodTime())
+            .append("custodianId", getCustodianId())
+            .append("custodianName", getCustodianName())
+            .append("storageLocation", getStorageLocation())
+            .toString();
+    }
+}

+ 84 - 24
ruoyi-anpin/src/main/java/com/ruoyi/anpin/domain/TCostManagement.java

@@ -47,6 +47,10 @@ public class TCostManagement extends BaseEntity
     @Excel(name = "创建人部门")
     private String createDept;
 
+    /** 创建人部门名称 */
+    @Excel(name = "创建人部门名称")
+    private String createDeptName;
+
     /** 业务日期 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
@@ -58,21 +62,76 @@ public class TCostManagement extends BaseEntity
 
     /** 报销方式 */
     @Excel(name = "报销方式")
-    private String expenseTypr;
+    private String expenseType;
 
     /** 金额合计 */
     @Excel(name = "金额合计")
     private BigDecimal totalAmount;
 
     /**
-     * 明细集合
+     * 查询业务日期区间
+     */
+    private List<String> businessTimeList;
+
+    /**
+     * 明细所属部门(检索)
      */
-    private List<TCostManagementItem> itemList;
+    private String itemDepartmentName;
 
     /**
-     * 附件集合
+     * 明细所属人员(检索)
      */
-    private List<TEnclosure> fileList;
+    private String itemPersonnelName;
+
+    /**
+     * 明细物料(检索)
+     */
+    private String itemMatterName;
+
+    /**
+     * 明细费用名称(检索)
+     */
+    private Long itemExpenseId;
+
+    public Long getItemExpenseName() {
+        return itemExpenseId;
+    }
+
+    public void setItemExpenseName(Long itemExpenseName) {
+        this.itemExpenseId = itemExpenseName;
+    }
+
+    public String getItemMatterName() {
+        return itemMatterName;
+    }
+
+    public void setItemMatterName(String itemMatterName) {
+        this.itemMatterName = itemMatterName;
+    }
+
+    public String getItemPersonnelName() {
+        return itemPersonnelName;
+    }
+
+    public void setItemPersonnelName(String itemPersonnelName) {
+        this.itemPersonnelName = itemPersonnelName;
+    }
+
+    public String getItemDepartmentName() {
+        return itemDepartmentName;
+    }
+
+    public void setItemDepartmentName(String itemDepartmentName) {
+        this.itemDepartmentName = itemDepartmentName;
+    }
+
+    public List<String> getBusinessTimeList() {
+        return businessTimeList;
+    }
+
+    public void setBusinessTimeList(List<String> businessTimeList) {
+        this.businessTimeList = businessTimeList;
+    }
 
     public void setfId(Long fId)
     {
@@ -155,15 +214,23 @@ public class TCostManagement extends BaseEntity
     {
         return businessType;
     }
-    public void setExpenseTypr(String expenseTypr)
-    {
-        this.expenseTypr = expenseTypr;
+
+    public String getExpenseType() {
+        return expenseType;
     }
 
-    public String getExpenseTypr()
-    {
-        return expenseTypr;
+    public void setExpenseType(String expenseType) {
+        this.expenseType = expenseType;
+    }
+
+    public Long getItemExpenseId() {
+        return itemExpenseId;
+    }
+
+    public void setItemExpenseId(Long itemExpenseId) {
+        this.itemExpenseId = itemExpenseId;
     }
+
     public void setTotalAmount(BigDecimal totalAmount)
     {
         this.totalAmount = totalAmount;
@@ -174,20 +241,12 @@ public class TCostManagement extends BaseEntity
         return totalAmount;
     }
 
-    public List<TCostManagementItem> getItemList() {
-        return itemList;
-    }
-
-    public void setItemList(List<TCostManagementItem> itemList) {
-        this.itemList = itemList;
-    }
-
-    public List<TEnclosure> getFileList() {
-        return fileList;
+    public String getCreateDeptName() {
+        return createDeptName;
     }
 
-    public void setFileList(List<TEnclosure> fileList) {
-        this.fileList = fileList;
+    public void setCreateDeptName(String createDeptName) {
+        this.createDeptName = createDeptName;
     }
 
     @Override
@@ -207,8 +266,9 @@ public class TCostManagement extends BaseEntity
             .append("createDept", getCreateDept())
             .append("businessTime", getBusinessTime())
             .append("businessType", getBusinessType())
-            .append("expenseTypr", getExpenseTypr())
+            .append("expenseType", getExpenseType())
             .append("totalAmount", getTotalAmount())
+            .append("createDeptName", getCreateDeptName())
             .toString();
     }
 }

+ 62 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/mapper/TContractManagementMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.anpin.mapper;
+
+import com.ruoyi.anpin.domain.TContractManagement;
+
+import java.util.List;
+
+/**
+ * 合同管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-27
+ */
+public interface TContractManagementMapper 
+{
+    /**
+     * 查询合同管理
+     * 
+     * @param fId 合同管理ID
+     * @return 合同管理
+     */
+    public TContractManagement selectTContractManagementById(Long fId);
+
+    /**
+     * 查询合同管理列表
+     * 
+     * @param tContractManagement 合同管理
+     * @return 合同管理集合
+     */
+    public List<TContractManagement> selectTContractManagementList(TContractManagement tContractManagement);
+
+    /**
+     * 新增合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    public int insertTContractManagement(TContractManagement tContractManagement);
+
+    /**
+     * 修改合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    public int updateTContractManagement(TContractManagement tContractManagement);
+
+    /**
+     * 删除合同管理
+     * 
+     * @param fId 合同管理ID
+     * @return 结果
+     */
+    public int deleteTContractManagementById(Long fId);
+
+    /**
+     * 批量删除合同管理
+     * 
+     * @param fIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTContractManagementByIds(Long[] fIds);
+}

+ 8 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/mapper/TCostManagementMapper.java

@@ -59,4 +59,12 @@ public interface TCostManagementMapper
      * @return 结果
      */
     public int deleteTCostManagementByIds(Long[] fIds);
+
+    /**
+     * 查询费用管理列表
+     *
+     * @param tCostManagement 费用管理
+     * @return 费用管理集合
+     */
+    public List<TCostManagement> selectManagementList(TCostManagement tCostManagement);
 }

+ 66 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/ITContractManagementService.java

@@ -0,0 +1,66 @@
+package com.ruoyi.anpin.service;
+
+import com.ruoyi.anpin.domain.TContractManagement;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 合同管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-27
+ */
+public interface ITContractManagementService 
+{
+    /**
+     * 查询合同管理
+     * 
+     * @param fId 合同管理ID
+     * @return 合同管理
+     */
+    public Map<String, Object> selectTContractManagementById(Long fId);
+
+    /**
+     * 查询合同管理列表
+     * 
+     * @param tContractManagement 合同管理
+     * @return 合同管理集合
+     */
+    public List<TContractManagement> selectTContractManagementList(TContractManagement tContractManagement);
+
+    /**
+     * 新增合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    public AjaxResult insertTContractManagement(String tContractManagement, String tEnclosure, LoginUser loginUser);
+
+    /**
+     * 修改合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    public int updateTContractManagement(TContractManagement tContractManagement);
+
+    /**
+     * 批量删除合同管理
+     * 
+     * @param fIds 需要删除的合同管理ID
+     * @return 结果
+     */
+    public int deleteTContractManagementByIds(Long[] fIds);
+
+    /**
+     * 删除合同管理信息
+     * 
+     * @param fId 合同管理ID
+     * @return 结果
+     */
+    public int deleteTContractManagementById(Long fId);
+}

+ 179 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TContractManagementServiceImpl.java

@@ -0,0 +1,179 @@
+package com.ruoyi.anpin.service.impl;
+
+import java.util.*;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.anpin.domain.TContractManagement;
+import com.ruoyi.anpin.mapper.TContractManagementMapper;
+import com.ruoyi.anpin.service.ITContractManagementService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.mapper.SysDeptMapper;
+import com.ruoyi.system.mapper.SysUserMapper;
+import com.ruoyi.warehouseBusiness.domain.TEnclosure;
+import com.ruoyi.warehouseBusiness.mapper.TEnclosureMapper;
+import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 合同管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-03-27
+ */
+@Service
+public class TContractManagementServiceImpl implements ITContractManagementService
+{
+    @Autowired
+    private TContractManagementMapper tContractManagementMapper;
+
+    @Autowired
+    private TEnclosureMapper tEnclosureMapper;
+
+    @Autowired
+    private SysDeptMapper sysDeptMapper;
+
+    @Autowired
+    private BillnoSerialServiceImpl billnoSerialServiceImpl;
+
+    @Autowired
+    private SysUserMapper sysUserMapper;
+
+    /**
+     * 查询合同管理
+     * 
+     * @param fId 合同管理ID
+     * @return 合同管理
+     */
+    @Override
+    public Map<String, Object> selectTContractManagementById(Long fId)
+    {
+        Map<String, Object> map = new HashMap<>();
+        //查询费用管理主表数据
+        TContractManagement tContractManagement = tContractManagementMapper.selectTContractManagementById(fId);
+
+        // 查询附件表数据
+        TEnclosure enclosure = new TEnclosure();
+        enclosure.setfPid(fId);
+        List<TEnclosure> enclosures = tEnclosureMapper.selectTEnclosureList(enclosure);
+        if (StringUtils.isNotEmpty(enclosures)) {
+            map.put("enclosures", enclosures);
+        }
+
+        map.put("tContractManagement", tContractManagement);
+
+        return map;
+    }
+
+    /**
+     * 查询合同管理列表
+     * 
+     * @param tContractManagement 合同管理
+     * @return 合同管理
+     */
+    @Override
+    public List<TContractManagement> selectTContractManagementList(TContractManagement tContractManagement)
+    {
+        return tContractManagementMapper.selectTContractManagementList(tContractManagement);
+    }
+
+    /**
+     * 新增合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    @Override
+    public AjaxResult insertTContractManagement(String tContractManagement, String tEnclosure, LoginUser loginUser)
+    {
+        Map<String, Object> map = new HashMap<>();
+        TContractManagement detailed = JSONArray.parseObject(tContractManagement, TContractManagement.class);
+        detailed.setSubmittingDepartmentName(sysDeptMapper.selectDeptById(detailed.getSubmittingDepartmentId()).getDeptName());//提交部门名称
+
+        SysUser use = sysUserMapper.selectUserById(detailed.getCustodianId());
+        detailed.setCustodianName(use.getUserName());//保管人名称
+
+        //保存主表信息
+        if (StringUtils.isNull(detailed.getfId())) {// 如果是新数据
+            // 业务编码
+            String billNo = billnoSerialServiceImpl.getBillNo("HT", new Date());
+            detailed.setfNo(billNo);
+            detailed.setCreateBy(loginUser.getUser().getUserName());
+            detailed.setCreateTime(new Date());
+            tContractManagementMapper.insertTContractManagement(detailed);
+        } else {
+            detailed.setUpdateBy(loginUser.getUser().getUserName());
+            detailed.setUpdateTime(new Date());
+            tContractManagementMapper.updateTContractManagement(detailed);
+        }
+
+        //保存附件信息
+        List<TEnclosure> enclosuresList = new ArrayList<>();
+        if (StringUtils.isNotNull(tEnclosure) && !"[]".equals(tEnclosure)) {
+            JSONArray jsonEnclosureArray = JSONArray.parseArray(tEnclosure);
+            enclosuresList = JSONObject.parseArray(jsonEnclosureArray.toJSONString(), TEnclosure.class);
+            long lineNo = 0L;
+            for (TEnclosure enclosure : enclosuresList) {
+                lineNo++;
+                if (enclosure.getfId() == null) {
+                    enclosure.setfPid(detailed.getfId());
+                    enclosure.setfLineno(lineNo);
+                    enclosure.setCreateTime(new Date());
+                    enclosure.setCreateBy(loginUser.getUser().getUserName());
+                    tEnclosureMapper.insertTEnclosure(enclosure);
+                } else {
+                    enclosure.setUpdateBy(loginUser.getUser().getUserName());
+                    enclosure.setUpdateTime(new Date());
+                    tEnclosureMapper.updateTEnclosure(enclosure);
+                }
+            }
+        }
+
+        map.put("tContractManagement",detailed);
+        map.put("enclosuresList", enclosuresList);
+
+        return AjaxResult.success("成功", map);
+    }
+
+    /**
+     * 修改合同管理
+     * 
+     * @param tContractManagement 合同管理
+     * @return 结果
+     */
+    @Override
+    public int updateTContractManagement(TContractManagement tContractManagement)
+    {
+        tContractManagement.setUpdateTime(DateUtils.getNowDate());
+        return tContractManagementMapper.updateTContractManagement(tContractManagement);
+    }
+
+    /**
+     * 批量删除合同管理
+     * 
+     * @param fIds 需要删除的合同管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTContractManagementByIds(Long[] fIds)
+    {
+        return tContractManagementMapper.deleteTContractManagementByIds(fIds);
+    }
+
+    /**
+     * 删除合同管理信息
+     * 
+     * @param fId 合同管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTContractManagementById(Long fId)
+    {
+        return tContractManagementMapper.deleteTContractManagementById(fId);
+    }
+}

+ 17 - 28
ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TCostManagementServiceImpl.java

@@ -14,12 +14,14 @@ import com.ruoyi.approvalFlow.service.impl.AuditItemsServiceImpl;
 import com.ruoyi.basicData.domain.TFees;
 import com.ruoyi.basicData.mapper.TFeesMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.mapper.SysConfigMapper;
+import com.ruoyi.system.mapper.SysDeptMapper;
 import com.ruoyi.warehouseBusiness.domain.TEnclosure;
 import com.ruoyi.warehouseBusiness.mapper.TEnclosureMapper;
 import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
@@ -57,6 +59,9 @@ public class TCostManagementServiceImpl implements ITCostManagementService
     @Autowired
     private AuditItemsServiceImpl auditItemsService;
 
+    @Autowired
+    private SysDeptMapper sysDeptMapper;
+
     /**
      * 查询费用管理
      * 
@@ -69,38 +74,20 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         Map<String, Object> map = new HashMap<>();
         //查询费用管理主表数据
         TCostManagement tCostManagement = tCostManagementMapper.selectTCostManagementById(fId);
-        // 费用
-        List<Long> feesId = new ArrayList<>();
+
         //查询明细信息
         TCostManagementItem tCostManagementItem = new TCostManagementItem();
         tCostManagementItem.setfPid(tCostManagement.getfId());
         List<TCostManagementItem> itemList = tCostManagementItemMapper.selectTCostManagementItemList(tCostManagementItem);
-        if (StringUtils.isNotEmpty(itemList)) {
-            for (TCostManagementItem fees : itemList) {
-                feesId.add(fees.getExpenseId());
-            }
-        }
-        //查询费用
-        List<TFees> feesList = new ArrayList<>();
-        List<Long> longList = StringUtils.integerDeduplication(feesId);
-        for (Long fees : longList) {
-            TFees tFees = tFeesMapper.selectTFeesById(fees);
-            if (StringUtils.isNotNull(tFees)) {
-                feesList.add(tFees);
-            }
-        }
 
         // 查询附件表数据
         TEnclosure enclosure = new TEnclosure();
         enclosure.setfPid(fId);
         List<TEnclosure> enclosures = tEnclosureMapper.selectTEnclosureList(enclosure);
-        if (StringUtils.isNotEmpty(enclosures)) {
-            map.put("enclosures", enclosures);
-        }
 
+        map.put("tEnclosure", enclosures);
         map.put("tCostManagement", tCostManagement);
-        map.put("itemList", itemList);
-        map.put("feesList", feesList);
+        map.put("tCostManagementItem", itemList);
         return map;
     }
 
@@ -113,7 +100,7 @@ public class TCostManagementServiceImpl implements ITCostManagementService
     @Override
     public List<TCostManagement> selectTCostManagementList(TCostManagement tCostManagement)
     {
-        return tCostManagementMapper.selectTCostManagementList(tCostManagement);
+        return tCostManagementMapper.selectManagementList(tCostManagement);
     }
 
     /**
@@ -127,7 +114,7 @@ public class TCostManagementServiceImpl implements ITCostManagementService
     {
         Map<String, Object> map = new HashMap<>();
         TCostManagement detailed = JSONArray.parseObject(tCostManagement, TCostManagement.class);
-
+        detailed.setDeptName(sysDeptMapper.selectDeptById(detailed.getDeptId()).getDeptName());//部门名称
         //保存主表信息
         if (StringUtils.isNull(detailed.getfId())) {// 如果是新数据
             // 业务编码
@@ -136,6 +123,7 @@ public class TCostManagementServiceImpl implements ITCostManagementService
             detailed.setCreateBy(loginUser.getUser().getUserName());
             detailed.setCreateTime(new Date());
             detailed.setCreateDept(String.valueOf(loginUser.getUser().getDeptId()));
+            detailed.setCreateDeptName(sysDeptMapper.selectDeptById(loginUser.getUser().getDeptId()).getDeptName());
             tCostManagementMapper.insertTCostManagement(detailed);
         } else {
             detailed.setUpdateBy(loginUser.getUser().getUserName());
@@ -147,9 +135,10 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         if (StringUtils.isNotNull(tCostManagementItem) && !"[]".equals(tCostManagementItem)) {
             JSONArray jsonDrArray = JSONArray.parseArray(tCostManagementItem);
             itemList = JSONObject.parseArray(jsonDrArray.toJSONString(), TCostManagementItem.class);
-
             for (TCostManagementItem item : itemList) {
+                item.setDepartmentName(sysDeptMapper.selectDeptById(item.getDepartmentId()).getDeptName());//所属部门名称
                 if (StringUtils.isNull(item.getfId())) {// 如果是新数据
+                    item.setfPid(detailed.getfId());
                     item.setCreateBy(loginUser.getUser().getUserName());
                     item.setCreateTime(new Date());
                     item.setCreateDept(String.valueOf(loginUser.getUser().getDeptId()));
@@ -184,8 +173,8 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         }
 
         map.put("tCostManagement",detailed);
-        map.put("itemList", itemList);
-        map.put("enclosuresList", enclosuresList);
+        map.put("tCostManagementItem", itemList);
+        map.put("tEnclosure", enclosuresList);
 
         return AjaxResult.success("成功", map);
     }
@@ -336,8 +325,8 @@ public class TCostManagementServiceImpl implements ITCostManagementService
             return approvalFlow;
         }
         map.put("tCostManagement",detailed);
-        map.put("itemList", itemList);
-        map.put("enclosuresList", enclosuresList);
+        map.put("tCostManagementItem", itemList);
+        map.put("tEnclosure", enclosuresList);
 
         return null;
     }

+ 179 - 0
ruoyi-anpin/src/main/resources/mapper/anpin/TContractManagementMapper.xml

@@ -0,0 +1,179 @@
+<?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.ruoyi.anpin.mapper.TContractManagementMapper">
+    
+    <resultMap type="TContractManagement" id="TContractManagementResult">
+        <result property="fId"    column="f_id"    />
+        <result property="fNo"    column="f_no"    />
+        <result property="contractNo"    column="contract_no"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="fStatus"    column="f_status"    />
+        <result property="content"    column="content"    />
+        <result property="copies"    column="copies"    />
+        <result property="creationDate"    column="creation_date"    />
+        <result property="fileType"    column="file_type"    />
+        <result property="submissionMethod"    column="submission_method"    />
+        <result property="submittingDepartmentId"    column="submitting_department_id"    />
+        <result property="submittingDepartmentName"    column="submitting_department_name"    />
+        <result property="issuingUnitId"    column="issuing_unit_id"    />
+        <result property="archiveTime"    column="archive_time"    />
+        <result property="validityMonth"    column="validity_month"    />
+        <result property="storagePeriodTime"    column="storage_period_time"    />
+        <result property="custodianId"    column="custodian_id"    />
+        <result property="custodianName"    column="custodian_name"    />
+        <result property="storageLocation"    column="storage_location"    />
+    </resultMap>
+
+    <sql id="selectTContractManagementVo">
+        select f_id, f_no, contract_no, create_by, create_time, update_by, update_time, remark, del_flag, f_status, content, copies, creation_date, file_type,
+               submission_method, submitting_department_id, submitting_department_name, issuing_unit_id, archive_time, validity_month, storage_period_time,
+               custodian_id, custodian_name, storage_location
+        from t_contract_management
+    </sql>
+
+    <select id="selectTContractManagementList" parameterType="TContractManagement" resultMap="TContractManagementResult">
+        <include refid="selectTContractManagementVo"/>
+        <where>
+            del_flag = 0
+            <if test="fNo != null  and fNo != ''"> and f_no like concat('%', #{fNo}, '%')</if>
+            <if test="contractNo != null  and contractNo != ''"> and contract_no like concat('%', #{contractNo}, '%')</if>
+            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="copies != null "> and copies = #{copies}</if>
+            <if test='creationDateList != null and creationDateList[0] != null and creationDateList[0]!= ""'>
+                and creation_date &gt;= #{creationDateList[0]}
+            </if>
+            <if test='creationDateList != null and creationDateList[1] != null and creationDateList[1]!= ""'>
+                and creation_date &lt;= #{creationDateList[1]}
+            </if>
+            <if test="fileType != null  and fileType != ''"> and file_type = #{fileType}</if>
+            <if test="submissionMethod != null  and submissionMethod != ''"> and submission_method = #{submissionMethod}</if>
+            <if test="submittingDepartmentId != null "> and submitting_department_id = #{submittingDepartmentId}</if>
+            <if test="submittingDepartmentName != null  and submittingDepartmentName != ''"> and submitting_department_name like concat('%', #{submittingDepartmentName}, '%')</if>
+            <if test="issuingUnitId != null "> and issuing_unit_id = #{issuingUnitId}</if>
+            <if test='archiveTimeList != null and archiveTimeList[0] != null and archiveTimeList[0]!= ""'>
+                and archive_time &gt;= #{archiveTimeList[0]}
+            </if>
+            <if test='archiveTimeList != null and archiveTimeList[1] != null and archiveTimeList[1]!= ""'>
+                and archive_time &lt;= #{archiveTimeList[1]}
+            </if>
+            <if test="validityMonth != null "> and validity_month = #{validityMonth}</if>
+            <if test="storagePeriodTime != null "> and storage_period_time = #{storagePeriodTime}</if>
+            <if test="custodianId != null "> and custodian_id = #{custodianId}</if>
+            <if test="custodianName != null  and custodianName != ''"> and custodian_name like concat('%', #{custodianName}, '%')</if>
+            <if test="storageLocation != null  and storageLocation != ''"> and storage_location = #{storageLocation}</if>
+        </where>
+    </select>
+    
+    <select id="selectTContractManagementById" parameterType="Long" resultMap="TContractManagementResult">
+        <include refid="selectTContractManagementVo"/>
+        where del_flag = 0
+        and f_id = #{fId}
+    </select>
+        
+    <insert id="insertTContractManagement" parameterType="TContractManagement" useGeneratedKeys="true" keyProperty="fId">
+        insert into t_contract_management
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fNo != null">f_no,</if>
+            <if test="contractNo != null">contract_no,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="fStatus != null and fStatus != ''">f_status,</if>
+            <if test="content != null">content,</if>
+            <if test="copies != null">copies,</if>
+            <if test="creationDate != null">creation_date,</if>
+            <if test="fileType != null">file_type,</if>
+            <if test="submissionMethod != null">submission_method,</if>
+            <if test="submittingDepartmentId != null">submitting_department_id,</if>
+            <if test="submittingDepartmentName != null">submitting_department_name,</if>
+            <if test="issuingUnitId != null">issuing_unit_id,</if>
+            <if test="archiveTime != null">archive_time,</if>
+            <if test="validityMonth != null">validity_month,</if>
+            <if test="storagePeriodTime != null">storage_period_time,</if>
+            <if test="custodianId != null">custodian_id,</if>
+            <if test="custodianName != null">custodian_name,</if>
+            <if test="storageLocation != null">storage_location,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fNo != null">#{fNo},</if>
+            <if test="contractNo != null">#{contractNo},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="fStatus != null and fStatus != ''">#{fStatus},</if>
+            <if test="content != null">#{content},</if>
+            <if test="copies != null">#{copies},</if>
+            <if test="creationDate != null">#{creationDate},</if>
+            <if test="fileType != null">#{fileType},</if>
+            <if test="submissionMethod != null">#{submissionMethod},</if>
+            <if test="submittingDepartmentId != null">#{submittingDepartmentId},</if>
+            <if test="submittingDepartmentName != null">#{submittingDepartmentName},</if>
+            <if test="issuingUnitId != null">#{issuingUnitId},</if>
+            <if test="archiveTime != null">#{archiveTime},</if>
+            <if test="validityMonth != null">#{validityMonth},</if>
+            <if test="storagePeriodTime != null">#{storagePeriodTime},</if>
+            <if test="custodianId != null">#{custodianId},</if>
+            <if test="custodianName != null">#{custodianName},</if>
+            <if test="storageLocation != null">#{storageLocation},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTContractManagement" parameterType="TContractManagement">
+        update t_contract_management
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fNo != null">f_no = #{fNo},</if>
+            <if test="contractNo != null">contract_no = #{contractNo},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="fStatus != null and fStatus != ''">f_status = #{fStatus},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="copies != null">copies = #{copies},</if>
+            <if test="creationDate != null">creation_date = #{creationDate},</if>
+            <if test="fileType != null">file_type = #{fileType},</if>
+            <if test="submissionMethod != null">submission_method = #{submissionMethod},</if>
+            <if test="submittingDepartmentId != null">submitting_department_id = #{submittingDepartmentId},</if>
+            <if test="submittingDepartmentName != null">submitting_department_name = #{submittingDepartmentName},</if>
+            <if test="issuingUnitId != null">issuing_unit_id = #{issuingUnitId},</if>
+            <if test="archiveTime != null">archive_time = #{archiveTime},</if>
+            <if test="validityMonth != null">validity_month = #{validityMonth},</if>
+            <if test="storagePeriodTime != null">storage_period_time = #{storagePeriodTime},</if>
+            <if test="custodianId != null">custodian_id = #{custodianId},</if>
+            <if test="custodianName != null">custodian_name = #{custodianName},</if>
+            <if test="storageLocation != null">storage_location = #{storageLocation},</if>
+        </trim>
+        where f_id = #{fId}
+    </update>
+
+    <update id="deleteTContractManagementById" parameterType="Long">
+        update t_contract_management
+        set del_flag = 1 where f_id = #{fId}
+    </update>
+
+    <update id="deleteTContractManagementByIds" parameterType="String">
+        update t_contract_management
+        set del_flag = 1
+        where f_id in
+        <foreach item="fId" collection="array" open="(" separator="," close=")">
+            #{fId}
+        </foreach>
+    </update>
+    
+</mapper>

+ 13 - 8
ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementItemMapper.xml

@@ -34,7 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTCostManagementItemList" parameterType="TCostManagementItem" resultMap="TCostManagementItemResult">
         <include refid="selectTCostManagementItemVo"/>
-        <where>  
+        <where>
+            del_flag = 0
             <if test="fPid != null "> and f_pid = #{fPid}</if>
             <if test="createDept != null  and createDept != ''"> and create_dept = #{createDept}</if>
             <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
@@ -54,7 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="selectTCostManagementItemById" parameterType="Long" resultMap="TCostManagementItemResult">
         <include refid="selectTCostManagementItemVo"/>
-        where f_id = #{fId}
+        where
+        del_flag = 0
+        and f_id = #{fId}
     </select>
         
     <insert id="insertTCostManagementItem" parameterType="TCostManagementItem" useGeneratedKeys="true" keyProperty="fId">
@@ -132,15 +135,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where f_id = #{fId}
     </update>
 
-    <delete id="deleteTCostManagementItemById" parameterType="Long">
-        delete from t_cost_management_item where f_id = #{fId}
-    </delete>
+    <update id="deleteTCostManagementItemById" parameterType="Long">
+        update t_cost_management_item set del_flag = 1
+        where f_id = #{fId}
+    </update>
 
-    <delete id="deleteTCostManagementItemByIds" parameterType="String">
-        delete from t_cost_management_item where f_id in 
+    <update id="deleteTCostManagementItemByIds" parameterType="String">
+        update t_cost_management_item set del_flag = 1
+        where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
-    </delete>
+    </update>
     
 </mapper>

+ 68 - 20
ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementMapper.xml

@@ -17,34 +17,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="deptName"    column="dept_name"    />
         <result property="createDept"    column="create_dept"    />
+        <result property="createDeptName"    column="create_dept_name"    />
         <result property="businessTime"    column="business_time"    />
         <result property="businessType"    column="business_type"    />
-        <result property="expenseTypr"    column="expense_typr"    />
+        <result property="expenseType"    column="expense_type"    />
         <result property="totalAmount"    column="total_amount"    />
     </resultMap>
 
     <sql id="selectTCostManagementVo">
-        select f_id, f_no, create_by, create_time, update_by, update_time, remark, del_flag, f_status, dept_id, dept_name, create_dept, business_time, business_type, expense_typr, total_amount from t_cost_management
+        select f_id, f_no, create_by, create_time, update_by, update_time, remark, del_flag, f_status, dept_id, dept_name,
+               create_dept, create_dept_name, business_time, business_type, expense_type, total_amount
+        from t_cost_management
     </sql>
 
     <select id="selectTCostManagementList" parameterType="TCostManagement" resultMap="TCostManagementResult">
         <include refid="selectTCostManagementVo"/>
-        <where>  
-            <if test="fNo != null  and fNo != ''"> and f_no = #{fNo}</if>
-            <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
+        <where>
+            del_flag = 0
+            <if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test='businessTimeList != null and businessTimeList[0] != null and businessTimeList[0]!= ""'>
+                and business_time &gt;= #{businessTimeList[0]}
+            </if>
+            <if test='businessTimeList != null and businessTimeList[1] != null and businessTimeList[1]!= ""'>
+                and business_time &lt;= #{businessTimeList[1]}
+            </if>
             <if test="createDept != null  and createDept != ''"> and create_dept = #{createDept}</if>
-            <if test="businessTime != null "> and business_time = #{businessTime}</if>
-            <if test="businessType != null  and businessType != ''"> and business_type = #{businessType}</if>
-            <if test="expenseTypr != null  and expenseTypr != ''"> and expense_typr = #{expenseTypr}</if>
-            <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
+            <if test="createDeptName != null  and createDeptName != ''"> and create_dept_name like concat('%', #{createDeptName}, '%')</if>
+            <if test="createBy != null  and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectManagementList" parameterType="TCostManagement" resultMap="TCostManagementResult">
+        select
+            TCM.f_id,
+            TCM.f_no,
+            TCM.f_status,
+            TCM.dept_id,
+            TCM.dept_name,
+            TCM.create_by,
+            TCM.create_dept,
+            TCM.create_dept_name,
+            TCM.business_time,
+            TCM.create_time,
+            TCM.total_amount,
+            TCM.remark
+        from t_cost_management TCM
+        LEFT JOIN t_cost_management_item TCMI ON TCMI.f_pid = TCM.f_id
+        <where>
+            TCM.del_flag = 0
+            <if test="deptId != null and deptId != ''"> and TCM.dept_id = #{deptId}</if>
+            <if test="deptName != null  and deptName != ''"> and TCM.dept_name like concat('%', #{deptName}, '%')</if>
+            <if test='businessTimeList != null and businessTimeList[0] != null and businessTimeList[0]!= ""'>
+                and TCM.business_time &gt;= #{businessTimeList[0]}
+            </if>
+            <if test='businessTimeList != null and businessTimeList[1] != null and businessTimeList[1]!= ""'>
+                and TCM.business_time &lt;= #{businessTimeList[1]}
+            </if>
+            <if test="createDept != null  and createDept != ''"> and TCM.create_dept = #{createDept}</if>
+            <if test="createDeptName != null  and createDeptName != ''"> and TCM.create_dept_name like concat('%', #{createDeptName}, '%')</if>
+            <if test="createBy != null  and createBy != ''"> and TCM.create_by like concat('%', #{createBy}, '%')</if>
+            <if test="itemExpenseId != null  and itemExpenseId != ''"> and TCMI.expense_id = #{itemExpenseId}</if>
+            <if test="itemDepartmentName != null  and itemDepartmentName != ''"> and TCMI.department_name like concat('%', #{itemDepartmentName}, '%')</if>
+            <if test="itemPersonnelName != null  and itemPersonnelName != ''"> and TCMI.personnel_name like concat('%', #{itemPersonnelName}, '%')</if>
+            <if test="itemMatterName != null  and itemMatterName != ''"> and TCMI.matter_name like concat('%', #{itemMatterName}, '%')</if>
         </where>
     </select>
     
     <select id="selectTCostManagementById" parameterType="Long" resultMap="TCostManagementResult">
         <include refid="selectTCostManagementVo"/>
-        where f_id = #{fId}
+        where del_flag = 0
+        and f_id = #{fId}
     </select>
         
     <insert id="insertTCostManagement" parameterType="TCostManagement" useGeneratedKeys="true" keyProperty="fId">
@@ -63,8 +106,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createDept != null">create_dept,</if>
             <if test="businessTime != null">business_time,</if>
             <if test="businessType != null">business_type,</if>
-            <if test="expenseTypr != null">expense_typr,</if>
+            <if test="expenseType != null">expense_type,</if>
             <if test="totalAmount != null">total_amount,</if>
+            <if test="createDeptName != null">create_dept_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fNo != null">#{fNo},</if>
@@ -80,8 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createDept != null">#{createDept},</if>
             <if test="businessTime != null">#{businessTime},</if>
             <if test="businessType != null">#{businessType},</if>
-            <if test="expenseTypr != null">#{expenseTypr},</if>
+            <if test="expenseType != null">#{expenseType},</if>
             <if test="totalAmount != null">#{totalAmount},</if>
+            <if test="createDeptName != null">#{createDeptName},</if>
          </trim>
     </insert>
 
@@ -101,21 +146,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createDept != null">create_dept = #{createDept},</if>
             <if test="businessTime != null">business_time = #{businessTime},</if>
             <if test="businessType != null">business_type = #{businessType},</if>
-            <if test="expenseTypr != null">expense_typr = #{expenseTypr},</if>
+            <if test="expenseType != null">expense_type = #{expenseType},</if>
             <if test="totalAmount != null">total_amount = #{totalAmount},</if>
         </trim>
         where f_id = #{fId}
     </update>
 
-    <delete id="deleteTCostManagementById" parameterType="Long">
-        delete from t_cost_management where f_id = #{fId}
-    </delete>
+    <update id="deleteTCostManagementById" parameterType="Long">
+        update t_cost_management set del_flag = 1
+        where f_id = #{fId}
+    </update>
 
-    <delete id="deleteTCostManagementByIds" parameterType="String">
-        delete from t_cost_management where f_id in 
+    <update id="deleteTCostManagementByIds" parameterType="String">
+        update t_cost_management
+        set del_flag = 1
+        where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
-    </delete>
+    </update>
     
 </mapper>

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/mapper/TFeesMapper.java

@@ -94,4 +94,12 @@ public interface TFeesMapper {
      * @return 费用信息集合
      */
     public List<TFees> selectTFeesAnPinList(TFees tFees);
+
+    /**
+     * 根据物料类别查询查询费用信息列表
+     *
+     * @param feesType 费用信息
+     * @return 费用信息
+     */
+    public List<TFees> selectFeesTypeList(String feesType);
 }

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/ITFeesService.java

@@ -79,4 +79,12 @@ public interface ITFeesService {
      * @return 费用信息集合
      */
     public List<TFees> selectTFeesAnPinList(TFees tFees);
+
+    /**
+     * 根据物料类别查询查询费用信息列表
+     *
+     * @param feesType 物资类别
+     * @return 费用信息集合
+     */
+    public AjaxResult selectFeesTypeList(String feesType);
 }

+ 12 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TFeesServiceImpl.java

@@ -154,4 +154,16 @@ public class TFeesServiceImpl implements ITFeesService {
     public List<TFees> selectTFeesAnPinList(TFees tFees) {
         return tFeesMapper.selectTFeesAnPinList(tFees);
     }
+
+    /**
+     * 根据物料类别查询查询费用信息列表
+     *
+     * @param feesType 费用信息
+     * @return 费用信息
+     */
+    @Override
+    public AjaxResult selectFeesTypeList(String feesType) {
+        List<TFees> list = tFeesMapper.selectFeesTypeList(feesType);
+        return AjaxResult.success(list);
+    }
 }

+ 13 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TEnclosure.java

@@ -60,6 +60,19 @@ public class TEnclosure extends BaseEntity {
      */
     private String delFlag;
 
+    /**
+     * 文件属性
+     */
+    private String fType;
+
+    public String getfType() {
+        return fType;
+    }
+
+    public void setfType(String fType) {
+        this.fType = fType;
+    }
+
     public void setfId(Long fId) {
         this.fId = fId;
     }

+ 7 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TFeesMapper.xml

@@ -235,4 +235,11 @@
         ORDER BY CONVERT(f_name USING gbk) asc
     </select>
 
+    <select id="selectFeesTypeList" parameterType="String" resultMap="TFeesResult">
+        <include refid="selectTFeesVo"/>
+        <where>
+            <if test="fFeetype != null  and fFeetype != ''">and f_feetype = #{feesType}</if>
+        </where>
+    </select>
+
 </mapper>

+ 4 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TEnclosureMapper.xml

@@ -18,10 +18,11 @@
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
         <result property="remark" column="remark"/>
+        <result property="fType" column="f_type"/>
     </resultMap>
 
     <sql id="selectTEnclosureVo">
-        select f_id, f_pid, f_lineno, f_name, f_desc, f_url, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_enclosure
+        select f_id, f_pid, f_lineno, f_name, f_desc, f_url, f_status, del_flag, create_by, create_time, update_by, update_time, remark, f_type from t_enclosure
     </sql>
 
     <select id="selectTEnclosureList" parameterType="TEnclosure" resultMap="TEnclosureResult">
@@ -68,6 +69,7 @@
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="fType != null">f_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
@@ -82,6 +84,7 @@
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="fType != null">#{fType},</if>
         </trim>
     </insert>