ezhizao_zx 1 year ago
parent
commit
5329a0a857
59 changed files with 2897 additions and 72 deletions
  1. 54 60
      src/main/java/cn/ezhizao/common/utils/DictUtils.java
  2. 163 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/controller/ArchiveTicketController.java
  3. 71 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/domain/BizArchiveReceiveTicket.java
  4. 30 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/mapper/BizArchiveReceiveTicketMapper.java
  5. 31 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/service/IBizArchiveReceiveTicketService.java
  6. 44 0
      src/main/java/cn/ezhizao/project/business/archiveTicket/service/impl/BizArchiveReceiveTicketServiceImpl.java
  7. 367 0
      src/main/java/cn/ezhizao/project/business/company/domain/BizCompany.java
  8. 31 0
      src/main/java/cn/ezhizao/project/business/company/mapper/BizCompanyMapper.java
  9. 38 0
      src/main/java/cn/ezhizao/project/business/company/service/IBizCompanyService.java
  10. 123 0
      src/main/java/cn/ezhizao/project/business/company/service/impl/BizCompanyServiceImpl.java
  11. 72 0
      src/main/java/cn/ezhizao/project/business/entrust/domain/BizEntrust.java
  12. 30 0
      src/main/java/cn/ezhizao/project/business/entrust/mapper/BizEntrustMapper.java
  13. 31 0
      src/main/java/cn/ezhizao/project/business/entrust/service/IBizEntrustService.java
  14. 44 0
      src/main/java/cn/ezhizao/project/business/entrust/service/impl/BizEntrustServiceImpl.java
  15. 31 0
      src/main/java/cn/ezhizao/project/business/financialBase/domain/BizArchiveReceiveTicketFinished.java
  16. 30 0
      src/main/java/cn/ezhizao/project/business/financialBase/domain/BizFinancialDictionary.java
  17. 56 0
      src/main/java/cn/ezhizao/project/business/financialBase/mapper/BizArchiveReceiveTicketFinishedMapper.java
  18. 51 0
      src/main/java/cn/ezhizao/project/business/financialBase/mapper/BizFinancialDictionaryMapper.java
  19. 52 0
      src/main/java/cn/ezhizao/project/business/financialBase/service/IBizArchiveReceiveTicketFinishedService.java
  20. 47 0
      src/main/java/cn/ezhizao/project/business/financialBase/service/IBizFinancialDictionaryService.java
  21. 46 0
      src/main/java/cn/ezhizao/project/business/financialBase/service/impl/BizArchiveReceiveTicketFinishedServiceImpl.java
  22. 46 0
      src/main/java/cn/ezhizao/project/business/financialBase/service/impl/BizFinancialDictionaryServiceImpl.java
  23. 81 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccount.java
  24. 58 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccountDetail.java
  25. 27 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/mapper/BizFinancialKeepAccountDetailMapper.java
  26. 22 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/mapper/BizFinancialKeepAccountMapper.java
  27. 19 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/service/IBizFinancialKeepAccountDetailService.java
  28. 23 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/service/IBizFinancialKeepAccountService.java
  29. 27 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/service/impl/BizFinancialKeepAccountDetailServiceImpl.java
  30. 27 0
      src/main/java/cn/ezhizao/project/business/keepAccounts/service/impl/BizFinancialKeepAccountServiceImpl.java
  31. 1 1
      src/main/java/cn/ezhizao/project/system/controller/SysDictDataController.java
  32. 111 0
      src/main/java/cn/ezhizao/project/system/controller/SysInItRoleController.java
  33. 127 0
      src/main/java/cn/ezhizao/project/system/controller/SysRoleMenuInitController.java
  34. 5 2
      src/main/java/cn/ezhizao/project/system/controller/SysUserController.java
  35. 44 0
      src/main/java/cn/ezhizao/project/system/domain/SysRoleInIt.java
  36. 34 0
      src/main/java/cn/ezhizao/project/system/domain/SysRoleMenuInit.java
  37. 9 1
      src/main/java/cn/ezhizao/project/system/mapper/SysDictDataMapper.java
  38. 2 0
      src/main/java/cn/ezhizao/project/system/mapper/SysMenuMapper.java
  39. 38 0
      src/main/java/cn/ezhizao/project/system/mapper/SysRoleInItMapper.java
  40. 38 0
      src/main/java/cn/ezhizao/project/system/mapper/SysRoleMenuInitMapper.java
  41. 1 0
      src/main/java/cn/ezhizao/project/system/service/ISysMenuService.java
  42. 38 0
      src/main/java/cn/ezhizao/project/system/service/ISysRoleInItService.java
  43. 33 0
      src/main/java/cn/ezhizao/project/system/service/ISysRoleMenuInitService.java
  44. 3 3
      src/main/java/cn/ezhizao/project/system/service/impl/SysDictTypeServiceImpl.java
  45. 16 0
      src/main/java/cn/ezhizao/project/system/service/impl/SysMenuServiceImpl.java
  46. 97 0
      src/main/java/cn/ezhizao/project/system/service/impl/SysRoleInItServiceImpl.java
  47. 51 0
      src/main/java/cn/ezhizao/project/system/service/impl/SysRoleMenuInitServiceImpl.java
  48. 18 2
      src/main/java/cn/ezhizao/project/tenant/controller/TenantController.java
  49. 54 0
      src/main/resources/mybatis/business/BizArchiveReceiveTicketFinishedMapper.xml
  50. 42 0
      src/main/resources/mybatis/business/BizArchiveReceiveTicketMapper.xml
  51. 58 0
      src/main/resources/mybatis/business/BizCompanyMapper.xml
  52. 31 0
      src/main/resources/mybatis/business/BizEntrustMapper.xml
  53. 44 0
      src/main/resources/mybatis/business/BizFinancialKeepAccountDetailMapper.xml
  54. 77 0
      src/main/resources/mybatis/business/BizFinancialKeepAccountMapper.xml
  55. 13 0
      src/main/resources/mybatis/system/SysMenuMapper.xml
  56. 69 0
      src/main/resources/mybatis/system/SysRoleInItMapper.xml
  57. 1 1
      src/main/resources/mybatis/system/SysRoleMapper.xml
  58. 50 0
      src/main/resources/mybatis/system/SysRoleMenuInitMapper.xml
  59. 20 2
      src/main/resources/mybatis/tenant/TenantMapper.xml

+ 54 - 60
src/main/java/cn/ezhizao/common/utils/DictUtils.java

@@ -14,8 +14,7 @@ import java.util.List;
  *
  * @author ruoyi
  */
-public class DictUtils
-{
+public class DictUtils {
     /**
      * 分隔符
      */
@@ -24,25 +23,44 @@ public class DictUtils
     /**
      * 设置字典缓存
      *
-     * @param key 参数键
+     * @param key       参数键
      * @param dictDatas 字典数据列表
      */
-    public static void setDictCache(String key, List<SysDictData> dictDatas)
-    {
+    public static void setDictCache(String key, List<SysDictData> dictDatas) {
         SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
     }
-
+    /**
+     * 设置字典缓存
+     *
+     * @param key       参数键
+     * @param dictDatas 字典数据列表
+     */
+    public static void setDictCache(String key, Long tenantId, List<SysDictData> dictDatas) {
+        SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key + "_" + tenantId), dictDatas);
+    }
     /**
      * 获取字典缓存
      *
      * @param key 参数键
      * @return dictDatas 字典数据列表
      */
-    public static List<SysDictData> getDictCache(String key)
-    {
+    public static List<SysDictData> getDictCache(String key) {
         JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
-        if (StringUtils.isNotNull(arrayCache))
-        {
+        if (StringUtils.isNotNull(arrayCache)) {
+            return arrayCache.toList(SysDictData.class);
+        }
+        return null;
+    }
+
+    /**
+     * 获取字典缓存
+     *
+     * @param key 参数键
+     * @return dictDatas 字典数据列表
+     */
+    public static List<SysDictData> getDictCache(String key, Long tenantId) {
+        JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key + "_" + tenantId));
+        if (StringUtils.isNotNull(arrayCache)) {
             return arrayCache.toList(SysDictData.class);
         }
         return null;
@@ -51,62 +69,50 @@ public class DictUtils
     /**
      * 根据字典类型和字典值获取字典标签
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictValue 字典值
      * @return 字典标签
      */
-    public static String getDictLabel(String dictType, String dictValue)
-    {
+    public static String getDictLabel(String dictType, String dictValue) {
         return getDictLabel(dictType, dictValue, SEPARATOR);
     }
 
     /**
      * 根据字典类型和字典标签获取字典值
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictLabel 字典标签
      * @return 字典值
      */
-    public static String getDictValue(String dictType, String dictLabel)
-    {
+    public static String getDictValue(String dictType, String dictLabel) {
         return getDictValue(dictType, dictLabel, SEPARATOR);
     }
 
     /**
      * 根据字典类型和字典值获取字典标签
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictValue 字典值
      * @param separator 分隔符
      * @return 字典标签
      */
-    public static String getDictLabel(String dictType, String dictValue, String separator)
-    {
+    public static String getDictLabel(String dictType, String dictValue, String separator) {
         StringBuilder propertyString = new StringBuilder();
         List<SysDictData> datas = getDictCache(dictType);
 
-        if (StringUtils.isNotEmpty(datas))
-        {
-            if (StringUtils.containsAny(separator, dictValue))
-            {
-                for (SysDictData dict : datas)
-                {
-                    for (String value : dictValue.split(separator))
-                    {
-                        if (value.equals(dict.getDictValue()))
-                        {
+        if (StringUtils.isNotEmpty(datas)) {
+            if (StringUtils.containsAny(separator, dictValue)) {
+                for (SysDictData dict : datas) {
+                    for (String value : dictValue.split(separator)) {
+                        if (value.equals(dict.getDictValue())) {
                             propertyString.append(dict.getDictLabel()).append(separator);
                             break;
                         }
                     }
                 }
-            }
-            else
-            {
-                for (SysDictData dict : datas)
-                {
-                    if (dictValue.equals(dict.getDictValue()))
-                    {
+            } else {
+                for (SysDictData dict : datas) {
+                    if (dictValue.equals(dict.getDictValue())) {
                         return dict.getDictLabel();
                     }
                 }
@@ -118,36 +124,27 @@ public class DictUtils
     /**
      * 根据字典类型和字典标签获取字典值
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictLabel 字典标签
      * @param separator 分隔符
      * @return 字典值
      */
-    public static String getDictValue(String dictType, String dictLabel, String separator)
-    {
+    public static String getDictValue(String dictType, String dictLabel, String separator) {
         StringBuilder propertyString = new StringBuilder();
         List<SysDictData> datas = getDictCache(dictType);
 
-        if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
-        {
-            for (SysDictData dict : datas)
-            {
-                for (String label : dictLabel.split(separator))
-                {
-                    if (label.equals(dict.getDictLabel()))
-                    {
+        if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) {
+            for (SysDictData dict : datas) {
+                for (String label : dictLabel.split(separator)) {
+                    if (label.equals(dict.getDictLabel())) {
                         propertyString.append(dict.getDictValue()).append(separator);
                         break;
                     }
                 }
             }
-        }
-        else
-        {
-            for (SysDictData dict : datas)
-            {
-                if (dictLabel.equals(dict.getDictLabel()))
-                {
+        } else {
+            for (SysDictData dict : datas) {
+                if (dictLabel.equals(dict.getDictLabel())) {
                     return dict.getDictValue();
                 }
             }
@@ -160,16 +157,14 @@ public class DictUtils
      *
      * @param key 字典键
      */
-    public static void removeDictCache(String key)
-    {
+    public static void removeDictCache(String key) {
         SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
     }
 
     /**
      * 清空字典缓存
      */
-    public static void clearDictCache()
-    {
+    public static void clearDictCache() {
         Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*");
         SpringUtils.getBean(RedisCache.class).deleteObject(keys);
     }
@@ -180,8 +175,7 @@ public class DictUtils
      * @param configKey 参数键
      * @return 缓存键key
      */
-    public static String getCacheKey(String configKey)
-    {
+    public static String getCacheKey(String configKey) {
         return CacheConstants.SYS_DICT_KEY + configKey;
     }
 }

+ 163 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/controller/ArchiveTicketController.java

@@ -0,0 +1,163 @@
+package cn.ezhizao.project.business.archiveTicket.controller;
+
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket;
+import cn.ezhizao.project.business.archiveTicket.service.IBizArchiveReceiveTicketService;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import cn.ezhizao.project.business.company.service.IBizCompanyService;
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
+import cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished;
+import cn.ezhizao.project.business.financialBase.service.IBizArchiveReceiveTicketFinishedService;
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
+import cn.ezhizao.project.business.keepAccounts.service.IBizFinancialKeepAccountService;
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@Api(tags = "收票 数据接口")
+@RequestMapping(value = "/business/archiveTicket")
+public class ArchiveTicketController extends BaseController {
+    @Resource
+    IBizFinancialKeepAccountService financialKeepAccountService;
+    @Resource
+    IBizArchiveReceiveTicketService bizArchiveReceiveTicketService;
+    @Resource
+    IBizEntrustService entrustService;
+    @Resource
+    IBizCompanyService companyService;
+
+    @Resource
+    IBizArchiveReceiveTicketFinishedService archiveReceiveTicketFinishedService;
+
+    @ApiOperation(value = "带条件List 分页查询", notes = "带条件List 分页查询")
+    @GetMapping("/list")
+    @ResponseBody
+    public TableDataInfo getList(BizCompany conditions) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(conditions);
+        startPage();
+        startOrderBy();
+        List<BizCompany> list = companyService.getList(conditions);
+        return getDataTable(list);
+    }
+    @PostMapping("/save")
+    @ApiOperation(value = "保存", notes = "保存")
+    @Transactional(rollbackFor = Exception.class)
+    @ResponseBody
+    public AjaxResult save(@RequestBody BizArchiveReceiveTicket archiveReceiveTicket) {
+
+//        return (archiveReceiveTicket.getId() == null ? archiveReceiveTicketService.save(archiveReceiveTicket) : archiveReceiveTicketService.updateById(archiveReceiveTicket)) ? Rutils.success() : Rutils.error();
+//        Map<String, Object> deleteCondition = new HashMap<>();
+//        deleteCondition.put("companyId", archiveReceiveTicket.getCompanyId());
+//        deleteCondition.put("year", archiveReceiveTicket.getYear());
+//        deleteCondition.put("month", archiveReceiveTicket.getMonth());
+        BizArchiveReceiveTicket deleteCondition = new BizArchiveReceiveTicket();
+        deleteCondition.setYear(archiveReceiveTicket.getYear());
+        deleteCondition.setMonth(archiveReceiveTicket.getMonth());
+        deleteCondition.setCompanyId(archiveReceiveTicket.getCompanyId());
+        bizArchiveReceiveTicketService.physicalDelete(deleteCondition);
+        archiveReceiveTicket.getFiles().forEach(l -> {
+            l.setYear(archiveReceiveTicket.getYear());
+            l.setMonth(archiveReceiveTicket.getMonth());
+            l.setCompanyId(archiveReceiveTicket.getCompanyId());
+        });
+        if (archiveReceiveTicket.getIsFinished().equals(1) || archiveReceiveTicket.getUploadTicketFinished() != null) {
+            BizArchiveReceiveTicketFinished uploadTicketFinished = archiveReceiveTicket.getUploadTicketFinished() != null ? archiveReceiveTicketFinishedService.getById(archiveReceiveTicket.getUploadTicketFinished().getId()) : new BizArchiveReceiveTicketFinished();
+            uploadTicketFinished.setYear(archiveReceiveTicket.getYear());
+            uploadTicketFinished.setMonth(archiveReceiveTicket.getMonth());
+            uploadTicketFinished.setCompanyId(archiveReceiveTicket.getCompanyId());
+            uploadTicketFinished.setIsFinished(archiveReceiveTicket.getIsFinished());
+            archiveReceiveTicketFinishedService.saveOrUpdate(uploadTicketFinished);
+        }
+        return archiveReceiveTicket.getFiles().isEmpty() ||  bizArchiveReceiveTicketService.saveOrUpdateBatch(archiveReceiveTicket.getFiles()) ? success(archiveReceiveTicket) : error();
+    }
+
+    @ApiOperation(value = "带条件List 分页查询", notes = "带条件List 分页查询")
+    @GetMapping("/listFiles")
+    @ResponseBody
+    public AjaxResult getFiles(BizArchiveReceiveTicket conditions) throws NoSuchFieldException, IllegalAccessException {
+//        setTenantId(conditions);
+        startPage();
+        List<BizArchiveReceiveTicket> list = bizArchiveReceiveTicketService.getList(conditions);
+        Map<String, Object> map = new HashMap<>();
+        map.put("files", list);
+        // 获取受委托账期
+        BizEntrust entrustConditions = new BizEntrust();
+        entrustConditions.setCompanyId(conditions.getCompanyId());
+        entrustConditions.setTaskTypeId(1L);
+        List<BizEntrust>entrusts = entrustService.getList(entrustConditions);
+        entrusts.sort(Comparator.comparing(BizEntrust::getWorkMonth).reversed());
+        List<Map<String, Object>> workMonths = entrusts.stream().map(v -> {
+            Map<String, Object> month = new HashMap<>();
+            month.put("id", v.getId());
+            month.put("year", DateTime.of(v.getCurrentMonth()).toString("yyyy"));
+            month.put("month", DateTime.of(v.getCurrentMonth()).toString("MM"));
+            month.put("currentMonth", DateTime.of(v.getCurrentMonth()).toString("yyyy年MM月"));
+            month.put("companyId", v.getCompanyId());
+            return month;
+        }).collect(Collectors.toList());
+        map.put("months", workMonths);
+        BizArchiveReceiveTicketFinished finished = new BizArchiveReceiveTicketFinished();
+        finished.setCompanyId(conditions.getCompanyId());
+        finished.setYear(conditions.getYear());
+        finished.setMonth(conditions.getMonth());
+        List<BizArchiveReceiveTicketFinished> status = archiveReceiveTicketFinishedService.getListByBean(finished);
+        finished = status.isEmpty() ? finished : status.get(0);
+        finished.setIsFinished(finished.getIsFinished() != null ? finished.getIsFinished() : 0);
+        map.put("finished", finished);
+
+//        BizFinancialKeepAccount bizFinancialKeepAccount = new BizFinancialKeepAccount();
+        return success(map);
+    }
+
+
+    @ApiOperation(value = "带条件List 分页查询", notes = "带条件List 分页查询")
+    @GetMapping("/getCheckout")
+    @ResponseBody
+    public AjaxResult getCheckout(BizArchiveReceiveTicket conditions) throws NoSuchFieldException, IllegalAccessException {
+        Map<String, Object> map = new HashMap<>();
+        // 获取受委托账期
+        BizEntrust entrustConditions = new BizEntrust();
+        entrustConditions.setCompanyId(conditions.getCompanyId());
+        entrustConditions.setTaskTypeId(1L);
+        List<BizEntrust>entrusts = entrustService.getList(entrustConditions);
+        entrusts.sort(Comparator.comparing(BizEntrust::getWorkMonth).reversed());
+        List<Map<String, Object>> workMonths = entrusts.stream().map(v -> {
+            Map<String, Object> month = new HashMap<>();
+            month.put("id", v.getId());
+            month.put("year", DateTime.of(v.getCurrentMonth()).toString("yyyy"));
+            month.put("month", DateTime.of(v.getCurrentMonth()).toString("MM"));
+            month.put("currentMonth", DateTime.of(v.getCurrentMonth()).toString("yyyy年MM月"));
+            month.put("companyId", v.getCompanyId());
+            return month;
+        }).collect(Collectors.toList());
+        map.put("months", workMonths);
+        return success(map);
+    }
+
+    @ApiModelProperty("获取完成状态")
+    @PostMapping("/getFinished")
+    @ResponseBody
+    public AjaxResult getFinished(@RequestBody BizArchiveReceiveTicket archiveReceiveTicket) {
+        QueryWrapper<BizArchiveReceiveTicketFinished> wrapper = new QueryWrapper<>();
+        wrapper.eq("year", archiveReceiveTicket.getYear());
+        wrapper.eq("month", archiveReceiveTicket.getMonth());
+        wrapper.eq("company_id", archiveReceiveTicket.getCompanyId());
+
+        return success(archiveReceiveTicketFinishedService.getOne(wrapper));
+    }
+}

+ 71 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/domain/BizArchiveReceiveTicket.java

@@ -0,0 +1,71 @@
+package cn.ezhizao.project.business.archiveTicket.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 票据上传对象 biz_archive_receive_ticket
+ *
+ * @author ruoyi
+ * @date 2023-11-26
+ */
+@Data
+@TableName(value = "biz_archive_receive_ticket")
+public class BizArchiveReceiveTicket extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 客户外键 */
+    @ApiModelProperty(value = "${comment}")
+    private Long companyId;
+
+    /** 账套外键 */
+    @ApiModelProperty(value = "${comment}")
+    private Long accountSetsId;
+
+    /** 年 */
+    @Excel(name = "年")
+    @ApiModelProperty(value = "年")
+    private String year;
+
+    /** 月 */
+    @Excel(name = "月")
+    @ApiModelProperty(value = "月")
+    private String month;
+
+    /** 票据类型 关联票据类型字典 */
+    @ApiModelProperty(value = "月")
+    private Long typeId;
+
+    /** 文件地址 */
+    @Excel(name = "文件地址")
+    @ApiModelProperty(value = "文件地址")
+    private String fileUrl;
+
+    /** 文件名 */
+    @Excel(name = "文件名")
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty("文件列表")
+    @TableField(exist = false)
+    private List<BizArchiveReceiveTicket> files;
+
+    @TableField(exist = false)
+    private Integer isFinished;
+    @TableField(exist = false)
+    private BizArchiveReceiveTicketFinished uploadTicketFinished;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/mapper/BizArchiveReceiveTicketMapper.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.archiveTicket.mapper;
+
+import cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 票据上传Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-11-26
+ */
+public interface BizArchiveReceiveTicketMapper extends BaseMapper<BizArchiveReceiveTicket>
+{
+    /**
+     * 查询票据上传列表
+     *
+     * @param bizArchiveReceiveTicket 票据上传
+     * @return 票据上传集合
+     */
+    public List<BizArchiveReceiveTicket> getList(BizArchiveReceiveTicket bizArchiveReceiveTicket);
+
+    /**
+     * 物理删除
+     * @param bizArchiveReceiveTicket
+     * @return 删除结果
+    */
+    public int physicalDelete(BizArchiveReceiveTicket bizArchiveReceiveTicket);
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/service/IBizArchiveReceiveTicketService.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.archiveTicket.service;
+
+import cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 票据上传Service接口
+ *
+ * @author ruoyi
+ * @date 2023-11-26
+ */
+public interface IBizArchiveReceiveTicketService extends IService<BizArchiveReceiveTicket>
+{
+    /**
+     * 查询票据上传列表
+     *
+     * @param bizArchiveReceiveTicket 票据上传
+     * @return 票据上传集合
+     */
+    public List<BizArchiveReceiveTicket> getList(BizArchiveReceiveTicket bizArchiveReceiveTicket);
+
+    /**
+     * 物理删除
+     * @param bizArchiveReceiveTicket
+     * @return 删除结果
+     */
+    public int physicalDelete(BizArchiveReceiveTicket bizArchiveReceiveTicket);
+
+}

+ 44 - 0
src/main/java/cn/ezhizao/project/business/archiveTicket/service/impl/BizArchiveReceiveTicketServiceImpl.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.archiveTicket.service.impl;
+
+import cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket;
+import cn.ezhizao.project.business.archiveTicket.mapper.BizArchiveReceiveTicketMapper;
+import cn.ezhizao.project.business.archiveTicket.service.IBizArchiveReceiveTicketService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 票据上传Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-11-26
+ */
+@Service
+public class BizArchiveReceiveTicketServiceImpl  extends ServiceImpl<BizArchiveReceiveTicketMapper, BizArchiveReceiveTicket> implements IBizArchiveReceiveTicketService
+{
+    @Resource
+    private BizArchiveReceiveTicketMapper bizArchiveReceiveTicketMapper;
+
+    /**
+     * 查询票据上传列表
+     *
+     * @param bizArchiveReceiveTicket 票据上传
+     * @return 票据上传
+     */
+    @Override
+    public List<BizArchiveReceiveTicket> getList(BizArchiveReceiveTicket bizArchiveReceiveTicket)
+    {
+        return bizArchiveReceiveTicketMapper.getList(bizArchiveReceiveTicket);
+    }
+
+    /**
+     * 物理删除
+     * @param bizArchiveReceiveTicket
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizArchiveReceiveTicket bizArchiveReceiveTicket){ return bizArchiveReceiveTicketMapper.physicalDelete(bizArchiveReceiveTicket); };
+
+}

+ 367 - 0
src/main/java/cn/ezhizao/project/business/company/domain/BizCompany.java

@@ -0,0 +1,367 @@
+package cn.ezhizao.project.business.company.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * company对象 biz_company
+ *
+ * @author ezhizao
+ * @date 2023-10-16
+ */
+@Data
+@TableName(value = "biz_company")
+public class BizCompany extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 合作伙伴分类:1、客户;2、供应商;3、外协商 */
+    @ApiModelProperty(value = "合作伙伴分类:1、客户;2、供应商;3、外协商")
+    private String category;
+
+    /** 客户编码 */
+    @Excel(name = "客户编码")
+    @ApiModelProperty(value = "客户编码")
+    private String code;
+
+    /** 客户名称 */
+    @Excel(name = "客户名称")
+    @ApiModelProperty(value = "客户名称")
+    @Size(min = 0, max = 100)
+    private String name;
+
+    /** 客户简称 */
+    @Excel(name = "客户简称")
+    @ApiModelProperty(value = "客户简称")
+    @Size(min = 0, max = 50)
+    private String shortName;
+
+    /** 曾用名 */
+    @Excel(name = "曾用名")
+    @ApiModelProperty(value = "曾用名")
+    private String oldName;
+
+    /** 所有权人 */
+    @Excel(name = "所有权人")
+    @ApiModelProperty(value = "所有权人")
+    private String owner;
+
+    /** 所有权人ID外键(字典所有权人分类) */
+    @ApiModelProperty(value = "所有权人")
+    private Long ownerId;
+
+    /** 企业电话 */
+    @Excel(name = "企业电话")
+    @ApiModelProperty(value = "企业电话")
+    private String phone;
+
+    /** 企业邮箱 */
+    @Excel(name = "企业邮箱")
+    @ApiModelProperty(value = "企业邮箱")
+    private String email;
+
+    /** 联系地址 */
+    @Excel(name = "联系地址")
+    @ApiModelProperty(value = "联系地址")
+    private String contactAddress;
+
+    /** 客户阶段字典分类外键 */
+    @ApiModelProperty(value = "联系地址")
+    private Long stageId;
+
+    /** 等级,对应的是数据字典外键 */
+    @ApiModelProperty(value = "联系地址")
+    private Long companyLevelId;
+
+    /** 客户来源:与合同来源共用一个数据源 */
+    @ApiModelProperty(value = "联系地址")
+    private Long sourceCategoryId;
+
+    /** 客户来源 */
+    @Excel(name = "客户来源")
+    @ApiModelProperty(value = "客户来源")
+    private String source;
+
+    /** 客户来源: */
+    @ApiModelProperty(value = "客户来源")
+    private Long sourceId;
+
+    /** 企业类型 */
+    @Excel(name = "企业类型")
+    @ApiModelProperty(value = "企业类型")
+    private String type;
+
+    /** 企业类型字典分类外键 */
+    @ApiModelProperty(value = "企业类型")
+    private Long typeId;
+
+    /** 社会信用代码 */
+    @Excel(name = "社会统一信用代码")
+    @ApiModelProperty(value = "社会统一信用代码")
+    @Pattern(regexp = "^$|^. {18}$", message = "社会统一信用代码必须为18位")
+    private String socialCreditCode;
+
+    /** 主营业务 */
+    @Excel(name = "主营业务")
+    @ApiModelProperty(value = "主营业务")
+    private String mainBusiness;
+
+    /** 主营行业字典分类外键 */
+    @ApiModelProperty(value = "主营业务")
+    private Long mainBusinessId;
+
+    /** 法定代表人 */
+    @Excel(name = "法定代表人")
+    @ApiModelProperty(value = "法定代表人")
+    private String legalRepresentative;
+
+    /** 成立日期 */
+    @Excel(name = "成立日期")
+    @ApiModelProperty(value = "成立日期")
+    @Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2}$")
+    private String foundationDate;
+
+    /** 出执照日期 */
+    @Excel(name = "出执照日期")
+    @ApiModelProperty(value = "出执照日期")
+    private String licenceDate;
+
+    /** 营业开始时间 */
+    @Excel(name = "营业开始时间")
+    @ApiModelProperty(value = "营业开始时间")
+    private String businessStartDate;
+
+    /** 营业结束时间 */
+    @Excel(name = "营业结束时间")
+    @ApiModelProperty(value = "营业结束时间")
+    private String businessEndDate;
+
+    /** 长期有效否 */
+    @Excel(name = "长期有效否")
+    @ApiModelProperty(value = "长期有效否")
+    private Integer isPermanentlyEffective;
+
+    /** 注册资金 */
+    @Excel(name = "注册资金")
+    @ApiModelProperty(value = "注册资金")
+    private String registerMoney;
+
+    /** 注册资金单位 */
+    @Excel(name = "注册资金单位")
+    @ApiModelProperty(value = "注册资金单位")
+    private String registerMoneyUnit;
+
+    /** 注册资金数据字典id */
+    @ApiModelProperty(value = "注册资金单位")
+    private Long registerMoneyUnitId;
+
+    /** 注册省份编码 */
+    @Excel(name = "注册省份编码")
+    @ApiModelProperty(value = "注册省份编码")
+    private String provinceCode;
+
+    /** 省 */
+    @Excel(name = "省")
+    @ApiModelProperty(value = "省")
+    private String province;
+
+    /** 注册城市编码 */
+    @Excel(name = "注册城市编码")
+    @ApiModelProperty(value = "注册城市编码")
+    private String cityCode;
+
+    /** 市 */
+    @Excel(name = "市")
+    @ApiModelProperty(value = "市")
+    private String city;
+
+    /** 注册行政区编码 */
+    @Excel(name = "注册行政区编码")
+    @ApiModelProperty(value = "注册行政区编码")
+    private String districtCode;
+
+    /** 区 */
+    @Excel(name = "区")
+    @ApiModelProperty(value = "区")
+    private String district;
+
+    /** 注册详细地址 */
+    @Excel(name = "注册详细地址")
+    @ApiModelProperty(value = "注册详细地址")
+    private String address;
+
+    /** 经营范围 */
+    @Excel(name = "经营范围")
+    @ApiModelProperty(value = "经营范围")
+    private String businessField;
+
+    /** 纳税类型 */
+    @Excel(name = "纳税类型")
+    @ApiModelProperty(value = "纳税类型")
+    private String taxType;
+
+    /** 纳税类型字典分类ID外键 */
+    @ApiModelProperty(value = "纳税类型")
+    private Long taxTypeId;
+
+    /** 报税类别ID外键字典 */
+    @ApiModelProperty(value = "纳税类型")
+    private Long taxDeclarationCategoryId;
+
+    /** 是否零申报 */
+    @Excel(name = "是否零申报")
+    @ApiModelProperty(value = "是否零申报")
+    private Integer isZero;
+
+    /** 税盘ID外键字典 */
+    @ApiModelProperty(value = "是否零申报")
+    private Long taxDishId;
+
+    /** 主管税务机关 */
+    @Excel(name = "主管税务机关")
+    @ApiModelProperty(value = "主管税务机关")
+    private String competentTaxAuthority;
+
+    /** 税务专管员 */
+    @Excel(name = "税务专管员")
+    @ApiModelProperty(value = "税务专管员")
+    private String taxCollectorName;
+
+    /** 专管员电话 */
+    @Excel(name = "专管员电话")
+    @ApiModelProperty(value = "专管员电话")
+    private String taxCollectorPhone;
+
+    /** 核税月份 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "核税月份", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "核税月份")
+    private Date taxMonth;
+
+    /** 开户行 */
+    @Excel(name = "开户行")
+    @ApiModelProperty(value = "开户行")
+    private String openingBank;
+
+    /** 银行账户 */
+    @Excel(name = "银行账户")
+    @ApiModelProperty(value = "银行账户")
+    private String bankAccount;
+
+    /** 账套外键 */
+    @ApiModelProperty(value = "银行账户")
+    private Long accountSetsId;
+
+    /** 主程序账套外键 */
+    @ApiModelProperty(value = "系统外键")
+    private Long tenantId;
+
+    /** 年收入 */
+    @Excel(name = "年收入")
+    @ApiModelProperty(value = "年收入")
+    private String annualIncome;
+
+    /** 政务网账号 */
+    @Excel(name = "政务网账号")
+    @ApiModelProperty(value = "政务网账号")
+    private String governmentAccountNo;
+
+    /** 政务网密码 */
+    @Excel(name = "政务网密码")
+    @ApiModelProperty(value = "政务网密码")
+    private String governmentPassword;
+
+    /** 社保账号 */
+    @Excel(name = "社保账号")
+    @ApiModelProperty(value = "社保账号")
+    private String socialSecurityAccountNo;
+
+    /** 社保密码 */
+    @Excel(name = "社保密码")
+    @ApiModelProperty(value = "社保密码")
+    private String socialSecurityPassword;
+
+    /** 用工密码 */
+    @Excel(name = "用工密码")
+    @ApiModelProperty(value = "用工密码")
+    private String employeePassword;
+
+    /** 公积金密码 */
+    @Excel(name = "公积金密码")
+    @ApiModelProperty(value = "公积金密码")
+    private String housingFundPassword;
+
+    /** 公积金单位账号 */
+    @Excel(name = "公积金单位账号")
+    @ApiModelProperty(value = "公积金单位账号")
+    private String housingFundUnitAccount;
+
+    /** 公积金划款密码 */
+    @Excel(name = "公积金划款密码")
+    @ApiModelProperty(value = "公积金划款密码")
+    private String housingFundDeductionPassword;
+
+    /** 征收方式 */
+    @Excel(name = "征收方式")
+    @ApiModelProperty(value = "征收方式")
+    private String collectionMethod;
+
+    /** 定额金额 */
+    @Excel(name = "定额金额")
+    @ApiModelProperty(value = "定额金额")
+    private BigDecimal quotaAmount;
+
+    /** 窗口现金交 */
+    @Excel(name = "窗口现金交")
+    @ApiModelProperty(value = "窗口现金交")
+    private Integer isPayOnWindow;
+
+    /** 初次社保信息保存 */
+    @Excel(name = "初次社保信息保存")
+    @ApiModelProperty(value = "初次社保信息保存")
+    private Integer isFirstSocialSecurity;
+
+    /** 初次公积金信息保存 */
+    @Excel(name = "初次公积金信息保存")
+    @ApiModelProperty(value = "初次公积金信息保存")
+    private Integer isFirstHousingFund;
+
+    @TableField(exist = false)
+    @Excel(name = "来源类型")
+    private String sourceCategoryName;
+
+    @TableField(exist = false)
+    @Excel(name="来源名称")
+    private String sourceName;
+
+    @ApiModelProperty("负责人")
+    private Long leaderId;
+    @ApiModelProperty("客服")
+    private Long adviserId;
+
+    @TableField(exist = false)
+    private String leaderName;
+    @TableField(exist = false)
+    private String adviserName;
+    @TableField(exist = false)
+    private String referrerDataSource;
+    @TableField(exist = false)
+    private List<Long> ids;
+
+    @TableField(exist = false)
+    private List<String> columns;
+
+    @TableField(exist = false)
+    private String keyword;
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/company/mapper/BizCompanyMapper.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.company.mapper;
+
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * companyMapper接口
+ *
+ * @author ezhizao
+ * @date 2023-10-16
+ */
+public interface BizCompanyMapper extends BaseMapper<BizCompany>
+{
+    public BizCompany getById(Long id);
+    /**
+     * 查询company列表
+     *
+     * @param bizCompany company
+     * @return company集合
+     */
+    public List<BizCompany> getList(BizCompany bizCompany);
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+     */
+    public int physicalDelete(BizCompany bizCompany);
+}

+ 38 - 0
src/main/java/cn/ezhizao/project/business/company/service/IBizCompanyService.java

@@ -0,0 +1,38 @@
+package cn.ezhizao.project.business.company.service;
+
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * companyService接口
+ *
+ * @author ezhizao
+ * @date 2023-10-16
+ */
+public interface IBizCompanyService extends IService<BizCompany>
+{
+    /**
+     * 查询 主键 为传入参数的客户
+     * @param id company.id
+     * @return 客户信息
+     */
+    public BizCompany getById(Long id);
+    /**
+     * 查询company列表
+     *
+     * @param bizCompany company
+     * @return company集合
+     */
+    public List<BizCompany> getList(BizCompany bizCompany);
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+     */
+    public int physicalDelete(BizCompany bizCompany);
+
+    String importCompany(List<BizCompany> companyList, String operName, Long tenantId);
+}

+ 123 - 0
src/main/java/cn/ezhizao/project/business/company/service/impl/BizCompanyServiceImpl.java

@@ -0,0 +1,123 @@
+package cn.ezhizao.project.business.company.service.impl;
+
+import cn.ezhizao.common.constant.HttpStatus;
+import cn.ezhizao.common.exception.ServiceException;
+import cn.ezhizao.common.utils.StringUtils;
+import cn.ezhizao.common.utils.bean.BeanValidators;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import cn.ezhizao.project.business.company.mapper.BizCompanyMapper;
+import cn.ezhizao.project.business.company.service.IBizCompanyService;
+import cn.ezhizao.project.system.mapper.SysUserMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.validation.Validator;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * companyService业务层处理
+ *
+ * @author ezhizao
+ * @date 2023-10-16
+ */
+@Service
+public class BizCompanyServiceImpl  extends ServiceImpl<BizCompanyMapper, BizCompany> implements IBizCompanyService
+{
+    @Resource
+    private BizCompanyMapper bizCompanyMapper;
+    private SysUserMapper sysUserMapper;
+    @Resource
+    private Validator validator;
+
+    @Override
+    public BizCompany getById(Long id) {
+        BizCompany company = super.getById(id);
+
+        return company;
+    }
+
+    /**
+     * 查询company列表
+     *
+     * @param bizCompany company
+     * @return company
+     */
+    @Override
+    public List<BizCompany> getList(BizCompany bizCompany)
+    {
+        return bizCompanyMapper.getList(bizCompany);
+    }
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizCompany bizCompany){ return bizCompanyMapper.physicalDelete(bizCompany); }
+
+    @Override
+    public String importCompany(List<BizCompany> companyList, String operName, Long tenantId) {
+        if (StringUtils.isNull(companyList) || companyList.size() == 0)
+        {
+            throw new ServiceException("导入用户数据不能为空!");
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+        for (BizCompany company : companyList) {
+            try {
+                // 验证是否存在这个客户
+                if(this.query().eq("name", company.getName()).eq("tenant_id", tenantId).count() > 0)
+                {
+                    failureNum++;
+                    failureMsg.append("<br/>" + failureNum + "、客户 " + company.getName() + " 已存在");
+                } else {
+                    BeanValidators.validateWithException(validator, company);
+                    String sourceName = company.getSourceName();
+                    String sourceCategory = company.getSourceCategoryName();
+                    company.setTenantId(tenantId);
+                    successNum++;
+                    successMsg.append("<br/>" + successNum + "、客户 " + company.getName() + " 导入成功");
+                }
+            }
+            catch (Exception e)
+            {
+                failureNum++;
+                String msg = "<br/>" + failureNum + "、客户 " + company.getName() + " 导入失败:";
+                failureMsg.append(msg + e.getMessage());
+                log.error(msg, e);
+            }
+        }
+        if (failureNum > 0)
+        {
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+            throw new ServiceException(failureMsg.toString());
+        }
+        else
+        {
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+        }
+        return successMsg.toString();
+//        return "";
+    }
+
+    ;
+
+    @Override
+    public boolean save(BizCompany company) {
+        // 判断客户名是否重复
+        if(this.query().eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
+        AtomicBoolean res = new AtomicBoolean(super.save(company));
+        return res.get();
+    }
+    @Override
+    public boolean updateById(BizCompany company) {
+        if(this.query().eq("name", company.getName()).ne("id", company.getId() == null ? 0L :company.getId()).count() > 0) throw new ServiceException("客户名称重复", HttpStatus.ERROR);
+        AtomicBoolean res = new AtomicBoolean(super.updateById(company));
+        return res.get();
+    }
+}

+ 72 - 0
src/main/java/cn/ezhizao/project/business/entrust/domain/BizEntrust.java

@@ -0,0 +1,72 @@
+package cn.ezhizao.project.business.entrust.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.sql.Date;
+import java.util.List;
+
+/**
+ * 委托对象 biz_entrust
+ *
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Data
+@TableName(value = "biz_entrust")
+public class BizEntrust extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 委托客户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long companyId;
+
+    /** 委托账套id */
+    @ApiModelProperty(value = "${comment}")
+    private Long fromTenantId;
+
+    /** 受委托账套id */
+    @ApiModelProperty(value = "${comment}")
+    private Long toTenantId;
+
+    /** 委托单据 */
+    @ApiModelProperty(value = "${comment}")
+    private Long workOrderId;
+
+    /** 委托id */
+    @ApiModelProperty(value = "${comment}")
+    private Long taskTypeDetailId;
+
+    /** 委托id */
+    @ApiModelProperty(value = "${comment}")
+    private Long taskTypeId;
+
+    /** 来源委托id */
+    @ApiModelProperty(value = "${comment}")
+    private Long fromId;
+
+    @ApiModelProperty("工作月")
+    private Date workMonth;
+
+    @ApiModelProperty("当期月")
+    private Date currentMonth;
+
+    /** 主程序账套外键 */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    @TableField(exist = false)
+    private List<Long> workOrderIds;
+
+    @TableField(exist = false)
+    private String toAccountName;
+
+//    /** 停止委托 */
+    @ApiModelProperty(value = "停止委托")
+    private Integer isStop;
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/entrust/mapper/BizEntrustMapper.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.entrust.mapper;
+
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 委托Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface BizEntrustMapper extends BaseMapper<BizEntrust>
+{
+    /**
+     * 查询委托列表
+     *
+     * @param bizEntrust 委托
+     * @return 委托集合
+     */
+    public List<BizEntrust> getList(BizEntrust bizEntrust);
+
+    /**
+     * 物理删除
+     * @param bizEntrust
+     * @return 删除结果
+    */
+    public int physicalDelete(BizEntrust bizEntrust);
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/entrust/service/IBizEntrustService.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.entrust.service;
+
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 委托Service接口
+ *
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface IBizEntrustService extends IService<BizEntrust>
+{
+    /**
+     * 查询委托列表
+     *
+     * @param bizEntrust 委托
+     * @return 委托集合
+     */
+    public List<BizEntrust> getList(BizEntrust bizEntrust);
+
+    /**
+     * 物理删除
+     * @param bizEntrust
+     * @return 删除结果
+     */
+    public int physicalDelete(BizEntrust bizEntrust);
+
+}

+ 44 - 0
src/main/java/cn/ezhizao/project/business/entrust/service/impl/BizEntrustServiceImpl.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.entrust.service.impl;
+
+import cn.ezhizao.project.business.entrust.domain.BizEntrust;
+import cn.ezhizao.project.business.entrust.mapper.BizEntrustMapper;
+import cn.ezhizao.project.business.entrust.service.IBizEntrustService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 委托Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Service
+public class BizEntrustServiceImpl  extends ServiceImpl<BizEntrustMapper, BizEntrust> implements IBizEntrustService
+{
+    @Resource
+    private BizEntrustMapper bizEntrustMapper;
+
+    /**
+     * 查询委托列表
+     *
+     * @param bizEntrust 委托
+     * @return 委托
+     */
+    @Override
+    public List<BizEntrust> getList(BizEntrust bizEntrust)
+    {
+        return bizEntrustMapper.getList(bizEntrust);
+    }
+
+    /**
+     * 物理删除
+     * @param bizEntrust
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizEntrust bizEntrust){ return bizEntrustMapper.physicalDelete(bizEntrust); };
+
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/financialBase/domain/BizArchiveReceiveTicketFinished.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.financialBase.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author 周晓
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+public class BizArchiveReceiveTicketFinished extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "账期年")
+    private String year;
+
+    @ApiModelProperty(value = "账期月")
+    private String month;
+
+    @ApiModelProperty(value = "是否完成")
+    private Integer isFinished;
+
+    @ApiModelProperty(value = "客户外键")
+    private Long companyId;
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/financialBase/domain/BizFinancialDictionary.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.financialBase.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author 周晓
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+public class BizFinancialDictionary extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型 1票据类型")
+    private Byte type;
+
+
+    @ApiModelProperty(value = "主程序账套外键")
+//
+    private Long tenantId;
+
+}

+ 56 - 0
src/main/java/cn/ezhizao/project/business/financialBase/mapper/BizArchiveReceiveTicketFinishedMapper.java

@@ -0,0 +1,56 @@
+package cn.ezhizao.project.business.financialBase.mapper;
+
+import cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 周晓
+ */
+@Mapper
+public interface BizArchiveReceiveTicketFinishedMapper extends BaseMapper<BizArchiveReceiveTicketFinished> {
+
+    /**
+     * 带条件的查询
+     *
+     * @param conditions 条件
+     * @return List 集合
+     */
+    List<BizArchiveReceiveTicketFinished> getList(Map<String, Object> conditions);
+
+    /**
+     * 根据Bean查询 列表
+     *
+     * @param uploadTicketFinished 实体类对象
+     * @return List 集合
+     */
+    List<BizArchiveReceiveTicketFinished> getList(BizArchiveReceiveTicketFinished uploadTicketFinished);
+
+    /**
+     * 带条件的查询总数
+     *
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    int getTotal(Map<String, Object> conditions);
+
+    /**
+     * 获取就表数据
+     *
+     * @return 旧表数据集
+     */
+    List<BizArchiveReceiveTicketFinished> getOldData();
+
+    /**
+     * 清除当前表所有数据
+     *
+     * @return 操作行数
+     */
+    int clear();
+
+}
+
+

+ 51 - 0
src/main/java/cn/ezhizao/project/business/financialBase/mapper/BizFinancialDictionaryMapper.java

@@ -0,0 +1,51 @@
+package cn.ezhizao.project.business.financialBase.mapper;
+
+import cn.ezhizao.project.business.financialBase.domain.BizFinancialDictionary;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 周晓
+ */
+@Mapper
+public interface BizFinancialDictionaryMapper extends BaseMapper<BizFinancialDictionary> {
+
+/**
+* 带条件的查询
+* @param conditions 条件
+* @return List 集合
+*/
+List<BizFinancialDictionary> getList(Map<String,Object> conditions);
+
+/**
+* 根据Bean查询 列表
+* @param financialDictionary 实体类对象
+* @return List 集合
+*/
+List<BizFinancialDictionary> getList(BizFinancialDictionary financialDictionary);
+
+/**
+* 带条件的查询总数
+* @param conditions 条件
+* @return int 查询总数量
+*/
+int getTotal(Map<String,Object> conditions);
+
+/**
+* 获取就表数据
+* @return 旧表数据集
+*/
+List<BizFinancialDictionary> getOldData();
+
+/**
+* 清除当前表所有数据
+* @return 操作行数
+*/
+int clear();
+
+}
+
+

+ 52 - 0
src/main/java/cn/ezhizao/project/business/financialBase/service/IBizArchiveReceiveTicketFinishedService.java

@@ -0,0 +1,52 @@
+package cn.ezhizao.project.business.financialBase.service;
+
+import cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 周晓
+ */
+public interface IBizArchiveReceiveTicketFinishedService extends IService<BizArchiveReceiveTicketFinished> {
+
+    /**
+     * 根据Bean查询 列表
+     *
+     * @param uploadTicketFinished 实体类对象
+     * @return List 集合
+     */
+    List<BizArchiveReceiveTicketFinished> getListByBean(BizArchiveReceiveTicketFinished uploadTicketFinished);
+
+
+    /**
+     * 带条件的查询
+     *
+     * @param conditions 条件
+     * @return List 集合
+     */
+    List<BizArchiveReceiveTicketFinished> getList(Map<String, Object> conditions);
+
+    /**
+     * 带条件的查询总数
+     *
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    int getTotal(Map<String, Object> conditions);
+
+    /**
+     * 获取就表数据
+     *
+     * @return 旧表数据集
+     */
+    List<BizArchiveReceiveTicketFinished> getOldData();
+
+    /**
+     * 清除当前表所有数据
+     *
+     * @return 操作行数
+     */
+    int clear();
+}

+ 47 - 0
src/main/java/cn/ezhizao/project/business/financialBase/service/IBizFinancialDictionaryService.java

@@ -0,0 +1,47 @@
+package cn.ezhizao.project.business.financialBase.service;
+
+import cn.ezhizao.project.business.financialBase.domain.BizFinancialDictionary;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+ /**
+  * @author 周晓
+  */
+ public interface IBizFinancialDictionaryService extends IService<BizFinancialDictionary> {
+
+ /**
+ * 根据Bean查询 列表
+ * @param financialDictionary 实体类对象
+ * @return List 集合
+ */
+ List<BizFinancialDictionary> getListByBean(BizFinancialDictionary financialDictionary);
+
+
+ /**
+ * 带条件的查询
+ * @param conditions 条件
+ * @return List 集合
+ */
+ List<BizFinancialDictionary> getList(Map<String,Object> conditions);
+
+ /**
+ * 带条件的查询总数
+ * @param conditions 条件
+ * @return int 查询总数量
+ */
+ int getTotal(Map<String,Object> conditions);
+
+ /**
+ * 获取就表数据
+ * @return 旧表数据集
+ */
+ List<BizFinancialDictionary> getOldData();
+
+ /**
+ * 清除当前表所有数据
+ * @return 操作行数
+ */
+ int clear();
+}

+ 46 - 0
src/main/java/cn/ezhizao/project/business/financialBase/service/impl/BizArchiveReceiveTicketFinishedServiceImpl.java

@@ -0,0 +1,46 @@
+package cn.ezhizao.project.business.financialBase.service.impl;
+
+import cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished;
+import cn.ezhizao.project.business.financialBase.mapper.BizArchiveReceiveTicketFinishedMapper;
+import cn.ezhizao.project.business.financialBase.service.IBizArchiveReceiveTicketFinishedService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 周晓
+ */
+
+@Service
+public class BizArchiveReceiveTicketFinishedServiceImpl extends ServiceImpl<BizArchiveReceiveTicketFinishedMapper, BizArchiveReceiveTicketFinished> implements IBizArchiveReceiveTicketFinishedService {
+
+    @Resource
+    BizArchiveReceiveTicketFinishedMapper uploadTicketFinishedDao;
+
+    @Override
+    public List<BizArchiveReceiveTicketFinished> getList(Map<String,Object> conditions) {
+        return uploadTicketFinishedDao.getList(conditions);
+    }
+
+    @Override
+    public List<BizArchiveReceiveTicketFinished> getListByBean(BizArchiveReceiveTicketFinished uploadTicketFinished) {
+        return uploadTicketFinishedDao.getList(uploadTicketFinished);
+    }
+
+    @Override
+    public int getTotal(Map<String,Object> conditions) {
+        return uploadTicketFinishedDao.getTotal(conditions);
+    }
+
+    @Override
+    public List<BizArchiveReceiveTicketFinished> getOldData() {
+        return uploadTicketFinishedDao.getOldData();
+    }
+    @Override
+    public int clear() {
+        return uploadTicketFinishedDao.clear();
+    }
+}

+ 46 - 0
src/main/java/cn/ezhizao/project/business/financialBase/service/impl/BizFinancialDictionaryServiceImpl.java

@@ -0,0 +1,46 @@
+package cn.ezhizao.project.business.financialBase.service.impl;
+
+import cn.ezhizao.project.business.financialBase.domain.BizFinancialDictionary;
+import cn.ezhizao.project.business.financialBase.mapper.BizFinancialDictionaryMapper;
+import cn.ezhizao.project.business.financialBase.service.IBizFinancialDictionaryService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 周晓
+ */
+
+@Service
+public class BizFinancialDictionaryServiceImpl extends ServiceImpl<BizFinancialDictionaryMapper, BizFinancialDictionary> implements IBizFinancialDictionaryService {
+
+    @Resource
+    BizFinancialDictionaryMapper financialDictionaryDao;
+
+    @Override
+    public List<BizFinancialDictionary> getList(Map<String,Object> conditions) {
+        return financialDictionaryDao.getList(conditions);
+    }
+
+    @Override
+    public List<BizFinancialDictionary> getListByBean(BizFinancialDictionary financialDictionary) {
+        return financialDictionaryDao.getList(financialDictionary);
+    }
+
+    @Override
+    public int getTotal(Map<String,Object> conditions) {
+        return financialDictionaryDao.getTotal(conditions);
+    }
+
+    @Override
+    public List<BizFinancialDictionary> getOldData() {
+        return financialDictionaryDao.getOldData();
+    }
+    @Override
+    public int clear() {
+        return financialDictionaryDao.clear();
+    }
+}

+ 81 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccount.java

@@ -0,0 +1,81 @@
+package cn.ezhizao.project.business.keepAccounts.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Accessors(chain = true)
+@ApiModel("biz_financial_keep_account 财务记账")
+public class BizFinancialKeepAccount extends BaseEntity {
+    @ApiModelProperty("客户外键")
+    private Long companyId;
+    @ApiModelProperty("账套外键")
+    private Integer accountSetsId;
+    @ApiModelProperty("登录账套外键")
+
+    private Long tenantId;
+    @ApiModelProperty("当前维护人员")
+    private Long currentEmployeeId;
+    @ApiModelProperty("全部维护人员")
+    private String employeeIds;
+
+    @TableField(exist = false)
+    private String companyName;
+    @TableField(exist = false)
+    private String companyLevel;
+    @TableField(exist = false)
+    private String currentDate;
+    @TableField(exist = false)
+    private List<BizFinancialKeepAccountDetail> details;
+
+
+    // 用于收票报表的属性
+//    @TableField(exist = false)
+//    private List<BizFinancialTicketReportDetail> receiveTickets;
+//    @TableField(exist = false)
+//    private List<BizFinancialTicketReportDetail> scanTickets;
+//    @TableField(exist = false)
+//    private List<BizFinancialTicketReportDetail> salaryTickets;
+
+    @TableField(exist = false)
+    private String fromCompanyName;
+
+    @TableField(exist = false)
+    private String taxType;
+
+    /** 查询条件新增 */
+    @TableField(exist = false)
+    private String year;
+    @TableField(exist = false)
+    private String month;
+    @TableField(exist = false)
+    private Integer status;
+
+    @TableField(exist = false)
+    private String keyword;
+
+    @ApiModelProperty("工单外键")
+    private Long workOrderId;
+    @ApiModelProperty(value = "是否零申报")
+    @TableField(exist = false)
+    private Integer isZero;
+    @ApiModelProperty(value = "是否停止")
+    @TableField(exist = false)
+    private Integer isStop;
+
+    //是否为自己负责(当前登陆人Id)
+    @TableField(exist = false)
+    private Long principal;
+
+    //执行人
+    @TableField(exist = false)
+    private String serviceName;
+}

+ 58 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/domain/BizFinancialKeepAccountDetail.java

@@ -0,0 +1,58 @@
+package cn.ezhizao.project.business.keepAccounts.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Accessors(chain = true)
+@ApiModel("biz_financial_keep_account 财务记账详情")
+public class BizFinancialKeepAccountDetail extends BaseEntity {
+    @ApiModelProperty("收款外键")
+    private Long financialKeepAccountId;
+    @ApiModelProperty("客户外键")
+    private Long companyId;
+    @ApiModelProperty("客户名称")
+    @TableField(exist = false)
+    private String companyName;
+    @ApiModelProperty("年")
+    private String year;
+    @ApiModelProperty("月")
+    private String month;
+    @ApiModelProperty("收票日期")
+    private Timestamp receiveDate;
+    @ApiModelProperty("状态")
+    private Integer status;
+    @ApiModelProperty("详情")
+    private String content;
+
+    @ApiModelProperty("本期收入")
+    private BigDecimal currentIncome;
+    @ApiModelProperty("本年收入")
+    private BigDecimal currentYearIncome;
+    @ApiModelProperty("本年累计成本")
+    private BigDecimal cumulativeCost;
+    @ApiModelProperty("是否暂估")
+    private Integer isProvisionalEstimate;
+    @ApiModelProperty("暂估金额")
+    private BigDecimal provisionalEstimateAmount;
+    @ApiModelProperty("本年利润")
+    private BigDecimal currentYearProfit;
+
+    /** 查询条件新增 */
+    @ApiModelProperty("记账表外键")
+    @TableField(exist = false)
+    private List<Long> mainIds;
+
+    @TableField(exist = false)
+    private BigDecimal previousAnnualLosses;
+}

+ 27 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/mapper/BizFinancialKeepAccountDetailMapper.java

@@ -0,0 +1,27 @@
+package cn.ezhizao.project.business.keepAccounts.mapper;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccountDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+@Mapper
+public interface BizFinancialKeepAccountDetailMapper extends BaseMapper<BizFinancialKeepAccountDetail> {
+    /**
+     * 带条件的查询
+     *
+     * @param conditions 条件
+     * @return List 集合
+     */
+    List<BizFinancialKeepAccountDetail> getList(BizFinancialKeepAccountDetail conditions);
+
+    /**
+     * 带条件的查询总数
+     *
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    Integer getTotal(Map<String, Object> conditions);
+
+}

+ 22 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/mapper/BizFinancialKeepAccountMapper.java

@@ -0,0 +1,22 @@
+package cn.ezhizao.project.business.keepAccounts.mapper;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface BizFinancialKeepAccountMapper extends BaseMapper<BizFinancialKeepAccount> {
+
+    /**
+     * 带条件的查询总数
+     *
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    Integer getTotal(Map<String, Object> conditions);
+
+    List<BizFinancialKeepAccount> getList(BizFinancialKeepAccount conditions);
+}

+ 19 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/service/IBizFinancialKeepAccountDetailService.java

@@ -0,0 +1,19 @@
+package cn.ezhizao.project.business.keepAccounts.service;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccountDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IBizFinancialKeepAccountDetailService extends IService<BizFinancialKeepAccountDetail> {
+
+    /**
+     * 带条件的查询总数
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    Integer getTotal(Map<String,Object> conditions);
+
+    List<BizFinancialKeepAccountDetail> getList(BizFinancialKeepAccountDetail conditions);
+}

+ 23 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/service/IBizFinancialKeepAccountService.java

@@ -0,0 +1,23 @@
+package cn.ezhizao.project.business.keepAccounts.service;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IBizFinancialKeepAccountService extends IService<BizFinancialKeepAccount> {
+    /**
+     * 带条件的查询
+     * @param conditions 条件
+     * @return List 集合
+     */
+    List<BizFinancialKeepAccount> getList(BizFinancialKeepAccount conditions);
+
+    /**
+     * 带条件的查询总数
+     * @param conditions 条件
+     * @return int 查询总数量
+     */
+    Integer getTotal(Map<String,Object> conditions);
+}

+ 27 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/service/impl/BizFinancialKeepAccountDetailServiceImpl.java

@@ -0,0 +1,27 @@
+package cn.ezhizao.project.business.keepAccounts.service.impl;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccountDetail;
+import cn.ezhizao.project.business.keepAccounts.mapper.BizFinancialKeepAccountDetailMapper;
+import cn.ezhizao.project.business.keepAccounts.service.IBizFinancialKeepAccountDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class BizFinancialKeepAccountDetailServiceImpl extends ServiceImpl<BizFinancialKeepAccountDetailMapper, BizFinancialKeepAccountDetail> implements IBizFinancialKeepAccountDetailService {
+    @Resource
+    BizFinancialKeepAccountDetailMapper financialKeepAccountDetailDao;
+
+    @Override
+    public List<BizFinancialKeepAccountDetail> getList(BizFinancialKeepAccountDetail conditions) {
+        return financialKeepAccountDetailDao.getList(conditions);
+    }
+
+    @Override
+    public Integer getTotal(Map<String, Object> conditions) {
+        return financialKeepAccountDetailDao.getTotal(conditions);
+    }
+}

+ 27 - 0
src/main/java/cn/ezhizao/project/business/keepAccounts/service/impl/BizFinancialKeepAccountServiceImpl.java

@@ -0,0 +1,27 @@
+package cn.ezhizao.project.business.keepAccounts.service.impl;
+
+import cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount;
+import cn.ezhizao.project.business.keepAccounts.mapper.BizFinancialKeepAccountMapper;
+import cn.ezhizao.project.business.keepAccounts.service.IBizFinancialKeepAccountService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class BizFinancialKeepAccountServiceImpl extends ServiceImpl<BizFinancialKeepAccountMapper, BizFinancialKeepAccount> implements IBizFinancialKeepAccountService {
+    @Resource
+    BizFinancialKeepAccountMapper financialKeepAccountDao;
+
+    @Override
+    public List<BizFinancialKeepAccount> getList(BizFinancialKeepAccount conditions) {
+        return financialKeepAccountDao.getList(conditions);
+    }
+
+    @Override
+    public Integer getTotal(Map<String, Object> conditions) {
+        return financialKeepAccountDao.getTotal(conditions);
+    }
+}

+ 1 - 1
src/main/java/cn/ezhizao/project/system/controller/SysDictDataController.java

@@ -34,7 +34,7 @@ public class SysDictDataController extends BaseController
     @Resource
     private ISysDictTypeService dictTypeService;
 
-    // @PreAuthorize("@ss.hasAnyPermi('system:dict:list,business:crm:dict:list')")
+    @PreAuthorize("@ss.hasAnyPermi('system:dict:list,business:crm:dict:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysDictData dictData) throws NoSuchFieldException, IllegalAccessException
     {

+ 111 - 0
src/main/java/cn/ezhizao/project/system/controller/SysInItRoleController.java

@@ -0,0 +1,111 @@
+package cn.ezhizao.project.system.controller;
+
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import cn.ezhizao.project.system.domain.*;
+
+import cn.ezhizao.project.system.service.ISysRoleInItService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 角色信息
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/inItRole")
+public class SysInItRoleController extends BaseController
+{
+    @Resource
+    private ISysRoleInItService sysRoleInitService;
+
+    /**
+     * 查询roleInit列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysRoleInIt sysRoleInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        startPage();
+        List<SysRoleInIt> list = sysRoleInitService.getList(sysRoleInit);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出roleInit列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:export')")
+    @Log(title = "roleInit", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysRoleInIt sysRoleInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(sysRoleInit);
+        List<SysRoleInIt> list = sysRoleInitService.getList(sysRoleInit);
+        ExcelUtil<SysRoleInIt> util = new ExcelUtil<SysRoleInIt>(SysRoleInIt.class);
+        util.exportExcel(response, list, "roleInit数据");
+    }
+
+    /**
+     * 获取roleInit详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(sysRoleInitService.getById(id));
+    }
+
+    /**
+     * 新增roleInit
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:add')")
+    @Log(title = "roleInit", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysRoleInIt sysRoleInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        //判断角色是否存在
+        List<SysRoleInIt> list = sysRoleInitService.getList(sysRoleInit);
+        if(list.size()>0){
+            return error("新增角色'" + sysRoleInit.getRoleName() + "'失败,角色名称已存在");
+        }
+        return toAjax(sysRoleInitService.insertRoleInIt(sysRoleInit));
+    }
+
+    /**
+     * 修改roleInit
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:edit')")
+    @Log(title = "roleInit", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysRoleInIt sysRoleInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        //判断角色是否存在
+        List<SysRoleInIt> list = sysRoleInitService.getList(sysRoleInit);
+        if(list.size()==1&&list.get(0).getId().equals(sysRoleInit.getId())){
+            return toAjax(sysRoleInitService.updateRoleInIt(sysRoleInit));
+        }
+        return error("修改角色'" + sysRoleInit.getRoleName() + "'失败,角色名称已存在");
+    }
+
+    /**
+     * 删除roleInit
+     */
+    @PreAuthorize("@ss.hasPermi('business:inItRole:remove')")
+    @Log(title = "roleInit", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(sysRoleInitService.deletedRoleInIt(ids));
+    }
+}

+ 127 - 0
src/main/java/cn/ezhizao/project/system/controller/SysRoleMenuInitController.java

@@ -0,0 +1,127 @@
+package cn.ezhizao.project.system.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.project.system.domain.SysMenu;
+import cn.ezhizao.project.system.domain.SysRoleMenuInit;
+import cn.ezhizao.project.system.service.ISysMenuService;
+import cn.ezhizao.project.system.service.ISysRoleMenuInitService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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;
+
+/**
+ * menuRoleController
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+@RestController
+@RequestMapping("/system/menuInit")
+public class SysRoleMenuInitController extends BaseController
+{
+    @Resource
+    private ISysRoleMenuInitService sysRoleMenuInitService;
+
+    @Resource
+    private ISysMenuService menuService;
+
+    /**
+     * 查询menuRole列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysRoleMenuInit sysRoleMenuInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(sysRoleMenuInit);
+        startPage();
+        List<SysRoleMenuInit> list = sysRoleMenuInitService.getList(sysRoleMenuInit);
+        return getDataTable(list);
+    }
+
+    /**
+     * 加载对应角色菜单列表树
+     */
+    @GetMapping(value = "/roleMenuTreeselect/{roleId}")
+    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
+    {
+        List<SysMenu> menus = menuService.selectMenuList(getUserId());
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("checkedKeys", menuService.selectMenuInItListByRoleId(roleId));
+        ajax.put("menus", menuService.buildMenuTreeSelect(menus));
+        return ajax;
+    }
+
+    /**
+     * 导出menuRole列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:export')")
+    @Log(title = "menuRole", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysRoleMenuInit sysRoleMenuInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(sysRoleMenuInit);
+        List<SysRoleMenuInit> list = sysRoleMenuInitService.getList(sysRoleMenuInit);
+        ExcelUtil<SysRoleMenuInit> util = new ExcelUtil<SysRoleMenuInit>(SysRoleMenuInit.class);
+        util.exportExcel(response, list, "menuRole数据");
+    }
+
+    /**
+     * 获取menuRole详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(sysRoleMenuInitService.getById(id));
+    }
+
+    /**
+     * 新增menuRole
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:add')")
+    @Log(title = "menuRole", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysRoleMenuInit sysRoleMenuInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(sysRoleMenuInit);
+        return toAjax(sysRoleMenuInitService.save(sysRoleMenuInit));
+    }
+
+    /**
+     * 修改menuRole
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:edit')")
+    @Log(title = "menuRole", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysRoleMenuInit sysRoleMenuInit) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(sysRoleMenuInit);
+        return toAjax(sysRoleMenuInitService.updateById(sysRoleMenuInit));
+    }
+
+    /**
+     * 删除menuRole
+     */
+    @PreAuthorize("@ss.hasPermi('business:init:remove')")
+    @Log(title = "menuRole", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(sysRoleMenuInitService.removeBatchByIds(ids));
+    }
+}

+ 5 - 2
src/main/java/cn/ezhizao/project/system/controller/SysUserController.java

@@ -109,8 +109,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) throws NoSuchFieldException, IllegalAccessException {
         userService.checkUserDataScope(userId);
         AjaxResult ajax = AjaxResult.success();
         List<SysRole> roles = roleService.selectRoleAll();
@@ -126,6 +125,10 @@ public class SysUserController extends BaseController
             BizUserTenant tenant = userTenantService.getOne(userTenantQueryWrapper);
             ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin() && tenant.getTenantId().equals(r.getTenantId())).collect(Collectors.toList()));
             ajax.put("posts", postService.selectPostAll().stream().filter(p -> tenant.getTenantId().equals(p.getTenantId())).collect(Collectors.toList()));
+        }else{
+            SysUser sysUser = new SysUser();
+            setTenantId(sysUser);
+            ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin() && sysUser.getTenantId().equals(r.getTenantId())).collect(Collectors.toList()));
         }
         return ajax;
     }

+ 44 - 0
src/main/java/cn/ezhizao/project/system/domain/SysRoleInIt.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.system.domain;
+
+
+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;
+
+/**
+ * roleInit对象 sys_role_init
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+@Data
+@TableName(value = "sys_role_init")
+public class SysRoleInIt extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 角色名称
+     */
+    @Excel(name = "角色名称")
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
+    private boolean menuCheckStrictly;
+
+    /** 角色权限 */
+    @Excel(name = "角色权限")
+    private String roleKey;
+
+    /** 菜单组 */
+    private Long[] menuIds;
+}

+ 34 - 0
src/main/java/cn/ezhizao/project/system/domain/SysRoleMenuInit.java

@@ -0,0 +1,34 @@
+package cn.ezhizao.project.system.domain;
+
+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;
+
+/**
+ * menuRole对象 sys_role_menu_init
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+@Data
+@TableName(value = "sys_role_menu_init")
+public class SysRoleMenuInit extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    @ApiModelProperty(value = "类型")
+    private String type;
+
+    /** $column.columnComment */
+    @ApiModelProperty(value = "类型")
+    private Long initRoleId;
+
+    /** $column.columnComment */
+    @ApiModelProperty(value = "类型")
+    private Long menuId;
+
+}

+ 9 - 1
src/main/java/cn/ezhizao/project/system/mapper/SysDictDataMapper.java

@@ -26,7 +26,15 @@ public interface SysDictDataMapper
      * @param dictType 字典类型
      * @return 字典数据集合信息
      */
-    public List<SysDictData> selectDictDataByType(String dictType);
+    public List<SysDictData> selectDictDataByType(@Param("dictType") String dictType, @Param("tenantId") Long tenantId);
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataByType(@Param("dictType") String dictType);
 
     /**
      * 根据字典类型和字典键值查询字典数据信息

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

@@ -134,4 +134,6 @@ public interface SysMenuMapper
     List<SysMenu> selectMenuTreeByVersionId(@Param("versionId")Long versionId, @Param("appKey") String appKey);
 
     List<SysMenu> selectMenuByTenantAdmin(String tenantId);
+
+    List<Long> selectMenuInItListByRoleId(Long roleId,boolean menuCheckStrictly);
 }

+ 38 - 0
src/main/java/cn/ezhizao/project/system/mapper/SysRoleInItMapper.java

@@ -0,0 +1,38 @@
+package cn.ezhizao.project.system.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.system.domain.SysRoleInIt;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * roleInitMapper接口
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+public interface SysRoleInItMapper extends BaseMapper<SysRoleInIt>
+{
+    /**
+     * 查询roleInit列表
+     *
+     * @param sysRoleInit roleInit
+     * @return roleInit集合
+     */
+    public List<SysRoleInIt> getList(SysRoleInIt sysRoleInit);
+
+    /**
+     * 物理删除
+     * @param sysRoleInit
+     * @return 删除结果
+    */
+    public int physicalDelete(SysRoleInIt sysRoleInit);
+
+    SysRoleInIt getById(Long id);
+
+    int insertRoleInIt(SysRoleInIt sysRoleInit);
+
+    int  updateRoleInIt(SysRoleInIt sysRoleInit);
+
+    int deleteRoleInItByIds(List<Long> ids);
+}

+ 38 - 0
src/main/java/cn/ezhizao/project/system/mapper/SysRoleMenuInitMapper.java

@@ -0,0 +1,38 @@
+package cn.ezhizao.project.system.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.system.domain.SysRoleMenuInit;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * menuRoleMapper接口
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+public interface SysRoleMenuInitMapper extends BaseMapper<SysRoleMenuInit>
+{
+    /**
+     * 查询menuRole列表
+     *
+     * @param sysRoleMenuInit menuRole
+     * @return menuRole集合
+     */
+    public List<SysRoleMenuInit> getList(SysRoleMenuInit sysRoleMenuInit);
+
+    /**
+     * 物理删除
+     * @param sysRoleMenuInit
+     * @return 删除结果
+    */
+    public int physicalDelete(SysRoleMenuInit sysRoleMenuInit);
+
+    List<SysRoleMenuInit> selectMenuList(Long userId);
+
+    int batchRoleMenu(List<SysRoleMenuInit> list);
+
+    int deleteRoleMenuByRoleId(Long id);
+
+    int deleteRoleMenu(List<Long> ids);
+}

+ 1 - 0
src/main/java/cn/ezhizao/project/system/service/ISysMenuService.java

@@ -150,4 +150,5 @@ public interface ISysMenuService
 
     List<SysMenu> selectMenuTreeByTenantId(Long tenantId);
 
+    List<Long> selectMenuInItListByRoleId(Long roleId);
 }

+ 38 - 0
src/main/java/cn/ezhizao/project/system/service/ISysRoleInItService.java

@@ -0,0 +1,38 @@
+package cn.ezhizao.project.system.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.system.domain.SysRoleInIt;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * roleInitService接口
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+public interface ISysRoleInItService extends IService<SysRoleInIt>
+{
+    /**
+     * 查询roleInit列表
+     *
+     * @param sysRoleInit roleInit
+     * @return roleInit集合
+     */
+    public List<SysRoleInIt> getList(SysRoleInIt sysRoleInit);
+
+    /**
+     * 物理删除
+     * @param sysRoleInit
+     * @return 删除结果
+     */
+    public int physicalDelete(SysRoleInIt sysRoleInit);
+
+    public SysRoleInIt getById(Long id);
+
+    int insertRoleInIt(SysRoleInIt sysRoleInit);
+
+    int updateRoleInIt(SysRoleInIt sysRoleInit);
+
+    int deletedRoleInIt(List<Long> ids);
+}

+ 33 - 0
src/main/java/cn/ezhizao/project/system/service/ISysRoleMenuInitService.java

@@ -0,0 +1,33 @@
+package cn.ezhizao.project.system.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.system.domain.SysMenu;
+import cn.ezhizao.project.system.domain.SysRoleMenuInit;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * menuRoleService接口
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+public interface ISysRoleMenuInitService extends IService<SysRoleMenuInit>
+{
+    /**
+     * 查询menuRole列表
+     *
+     * @param sysRoleMenuInit menuRole
+     * @return menuRole集合
+     */
+    public List<SysRoleMenuInit> getList(SysRoleMenuInit sysRoleMenuInit);
+
+    /**
+     * 物理删除
+     * @param sysRoleMenuInit
+     * @return 删除结果
+     */
+    public int physicalDelete(SysRoleMenuInit sysRoleMenuInit);
+
+    List<SysRoleMenuInit> selectMenuList(Long userId);
+}

+ 3 - 3
src/main/java/cn/ezhizao/project/system/service/impl/SysDictTypeServiceImpl.java

@@ -84,15 +84,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
     @Override
     public List<SysDictData> selectDictDataByType(String dictType, Long tenantId)
     {
-        List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
+        List<SysDictData> dictDatas = DictUtils.getDictCache(dictType, tenantId);
         if (StringUtils.isNotEmpty(dictDatas))
         {
             return dictDatas;
         }
-        dictDatas = dictDataMapper.selectDictDataByType(dictType);
+        dictDatas = dictDataMapper.selectDictDataByType(dictType, tenantId);
         if (StringUtils.isNotEmpty(dictDatas))
         {
-            DictUtils.setDictCache(dictType, dictDatas);
+            DictUtils.setDictCache(dictType, tenantId, dictDatas);
             return dictDatas;
         }
         return null;

+ 16 - 0
src/main/java/cn/ezhizao/project/system/service/impl/SysMenuServiceImpl.java

@@ -10,6 +10,7 @@ import cn.ezhizao.project.system.domain.*;
 import cn.ezhizao.project.system.domain.vo.MetaVo;
 import cn.ezhizao.project.system.domain.vo.RouterVo;
 import cn.ezhizao.project.system.mapper.SysMenuMapper;
+import cn.ezhizao.project.system.mapper.SysRoleInItMapper;
 import cn.ezhizao.project.system.mapper.SysRoleMapper;
 import cn.ezhizao.project.system.mapper.SysRoleMenuMapper;
 import cn.ezhizao.project.system.service.*;
@@ -57,6 +58,8 @@ public class SysMenuServiceImpl implements ISysMenuService
     private ISysModuleDetailService moduleDetailService;
     @Resource
     private ISysModuleService moduleService;
+    @Resource
+    private SysRoleInItMapper roleInItMapper;
 
     @Resource
     private HttpServletRequest request;
@@ -290,6 +293,19 @@ public class SysMenuServiceImpl implements ISysMenuService
         return getChildPerms(menus, 0);
     }
 
+    /**
+     * 根据角色ID查询菜单树信息
+     *
+     * @param roleId 角色ID
+     * @return 选中菜单列表
+     */
+    @Override
+    public List<Long> selectMenuInItListByRoleId(Long roleId) {
+        SysRoleInIt role = roleInItMapper.getById(roleId);
+        return menuMapper.selectMenuInItListByRoleId(roleId,role.isMenuCheckStrictly());
+    }
+
+
     /**
      * 根据角色ID查询菜单树信息
      *

+ 97 - 0
src/main/java/cn/ezhizao/project/system/service/impl/SysRoleInItServiceImpl.java

@@ -0,0 +1,97 @@
+package cn.ezhizao.project.system.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.system.domain.SysRoleInIt;
+import cn.ezhizao.project.system.domain.SysRoleMenu;
+import cn.ezhizao.project.system.domain.SysRoleMenuInit;
+import cn.ezhizao.project.system.mapper.SysRoleInItMapper;
+import cn.ezhizao.project.system.mapper.SysRoleMenuInitMapper;
+import cn.ezhizao.project.system.service.ISysRoleInItService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * roleInitService业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+@Service
+public class SysRoleInItServiceImpl extends ServiceImpl<SysRoleInItMapper, SysRoleInIt> implements ISysRoleInItService
+{
+    @Resource
+    private SysRoleInItMapper sysRoleInitMapper;
+
+    @Resource
+    private SysRoleMenuInitMapper  roleMenuMapper;
+
+    /**
+     * 查询roleInit列表
+     *
+     * @param sysRoleInit roleInit
+     * @return roleInit
+     */
+    @Override
+    public List<SysRoleInIt> getList(SysRoleInIt sysRoleInit)
+    {
+        return sysRoleInitMapper.getList(sysRoleInit);
+    }
+
+    /**
+     * 物理删除
+     * @param sysRoleInit
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(SysRoleInIt sysRoleInit){ return sysRoleInitMapper.physicalDelete(sysRoleInit); }
+
+    @Override
+    public SysRoleInIt getById(Long id) {
+        return sysRoleInitMapper.getById(id);
+    }
+
+    @Override
+    public int insertRoleInIt(SysRoleInIt sysRoleInit) {
+        sysRoleInitMapper.insertRoleInIt(sysRoleInit);
+        return insertRoleMenuInIt(sysRoleInit);
+    }
+
+    @Override
+    public int updateRoleInIt(SysRoleInIt sysRoleInit) {
+
+        //修改初始化角色表
+        sysRoleInitMapper.updateRoleInIt(sysRoleInit);
+        //删除初始化角色表关联菜单
+        roleMenuMapper.deleteRoleMenuByRoleId(sysRoleInit.getId());
+        return insertRoleMenuInIt(sysRoleInit);
+    }
+
+    @Override
+    public int deletedRoleInIt(List<Long> ids) {
+
+        roleMenuMapper.deleteRoleMenu(ids);
+        return sysRoleInitMapper.deleteRoleInItByIds(ids);
+    }
+
+    public int insertRoleMenuInIt(SysRoleInIt role){
+        int rows = 1;
+        List<SysRoleMenuInit> list = new ArrayList<SysRoleMenuInit>();
+        for (Long menuId : role.getMenuIds())
+        {
+            SysRoleMenuInit rm = new SysRoleMenuInit();
+            rm.setInitRoleId(role.getId());
+            rm.setMenuId(menuId);
+            list.add(rm);
+        }
+        if (list.size() > 0)
+        {
+            rows = roleMenuMapper.batchRoleMenu(list);
+        }
+        return rows;
+    }
+
+}

+ 51 - 0
src/main/java/cn/ezhizao/project/system/service/impl/SysRoleMenuInitServiceImpl.java

@@ -0,0 +1,51 @@
+package cn.ezhizao.project.system.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.system.domain.SysRoleMenuInit;
+import cn.ezhizao.project.system.mapper.SysRoleMenuInitMapper;
+import cn.ezhizao.project.system.service.ISysRoleMenuInitService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * menuRoleService业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-01-10
+ */
+@Service
+public class SysRoleMenuInitServiceImpl  extends ServiceImpl<SysRoleMenuInitMapper, SysRoleMenuInit> implements ISysRoleMenuInitService
+{
+    @Resource
+    private SysRoleMenuInitMapper sysRoleMenuInitMapper;
+
+    /**
+     * 查询menuRole列表
+     *
+     * @param sysRoleMenuInit menuRole
+     * @return menuRole
+     */
+    @Override
+    public List<SysRoleMenuInit> getList(SysRoleMenuInit sysRoleMenuInit)
+    {
+        return sysRoleMenuInitMapper.getList(sysRoleMenuInit);
+    }
+
+    /**
+     * 物理删除
+     * @param sysRoleMenuInit
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(SysRoleMenuInit sysRoleMenuInit){ return sysRoleMenuInitMapper.physicalDelete(sysRoleMenuInit); }
+
+    @Override
+    public List<SysRoleMenuInit> selectMenuList(Long userId) {
+        return sysRoleMenuInitMapper.selectMenuList(userId);
+    }
+
+
+
+}

+ 18 - 2
src/main/java/cn/ezhizao/project/tenant/controller/TenantController.java

@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -320,17 +321,32 @@ public class TenantController extends BaseController {
 
     private boolean initRoles(InitTenantVo initFlow) {
         List<SysRole> sysRoles = initFlow.getInitRoles();
+        sysRoles.forEach(v -> v.setTenantId(initFlow.getTenantId()));
         List<SysRole> existsRoles = roleService.selectRolesByTenantId(initFlow.getTenantId());
+
         // 判断角色是否存在
         List<SysRole> insertRoles = sysRoles.stream().filter(v -> existsRoles.stream().noneMatch(t -> v.getInitId().equals(t.getInitId()))).collect(Collectors.toList());
-        List<SysRole> updateRoles = sysRoles.stream().filter(v -> existsRoles.stream().anyMatch(t -> t.getInitId().equals(v.getInitId()))).collect(Collectors.toList());
+        List<SysRole> updateRoles = new ArrayList<>();
+        for (SysRole sysRole : sysRoles) {
+            boolean b = false;
+            for (SysRole t : existsRoles) {
+                if (t.getInitId().equals(sysRole.getInitId())) {
+                    b = true;
+                    sysRole.setRoleId(t.getRoleId());
+                    break;
+                }
+            }
+            if (b) {
+                updateRoles.add(sysRole);
+            }
+        }
         // 不存在则新增角色
         AtomicInteger insertRole = new AtomicInteger();
         insertRoles.forEach(v -> insertRole.addAndGet(roleService.insertRole(v)));
         // 存在则更新角色
         AtomicInteger updateRole = new AtomicInteger();
         updateRoles.forEach(v -> updateRole.addAndGet(roleService.updateRole(v)));
-        return sysRoles.isEmpty() || insertRole.getAndAdd(updateRole.get()) > 0;
+        return sysRoles.isEmpty() ||updateRole.getAndAdd(updateRole.get()) > 0 ||insertRole.getAndAdd(updateRole.get()) > 0;
     }
 
     private boolean initAdminSysUser(InitTenantVo initFlow) {

+ 54 - 0
src/main/resources/mybatis/business/BizArchiveReceiveTicketFinishedMapper.xml

@@ -0,0 +1,54 @@
+<?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.financialBase.mapper.BizArchiveReceiveTicketFinishedMapper">
+    <!-- 基础的返回map 多表复杂的 自行组合 -->
+    <resultMap id="BaseResultMap" type="cn.ezhizao.project.business.financialBase.domain.BizArchiveReceiveTicketFinished">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="id" jdbcType="BIGINT" property="id"/>
+        <result column="year" jdbcType="CHAR" property="year"/>
+        <result column="month" jdbcType="CHAR" property="month"/>
+        <result column="is_finished" jdbcType="TINYINT" property="isFinished"/>
+    </resultMap>
+
+    <!--带条件的List查询-->
+    <select id="getList" resultMap="BaseResultMap">
+        <include refid="getListSql"/>
+    </select>
+
+    <!--带条件的List查询 数据总条数-->
+    <select id="getTotal" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM (<include refid="getListSql"/>) AS C
+    </select>
+
+    <sql id="getListSql">
+        SELECT * FROM biz_archive_receive_ticket_finished
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0 AND
+            <if test="id != null  ">
+                id = #{id} AND
+            </if>
+            <if test="year != null  and year != '' ">
+                year = #{year} AND
+            </if>
+            <if test="month != null  and month != '' ">
+                month = #{month} AND
+            </if>
+            <if test="isFinished != null  ">
+                is_finished = #{isFinished} AND
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId} AND
+            </if>
+        </trim>
+    </sql>
+
+    <!-- 工业大学科研管理系统 导出数据用-->
+    <select id="getOldData" resultMap="BaseResultMap">
+        SELECT * FROM biz_archive_receive_ticket_finished
+    </select>
+
+    <delete id="clear" parameterType="java.lang.Long">
+        DELETE FROM biz_archive_receive_ticket_finished WHERE id IS NULL;
+    </delete>
+    <!-- 工业大学科研管理系统 导出数据用-->
+</mapper>

+ 42 - 0
src/main/resources/mybatis/business/BizArchiveReceiveTicketMapper.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.archiveTicket.mapper.BizArchiveReceiveTicketMapper">
+
+    <resultMap type="cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket"
+               id="BizArchiveReceiveTicketResult">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizArchiveReceiveTicket" resultMap="BizArchiveReceiveTicketResult">
+        SELECT t1.* FROM biz_archive_receive_ticket t1
+        LEFT JOIN biz_company t2 ON t2.id = t2.id = t1.company_id
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            t1.deleted = 0
+            <if test="companyId != null ">AND t1.company_id = #{companyId}</if>
+
+            <if test="year != null  and year != ''">AND t1.year = #{year}</if>
+            <if test="month != null  and month != ''">AND t1.month = #{month}</if>
+            <if test="fileUrl != null  and fileUrl != ''">AND t1.file_url = #{fileUrl}</if>
+            <if test="fileName != null  and fileName != ''">AND t1.file_name like concat('%', #{fileName}, '%')</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_archive_receive_ticket
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId} AND
+            </if>
+            <if test="year != null  and year != ''">year = #{year} AND</if>
+            <if test="month != null  and month != ''">month = #{month} AND</if>
+
+            <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 58 - 0
src/main/resources/mybatis/business/BizCompanyMapper.xml

@@ -0,0 +1,58 @@
+<?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.company.mapper.BizCompanyMapper">
+
+    <resultMap type="cn.ezhizao.project.business.company.domain.BizCompany" id="BizCompanyResult">
+        <id column="id" property="id"/>
+        <result column="source_category_id" property="sourceCategoryId" />
+        <association property="sourceCategoryName" javaType="java.lang.String" select="getSourceCategoryName" column="source_category_id"/>
+        <association property="referrerDataSource" javaType="java.lang.String" select="getReferrerDataSource" column="source_category_id"/>
+    </resultMap>
+
+    <select id="getSourceCategoryName" resultType="java.lang.String">
+        select title from biz_source where id = #{source_category_id}
+    </select>
+    <select id="getReferrerDataSource" resultType="java.lang.String">
+        select referrer_data_source from biz_source where id = #{source_category_id}
+    </select>
+
+    <select id="getList" parameterType="BizCompany" resultMap="BizCompanyResult">
+        SELECT
+        c.*, s.nick_name as leader_name, a.nick_name as adviser_name
+        FROM biz_company c
+        LEFT JOIN sys_user s ON c.leader_id=s.user_id
+        Left join sys_user a on c.adviser_id = a.user_id
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            c.deleted = 0
+            <if test="id != null  and id != ''">AND c.id = #{id}</if>
+            <if test="category != null  and category != ''">AND c.category = #{category}</if>
+            <if test="code != null  and code != ''">AND c.code = #{code}</if>
+            <if test="name != null  and name != ''">AND c.name like concat('%', #{name}, '%')</if>
+            <if test="keyword != null  and keyword != ''">AND (c.name like concat('%', #{keyword}, '%') or c.code like concat('%', #{keyword}, '%'))</if>
+            <if test="tenantId != null"> AND (c.tenant_id = #{tenantId}
+                or exists (select 1 from biz_entrust entrust where entrust.deleted = 0 and entrust.company_id =
+                c.id and entrust.task_type_id = 1 and entrust.to_tenant_id = #{tenantId}) )</if>
+        </trim>
+    </select>
+
+    <select id="getById" parameterType="Long" resultMap="BizCompanyResult">
+        SELECT * FROM biz_company WHERE id = #{id}
+    </select>
+
+
+    <select id="getUserById" resultType="String">
+        SELECT nick_name FROM sys_user WHERE user_id = #{id}
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_company
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+            <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 31 - 0
src/main/resources/mybatis/business/BizEntrustMapper.xml

@@ -0,0 +1,31 @@
+<?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.entrust.mapper.BizEntrustMapper">
+
+    <resultMap type="cn.ezhizao.project.business.entrust.domain.BizEntrust" id="BizEntrustResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizEntrust" resultMap="BizEntrustResult">
+        SELECT * FROM biz_entrust
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="companyId != null "> AND company_id = #{companyId}</if>
+            <if test="taskTypeId != null "> AND task_type_id = #{taskTypeId}</if>
+            <if test="isStop != null "> AND is_stop = #{isStop}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_entrust
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 44 - 0
src/main/resources/mybatis/business/BizFinancialKeepAccountDetailMapper.xml

@@ -0,0 +1,44 @@
+<?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.keepAccounts.mapper.BizFinancialKeepAccountDetailMapper">
+    <!-- 基础的返回map 多表复杂的 自行组合 -->
+    <resultMap id="BaseResultMap" type="cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccountDetail" />
+
+    <!--带条件的List查询-->
+    <select id="getList" resultMap="BaseResultMap">
+        <include refid="getListSql" />
+    </select>
+
+    <!--带条件的List查询 数据总条数-->
+    <select id="getTotal" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM (<include refid="getListSql" />) AS t
+    </select>
+
+    <sql id="getListSql">
+        SELECT
+        t1.*, t2.name as company_name
+        from
+        biz_financial_keep_account_detail t1
+        left join biz_company t2 on t2.id = t1.company_id
+        WHERE
+        t1.deleted = 0
+        <if test="id != null">
+            AND t1.id = #{id}
+        </if>
+        <if test="financialKeepAccountId != null">
+            AND t1.financial_keep_account_id = ${financialKeepAccountId}
+        </if>
+        <if test="year != null and year != ''">
+            AND t1.year = #{year}
+        </if>
+        <if test="month != null and month != ''">
+            AND t1.month = #{month}
+        </if>
+        <if test="mainIds != null and mainIds.size > 0">
+            AND t1.financial_keep_account_id in
+            <foreach collection="mainIds" index="index" item="item" separator=","  open="(" close=")">
+                #{item,jdbcType=BIGINT}
+            </foreach>
+        </if>
+    </sql>
+</mapper>

+ 77 - 0
src/main/resources/mybatis/business/BizFinancialKeepAccountMapper.xml

@@ -0,0 +1,77 @@
+<?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.keepAccounts.mapper.BizFinancialKeepAccountMapper">
+    <!-- 基础的返回map 多表复杂的 自行组合 -->
+    <resultMap id="BaseResultMap" type="cn.ezhizao.project.business.keepAccounts.domain.BizFinancialKeepAccount" >
+        <result column="company_id" jdbcType="BIGINT" property="companyId"/>
+        <association property="serviceName" select="getServiceName" column="company_id"></association>
+    </resultMap>
+
+    <!--带条件的List查询-->
+    <select id="getList" resultMap="BaseResultMap">
+        <include refid="getListSql" />
+    </select>
+
+    <!--带条件的List查询 数据总条数-->
+    <select id="getTotal" resultType="java.lang.Integer">
+        SELECT COUNT(1) FROM (<include refid="getListSql" />) AS t
+    </select>
+
+    <select id="getServiceName" resultType="String">
+        SELECT s.nick_name FROM sys_user s
+        WHERE s.user_id =(SELECT leader_id  FROM biz_company WHERE id=#{company_id})
+    </select>
+
+    <sql id="getListSql">
+        SELECT
+        t1.*, t2.name as company_name,
+        t3.account_name as from_company_name, t2.tax_type
+        from biz_financial_keep_account t1
+        left join biz_company t2 on t2.id = t1.company_id
+        left join biz_tenant t3 on t3.id = t1.tenant_id
+        WHERE
+        t1.deleted = 0
+        <if test="id != null">
+            AND t1.id = #{id}
+        </if>
+        <if test="principal != null and principal != ''">
+            AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+        </if>
+        <if test="isZero != null">
+            AND t2.is_zero = #{isZero}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            AND (t2.name like concat('%', #{keyword}, '%') or t2.code like concat('%', #{keyword}, '%'))
+        </if>
+        <if test="workOrderId != null and workOrderId != ''">
+            AND t1.work_order_id = #{workOrderId}
+        </if>
+        <if test="taxType != null and taxType != ''">
+            AND t2.tax_type = #{taxType}
+        </if>
+        <if test="fromCompanyName != null and fromCompanyName != ''">
+            AND (t3.account_name like concat('%', #{fromCompanyName}, '%'))
+        </if>
+        <if test="companyName != null and companyName != ''">
+            AND (t2.name like concat('%', #{companyName}, '%'))
+        </if>
+        <if test="month != null and year != null">
+            <if test="tenantId != null">
+                AND exists (select 1 from biz_entrust eb
+                where eb.deleted = 0
+                and (eb.to_tenant_id = #{tenantId} or eb.from_tenant_id = #{tenantId})
+                and date_format(eb.current_month, '%Y%m') = concat(#{year}, #{month})
+                and eb.work_order_id = t1.work_order_id
+                )
+            </if>
+            <if test="status != null and status != 0">
+                AND exists (select 1 from biz_financial_keep_account_detail fsd where fsd.financial_keep_account_id = t1.id and
+                fsd.month = #{month} and fsd.year = #{year} and fsd.status = #{status})
+            </if>
+            <if test="status != null and status == 0">
+                AND not exists (select 1 from biz_financial_keep_account_detail fsd where fsd.financial_keep_account_id = t1.id and
+                fsd.month = #{month} and fsd.year = #{year})
+            </if>
+        </if>
+    </sql>
+</mapper>

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

@@ -135,6 +135,19 @@
 		order by m.parent_id, m.order_num
 	</select>
 
+
+
+	<select id="selectMenuInItListByRoleId" resultType="Long">
+		select m.menu_id
+		from sys_menu m
+		left join sys_role_menu_init rm on m.menu_id = rm.menu_id
+		where rm.init_role_id = #{roleId}
+		<if test="menuCheckStrictly">
+			and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu_init rm on m.menu_id = rm.menu_id and rm.init_role_id = #{roleId})
+		</if>
+		order by m.parent_id, m.order_num
+	</select>
+
 	<select id="selectMenuListByRoleId" resultType="Long">
 		select m.menu_id
 		from sys_menu m

+ 69 - 0
src/main/resources/mybatis/system/SysRoleInItMapper.xml

@@ -0,0 +1,69 @@
+<?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.system.mapper.SysRoleInItMapper">
+
+    <resultMap type="cn.ezhizao.project.system.domain.SysRoleInIt" id="SysRoleInItResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="SysRoleInIt" resultMap="SysRoleInItResult">
+        SELECT * FROM sys_role_init
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="roleName != null  and roleName != ''">AND role_name like concat('%', #{roleName}, '%')</if>
+        </trim>
+    </select>
+
+    <select id="getById" parameterType="SysRoleInIt" resultMap="SysRoleInItResult">
+        SELECT * FROM sys_role_init
+        WHERE id=#{id}
+        AND deleted=0
+    </select>
+
+    <update id="updateRoleInIt" parameterType="SysRoleInIt">
+        update sys_role_init
+        <set>
+            <if test="roleName!= null">role_name=#{roleName},</if>
+            <if test="remark!= null">remark=#{remark},</if>
+            <if test="menuCheckStrictly!= null">menu_check_strictly=#{menuCheckStrictly},</if>
+            <if test="roleKey!= null">role_key=#{roleKey},</if>
+        </set>
+        <where>
+            id=#{id}
+        </where>
+    </update>
+
+    <insert id="insertRoleInIt" useGeneratedKeys="true" keyProperty="id" parameterType="SysRoleInIt">
+        insert into sys_role_init(
+        role_name
+        <if test="remark != null and remark != ''">,remark</if>
+        <if test="menuCheckStrictly != null ">,menu_check_strictly</if>
+        <if test="roleKey!= null and roleKey != '' ">,role_key</if>
+        )values(
+        #{roleName}
+        <if test="remark != null and remark != '' ">,#{remark}</if>
+        <if test="menuCheckStrictly != null ">,#{menuCheckStrictly}</if>
+        <if test="roleKey!= null  and roleKey != ''">,#{roleKey}</if>
+        )
+    </insert>
+
+    <update id="deleteRoleInItByIds" parameterType="Long">
+        update sys_role_init set deleted = 1 where id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <delete id="physicalDelete">
+        DELETE FROM sys_role_init
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 1 - 1
src/main/resources/mybatis/system/SysRoleMapper.xml

@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<sql id="selectRoleVo">
 	    select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
-            r.status, r.del_flag, r.create_time, r.remark, r.tenant_id
+            r.status, r.del_flag, r.create_time, r.remark, r.tenant_id,r.init_id
         from sys_role r
 	        left join sys_user_role ur on ur.role_id = r.role_id
 	        left join sys_user u on u.user_id = ur.user_id

+ 50 - 0
src/main/resources/mybatis/system/SysRoleMenuInitMapper.xml

@@ -0,0 +1,50 @@
+<?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.system.mapper.SysRoleMenuInitMapper">
+
+    <resultMap type="cn.ezhizao.project.system.domain.SysRoleMenuInit" id="SysRoleMenuInitResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="SysRoleMenuInit" resultMap="SysRoleMenuInitResult">
+        SELECT * FROM sys_role_menu_init
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="type != null  and type != ''"> AND type = #{type}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM sys_role_menu_init
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+
+    <delete id="deleteRoleMenuByRoleId">
+        DELETE FROM sys_role_menu_init
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            init_role_id = #{roleId}
+        </trim>
+    </delete>
+
+    <delete id="deleteRoleMenu" parameterType="Long">
+        delete from sys_role_menu_init where init_role_id in
+        <foreach collection="ids" item="roleId" open="(" separator="," close=")">
+            #{roleId}
+        </foreach>
+    </delete>
+
+    <insert id="batchRoleMenu">
+        insert into sys_role_menu_init(init_role_id, menu_id) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.initRoleId},#{item.menuId})
+        </foreach>
+    </insert>
+</mapper>

+ 20 - 2
src/main/resources/mybatis/tenant/TenantMapper.xml

@@ -18,6 +18,16 @@
         <id column="role_id" property="roleId" />
     </resultMap>
 
+    <resultMap id="RoleInItResult" type="cn.ezhizao.project.system.domain.SysRole">
+        <id column="id" property="id" />
+        <result column="init_id" property="initId" />
+        <collection property="menuIds" ofType="java.lang.Long" column="init_id" select="getInItMenuIds" />
+    </resultMap>
+
+    <resultMap id="SysRoleMenuInitResult" type="cn.ezhizao.project.system.domain.SysRoleMenuInit">
+
+    </resultMap>
+
     <resultMap id="SourceResult" type="cn.ezhizao.project.setting.domain.BizSource">
         <id column="id" property="id" />
     </resultMap>
@@ -111,9 +121,17 @@
         and sys_role.tenant_id = #{tenantId}
         and is_init = '1'
     </select>
-    <select id="initRolesData" resultMap="RoleResult">
-        select id as init_id, role_name, remark from sys_role_init
+
+    <select id="getInItMenuIds" resultType="java.lang.Long">
+        select menu_id from sys_role_menu_init
+        WHERE init_role_id =#{roleId}
     </select>
+
+    <select id="initRolesData" resultMap="RoleInItResult">
+        select id as init_id, role_name, remark ,role_key,role_sort,menu_check_strictly from sys_role_init
+        WHERE deleted = 0
+    </select>
+
     <select id="getMenuIds" resultType="java.lang.Long">
         select sys_module_detail.menu_id from biz_tenant
         left join sys_version_menu on sys_version_menu.version_id = biz_tenant.version_id