ly 1 vuosi sitten
vanhempi
säilyke
718ebd3d5e
17 muutettua tiedostoa jossa 465 lisäystä ja 19 poistoa
  1. 1 1
      src/main/java/cn/ezhizao/framework/lock/LockKey.java
  2. 32 3
      src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/controller/BizFinancialIndividualIncomeTaxDetailController.java
  3. 4 0
      src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/domain/BizFinancialIndividualIncomeTaxDetail.java
  4. 35 3
      src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTaxIsZero/controller/BizFinancialIndividualIncomeTaxDetailIsZeroController.java
  5. 64 0
      src/main/java/cn/ezhizao/project/business/history/controller/BizHistoryController.java
  6. 54 0
      src/main/java/cn/ezhizao/project/business/history/domain/BizHistory.java
  7. 30 0
      src/main/java/cn/ezhizao/project/business/history/mapper/BizHistoryMapper.java
  8. 31 0
      src/main/java/cn/ezhizao/project/business/history/service/IBizHistoryService.java
  9. 47 0
      src/main/java/cn/ezhizao/project/business/history/service/impl/BizHistoryServiceImpl.java
  10. 19 2
      src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundDeclareController.java
  11. 20 1
      src/main/java/cn/ezhizao/project/business/reportTax/controller/BizFinancialReportTaxNonZeroController.java
  12. 41 4
      src/main/java/cn/ezhizao/project/business/reportTaxIsZero/controller/BizFinancialReportTaxController.java
  13. 5 0
      src/main/java/cn/ezhizao/project/business/reportTaxIsZero/domain/BizFinancialReportTaxDetail.java
  14. 1 1
      src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryController.java
  15. 35 4
      src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityDeclareController.java
  16. 4 0
      src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclareDetail.java
  17. 42 0
      src/main/resources/mybatis/business/BizHistoryMapper.xml

+ 1 - 1
src/main/java/cn/ezhizao/framework/lock/LockKey.java

@@ -20,7 +20,7 @@ public class LockKey {
     public static final String SALARYZERO = "lock:salaryZero";
     public static final String SALARY = "lock:salary";
     public static final String INCOMETAX = "lock:incomeTax";
-    public static final String INCOMETAXZero = "lock:incomeTaxZero";
+    public static final String INCOMETAXZERO = "lock:incomeTaxZero";
     public static final String VERIFYNOZERO = "lock:incomeTaxZero";
 
 }

+ 32 - 3
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/controller/BizFinancialIndividualIncomeTaxDetailController.java

@@ -14,6 +14,8 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
 import cn.ezhizao.project.business.company.service.IBizCompanyService;
 import cn.ezhizao.project.business.deduction.domain.BizDeduction;
 import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
 import cn.ezhizao.project.business.finance.IndividualIncomeTax.domain.BizFinancialIndividualIncomeTax;
 import cn.ezhizao.project.business.finance.IndividualIncomeTax.domain.BizFinancialIndividualIncomeTaxDetail;
 import cn.ezhizao.project.business.finance.IndividualIncomeTax.service.IBizFinancialIndividualIncomeTaxDetailService;
@@ -22,6 +24,8 @@ import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizF
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxDetailIsZeroService;
 import cn.ezhizao.project.business.financialBase.domain.BizFinancialMerge;
 import cn.ezhizao.project.business.financialBase.service.IBizFinancialMergeService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTaxDetail;
 import cn.ezhizao.project.business.reportTaxIsZero.service.IBizFinancialReportTaxDetailService;
 import cn.ezhizao.project.business.reportTaxIsZero.service.IBizFinancialReportTaxService;
@@ -81,12 +85,13 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
     private ISysFileStorageService fileStorageService;
 
     @Resource
-    private IBizFinancialMergeService bizFinancialMergeService;
+    private IBizEntrustService bizEntrustService;
 
     @Resource
     IBizCompanyService companyService;
 
-
+    @Resource
+    private IBizHistoryService bizHistoryService;
     /**
      * 查询个税详情列表
      */
@@ -147,6 +152,14 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
                 return success(biz);
             }
         }
+        Long id = biz.getFinancialIndividualIncomeTaxId();
+        Long workOrderId = bizFinancialIndividualIncomeTaxService.getById(id).getWorkOrderId();
+        String s3 = year +"-"+ month+ "-01";
+        BizEntrust one = bizEntrustService.getOne(new LambdaQueryWrapper<BizEntrust>()
+                .eq(BizEntrust::getWorkOrderId, workOrderId)
+                .eq(BizEntrust::getDeleted, 0)
+                .eq(BizEntrust::getCurrentMonth, s3 ));
+        biz.setEntrust(one);
         biz.setReportFiles(bizFinancialIndividualIncomeTaxDetailService.getFiles(biz.getId()));
         return success(biz);
     }
@@ -208,7 +221,13 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
             delConditions.setMasterTableName("biz_financial_individual_income_tax_detail");
             fileStorageService.physicalDelete(delConditions);
             bool = bool && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages));
-
+            BizHistory bizHistory = new BizHistory();
+            bizHistory.setTableName("biz_financial_individual_income_tax");
+            bizHistory.setCompanyId(bizFinancialIndividualIncomeTaxDetail.getCompanyId());
+            bizHistory.setEvent("保存");
+            bizHistory.setTenantId(getTenantId());
+            bizHistory.setBelongPeriod(bizFinancialIndividualIncomeTaxDetail.getYear() + "-" + String.format("%02d", Integer.valueOf(bizFinancialIndividualIncomeTaxDetail.getMonth())));
+            bizHistoryService.save(bizHistory);
             return toAjax(addRecord(bizFinancialIndividualIncomeTaxDetail.getFinancialIndividualIncomeTaxId(),
                     bizFinancialIndividualIncomeTaxDetail.getYear(), bizFinancialIndividualIncomeTaxDetail.getMonth(), SecurityUtils.getUserId(), status) && bool);
         } catch (Exception e) {
@@ -314,6 +333,16 @@ public class BizFinancialIndividualIncomeTaxDetailController extends BaseControl
                 }
             }
         }
+        //非零申报
+        BizHistory bizHistory2 = new BizHistory();
+        bizHistory2.setTableName("biz_financial_individual_income_tax");
+        bizHistory2.setCompanyId(detail.getCompanyId());
+        bizHistory2.setEvent("退回");
+        bizHistory2.setTenantId(getTenantId());
+        bizHistory2.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+        bizHistoryService.save(bizHistory2);
+
+
         return bizFinancialIndividualIncomeTaxDetailService.updateById(detail) ? success() : error();
     }
 

+ 4 - 0
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTax/domain/BizFinancialIndividualIncomeTaxDetail.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.finance.IndividualIncomeTax.domain;
 
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
 import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTaxDetailReport;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -82,4 +83,7 @@ public class BizFinancialIndividualIncomeTaxDetail extends BaseEntity implements
     private String currentMonth;
 
     private Date verifierTime;
+
+    @TableField(exist = false)
+    private BizEntrust entrust;
 }

+ 35 - 3
src/main/java/cn/ezhizao/project/business/finance/IndividualIncomeTaxIsZero/controller/BizFinancialIndividualIncomeTaxDetailIsZeroController.java

@@ -11,9 +11,12 @@ import cn.ezhizao.framework.lock.LockKey;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxIsZeroService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.workOrder.domain.BizWorkOrderRecord;
 import cn.ezhizao.project.business.workOrder.service.IBizWorkOrderRecordService;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -48,6 +51,9 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
     @Resource
     private IBizWorkOrderRecordService bizWorkOrderRecordService;
 
+    @Resource
+    private IBizHistoryService bizHistoryService;
+
 
     /**
      * 查询个税详情列表
@@ -91,7 +97,7 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
     @PostMapping
     public AjaxResult add(@RequestBody BizFinancialIndividualIncomeTaxDetailIsZero bizFinancialIndividualIncomeTaxDetail) throws NoSuchFieldException, IllegalAccessException {
 
-        String join = LockKey.join(LockKey.INCOMETAXZero, getUserId());
+        String join = LockKey.join(LockKey.INCOMETAXZERO, getUserId());
         DistributionLock lock = new DistributionLock(join);
 
         try {
@@ -111,6 +117,15 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
             }
             bizFinancialIndividualIncomeTaxDetail.setVerifierId(getUserId());
             bizFinancialIndividualIncomeTaxDetail.setVerifierTime(new Date());
+
+            //零申报
+            BizHistory bizHistory = new BizHistory();
+            bizHistory.setTableName("biz_financial_individual_income_tax_zero");
+            bizHistory.setCompanyId(bizFinancialIndividualIncomeTaxDetail.getCompanyId());
+            bizHistory.setEvent("保存");
+            bizHistory.setTenantId(getTenantId());
+            bizHistory.setBelongPeriod(bizFinancialIndividualIncomeTaxDetail.getYear() + "-" +String.format("%02d", Integer.valueOf(bizFinancialIndividualIncomeTaxDetail.getMonth())));
+            bizHistoryService.save(bizHistory);
             return toAjax(bizFinancialIndividualIncomeTaxDetailService.save(bizFinancialIndividualIncomeTaxDetail) && addRecord(bizFinancialIndividualIncomeTaxDetail.getCompanyId(), bizFinancialIndividualIncomeTaxDetail.getFinancialIndividualIncomeTaxId(),
 
                     bizFinancialIndividualIncomeTaxDetail.getYear(), bizFinancialIndividualIncomeTaxDetail.getMonth(), SecurityUtils.getUserId(), status));
@@ -120,8 +135,6 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
         } finally {
             lock.unlock();
         }
-
-
     }
 
 
@@ -131,6 +144,7 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
     @PreAuthorize("@ss.hasPermi('business:individualIncomeTaxDetail:saveDetail')")
     @Log(title = "个税详情", businessType = BusinessType.UPDATE)
     @PutMapping
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult edit(@RequestBody BizFinancialIndividualIncomeTaxDetailIsZero bizFinancialIndividualIncomeTaxDetail) throws NoSuchFieldException, IllegalAccessException {
 
         String status = "";
@@ -140,14 +154,32 @@ public class BizFinancialIndividualIncomeTaxDetailIsZeroController extends BaseC
                 break;
             case 1:
                 status = "个税进行中";
+                //零申报
+                BizHistory bizHistory = new BizHistory();
+                bizHistory.setTableName("biz_financial_individual_income_tax_zero");
+                bizHistory.setCompanyId(bizFinancialIndividualIncomeTaxDetail.getCompanyId());
+                bizHistory.setBelongPeriod(bizFinancialIndividualIncomeTaxDetail.getYear() + "-" + String.format("%02d", Integer.valueOf(bizFinancialIndividualIncomeTaxDetail.getMonth())) );
+                bizHistory.setEvent("退回");
+                bizHistory.setTenantId(getTenantId());
+                bizHistoryService.save(bizHistory);
                 break;
             case 3:
                 status = "个税已完成";
+                //零申报
+                BizHistory bizHistory2 = new BizHistory();
+                bizHistory2.setTableName("biz_financial_individual_income_tax_zero");
+                bizHistory2.setCompanyId(bizFinancialIndividualIncomeTaxDetail.getCompanyId());
+                bizHistory2.setEvent("保存");
+                bizHistory2.setTenantId(getTenantId());
+                bizHistory2.setBelongPeriod(bizFinancialIndividualIncomeTaxDetail.getYear() + "-" + String.format("%02d", Integer.valueOf(bizFinancialIndividualIncomeTaxDetail.getMonth())) );
+                bizHistoryService.save(bizHistory2);
                 break;
 
         }
         bizFinancialIndividualIncomeTaxDetail.setVerifierId(getUserId());
         bizFinancialIndividualIncomeTaxDetail.setVerifierTime(new Date());
+
+
         return toAjax(bizFinancialIndividualIncomeTaxDetailService.updateById(bizFinancialIndividualIncomeTaxDetail) && addRecord(bizFinancialIndividualIncomeTaxDetail.getCompanyId(), bizFinancialIndividualIncomeTaxDetail.getFinancialIndividualIncomeTaxId(),
 
                 bizFinancialIndividualIncomeTaxDetail.getYear(), bizFinancialIndividualIncomeTaxDetail.getMonth(), SecurityUtils.getUserId(), status));

+ 64 - 0
src/main/java/cn/ezhizao/project/business/history/controller/BizHistoryController.java

@@ -0,0 +1,64 @@
+package cn.ezhizao.project.business.history.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+
+/**
+ * 企业租户Controller
+ *
+ * @author ruoyi
+ * @date 2024-09-09
+ */
+@RestController
+@RequestMapping("/business/history")
+public class BizHistoryController extends BaseController
+{
+    @Resource
+    private IBizHistoryService bizHistoryService;
+
+    /**
+     * 查询
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(BizHistory bizHistory) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizHistory);
+        startPage();
+        List<BizHistory> list = bizHistoryService.getList(bizHistory);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出
+     */
+    @Log(title = "企业租户", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizHistory bizHistory) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizHistory);
+        List<BizHistory> list = bizHistoryService.getList(bizHistory);
+        ExcelUtil<BizHistory> util = new ExcelUtil<BizHistory>(BizHistory.class);
+        util.exportExcel(response, list, "企业租户数据");
+    }
+
+
+
+}

+ 54 - 0
src/main/java/cn/ezhizao/project/business/history/domain/BizHistory.java

@@ -0,0 +1,54 @@
+package cn.ezhizao.project.business.history.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+
+import java.util.List;
+
+/**
+ * 企业租户对象 biz_history
+ *
+ * @author ruoyi
+ * @date 2024-09-09
+ */
+@Data
+@TableName(value = "biz_history")
+public class BizHistory extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 表名 */
+    @Excel(name = "表名")
+    @ApiModelProperty(value = "表名")
+    private String tableName;
+
+    /** 公司id */
+    @ApiModelProperty(value = "表名")
+    private Long companyId;
+
+    /** 操作 */
+    @Excel(name = "操作")
+    @ApiModelProperty(value = "操作")
+    private String event;
+
+    /** 租户id */
+    @ApiModelProperty(value = "租户id")
+    private Long tenantId;
+
+    private  String belongPeriod;
+    private String reason;
+
+    @TableField(exist = false)
+    private String userName;
+
+    @TableField(exist = false)
+    private String tenantName;
+    @TableField(exist = false)
+    private String currentMonth;
+    @TableField(exist = false)
+    private List<String> dateFilter;
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/history/mapper/BizHistoryMapper.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.history.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 企业租户Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-09-09
+ */
+public interface BizHistoryMapper extends BaseMapper<BizHistory>
+{
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizHistory 企业租户
+     * @return 企业租户集合
+     */
+    public List<BizHistory> getList(BizHistory bizHistory);
+
+    /**
+     * 物理删除
+     * @param bizHistory
+     * @return 删除结果
+    */
+    public int physicalDelete(BizHistory bizHistory);
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/history/service/IBizHistoryService.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.history.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 企业租户Service接口
+ *
+ * @author ruoyi
+ * @date 2024-09-09
+ */
+public interface IBizHistoryService extends IService<BizHistory>
+{
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizHistory 企业租户
+     * @return 企业租户集合
+     */
+    public List<BizHistory> getList(BizHistory bizHistory);
+
+    /**
+     * 物理删除
+     * @param bizHistory
+     * @return 删除结果
+     */
+    public int physicalDelete(BizHistory bizHistory);
+
+}

+ 47 - 0
src/main/java/cn/ezhizao/project/business/history/service/impl/BizHistoryServiceImpl.java

@@ -0,0 +1,47 @@
+package cn.ezhizao.project.business.history.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.mapper.BizHistoryMapper;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 企业租户Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-09-09
+ */
+@Service
+public class BizHistoryServiceImpl extends ServiceImpl<BizHistoryMapper, BizHistory> implements IBizHistoryService {
+    @Resource
+    private BizHistoryMapper bizHistoryMapper;
+
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizHistory 企业租户
+     * @return 企业租户
+     */
+    @Override
+    public List<BizHistory> getList(BizHistory bizHistory) {
+        return bizHistoryMapper.getList(bizHistory);
+    }
+
+    /**
+     * 物理删除
+     *
+     * @param bizHistory
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizHistory bizHistory) {
+        return bizHistoryMapper.physicalDelete(bizHistory);
+    }
+
+    ;
+
+}

+ 19 - 2
src/main/java/cn/ezhizao/project/business/housingFund/controller/BizHousingFundDeclareController.java

@@ -11,6 +11,8 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
 import cn.ezhizao.project.business.company.service.IBizCompanyService;
 import cn.ezhizao.project.business.deduction.domain.BizDeduction;
 import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundDeclare;
@@ -34,7 +36,6 @@ import com.alibaba.excel.write.metadata.fill.FillConfig;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.ResourceLoader;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -79,8 +80,10 @@ public class BizHousingFundDeclareController extends BaseController {
     IBizDeductionService deductionService;
     @Resource
     IBizWorkOrderRecordService bizWorkOrderRecordService;
+
+
     @Resource
-    ResourceLoader resourceLoader;
+    private IBizHistoryService bizHistoryService;
 
     @ApiOperation(value = "根据id查询", notes = "根据id查询")
     @GetMapping("/getById/{id}")
@@ -369,6 +372,13 @@ public class BizHousingFundDeclareController extends BaseController {
         delCondition.setMasterId(detail.getId());
         delCondition.setMasterTableName("biz_housing_fund_declare_detail");
         fileStorageService.physicalDelete(delCondition);
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_housing_fund_declare");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setEvent("保存");
+        bizHistory.setTenantId(getTenantId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
+        bizHistoryService.save(bizHistory);
         bool = bool && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages)) && addRecord(detail.getHousingFundDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "公积金申报保存" : "公积金申报完成", detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? 1 : 3);
         return bool ? success(detail) : error();
     }
@@ -472,6 +482,13 @@ public class BizHousingFundDeclareController extends BaseController {
         if (deductions.stream().anyMatch(v -> v.getStatus().equals(2))) {
             return error("该公积金记录已扣款");
         }
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_housing_fund_declare");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setEvent("退回");
+        bizHistory.setTenantId(getTenantId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
+        bizHistoryService.save(bizHistory);
         deductionService.removeBatchByIds(deductions.stream().map(BizDeduction::getId).collect(Collectors.toList()));
         return housingFundDeclareDetailService.updateById(detail) && addRecord(detail.getHousingFundDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), "公积金申报退回", 1) ? success() : error();
     }

+ 20 - 1
src/main/java/cn/ezhizao/project/business/reportTax/controller/BizFinancialReportTaxNonZeroController.java

@@ -17,6 +17,8 @@ import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizF
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxDetailIsZeroService;
 import cn.ezhizao.project.business.financialBase.domain.BizFinancialMerge;
 import cn.ezhizao.project.business.financialBase.service.IBizFinancialMergeService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.reportTax.domain.BizFinancialReportTaxNonZero;
 import cn.ezhizao.project.business.reportTax.domain.BizFinancialReportTaxDetailNonZero;
 import cn.ezhizao.project.business.reportTax.domain.BizFinancialReportTaxDetailReportNonZero;
@@ -31,6 +33,7 @@ import cn.ezhizao.project.system.domain.SysFileStorage;
 import cn.ezhizao.project.system.domain.SysUser;
 import cn.ezhizao.project.system.mapper.SysUserMapper;
 import cn.ezhizao.project.system.service.ISysFileStorageService;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -79,6 +82,8 @@ public class BizFinancialReportTaxNonZeroController extends BaseController {
     IBizDeductionService deductionService;
     @Resource
     IBizCompanyService companyService;
+    @Resource
+    IBizHistoryService bizHistoryService;
 
 
 
@@ -128,6 +133,7 @@ public class BizFinancialReportTaxNonZeroController extends BaseController {
     @PreAuthorize("@ss.hasPermi('business:financialReportTaxNonZero:saveDetail')")
     @PostMapping("/saveDetail")
     @ResponseBody
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult saveDetail(@RequestBody BizFinancialReportTaxDetail detail) {
         detail.setVerifierTime(new Date());
         detail.setVerifierId(getUserId());
@@ -158,7 +164,13 @@ public class BizFinancialReportTaxNonZeroController extends BaseController {
             l.setMasterId(detail.getId());
             l.setMasterTableName("biz_financial_report_tax_detail");
         });
-
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_financial_report_tax");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+        bizHistory.setEvent("保存");
+        bizHistory.setTenantId(getTenantId());
+        bizHistoryService.save(bizHistory);
         bool = bool && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages));
         return bool ? success(detail) : error();
     }
@@ -527,6 +539,13 @@ public class BizFinancialReportTaxNonZeroController extends BaseController {
                 }
             }
         }
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_financial_report_tax");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+        bizHistory.setEvent("退回");
+        bizHistory.setTenantId(getTenantId());
+        bizHistoryService.save(bizHistory);
         return financialReportTaxDetaiIsZerolService.updateById(detail) ? success() : error();
     }
 

+ 41 - 4
src/main/java/cn/ezhizao/project/business/reportTaxIsZero/controller/BizFinancialReportTaxController.java

@@ -11,12 +11,16 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
 import cn.ezhizao.project.business.company.service.IBizCompanyService;
 import cn.ezhizao.project.business.deduction.domain.BizDeduction;
 import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
 import cn.ezhizao.project.business.finance.IndividualIncomeTax.domain.BizFinancialIndividualIncomeTaxDetail;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxDetailIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.domain.BizFinancialIndividualIncomeTaxIsZero;
 import cn.ezhizao.project.business.finance.IndividualIncomeTaxIsZero.service.IBizFinancialIndividualIncomeTaxDetailIsZeroService;
 import cn.ezhizao.project.business.financialBase.domain.BizFinancialMerge;
 import cn.ezhizao.project.business.financialBase.service.IBizFinancialMergeService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTaxDetail;
 import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTax;
 import cn.ezhizao.project.business.reportTaxIsZero.domain.BizFinancialReportTaxDetailReport;
@@ -27,6 +31,7 @@ import cn.ezhizao.project.system.domain.SysFileStorage;
 import cn.ezhizao.project.system.domain.SysUser;
 import cn.ezhizao.project.system.mapper.SysUserMapper;
 import cn.ezhizao.project.system.service.ISysFileStorageService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -56,7 +61,8 @@ public class BizFinancialReportTaxController extends BaseController {
     IBizFinancialIndividualIncomeTaxDetailIsZeroService financialIndividualIncomeTaxDetailService;
     @Resource
     IBizFinancialReportTaxDetailReportService financialReportTaxDetailReportService;
-
+    @Resource
+    private IBizHistoryService bizHistoryService;
     @Resource
     private SysUserMapper sysUserMapper;
     @Resource
@@ -65,7 +71,8 @@ public class BizFinancialReportTaxController extends BaseController {
     IBizDeductionService deductionService;
     @Resource
     IBizCompanyService companyService;
-
+    @Resource
+    private IBizEntrustService bizEntrustService;
     @ApiOperation(value = "查询FinancialReceiveTicket", notes = "根据id查询Channel")
     @GetMapping("/getById/{id}")
     @ResponseBody
@@ -104,7 +111,14 @@ public class BizFinancialReportTaxController extends BaseController {
         if (detail==null  ) {
             return error("当前月未找到数据");
         }
-
+        Long fatherId = detail.getFinancialReportTaxId();
+        Long workOrderId = financialReportTaxService.getById(fatherId).getWorkOrderId();
+        String s3 = year +"-"+ month+ "-01";
+        BizEntrust one = bizEntrustService.getOne(new LambdaQueryWrapper<BizEntrust>()
+                .eq(BizEntrust::getWorkOrderId, workOrderId)
+                .eq(BizEntrust::getDeleted, 0)
+                .eq(BizEntrust::getCurrentMonth, s3 ));
+        detail.setEntrust(one);
         return success(detail);
     }
 
@@ -112,6 +126,7 @@ public class BizFinancialReportTaxController extends BaseController {
     @PostMapping("/saveDetail")
     @PreAuthorize("@ss.hasPermi('business:financialReportTax:saveDetail')")
     @Log(title = "报税零申报", businessType = BusinessType.UPDATE)
+    @Transactional(rollbackFor = Exception.class)
     @ResponseBody
     public AjaxResult saveDetail(@RequestBody BizFinancialReportTaxDetail detail) {
         detail.setVerifierId(getUserId());
@@ -142,7 +157,14 @@ public class BizFinancialReportTaxController extends BaseController {
             l.setMasterId(detail.getId());
             l.setMasterTableName("biz_financial_report_tax_detail");
         });
-
+        //零申报
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_financial_report_tax_zero");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+        bizHistory.setEvent("保存");
+        bizHistory.setTenantId(getTenantId());
+        bizHistoryService.save(bizHistory);
         bool = bool && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages));
         return bool ? success(detail) : error();
     }
@@ -176,10 +198,18 @@ public class BizFinancialReportTaxController extends BaseController {
                     case 1:
                         l.setStatusText("进行中");
                         l.setMakeOut("进行中");
+
                         break;
                     case 3:
                         l.setStatusText("已完成");
                         l.setMakeOut("已填写");
+                        BizHistory bizHistory2 = new BizHistory();
+                        bizHistory2.setTableName("biz_financial_report_tax_zero");
+                        bizHistory2.setCompanyId(detail.getCompanyId());
+                        bizHistory2.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+                        bizHistory2.setEvent("保存");
+                        bizHistory2.setTenantId(getTenantId());
+                        bizHistoryService.save(bizHistory2);
                         break;
                     default:
                         break;
@@ -507,6 +537,13 @@ public class BizFinancialReportTaxController extends BaseController {
                 }
             }
         }
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_financial_report_tax_zero");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" + String.format("%02d", Integer.valueOf(detail.getMonth())) );
+        bizHistory.setEvent("退回");
+        bizHistory.setTenantId(getTenantId());
+        bizHistoryService.save(bizHistory);
         return financialReportTaxDetailService.updateById(detail) ? success() : error();
     }
 

+ 5 - 0
src/main/java/cn/ezhizao/project/business/reportTaxIsZero/domain/BizFinancialReportTaxDetail.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.reportTaxIsZero.domain;
 
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
@@ -90,5 +91,9 @@ public class BizFinancialReportTaxDetail extends BaseEntity {
     @TableField(exist = false)
     private String companyName;
 
+    @TableField(exist = false)
+    private BizEntrust entrust;
+
+
     private Date verifierTime;
 }

+ 1 - 1
src/main/java/cn/ezhizao/project/business/salary/controller/BizFinancialSalaryController.java

@@ -372,7 +372,7 @@ public class BizFinancialSalaryController extends BaseController {
     @Log(title = "生产管理-工资非零申报-新增", businessType = BusinessType.INSERT)
     @Transactional(rollbackFor = Exception.class)
     public AjaxResult saveDetail(@RequestBody BizFinancialSalaryDetail bizFinancialSalaryDetail) {
-        String join = LockKey.join(LockKey.SALARYZERO, getUserId());
+        String join = LockKey.join(LockKey.SALARY, getUserId());
         DistributionLock lock = new DistributionLock(join);
         try {
             lock.lock();

+ 35 - 4
src/main/java/cn/ezhizao/project/business/socialSecurity/controller/SocialSecurityDeclareController.java

@@ -11,6 +11,10 @@ import cn.ezhizao.project.business.company.domain.BizCompany;
 import cn.ezhizao.project.business.company.service.IBizCompanyService;
 import cn.ezhizao.project.business.deduction.domain.BizDeduction;
 import cn.ezhizao.project.business.deduction.service.IBizDeductionService;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
+import cn.ezhizao.project.business.history.domain.BizHistory;
+import cn.ezhizao.project.business.history.service.IBizHistoryService;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetail;
 import cn.ezhizao.project.business.housingFund.domain.BizHousingFundConfirmDetailEmployee;
 import cn.ezhizao.project.business.housingFund.domain.vo.EmployeeExcel;
@@ -34,6 +38,7 @@ import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.metadata.fill.FillConfig;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.catalina.security.SecurityUtil;
@@ -82,7 +87,11 @@ public class SocialSecurityDeclareController extends BaseController {
     IBizDeductionService deductionService;
     @Resource
     IBizWorkOrderRecordService bizWorkOrderRecordService;
+    @Resource
+    private IBizEntrustService bizEntrustService;
 
+    @Resource
+    private IBizHistoryService bizHistoryService;
     @ApiOperation(value = "根据id查询", notes = "根据id查询")
     @GetMapping("/getById/{id}")
     @ResponseBody
@@ -379,9 +388,6 @@ public class SocialSecurityDeclareController extends BaseController {
         String month = condition.getMonth();
         String s1 = year + month;
         String s2 = nowYear + formattedMonth;
-//        if(s1.equals(s2) && socialSecurityConfirmDetails .isEmpty()){
-//            return success(new BizSocialSecurityDeclareDetail());
-//        }
         if (!s1.equals(s2) && socialSecurityConfirmDetails.isEmpty()) {
             return error("当前月未找到数据");
         }
@@ -410,7 +416,17 @@ public class SocialSecurityDeclareController extends BaseController {
             condition.setIsFirstSocialSecurity(company.getIsFirstSocialSecurity());
             return success(condition);
         }
-        return success(socialSecurityConfirmDetails.get(0));
+        Long id = condition.getSocialSecurityDeclareId();
+        Long workOrderId = socialSecurityDeclareService.getById(id).getWorkOrderId();
+        String s3 = year +"-"+ month+ "-01";
+        BizEntrust one = bizEntrustService.getOne(new LambdaQueryWrapper<BizEntrust>()
+                .eq(BizEntrust::getWorkOrderId, workOrderId)
+                .eq(BizEntrust::getDeleted, 0)
+                .eq(BizEntrust::getCurrentMonth, s3 ));
+        BizSocialSecurityDeclareDetail bizSocialSecurityDeclareDetail = socialSecurityConfirmDetails.get(0);
+        bizSocialSecurityDeclareDetail.setEntrust(one);
+
+        return success(bizSocialSecurityDeclareDetail);
     }
 
 
@@ -419,6 +435,7 @@ public class SocialSecurityDeclareController extends BaseController {
     @PostMapping("/saveDetail")
     @Log(title = "社保申报", businessType = BusinessType.UPDATE)
     @ResponseBody
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult saveDetail(@RequestBody BizSocialSecurityDeclareDetail detail) {
         detail.setVerifierId(SecurityUtils.getUserId());
         detail.setVerifierTime(new Date());
@@ -440,6 +457,13 @@ public class SocialSecurityDeclareController extends BaseController {
         delCondition.setMasterId(detail.getId());
         delCondition.setMasterTableName("biz_social_security_declare_detail");
         fileStorageService.physicalDelete(delCondition);
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_social_security_declare");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setEvent("保存");
+        bizHistory.setTenantId(getTenantId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
+        bizHistoryService.save(bizHistory);
         bool = bool && (reportFiles.isEmpty() || fileStorageService.saveOrUpdateBatch(reportFiles)) && (fileStorages.isEmpty() || fileStorageService.saveOrUpdateBatch(fileStorages)) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "社保申报保存" : "社保申报完成", detail.getAmount().compareTo(BigDecimal.ZERO) > 0 ? 1 : 3);
         return bool ? success(detail) : error();
     }
@@ -607,6 +631,13 @@ public class SocialSecurityDeclareController extends BaseController {
             return error("该社保记录已扣款");
         }
         deductionService.removeBatchByIds(deductions.stream().map(BizDeduction::getId).collect(Collectors.toList()));
+        BizHistory bizHistory = new BizHistory();
+        bizHistory.setTableName("biz_social_security_declare");
+        bizHistory.setCompanyId(detail.getCompanyId());
+        bizHistory.setEvent("退回");
+        bizHistory.setTenantId(getTenantId());
+        bizHistory.setBelongPeriod(detail.getYear() + "-" +String.format("%02d", Integer.valueOf(detail.getMonth())));
+        bizHistoryService.save(bizHistory);
         return socialSecurityDeclareDetailService.updateById(detail) && addRecord(detail.getSocialSecurityDeclareId(), detail.getYear(), detail.getMonth(), SecurityUtils.getUserId(), "社保申报退回", 1) ? success() : error();
     }
 

+ 4 - 0
src/main/java/cn/ezhizao/project/business/socialSecurity/domain/BizSocialSecurityDeclareDetail.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.socialSecurity.domain;
 
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
@@ -116,4 +117,7 @@ public class BizSocialSecurityDeclareDetail extends BaseEntity implements Serial
 
     private BigDecimal injuryRadio;
 
+    @TableField(exist = false)
+    private BizEntrust entrust;
+
 }

+ 42 - 0
src/main/resources/mybatis/business/BizHistoryMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.history.mapper.BizHistoryMapper">
+
+    <resultMap type="cn.ezhizao.project.business.history.domain.BizHistory" id="BizHistoryResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizHistory" resultMap="BizHistoryResult">
+        SELECT t1.* ,t2.nick_name as userName,t3.account_name as tenantName  FROM biz_history t1
+            left join sys_user t2 on t1.creator_id = t2.user_id
+            left join biz_tenant t3 on t1.tenant_id = t3.id
+
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            t1.deleted = 0
+            <if test="companyId != null">AND t1.company_id = #{companyId}</if>
+            <if test="tableName != null">AND t1.table_name = #{tableName}</if>
+            <if test="currentMonth != null and currentMonth != ''">AND t1.belong_period = DATE_FORMAT(#{currentMonth}, '%Y-%m')</if>
+            <if test="dateFilter != null and dateFilter.size()>0 ">
+                AND (
+                DATE_FORMAT(t1.create_time,'%Y-%m-%d') &gt;= #{dateFilter[0]}
+                AND
+                DATE_FORMAT(t1.create_time,'%Y-%m-%d') &lt;= #{dateFilter[1]}
+                )
+            </if>
+        </trim>
+        order by create_time desc
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_history
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+            <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>