From 6836a3e230c874e457a21ea8ec2b99e74711049c Mon Sep 17 00:00:00 2001 From: username Date: Tue, 27 Aug 2024 13:52:46 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E3=80=81=E6=8F=92=E4=BB=B6=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E3=80=81=E6=8F=92=E4=BB=B6=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E3=80=81=E6=8F=92=E4=BB=B6=E6=92=A4=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/pom.xml | 6 + .../main/resources/application-zqtlocal.yml | 39 +++ .../excel/template/dao/IExcelTemplateDao.java | 15 + .../dao/impl/ExcelTemplateDaoImpl.java | 17 ++ .../template/entity/ExcelTemplateEntity.java | 76 +++++ .../template/entity/ExcelTemplateEntity.xml | 261 ++++++++++++++++ .../service/IExcelTemplateService.java | 12 + .../impl/ExcelTemplateServiceImpl.java | 26 ++ .../dao/IExcelTemplateConfigDao.java | 15 + .../dao/impl/ExcelTemplateConfigDaoImpl.java | 17 ++ .../entity/ExcelTemplateConfigEntity.java | 66 +++++ .../entity/ExcelTemplateConfigEntity.xml | 243 +++++++++++++++ .../service/IExcelTemplateConfigService.java | 12 + .../impl/ExcelTemplateConfigServiceImpl.java | 26 ++ .../dao/IExcelTemplateConfigDetailDao.java | 15 + .../ExcelTemplateConfigDetailDaoImpl.java | 17 ++ .../ExcelTemplateConfigDetailEntity.java | 96 ++++++ .../ExcelTemplateConfigDetailEntity.xml | 278 ++++++++++++++++++ .../IExcelTemplateConfigDetailService.java | 12 + .../ExcelTemplateConfigDetailServiceImpl.java | 26 ++ .../download/entity/FileDownloadEntity.java | 12 + .../download/entity/FileDownloadEntity.xml | 13 +- .../service/IFileDownloadService.java | 2 + .../service/impl/FileDownloadServiceImpl.java | 158 +++++++++- .../file/upload/entity/FileResultEntity.java | 2 + .../sys/file/upload/entity/FileUploadDto.java | 14 + .../file/upload/entity/FileUploadEntity.java | 14 + .../file/upload/entity/FileUploadEntity.xml | 12 + .../upload/service/IFileUploadService.java | 2 + .../service/impl/FileUploadServiceImpl.java | 102 ++++++- .../com/hzya/frame/sys/org/entity/Org.java | 2 + .../dao/ISysApplicationDictionaryDao.java | 15 + .../impl/SysApplicationDictionaryDaoImpl.java | 17 ++ .../SysApplicationDictionaryEntity.java | 76 +++++ .../entity/SysApplicationDictionaryEntity.xml | 256 ++++++++++++++++ .../ISysApplicationDictionaryService.java | 12 + .../SysApplicationDictionaryServiceImpl.java | 26 ++ .../ISysApplicationDictionaryDetailDao.java | 15 + ...SysApplicationDictionaryDetailDaoImpl.java | 17 ++ .../SysApplicationDictionaryDetailEntity.java | 76 +++++ .../SysApplicationDictionaryDetailEntity.xml | 256 ++++++++++++++++ ...SysApplicationDictionaryDetailService.java | 12 + ...pplicationDictionaryDetailServiceImpl.java | 26 ++ .../entity/SysApplicationPluginEntity.java | 19 ++ .../entity/SysApplicationPluginEntity.xml | 20 +- .../service/ISysApplicationService.java | 2 + .../impl/SysApplicationServiceImpl.java | 48 +++ .../mapper/ExcelTemplateConfigDetailDao.xml | 239 +++++++++++++++ .../SysApplicationDictionaryDetailDao.xml | 217 ++++++++++++++ .../controler/EntranceController.java | 53 +++- .../entrance/service/IEntranceService.java | 3 + .../service/impl/EntranceServiceImpl.java | 18 ++ 52 files changed, 3018 insertions(+), 13 deletions(-) create mode 100644 buildpackage/src/main/resources/application-zqtlocal.yml create mode 100644 service/src/main/java/com/hzya/frame/excel/template/dao/IExcelTemplateDao.java create mode 100644 service/src/main/java/com/hzya/frame/excel/template/dao/impl/ExcelTemplateDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.java create mode 100644 service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/excel/template/service/IExcelTemplateService.java create mode 100644 service/src/main/java/com/hzya/frame/excel/template/service/impl/ExcelTemplateServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/dao/IExcelTemplateConfigDao.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/dao/impl/ExcelTemplateConfigDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/service/IExcelTemplateConfigService.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfig/service/impl/ExcelTemplateConfigServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/IExcelTemplateConfigDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/impl/ExcelTemplateConfigDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/IExcelTemplateConfigDetailService.java create mode 100644 service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/impl/ExcelTemplateConfigDetailServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/ISysApplicationDictionaryDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/impl/SysApplicationDictionaryDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/ISysApplicationDictionaryService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/impl/SysApplicationDictionaryServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/ISysApplicationDictionaryDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/impl/SysApplicationDictionaryDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/ISysApplicationDictionaryDetailService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/impl/SysApplicationDictionaryDetailServiceImpl.java create mode 100644 service/src/main/resources/mapper/ExcelTemplateConfigDetailDao.xml create mode 100644 service/src/main/resources/mapper/SysApplicationDictionaryDetailDao.xml diff --git a/buildpackage/pom.xml b/buildpackage/pom.xml index 5c949541..fea721b7 100644 --- a/buildpackage/pom.xml +++ b/buildpackage/pom.xml @@ -69,6 +69,12 @@ llg + + zqtlocal + + zqtlocal + + yuqh diff --git a/buildpackage/src/main/resources/application-zqtlocal.yml b/buildpackage/src/main/resources/application-zqtlocal.yml new file mode 100644 index 00000000..a656bd59 --- /dev/null +++ b/buildpackage/src/main/resources/application-zqtlocal.yml @@ -0,0 +1,39 @@ +#######################zqtlocal环境####################### +logging: + #日志级别 指定目录级别 + level: + root: warn + encodings: UTF-8 + file: + # 日志保存路径 + path: D:/local/logs/ +spring: + datasource: + dynamic: + datasource: + master: + url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: 62e4295b615a30dbf3b8ee96f41c820b + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: D:/local/upload/ + pluginpath : D:/local/plugin/ + tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\ +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +zt: + url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/excel/template/dao/IExcelTemplateDao.java b/service/src/main/java/com/hzya/frame/excel/template/dao/IExcelTemplateDao.java new file mode 100644 index 00000000..0ba1ac03 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/dao/IExcelTemplateDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.excel.template.dao; + +import com.hzya.frame.excel.template.entity.ExcelTemplateEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * excel模版表(excel_template: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:42:49 + */ +public interface IExcelTemplateDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/template/dao/impl/ExcelTemplateDaoImpl.java b/service/src/main/java/com/hzya/frame/excel/template/dao/impl/ExcelTemplateDaoImpl.java new file mode 100644 index 00000000..2427d9cc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/dao/impl/ExcelTemplateDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.excel.template.dao.impl; + +import com.hzya.frame.excel.template.entity.ExcelTemplateEntity; +import com.hzya.frame.excel.template.dao.IExcelTemplateDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * excel模版表(ExcelTemplate)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:42:50 + */ +@Repository(value = "ExcelTemplateDaoImpl") +public class ExcelTemplateDaoImpl extends MybatisGenericDao implements IExcelTemplateDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.java b/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.java new file mode 100644 index 00000000..015df9bb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.excel.template.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * excel模版表(ExcelTemplate)实体类 + * + * @author makejava + * @since 2024-08-12 16:42:50 + */ +public class ExcelTemplateEntity extends BaseEntity { + + /** 模版名称 */ + private String templateName; + /** 应用id */ + private String appId; + /** 模版编码 */ + private String templateCode; + /** 绑定菜单 */ + private String menuBind; + /** 菜单按钮 */ + private String menuButton; + /** 公司id */ + private String companyId; + + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getTemplateCode() { + return templateCode; + } + + public void setTemplateCode(String templateCode) { + this.templateCode = templateCode; + } + + public String getMenuBind() { + return menuBind; + } + + public void setMenuBind(String menuBind) { + this.menuBind = menuBind; + } + + public String getMenuButton() { + return menuButton; + } + + public void setMenuButton(String menuButton) { + this.menuButton = menuButton; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.xml b/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.xml new file mode 100644 index 00000000..91ab557a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/entity/ExcelTemplateEntity.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + template_name + ,app_id + ,template_code + ,menu_bind + ,menu_button + ,sorts + ,id + ,create_user_id + ,create_time + ,modify_time + ,modify_user_id + ,org_id + ,company_id + ,sts + + + + + + + + + + + + + + + + + + + insert into excel_template( + + template_name , + app_id , + template_code , + menu_bind , + menu_button , + sorts , + id , + create_user_id , + create_time , + modify_time , + modify_user_id , + org_id , + company_id , + sts , + sts, + + )values( + + #{templateName} , + #{appId} , + #{templateCode} , + #{menuBind} , + #{menuButton} , + #{sorts} , + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_time} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{sts} , + 'Y', + + ) + + + + insert into excel_template(template_name, app_id, template_code, menu_bind, menu_button, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts, sts) + values + + (#{entity.templateName},#{entity.appId},#{entity.templateCode},#{entity.menuBind},#{entity.menuButton},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}, 'Y') + + + + + insert into excel_template(template_name, app_id, template_code, menu_bind, menu_button, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.templateName},#{entity.appId},#{entity.templateCode},#{entity.menuBind},#{entity.menuButton},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}) + + on duplicate key update + template_name = values(template_name), + app_id = values(app_id), + template_code = values(template_code), + menu_bind = values(menu_bind), + menu_button = values(menu_button), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + +update excel_template set + + template_name = #{templateName}, + app_id = #{appId}, + template_code = #{templateCode}, + menu_bind = #{menuBind}, + menu_button = #{menuButton}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + org_id = #{org_id}, + company_id = #{companyId}, + sts = #{sts}, + +where sorts = #{sorts} + + + +update excel_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where sorts = #{sorts} + + + +update excel_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and template_name = #{templateName} + and app_id = #{appId} + and template_code = #{templateCode} + and menu_bind = #{menuBind} + and menu_button = #{menuButton} + and sorts = #{sorts} + and id = #{id} + and company_id = #{companyId} + and sts = #{sts} + and sts='Y' + + + + + delete from excel_template where sorts = #{sorts} + + + + diff --git a/service/src/main/java/com/hzya/frame/excel/template/service/IExcelTemplateService.java b/service/src/main/java/com/hzya/frame/excel/template/service/IExcelTemplateService.java new file mode 100644 index 00000000..ad8671d1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/service/IExcelTemplateService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.excel.template.service; + +import com.hzya.frame.excel.template.entity.ExcelTemplateEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * excel模版表(ExcelTemplate)表服务接口 + * + * @author makejava + * @since 2024-08-12 16:42:50 + */ +public interface IExcelTemplateService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/excel/template/service/impl/ExcelTemplateServiceImpl.java b/service/src/main/java/com/hzya/frame/excel/template/service/impl/ExcelTemplateServiceImpl.java new file mode 100644 index 00000000..f73a486c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/template/service/impl/ExcelTemplateServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.excel.template.service.impl; + +import com.hzya.frame.excel.template.entity.ExcelTemplateEntity; +import com.hzya.frame.excel.template.dao.IExcelTemplateDao; +import com.hzya.frame.excel.template.service.IExcelTemplateService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * excel模版表(ExcelTemplate)表服务实现类 + * + * @author makejava + * @since 2024-08-12 16:42:50 + */ +@Service(value = "excelTemplateService") +public class ExcelTemplateServiceImpl extends BaseService implements IExcelTemplateService { + + private IExcelTemplateDao excelTemplateDao; + + @Autowired + public void setExcelTemplateDao(IExcelTemplateDao dao) { + this.excelTemplateDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/IExcelTemplateConfigDao.java b/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/IExcelTemplateConfigDao.java new file mode 100644 index 00000000..ef72b230 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/IExcelTemplateConfigDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.excel.templateConfig.dao; + +import com.hzya.frame.excel.templateConfig.entity.ExcelTemplateConfigEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * excel模版配置表(excel_template_config: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:43:38 + */ +public interface IExcelTemplateConfigDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/impl/ExcelTemplateConfigDaoImpl.java b/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/impl/ExcelTemplateConfigDaoImpl.java new file mode 100644 index 00000000..ea9afd4e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/dao/impl/ExcelTemplateConfigDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.excel.templateConfig.dao.impl; + +import com.hzya.frame.excel.templateConfig.entity.ExcelTemplateConfigEntity; +import com.hzya.frame.excel.templateConfig.dao.IExcelTemplateConfigDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * excel模版配置表(ExcelTemplateConfig)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:43:38 + */ +@Repository(value = "ExcelTemplateConfigDaoImpl") +public class ExcelTemplateConfigDaoImpl extends MybatisGenericDao implements IExcelTemplateConfigDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.java b/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.java new file mode 100644 index 00000000..f75acdab --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.java @@ -0,0 +1,66 @@ +package com.hzya.frame.excel.templateConfig.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * excel模版配置表(ExcelTemplateConfig)实体类 + * + * @author makejava + * @since 2024-08-12 16:43:38 + */ +public class ExcelTemplateConfigEntity extends BaseEntity { + + /** 模版id */ + private String templateId; + /** 类型(数据库表/语句) */ + private String type; + /** 表类型(主表/明细) */ + private String tableType; + /** 数据字典id */ + private String dataDictionaryId; + /** 公司id */ + private String companyId; + + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTableType() { + return tableType; + } + + public void setTableType(String tableType) { + this.tableType = tableType; + } + + public String getDataDictionaryId() { + return dataDictionaryId; + } + + public void setDataDictionaryId(String dataDictionaryId) { + this.dataDictionaryId = dataDictionaryId; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.xml b/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.xml new file mode 100644 index 00000000..40f7605f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/entity/ExcelTemplateConfigEntity.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + template_id + ,type + ,table_type + ,data_dictionary_id + ,sorts + ,id + ,create_user_id + ,create_time + ,modify_time + ,modify_user_id + ,org_id + ,company_id + ,sts + + + + + + + + + + + + + + + + insert into excel_template_config( + + template_id , + type , + table_type , + data_dictionary_id , + sorts , + id , + create_user_id , + create_time , + modify_time , + modify_user_id , + org_id , + company_id , + sts , + sts, + + )values( + + #{templateId} , + #{type} , + #{tableType} , + #{dataDictionaryId} , + #{sorts} , + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_time} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{sts} , + 'Y', + + ) + + + + insert into excel_template_config(template_id, type, table_type, data_dictionary_id, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts, sts) + values + + (#{entity.templateId},#{entity.type},#{entity.tableType},#{entity.dataDictionaryId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}, 'Y') + + + + + insert into excel_template_config(template_id, type, table_type, data_dictionary_id, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.templateId},#{entity.type},#{entity.tableType},#{entity.dataDictionaryId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}) + + on duplicate key update + template_id = values(template_id), + type = values(type), + table_type = values(table_type), + data_dictionary_id = values(data_dictionary_id), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + +update excel_template_config set + + template_id = #{templateId}, + type = #{type}, + table_type = #{tableType}, + data_dictionary_id = #{dataDictionaryId}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + org_id = #{org_id}, + company_id = #{companyId}, + sts = #{sts}, + +where sorts = #{sorts} + + + +update excel_template_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where sorts = #{sorts} + + + +update excel_template_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and template_id = #{templateId} + and type = #{type} + and table_type = #{tableType} + and data_dictionary_id = #{dataDictionaryId} + and sorts = #{sorts} + and id = #{id} + and company_id = #{companyId} + and sts = #{sts} + and sts='Y' + + + + + delete from excel_template_config where sorts = #{sorts} + + + + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/service/IExcelTemplateConfigService.java b/service/src/main/java/com/hzya/frame/excel/templateConfig/service/IExcelTemplateConfigService.java new file mode 100644 index 00000000..2f690a33 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/service/IExcelTemplateConfigService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.excel.templateConfig.service; + +import com.hzya.frame.excel.templateConfig.entity.ExcelTemplateConfigEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * excel模版配置表(ExcelTemplateConfig)表服务接口 + * + * @author makejava + * @since 2024-08-12 16:43:38 + */ +public interface IExcelTemplateConfigService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfig/service/impl/ExcelTemplateConfigServiceImpl.java b/service/src/main/java/com/hzya/frame/excel/templateConfig/service/impl/ExcelTemplateConfigServiceImpl.java new file mode 100644 index 00000000..72147b38 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfig/service/impl/ExcelTemplateConfigServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.excel.templateConfig.service.impl; + +import com.hzya.frame.excel.templateConfig.entity.ExcelTemplateConfigEntity; +import com.hzya.frame.excel.templateConfig.dao.IExcelTemplateConfigDao; +import com.hzya.frame.excel.templateConfig.service.IExcelTemplateConfigService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * excel模版配置表(ExcelTemplateConfig)表服务实现类 + * + * @author makejava + * @since 2024-08-12 16:43:38 + */ +@Service(value = "excelTemplateConfigService") +public class ExcelTemplateConfigServiceImpl extends BaseService implements IExcelTemplateConfigService { + + private IExcelTemplateConfigDao excelTemplateConfigDao; + + @Autowired + public void setExcelTemplateConfigDao(IExcelTemplateConfigDao dao) { + this.excelTemplateConfigDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/IExcelTemplateConfigDetailDao.java b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/IExcelTemplateConfigDetailDao.java new file mode 100644 index 00000000..ade61d52 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/IExcelTemplateConfigDetailDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.excel.templateConfigDetial.dao; + +import com.hzya.frame.excel.templateConfigDetial.entity.ExcelTemplateConfigDetailEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * excel模版配置明细表(excel_template_config_detail: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-13 08:39:02 + */ +public interface IExcelTemplateConfigDetailDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/impl/ExcelTemplateConfigDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/impl/ExcelTemplateConfigDetailDaoImpl.java new file mode 100644 index 00000000..60b4ff82 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/dao/impl/ExcelTemplateConfigDetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.excel.templateConfigDetial.dao.impl; + +import com.hzya.frame.excel.templateConfigDetial.entity.ExcelTemplateConfigDetailEntity; +import com.hzya.frame.excel.templateConfigDetial.dao.IExcelTemplateConfigDetailDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * excel模版配置明细表(ExcelTemplateConfigDetail)表数据库访问层 + * + * @author makejava + * @since 2024-08-13 08:39:02 + */ +@Repository(value = "ExcelTemplateConfigDetailDaoImpl") +public class ExcelTemplateConfigDetailDaoImpl extends MybatisGenericDao implements IExcelTemplateConfigDetailDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.java b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.java new file mode 100644 index 00000000..0119a934 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.java @@ -0,0 +1,96 @@ +package com.hzya.frame.excel.templateConfigDetial.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * excel模版配置明细表(ExcelTemplateConfigDetail)实体类 + * + * @author makejava + * @since 2024-08-13 08:39:02 + */ +public class ExcelTemplateConfigDetailEntity extends BaseEntity { + + /** 字段名称 */ + private String fieldName; + /** 字段编码 */ + private String fieldCode; + /** 字段类型 */ + private String fieldType; + /** 应用数据字典明细表id */ + private String dictionaryDetailId; + /** 显示名称 */ + private String showName; + /** 序号 */ + private Long templateSort; + /** 开关 */ + private String templateSwitch; + /** 公司id */ + private String companyId; + + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldCode() { + return fieldCode; + } + + public void setFieldCode(String fieldCode) { + this.fieldCode = fieldCode; + } + + public String getFieldType() { + return fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } + + public String getDictionaryDetailId() { + return dictionaryDetailId; + } + + public void setDictionaryDetailId(String dictionaryDetailId) { + this.dictionaryDetailId = dictionaryDetailId; + } + + public String getShowName() { + return showName; + } + + public void setShowName(String showName) { + this.showName = showName; + } + + public Long getTemplateSort() { + return templateSort; + } + + public void setTemplateSort(Long templateSort) { + this.templateSort = templateSort; + } + + public String getTemplateSwitch() { + return templateSwitch; + } + + public void setTemplateSwitch(String templateSwitch) { + this.templateSwitch = templateSwitch; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.xml b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.xml new file mode 100644 index 00000000..abcd07b0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/entity/ExcelTemplateConfigDetailEntity.xml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + field_name + ,field_code + ,field_type + ,dictionary_detail_id + ,show_name + ,template_sort + ,template_switch + ,sorts + ,id + ,create_user_id + ,create_time + ,modify_time + ,modify_user_id + ,org_id + ,company_id + ,sts + + + + + + + + + + + + + + + + insert into excel_template_config_detail( + + field_name , + field_code , + field_type , + dictionary_detail_id , + show_name , + template_sort , + template_switch , + sorts , + id , + create_user_id , + create_time , + modify_time , + modify_user_id , + org_id , + company_id , + sts , + sorts, + sts, + + )values( + + #{fieldName} , + #{fieldCode} , + #{fieldType} , + #{dictionaryDetailId} , + #{showName} , + #{templateSort} , + #{templateSwitch} , + #{sorts} , + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_time} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{sts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from excel_template_config_detail a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into excel_template_config_detail(field_name, field_code, field_type, dictionary_detail_id, show_name, template_sort, template_switch, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts, sts) + values + + (#{entity.fieldName},#{entity.fieldCode},#{entity.fieldType},#{entity.dictionaryDetailId},#{entity.showName},#{entity.templateSort},#{entity.templateSwitch},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}, 'Y') + + + + + insert into excel_template_config_detail(field_name, field_code, field_type, dictionary_detail_id, show_name, template_sort, template_switch, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.fieldName},#{entity.fieldCode},#{entity.fieldType},#{entity.dictionaryDetailId},#{entity.showName},#{entity.templateSort},#{entity.templateSwitch},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}) + + on duplicate key update + field_name = values(field_name), + field_code = values(field_code), + field_type = values(field_type), + dictionary_detail_id = values(dictionary_detail_id), + show_name = values(show_name), + template_sort = values(template_sort), + template_switch = values(template_switch), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + +update excel_template_config_detail set + + field_name = #{fieldName}, + field_code = #{fieldCode}, + field_type = #{fieldType}, + dictionary_detail_id = #{dictionaryDetailId}, + show_name = #{showName}, + template_sort = #{templateSort}, + template_switch = #{templateSwitch}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + org_id = #{org_id}, + company_id = #{companyId}, + sts = #{sts}, + +where sorts = #{sorts} + + + +update excel_template_config_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where sorts = #{sorts} + + + +update excel_template_config_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and field_name = #{fieldName} + and field_code = #{fieldCode} + and field_type = #{fieldType} + and dictionary_detail_id = #{dictionaryDetailId} + and show_name = #{showName} + and template_sort = #{templateSort} + and template_switch = #{templateSwitch} + and sorts = #{sorts} + and id = #{id} + and company_id = #{companyId} + and sts = #{sts} + and sts='Y' + + + + + delete from excel_template_config_detail where sorts = #{sorts} + + + + diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/IExcelTemplateConfigDetailService.java b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/IExcelTemplateConfigDetailService.java new file mode 100644 index 00000000..746ee7fc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/IExcelTemplateConfigDetailService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.excel.templateConfigDetial.service; + +import com.hzya.frame.excel.templateConfigDetial.entity.ExcelTemplateConfigDetailEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * excel模版配置明细表(ExcelTemplateConfigDetail)表服务接口 + * + * @author makejava + * @since 2024-08-13 08:39:02 + */ +public interface IExcelTemplateConfigDetailService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/impl/ExcelTemplateConfigDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/impl/ExcelTemplateConfigDetailServiceImpl.java new file mode 100644 index 00000000..51e02292 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/excel/templateConfigDetial/service/impl/ExcelTemplateConfigDetailServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.excel.templateConfigDetial.service.impl; + +import com.hzya.frame.excel.templateConfigDetial.entity.ExcelTemplateConfigDetailEntity; +import com.hzya.frame.excel.templateConfigDetial.dao.IExcelTemplateConfigDetailDao; +import com.hzya.frame.excel.templateConfigDetial.service.IExcelTemplateConfigDetailService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * excel模版配置明细表(ExcelTemplateConfigDetail)表服务实现类 + * + * @author makejava + * @since 2024-08-13 08:39:02 + */ +@Service(value = "excelTemplateConfigDetailService") +public class ExcelTemplateConfigDetailServiceImpl extends BaseService implements IExcelTemplateConfigDetailService { + + private IExcelTemplateConfigDetailDao excelTemplateConfigDetailDao; + + @Autowired + public void setExcelTemplateConfigDetailDao(IExcelTemplateConfigDetailDao dao) { + this.excelTemplateConfigDetailDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.java b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.java index 34dae4ad..928a687d 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.java +++ b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.java @@ -25,6 +25,18 @@ public class FileDownloadEntity extends BaseEntity { private String filepath; /** 文件*/ private File file; + /** 文件类型 + * 1:普通文件 + * 2:插件附件*/ + private String fileType; + + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } /** 文件名称 */ public void setFilename(String filename) { diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml index f9065b2b..892b4f23 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml @@ -26,6 +26,8 @@ + + @@ -40,7 +42,8 @@ create_time, modify_user_id, modify_time, - sts + sts, + file_type @@ -60,6 +63,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} @@ -82,6 +86,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} @@ -106,6 +111,7 @@ and filename like concat('%',#{filename},'%') and filesavename like concat('%',#{filesavename},'%') and type like concat('%',#{type},'%') + and file_type like concat('%',#{fileType},'%') and file_size = #{file_size} and description like concat('%',#{description},'%') and filepath like concat('%',#{filepath},'%') @@ -130,6 +136,7 @@ or filename = #{filename} or filesavename = #{filesavename} or type = #{type} + or file_type = #{fileType} or file_size = #{file_size} or description = #{description} or filepath = #{filepath} @@ -151,6 +158,7 @@ filename, filesavename, type, + file_type, file_size, description, filepath, @@ -167,6 +175,7 @@ #{filename}, #{filesavename}, #{type}, + #{fileType}, #{file_size}, #{description}, #{filepath}, @@ -192,6 +201,7 @@ filename = #{filename}, filesavename = #{filesavename}, type = #{type}, + file_type = #{fileType}, file_size = #{file_size}, description = #{description}, filepath = #{filepath}, @@ -219,6 +229,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/service/IFileDownloadService.java b/service/src/main/java/com/hzya/frame/sys/file/download/service/IFileDownloadService.java index 36efcf95..ff8358f1 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/service/IFileDownloadService.java +++ b/service/src/main/java/com/hzya/frame/sys/file/download/service/IFileDownloadService.java @@ -28,4 +28,6 @@ public interface IFileDownloadService extends IBaseService entries = zipFile.entries(); +// boolean isFirst = true; +// String firstName = ""; +// while (entries.hasMoreElements()) { +// ZipEntry entry = (ZipEntry) entries.nextElement(); +// // 构造解压后的文件路径,去掉压缩包的名字 +// String unzipPath = entry.getName().replace(firstName,""); +// String classPath = "com\\hzya\\frame\\plugin"; +// String xmlPath = "cfgHome\\plugin"; +// +// String dirPath = ""; +// if(unzipPath.contains("classfile/")){ +// dirPath = TOMCATPATH + "/" + classPath + unzipPath.replace("classfile",""); +// } +// if(unzipPath.contains("xmlfile/")){ +// dirPath = TOMCATPATH + "/" + xmlPath + unzipPath.replace("xmlfile",""); +// } +// +// // 如果是文件夹,就创建个文件夹 +// if (entry.isDirectory()) { +// if(isFirst == false){ +// File dir = new File(dirPath); +// dir.mkdirs(); +// }else{ +// firstName = entry.getName(); +// isFirst = false; +// } +// } else { +// // 如果是文件,就先创建一个文件,然后用io流把内容copy过去 +// File targetFile = new File(dirPath); +// // 保证这个文件的父文件夹必须要存在 +// if (!targetFile.getParentFile().exists()) { +// targetFile.getParentFile().mkdirs(); +// } +// targetFile.createNewFile(); +// // 将压缩文件内容写入到这个文件中 +// InputStream is = zipFile.getInputStream(entry); +// FileOutputStream fos = new FileOutputStream(targetFile); +// int len; +// byte[] buf = new byte[1024]; +// while ((len = is.read(buf)) != -1) { +// fos.write(buf, 0, len); +// } +// // 关流顺序,先打开的后关闭 +// fos.close(); +// is.close(); +// } +// } +// +// +// +// return fileDownloadEntity; +// } + + @Override + public FileDownloadEntity pluginZipUpate(FileUploadDto fileUploadDto) throws Exception { + /** 如果fileUploadDto的id直接为空,或者null直接抛出异常*/ + if(fileUploadDto == null || fileUploadDto.getId() == null || "".equals(fileUploadDto.getId())){ + throw new BaseSystemException("请传入参数!"); + } + /** 根据唯一名称获取文件信息*/ + FileDownloadEntity queryEntity = new FileDownloadEntity(); + queryEntity.setId(fileUploadDto.getId()); + queryEntity.setSts("Y"); + FileDownloadEntity fileDownloadEntity =filedownloadDao.queryOne(queryEntity); + String filePath = fileDownloadEntity.getFilepath(); + //插件附件路径 + String inputFile = PLUGINPATH + filePath; + + File srcFile = new File(inputFile);//获取当前压缩文件 + // 判断源文件是否存在 + if (!srcFile.exists()) { + throw new Exception(srcFile.getPath() + "所指文件不存在"); + } + ZipFile zipFile = new ZipFile(srcFile);//创建压缩文件对象 + //开始解压 + Enumeration entries = zipFile.entries(); + + while (entries.hasMoreElements()) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + String unzipPath = entry.getName(); + + String dirPath = TOMCATPATH + unzipPath; + + // 如果是文件夹,就创建个文件夹 + if (entry.isDirectory()) { + File dir = new File(dirPath); + dir.mkdirs(); + } else { + // 如果是文件,就先创建一个文件,然后用io流把内容copy过去 + File targetFile = new File(dirPath); + // 保证这个文件的父文件夹必须要存在 + if (!targetFile.getParentFile().exists()) { + targetFile.getParentFile().mkdirs(); + } + targetFile.createNewFile(); + // 将压缩文件内容写入到这个文件中 + InputStream is = zipFile.getInputStream(entry); + FileOutputStream fos = new FileOutputStream(targetFile); + int len; + byte[] buf = new byte[1024]; + while ((len = is.read(buf)) != -1) { + fos.write(buf, 0, len); + } + // 关流顺序,先打开的后关闭 + fos.close(); + is.close(); + } + } + + return fileDownloadEntity; + } + + } diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileResultEntity.java b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileResultEntity.java index 4e2bd287..0ae3765f 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileResultEntity.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileResultEntity.java @@ -28,7 +28,9 @@ private Long business_id; * * */ private String business_type; + /** 1:上传普通文件 2:上传插件*/ /** 是否是业务附件 true 是(是业务附件的时候,请传入相对应的业务ID,) false 不是,*/ + private boolean fileFlag; /** 上传文件的ID*/ private String fileID; diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadDto.java b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadDto.java index 049adf4c..ee752549 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadDto.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadDto.java @@ -21,12 +21,26 @@ public class FileUploadDto { * 业务类型 */ private String businessType; + /** + * 文件类型 + * 1:普通文件 + * 2:插件附件 + */ + private String fileType = "1"; /** * 是否是业务类型 */ private boolean fileFlag; + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + public String getBusinessType() { return businessType; } diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.java b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.java index 3aabaa19..0a920b89 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.java @@ -26,6 +26,12 @@ public class FileUploadEntity extends BaseEntity { * 文件类型 */ private String type; + /** + * 文件类型 + * 1:普通文件 + * 2:插件附件 + */ + private String fileType; /** * 文件大小(kb) */ @@ -48,6 +54,14 @@ public class FileUploadEntity extends BaseEntity { private File[] multiFile; private String[] multiFileFileName; + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + /** * 文件名称 */ diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.xml b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.xml index 71f2a604..81374007 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.xml +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/entity/FileUploadEntity.xml @@ -10,6 +10,8 @@ + + @@ -33,6 +35,7 @@ filename, filesavename, type, + file_type, file_size, description, filepath, @@ -60,6 +63,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} @@ -82,6 +86,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} @@ -106,6 +111,7 @@ and filename like concat('%',#{filename},'%') and filesavename like concat('%',#{filesavename},'%') and type like concat('%',#{type},'%') + and file_type like concat('%',#{fileType},'%') and file_size = #{file_size} and description like concat('%',#{description},'%') and filepath like concat('%',#{filepath},'%') @@ -130,6 +136,7 @@ or filename = #{filename} or filesavename = #{filesavename} or type = #{type} + or file_type = #{fileType} or file_size = #{file_size} or description = #{description} or filepath = #{filepath} @@ -151,6 +158,7 @@ filename, filesavename, type, + file_type, file_size, description, filepath, @@ -167,6 +175,7 @@ #{filename}, #{filesavename}, #{type}, + #{fileType}, #{file_size}, #{description}, #{filepath}, @@ -189,6 +198,7 @@ filename = #{filename}, filesavename = #{filesavename}, type = #{type}, + file_type = #{fileType}, file_size = #{file_size}, description = #{description}, filepath = #{filepath}, @@ -206,6 +216,7 @@ filename = #{filename}, type = #{type}, + file_type = #{fileType}, file_size = #{file_size}, description = #{description}, filepath = #{filepath}, @@ -233,6 +244,7 @@ and filename = #{filename} and filesavename = #{filesavename} and type = #{type} + and file_type = #{fileType} and file_size = #{file_size} and description = #{description} and filepath = #{filepath} diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/service/IFileUploadService.java b/service/src/main/java/com/hzya/frame/sys/file/upload/service/IFileUploadService.java index 24d47a77..41ad6ebc 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/service/IFileUploadService.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/service/IFileUploadService.java @@ -25,6 +25,8 @@ public interface IFileUploadService extends IBaseService * @throws IOException */ FileUploadEntity fileUpload(MultipartFile files, FileUploadDto entity) throws Exception; + + FileUploadEntity pluginfileUpload(MultipartFile files, FileUploadDto entity,String pluginPackageName) throws Exception; /** * 文件上传方法 * diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java index 8060899b..b2ccda26 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java @@ -23,9 +23,13 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.InputStream; import java.util.Date; +import java.util.Enumeration; import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; /** * @description: 系统文件上传 service @@ -39,6 +43,9 @@ public class FileUploadServiceImpl extends BaseService i @Value("${savefile.path}") public String DSK; + @Value("${savefile.pluginpath}") + public String PLUGINPATH; + protected IFileUploadDao fileUploadDao; @Autowired @@ -76,8 +83,92 @@ public class FileUploadServiceImpl extends BaseService i /** 获取到拼接完成的文件属性*/ String path = stringBuffer.toString(); /** 保存到file表信息*/ - FileUploadEntity fileUploadEntity = saveFile(file, path, "附件备注"); - path = DSK + fileUploadEntity.getFilepath(); + FileUploadEntity fileUploadEntity = saveFile(file, path, "附件备注",entity.getFileType()); + /**当fileType为2时,存储的是插件附件*/ + if(entity.getFileType().equals("2")){ + path = PLUGINPATH + fileUploadEntity.getFilepath(); + }else{ + path = DSK + fileUploadEntity.getFilepath(); + } + + /** 创建文件夹*/ + FileUtils.createDir(path); + File uploadFile = new File(path); + file.transferTo(uploadFile); + return fileUploadEntity; + } + + @Override + public FileUploadEntity pluginfileUpload(MultipartFile file, FileUploadDto entity,String pluginPackageName) throws Exception { + + // 创建一个临时文件 + File fileT = new File(file.getOriginalFilename()); + // 将 MultipartFile 的内容写入文件 + try (FileOutputStream fos = new FileOutputStream(fileT)) { + // 获取文件内容的字节数组 + byte[] bytes = file.getBytes(); + fos.write(bytes); + } + + ZipFile zipFile = new ZipFile(fileT);//创建压缩文件对象 + //开始解压 + Enumeration entries = zipFile.entries(); + boolean xmlflag = false; + boolean classflag = false; + while (entries.hasMoreElements()) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + if(xmlflag == false){ + if(entry.getName().contains("cfgHome/plugin/"+pluginPackageName) && entry.isDirectory()){ + xmlflag = true; + } + } + if(classflag == false){ + if(entry.getName().contains("com/hzya/frame/plugin/"+pluginPackageName) && entry.isDirectory()){ + classflag = true; + } + } + if(xmlflag && classflag){ + break; + } + } + if(xmlflag == false || classflag == false){ + throw new BaseSystemException("插件附件不符合规范或插件包名填写错误,请检查!"); + } + fileT.delete(); + zipFile.close(); + + + /** 获取系统设置文件存放的盘符*/ + StringBuffer stringBuffer = new StringBuffer(); + /** 获取根目录*/ + //stringBuffer.append(DSK); + /** 根据当前日期创建文件目录*/ + String nowDateString = DateUtil.dateToString(new Date(), "yyyy-MM-dd"); + + /** 判断传入的文件是否是属于业务的文件数据,如果是则根据业务单据去生成文件夹,否则,按照日期生成*/ + if (entity.isFileFlag() && entity.getBusinessType() != null && !"".equals(entity.getBusinessType())) { + /** 没有单票ID临时把文件放在default目录下面*/ + /** 创建默认文件夹*/ + stringBuffer.append(File.separator+entity.getBusinessType()); + /** 根据当前日期生成文件夹*/ + stringBuffer.append(File.separator + nowDateString); + } else { + /** 创建默认文件夹*/ + stringBuffer.append(File.separator+"default"); + /** 拼接上当前日期*/ + stringBuffer.append(File.separator + nowDateString); + } + /** 获取到拼接完成的文件属性*/ + String path = stringBuffer.toString(); + /** 保存到file表信息*/ + FileUploadEntity fileUploadEntity = saveFile(file, path, "附件备注",entity.getFileType()); + /**当fileType为2时,存储的是插件附件*/ + if(entity.getFileType().equals("2")){ + path = PLUGINPATH + fileUploadEntity.getFilepath(); + }else{ + path = DSK + fileUploadEntity.getFilepath(); + } + /** 创建文件夹*/ FileUtils.createDir(path); File uploadFile = new File(path); @@ -91,7 +182,9 @@ public class FileUploadServiceImpl extends BaseService i /** 获取系统设置文件存放的盘符*/ StringBuffer stringBuffer = new StringBuffer(); /** 获取根目录*/ - stringBuffer.append(DSK); + stringBuffer.append(DSK); + + /** 获取当前人所在的公司,用ID和公司名称拼接*/ // stringBuffer.append("/" + userEntity.getOrg_name() + "_" + userEntity.getOrg_id()); /** 根据当前日期创建文件目录*/ @@ -278,7 +371,7 @@ public class FileUploadServiceImpl extends BaseService i * @param description * @return */ - private FileUploadEntity saveFile(MultipartFile file, String filepath, String description) { + private FileUploadEntity saveFile(MultipartFile file, String filepath, String description,String fileType) { /*** UUID生成File的新名称*/ Long id = UUIDLong.longUUID(); Long fileNewName = UUIDLong.longUUID(); @@ -291,6 +384,7 @@ public class FileUploadServiceImpl extends BaseService i fileUploadEntity.setFilename(fileName); fileUploadEntity.setFilesavename(String.valueOf(fileNewName)); fileUploadEntity.setType(type); + fileUploadEntity.setFileType(fileType); fileUploadEntity.setFile_size(file.getSize()); fileUploadEntity.setDescription(description); fileUploadEntity.setFilepath(filepath+ File.separator +fileUploadEntity.getFilesavename()); diff --git a/service/src/main/java/com/hzya/frame/sys/org/entity/Org.java b/service/src/main/java/com/hzya/frame/sys/org/entity/Org.java index 71f5bb48..c1478753 100644 --- a/service/src/main/java/com/hzya/frame/sys/org/entity/Org.java +++ b/service/src/main/java/com/hzya/frame/sys/org/entity/Org.java @@ -20,6 +20,8 @@ import java.util.List; */ public class Org extends BaseEntity { + + /** 唯一标识码 */ private String id; /** 组织机构编码 */ diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/ISysApplicationDictionaryDao.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/ISysApplicationDictionaryDao.java new file mode 100644 index 00000000..cfa3dc0c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/ISysApplicationDictionaryDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.application.dictionary.dao; + +import com.hzya.frame.sysnew.application.dictionary.entity.SysApplicationDictionaryEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 应用数据字典表(sys_application_dictionary: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:40:53 + */ +public interface ISysApplicationDictionaryDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/impl/SysApplicationDictionaryDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/impl/SysApplicationDictionaryDaoImpl.java new file mode 100644 index 00000000..6d955f8b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/dao/impl/SysApplicationDictionaryDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.application.dictionary.dao.impl; + +import com.hzya.frame.sysnew.application.dictionary.entity.SysApplicationDictionaryEntity; +import com.hzya.frame.sysnew.application.dictionary.dao.ISysApplicationDictionaryDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 应用数据字典表(SysApplicationDictionary)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:41:07 + */ +@Repository(value = "SysApplicationDictionaryDaoImpl") +public class SysApplicationDictionaryDaoImpl extends MybatisGenericDao implements ISysApplicationDictionaryDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.java new file mode 100644 index 00000000..fb52744c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.sysnew.application.dictionary.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 应用数据字典表(SysApplicationDictionary)实体类 + * + * @author makejava + * @since 2024-08-12 16:41:20 + */ +public class SysApplicationDictionaryEntity extends BaseEntity { + + /** 应用id */ + private String appId; + /** 名称 */ + private String name; + /** 类型 */ + private String dictionaryType; + /** 表 */ + private String dictionaryTable; + /** 语句 */ + private String dictionarySql; + /** 公司id */ + private String companyId; + + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDictionaryType() { + return dictionaryType; + } + + public void setDictionaryType(String dictionaryType) { + this.dictionaryType = dictionaryType; + } + + public String getDictionaryTable() { + return dictionaryTable; + } + + public void setDictionaryTable(String dictionaryTable) { + this.dictionaryTable = dictionaryTable; + } + + public String getDictionarySql() { + return dictionarySql; + } + + public void setDictionarySql(String dictionarySql) { + this.dictionarySql = dictionarySql; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.xml new file mode 100644 index 00000000..6c3be854 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/entity/SysApplicationDictionaryEntity.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + app_id + ,name + ,dictionary_type + ,dictionary_table + ,dictionary_sql + ,sorts + ,id + ,create_user_id + ,create_time + ,modify_time + ,modify_user_id + ,org_id + ,company_id + ,sts + + + + + + + + + + + + + + + + insert into sys_application_dictionary( + + app_id , + name , + dictionary_type , + dictionary_table , + dictionary_sql , + sorts , + id , + create_user_id , + create_time , + modify_time , + modify_user_id , + org_id , + company_id , + sts , + sorts, + sts, + + )values( + + #{appId} , + #{name} , + #{dictionaryType} , + #{dictionaryTable} , + #{dictionarySql} , + #{sorts} , + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_time} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{sts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_dictionary a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_application_dictionary(app_id, name, dictionary_type, dictionary_table, dictionary_sql, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts, sts) + values + + (#{entity.appId},#{entity.name},#{entity.dictionaryType},#{entity.dictionaryTable},#{entity.dictionarySql},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}, 'Y') + + + + + insert into sys_application_dictionary(app_id, name, dictionary_type, dictionary_table, dictionary_sql, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.appId},#{entity.name},#{entity.dictionaryType},#{entity.dictionaryTable},#{entity.dictionarySql},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}) + + on duplicate key update + app_id = values(app_id), + name = values(name), + dictionary_type = values(dictionary_type), + dictionary_table = values(dictionary_table), + dictionary_sql = values(dictionary_sql), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + +update sys_application_dictionary set + + app_id = #{appId}, + name = #{name}, + dictionary_type = #{dictionaryType}, + dictionary_table = #{dictionaryTable}, + dictionary_sql = #{dictionarySql}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + org_id = #{org_id}, + company_id = #{companyId}, + sts = #{sts}, + +where sorts = #{sorts} + + + +update sys_application_dictionary set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where sorts = #{sorts} + + + +update sys_application_dictionary set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and app_id = #{appId} + and name = #{name} + and dictionary_type = #{dictionaryType} + and dictionary_table = #{dictionaryTable} + and dictionary_sql = #{dictionarySql} + and sorts = #{sorts} + and id = #{id} + and company_id = #{companyId} + and sts = #{sts} + and sts='Y' + + + + + delete from sys_application_dictionary where sorts = #{sorts} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/ISysApplicationDictionaryService.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/ISysApplicationDictionaryService.java new file mode 100644 index 00000000..08d06dd5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/ISysApplicationDictionaryService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sysnew.application.dictionary.service; + +import com.hzya.frame.sysnew.application.dictionary.entity.SysApplicationDictionaryEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 应用数据字典表(SysApplicationDictionary)表服务接口 + * + * @author makejava + * @since 2024-08-12 16:41:22 + */ +public interface ISysApplicationDictionaryService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/impl/SysApplicationDictionaryServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/impl/SysApplicationDictionaryServiceImpl.java new file mode 100644 index 00000000..cee72fe9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionary/service/impl/SysApplicationDictionaryServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sysnew.application.dictionary.service.impl; + +import com.hzya.frame.sysnew.application.dictionary.entity.SysApplicationDictionaryEntity; +import com.hzya.frame.sysnew.application.dictionary.dao.ISysApplicationDictionaryDao; +import com.hzya.frame.sysnew.application.dictionary.service.ISysApplicationDictionaryService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 应用数据字典表(SysApplicationDictionary)表服务实现类 + * + * @author makejava + * @since 2024-08-12 16:41:25 + */ +@Service(value = "sysApplicationDictionaryService") +public class SysApplicationDictionaryServiceImpl extends BaseService implements ISysApplicationDictionaryService { + + private ISysApplicationDictionaryDao sysApplicationDictionaryDao; + + @Autowired + public void setSysApplicationDictionaryDao(ISysApplicationDictionaryDao dao) { + this.sysApplicationDictionaryDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/ISysApplicationDictionaryDetailDao.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/ISysApplicationDictionaryDetailDao.java new file mode 100644 index 00000000..485ee68f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/ISysApplicationDictionaryDetailDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.application.dictionaryDetail.dao; + +import com.hzya.frame.sysnew.application.dictionaryDetail.entity.SysApplicationDictionaryDetailEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 应用数据字典明细表(sys_application_dictionary_detail: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:52:14 + */ +public interface ISysApplicationDictionaryDetailDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/impl/SysApplicationDictionaryDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/impl/SysApplicationDictionaryDetailDaoImpl.java new file mode 100644 index 00000000..6b61f3af --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/dao/impl/SysApplicationDictionaryDetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.application.dictionaryDetail.dao.impl; + +import com.hzya.frame.sysnew.application.dictionaryDetail.entity.SysApplicationDictionaryDetailEntity; +import com.hzya.frame.sysnew.application.dictionaryDetail.dao.ISysApplicationDictionaryDetailDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 应用数据字典明细表(SysApplicationDictionaryDetail)表数据库访问层 + * + * @author makejava + * @since 2024-08-12 16:52:14 + */ +@Repository(value = "SysApplicationDictionaryDetailDaoImpl") +public class SysApplicationDictionaryDetailDaoImpl extends MybatisGenericDao implements ISysApplicationDictionaryDetailDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.java new file mode 100644 index 00000000..0cfdbf6d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.sysnew.application.dictionaryDetail.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 应用数据字典明细表(SysApplicationDictionaryDetail)实体类 + * + * @author makejava + * @since 2024-08-12 16:52:14 + */ +public class SysApplicationDictionaryDetailEntity extends BaseEntity { + + /** 应用id */ + private String appId; + /** 应用数据字典主表id */ + private String dictionaryId; + /** 字段名称 */ + private String fieldName; + /** 字段编码 */ + private String fieldCode; + /** 字段类型 */ + private String fieldType; + /** 公司id */ + private String companyId; + + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getDictionaryId() { + return dictionaryId; + } + + public void setDictionaryId(String dictionaryId) { + this.dictionaryId = dictionaryId; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldCode() { + return fieldCode; + } + + public void setFieldCode(String fieldCode) { + this.fieldCode = fieldCode; + } + + public String getFieldType() { + return fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.xml new file mode 100644 index 00000000..427734b1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/entity/SysApplicationDictionaryDetailEntity.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + app_id + ,dictionary_id + ,field_name + ,field_code + ,field_type + ,sorts + ,id + ,create_user_id + ,create_time + ,modify_time + ,modify_user_id + ,org_id + ,company_id + ,sts + + + + + + + + + + + + + + + + insert into sys_application_dictionary_detail( + + app_id , + dictionary_id , + field_name , + field_code , + field_type , + sorts , + id , + create_user_id , + create_time , + modify_time , + modify_user_id , + org_id , + company_id , + sts , + sorts, + sts, + + )values( + + #{appId} , + #{dictionaryId} , + #{fieldName} , + #{fieldCode} , + #{fieldType} , + #{sorts} , + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_time} , + #{modify_user_id} , + #{org_id} , + #{companyId} , + #{sts} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_dictionary_detail a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_application_dictionary_detail(app_id, dictionary_id, field_name, field_code, field_type, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts, sts) + values + + (#{entity.appId},#{entity.dictionaryId},#{entity.fieldName},#{entity.fieldCode},#{entity.fieldType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}, 'Y') + + + + + insert into sys_application_dictionary_detail(app_id, dictionary_id, field_name, field_code, field_type, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.appId},#{entity.dictionaryId},#{entity.fieldName},#{entity.fieldCode},#{entity.fieldType},#{entity.create_user_id},#{entity.create_time},#{entity.modify_time},#{entity.modify_user_id},#{entity.org_id},#{entity.companyId},#{entity.sts}) + + on duplicate key update + app_id = values(app_id), + dictionary_id = values(dictionary_id), + field_name = values(field_name), + field_code = values(field_code), + field_type = values(field_type), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + +update sys_application_dictionary_detail set + + app_id = #{appId}, + dictionary_id = #{dictionaryId}, + field_name = #{fieldName}, + field_code = #{fieldCode}, + field_type = #{fieldType}, + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + org_id = #{org_id}, + company_id = #{companyId}, + sts = #{sts}, + +where sorts = #{sorts} + + + +update sys_application_dictionary_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where sorts = #{sorts} + + + +update sys_application_dictionary_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and app_id = #{appId} + and dictionary_id = #{dictionaryId} + and field_name = #{fieldName} + and field_code = #{fieldCode} + and field_type = #{fieldType} + and sorts = #{sorts} + and id = #{id} + and company_id = #{companyId} + and sts = #{sts} + and sts='Y' + + + + + delete from sys_application_dictionary_detail where sorts = #{sorts} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/ISysApplicationDictionaryDetailService.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/ISysApplicationDictionaryDetailService.java new file mode 100644 index 00000000..5b40d55d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/ISysApplicationDictionaryDetailService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sysnew.application.dictionaryDetail.service; + +import com.hzya.frame.sysnew.application.dictionaryDetail.entity.SysApplicationDictionaryDetailEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 应用数据字典明细表(SysApplicationDictionaryDetail)表服务接口 + * + * @author makejava + * @since 2024-08-12 16:52:14 + */ +public interface ISysApplicationDictionaryDetailService extends IBaseService{ +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/impl/SysApplicationDictionaryDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/impl/SysApplicationDictionaryDetailServiceImpl.java new file mode 100644 index 00000000..1294c8ea --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/dictionaryDetail/service/impl/SysApplicationDictionaryDetailServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sysnew.application.dictionaryDetail.service.impl; + +import com.hzya.frame.sysnew.application.dictionaryDetail.entity.SysApplicationDictionaryDetailEntity; +import com.hzya.frame.sysnew.application.dictionaryDetail.dao.ISysApplicationDictionaryDetailDao; +import com.hzya.frame.sysnew.application.dictionaryDetail.service.ISysApplicationDictionaryDetailService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 应用数据字典明细表(SysApplicationDictionaryDetail)表服务实现类 + * + * @author makejava + * @since 2024-08-12 16:52:14 + */ +@Service(value = "sysApplicationDictionaryDetailService") +public class SysApplicationDictionaryDetailServiceImpl extends BaseService implements ISysApplicationDictionaryDetailService { + + private ISysApplicationDictionaryDetailDao sysApplicationDictionaryDetailDao; + + @Autowired + public void setSysApplicationDictionaryDetailDao(ISysApplicationDictionaryDetailDao dao) { + this.sysApplicationDictionaryDetailDao = dao; + this.dao = dao; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java index 7aa5471a..5929e14b 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java @@ -16,6 +16,8 @@ public class SysApplicationPluginEntity extends BaseEntity { private String pluginName; /** 插件编号 */ private String pluginCode; + /** 插件包名 */ + private String pluginPackageName; /** 插件版本 */ private String pluginVersion; /** 描述 */ @@ -25,6 +27,23 @@ public class SysApplicationPluginEntity extends BaseEntity { /** 启用停用(1启用2停用) */ private String pluginStatus; + private String attachmentId; + + public String getPluginPackageName() { + return pluginPackageName; + } + + public void setPluginPackageName(String pluginPackageName) { + this.pluginPackageName = pluginPackageName; + } + + public String getAttachmentId() { + return attachmentId; + } + + public void setAttachmentId(String attachmentId) { + this.attachmentId = attachmentId; + } public String getAppId() { return appId; diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml index bfcebf0d..90b5444d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml @@ -18,6 +18,8 @@ + + @@ -35,7 +37,9 @@ ,modify_user_id ,modify_time ,sts - ,org_id + ,org_id + ,attachment_id + ,plugin_package_name + select + field_name, field_code, field_type, dictionary_detail_id, show_name, sort, switch, sorts, id, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts + from excel_template_config_detail + where sorts = #{sorts} + + + + + + + + + + + insert into excel_template_config_detail(field_name, field_code, field_type, dictionary_detail_id, show_name, sort, switch, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values (#{fieldName}, #{fieldCode}, #{fieldType}, #{dictionaryDetailId}, #{showName}, #{sort}, #{switch}, #{createUserId}, #{createTime}, #{modifyTime}, #{modifyUserId}, #{orgId}, #{companyId}, #{sts}) + + + + insert into excel_template_config_detail(field_name, field_code, field_type, dictionary_detail_id, show_name, sort, switch, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.fieldName}, #{entity.fieldCode}, #{entity.fieldType}, #{entity.dictionaryDetailId}, #{entity.showName}, #{entity.sort}, #{entity.switch}, #{entity.createUserId}, #{entity.createTime}, #{entity.modifyTime}, #{entity.modifyUserId}, #{entity.orgId}, #{entity.companyId}, #{entity.sts}) + + + + + insert into excel_template_config_detail(field_name, field_code, field_type, dictionary_detail_id, show_name, sort, switch, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.fieldName}, #{entity.fieldCode}, #{entity.fieldType}, #{entity.dictionaryDetailId}, #{entity.showName}, #{entity.sort}, #{entity.switch}, #{entity.createUserId}, #{entity.createTime}, #{entity.modifyTime}, #{entity.modifyUserId}, #{entity.orgId}, #{entity.companyId}, #{entity.sts}) + + on duplicate key update + field_name = values(field_name), + field_code = values(field_code), + field_type = values(field_type), + dictionary_detail_id = values(dictionary_detail_id), + show_name = values(show_name), + sort = values(sort), + switch = values(switch), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + + + + update excel_template_config_detail + + + field_name = #{fieldName}, + + + field_code = #{fieldCode}, + + + field_type = #{fieldType}, + + + dictionary_detail_id = #{dictionaryDetailId}, + + + show_name = #{showName}, + + + sort = #{sort}, + + + switch = #{switch}, + + + create_user_id = #{createUserId}, + + + create_time = #{createTime}, + + + modify_time = #{modifyTime}, + + + modify_user_id = #{modifyUserId}, + + + org_id = #{orgId}, + + + company_id = #{companyId}, + + + sts = #{sts}, + + + where sorts = #{sorts} + + + + + delete from excel_template_config_detail where sorts = #{sorts} + + + + diff --git a/service/src/main/resources/mapper/SysApplicationDictionaryDetailDao.xml b/service/src/main/resources/mapper/SysApplicationDictionaryDetailDao.xml new file mode 100644 index 00000000..eac1c08e --- /dev/null +++ b/service/src/main/resources/mapper/SysApplicationDictionaryDetailDao.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into sys_application_dictionary_detail(app_id, dictionary_id, field_name, field_code, field_type, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values (#{appId}, #{dictionaryId}, #{fieldName}, #{fieldCode}, #{fieldType}, #{createUserId}, #{createTime}, #{modifyTime}, #{modifyUserId}, #{orgId}, #{companyId}, #{sts}) + + + + insert into sys_application_dictionary_detail(app_id, dictionary_id, field_name, field_code, field_type, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.appId}, #{entity.dictionaryId}, #{entity.fieldName}, #{entity.fieldCode}, #{entity.fieldType}, #{entity.createUserId}, #{entity.createTime}, #{entity.modifyTime}, #{entity.modifyUserId}, #{entity.orgId}, #{entity.companyId}, #{entity.sts}) + + + + + insert into sys_application_dictionary_detail(app_id, dictionary_id, field_name, field_code, field_type, create_user_id, create_time, modify_time, modify_user_id, org_id, company_id, sts) + values + + (#{entity.appId}, #{entity.dictionaryId}, #{entity.fieldName}, #{entity.fieldCode}, #{entity.fieldType}, #{entity.createUserId}, #{entity.createTime}, #{entity.modifyTime}, #{entity.modifyUserId}, #{entity.orgId}, #{entity.companyId}, #{entity.sts}) + + on duplicate key update + app_id = values(app_id), + dictionary_id = values(dictionary_id), + field_name = values(field_name), + field_code = values(field_code), + field_type = values(field_type), + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + org_id = values(org_id), + company_id = values(company_id), + sts = values(sts) + + + + + update sys_application_dictionary_detail + + + app_id = #{appId}, + + + dictionary_id = #{dictionaryId}, + + + field_name = #{fieldName}, + + + field_code = #{fieldCode}, + + + field_type = #{fieldType}, + + + create_user_id = #{createUserId}, + + + create_time = #{createTime}, + + + modify_time = #{modifyTime}, + + + modify_user_id = #{modifyUserId}, + + + org_id = #{orgId}, + + + company_id = #{companyId}, + + + sts = #{sts}, + + + where sorts = #{sorts} + + + + + delete from sys_application_dictionary_detail where sorts = #{sorts} + + + + diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 42d5247c..01b03ce5 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -33,8 +33,18 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.Enumeration; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; /** * @Content程序唯一入口controller @@ -110,12 +120,43 @@ public class EntranceController { logger.info("-------------------结束调用上传文件upload接口-------------------"); return jsonResultEntity; } - /** - * 根据文件保存的新名称下载文件 - * - * @param fileSaveName - * @return - */ + + @RequestMapping(value = "/pluginfileUpload", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity pluginfileUpload(MultipartFile file, FileUploadDto entity,String pluginPackageName, ServletRequest servletRequest, ServletResponse servletResponse) { + JsonResultEntity jsonResultEntity = null; + logger.info("-------------------开始调用上传插件附件upload接口-------------------"); + try { + jsonResultEntity = entranceService.pluginfileUpload(file, entity,pluginPackageName,servletRequest,servletResponse); + } catch (Exception e) { + jsonResultEntity = BaseResult.getFailureMessageEntity(e.getMessage()); + } + logger.info("-------------------结束调用上传插件附件upload接口-------------------"); + return jsonResultEntity; + } + + @ResponseBody + @RequestMapping(value = "/pluginZipUpdate") + public JsonResultEntity pluginZipUpate(FileUploadDto fileUploadDto){ + JsonResultEntity jsonResultEntity = null; + logger.info("-------------------开始调用插件更新接口-------------------"); + try{ + jsonResultEntity = entranceService.pluginZipUpate(fileUploadDto); + } catch (Exception e) { + jsonResultEntity = BaseResult.getFailureMessageEntity(e.getMessage()); + } + logger.info("-------------------结束调用插件更新接口------------------"); + return jsonResultEntity; + } + + + + /** + * 根据文件保存的新名称下载文件 + * + * @param fileSaveName + * @return + */ @RequestMapping(value = "/option/fileDownload") public ResponseEntity fileDownload(String fileSaveName) { ResponseEntity responseEntity = null; diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/IEntranceService.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/IEntranceService.java index 0665cb93..54eda1a6 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/IEntranceService.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/IEntranceService.java @@ -32,6 +32,9 @@ public interface IEntranceService { * @return com.hzya.frame.web.entity.JsonResultEntity **/ JsonResultEntity fileUpload(MultipartFile file, FileUploadDto entity, ServletRequest servletRequest, ServletResponse servletResponse) throws Exception; + + JsonResultEntity pluginfileUpload(MultipartFile file, FileUploadDto entity,String pluginPackageName, ServletRequest servletRequest, ServletResponse servletResponse) throws Exception; + JsonResultEntity pluginZipUpate(FileUploadDto fileUploadDto) throws Exception; /*** * 系统框架附件上传接口 * @content: diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index 86d047b0..46af2a3c 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -6,6 +6,8 @@ import cn.hutool.extra.servlet.ServletUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.hzya.frame.sys.entity.EsbReturnEntity; +import com.hzya.frame.sys.file.download.entity.FileDownloadEntity; +import com.hzya.frame.sys.file.download.service.IFileDownloadService; import com.hzya.frame.sys.file.upload.entity.FileResultEntity; import com.hzya.frame.sys.file.upload.entity.FileUploadDto; import com.hzya.frame.sys.file.upload.entity.FileUploadEntity; @@ -54,6 +56,9 @@ public class EntranceServiceImpl implements IEntranceService { @Autowired private IFileUploadService fileUploadService; + @Autowired + private IFileDownloadService fileDownloadService; + @Override @DSTransactional() public JsonResultEntity doBusiness(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { @@ -225,6 +230,19 @@ public class EntranceServiceImpl implements IEntranceService { FileUploadEntity fileUploadEntity = fileUploadService.fileUpload(file,entity); return BaseResult.getSuccessMessageEntity("附件上传成功",fileUploadEntity); } + + @Override + public JsonResultEntity pluginfileUpload(MultipartFile file, FileUploadDto entity,String pluginPackageName, ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { + StpUtil.checkLogin(); + FileUploadEntity fileUploadEntity = fileUploadService.pluginfileUpload(file,entity,pluginPackageName); + return BaseResult.getSuccessMessageEntity("附件上传成功",fileUploadEntity); + } + + public JsonResultEntity pluginZipUpate(FileUploadDto fileUploadDto) throws Exception{ + StpUtil.checkLogin(); + FileDownloadEntity fileDownloadEntity = fileDownloadService.pluginZipUpate(fileUploadDto); + return BaseResult.getSuccessMessageEntity("插件更新成功",fileDownloadEntity); + } @Override public JsonResultEntity fileUpload(MultipartFile file, FileResultEntity entity, ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { entity = fileUploadService.fileUpload(file,entity); From ef5d366074966e26ed1132e5bd8221a46c9ea9f5 Mon Sep 17 00:00:00 2001 From: username Date: Tue, 27 Aug 2024 14:43:34 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E3=80=81=E6=8F=92=E4=BB=B6=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E3=80=81=E6=8F=92=E4=BB=B6=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E3=80=81=E6=8F=92=E4=BB=B6=E6=92=A4=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpackage/src/main/resources/application-dev.yml b/buildpackage/src/main/resources/application-dev.yml index 9156fac5..8dffa2d4 100644 --- a/buildpackage/src/main/resources/application-dev.yml +++ b/buildpackage/src/main/resources/application-dev.yml @@ -19,6 +19,8 @@ spring: savefile: # 文件保存路径 path: /home/webservice/zt/file + pluginpath: D:/local/plugin/ + tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\ cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a From 4c50b026f8560528fa72d6240b3a098e45943e70 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 27 Aug 2024 15:11:56 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=87=AD=E8=AF=81?= =?UTF-8?q?=E5=8F=B7=E6=9F=A5=E8=AF=A2=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nxproof/glPzml/dao/ISenderGlPzmlDao.java | 11 ++ .../glPzml/dao/impl/SenderGlPzmlDaoImpl.java | 7 ++ .../glPzml/entity/SenderGlPzmlEntity.java | 10 ++ .../glPzml/entity/SenderGlPzmlEntity.xml | 25 +++++ .../glPzml/service/ISenderGlPzmlService.java | 4 +- .../service/impl/SenderGlPzmlServiceImpl.java | 106 +++++++++++++----- 6 files changed, 134 insertions(+), 29 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/ISenderGlPzmlDao.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/ISenderGlPzmlDao.java index 529198c9..fda53f20 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/ISenderGlPzmlDao.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/ISenderGlPzmlDao.java @@ -4,6 +4,7 @@ import com.hzya.frame.basedao.dao.IBaseDao; import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity; import java.util.List; +import java.util.Map; /** * (gl_pzml: table)表数据库访问层 @@ -83,6 +84,16 @@ public interface ISenderGlPzmlDao extends IBaseDao { * **/ Integer deleteGlPzmlHealthBureau(SenderGlPzmlEntity senderGlPzmlEntity); + /** + * + * @content 查询凭证 商学院 + * @Param + * @Return + * @Author hecan + * @Date 2024/8/14 16:25 + * **/ + List queryGlPzmlSxy(SenderGlPzmlEntity senderGlPzmlEntity); + } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java index 9b4655f7..ccaa162a 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java @@ -8,6 +8,7 @@ import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity; import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; /** * (GlPzml)表数据库访问层 @@ -60,5 +61,11 @@ public class SenderGlPzmlDaoImpl extends MybatisGenericDao queryGlPzmlSxy(SenderGlPzmlEntity senderGlPzmlEntity) { + return (List) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity); + } } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java index bcaf3369..11865f92 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java @@ -54,6 +54,16 @@ public class SenderGlPzmlEntity extends BaseEntity { private String stamp; private String yspzje; + private String bmdm; + + public String getBmdm() { + return bmdm; + } + + public void setBmdm(String bmdm) { + this.bmdm = bmdm; + } + public String getPzsbm() { return pzsbm; } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.xml b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.xml index 86d48292..a130f435 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.xml +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.xml @@ -259,6 +259,31 @@ + + + insert into gl_pzml( diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/service/ISenderGlPzmlService.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/service/ISenderGlPzmlService.java index ad085e24..c0397b3b 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/service/ISenderGlPzmlService.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/service/ISenderGlPzmlService.java @@ -95,11 +95,11 @@ public interface ISenderGlPzmlService extends IBaseService pzmlEntities = senderGlPzmlDao.query(glPzmlEntity); - if(CollectionUtils.isEmpty(pzmlEntities)){ + List list = senderGlPzmlDao.queryGlPzmlSxy(glPzmlEntity); + if(CollectionUtils.isEmpty(list)){ return BaseResult.getSuccessMessageEntity("没有需要同步得凭证",null); } - for (SenderGlPzmlEntity pzmlEntity : pzmlEntities) { - String pzNum = pzmlEntity.getGsdm() + "_" + pzmlEntity.getZth() + "_" + pzmlEntity.getKjqj() + "_" + pzmlEntity.getPzh(); - JSONObject jsonObjectParams=new JSONObject(); - jsonObjectParams.put("code",pzmlEntity.getIdpzh());//pzid - jsonObjectParams.put("budgetYear",pzmlEntity.getKjqj().substring(0,4));//预算年度 - jsonObjectParams.put("applyDate",DateUtil.format(new Date(),"yyyy-MM-dd"));//日期 - jsonObjectParams.put("userCode","");//用户编码 - jsonObjectParams.put("depCode","");//部门编码 - jsonObjectParams.put("description",pzmlEntity.getPzzy());//说明 - jsonObjectParams.put("amount",pzmlEntity.getPzje());//金额 - jsonObjectParams.put("pzNum",pzNum);//凭证号 例如:公司代码+账套号+会计期间+凭证号:001_001_202408_付款_1 - JSONArray jsonArray=new JSONArray(); - jsonArray.add(jsonObjectParams); - JSONObject jsonObjectData=new JSONObject(); - jsonObjectData.put("data",jsonArray); - - + try { + String result=null; + for (SenderGlPzmlEntity pzmlEntity : list) { + String pzNum = pzmlEntity.getGsdm() + "_" + pzmlEntity.getZth() + "_" + pzmlEntity.getKjqj() + "_" + pzmlEntity.getPzh(); + //转换日期,如将20240514转为2024-05-14 + SimpleDateFormat inputFormat = new SimpleDateFormat("yyyyMMdd"); + SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd"); + Date date = inputFormat.parse(pzmlEntity.getSrrq()); + String outputDateString = outputFormat.format(date); + //将金额四舍五入 + BigDecimal bigDecimalValue = new BigDecimal(pzmlEntity.getPzje()); + BigDecimal roundedValue = bigDecimalValue.setScale(2, + RoundingMode.HALF_UP); + JSONObject jsonObjectParams=new JSONObject(); + jsonObjectParams.put("code",pzmlEntity.getIdpzh());//pzid + jsonObjectParams.put("budgetYear",pzmlEntity.getKjqj().substring(0,4));//预算年度 + jsonObjectParams.put("applyDate",outputDateString);//日期 + jsonObjectParams.put("userCode",pzmlEntity.getSrid());//用户编码 + jsonObjectParams.put("depCode","A518");//部门编码 + jsonObjectParams.put("description",pzmlEntity.getPzzy());//说明 + jsonObjectParams.put("amount",roundedValue.doubleValue());//金额 + jsonObjectParams.put("pzNum",pzNum);//凭证号 例如:公司代码+账套号+会计期间+凭证号:001_001_202408_付款_1 + //根据idpzh查询指标id和指标金额 + GbiZbxmbEntity gbiZbxmbEntity=new GbiZbxmbEntity(); + gbiZbxmbEntity.setDjId(pzmlEntity.getIdpzh()); + gbiZbxmbEntity.setKjnd(pzmlEntity.getKjqj().substring(0,4)); + gbiZbxmbEntity.setDataSourceCode(glPzmlEntity.getDataSourceCode()); + List gbiZbsyrecEntities = gbiZbxmbDao.queryZbxmbByIdpzh(gbiZbxmbEntity); + logger.info("=======根据凭证idpzh:{}查询的指标金额和指标id数据有{}条",pzmlEntity.getIdpzh(),gbiZbsyrecEntities.size()); + if(CollectionUtils.isEmpty(gbiZbsyrecEntities)){ + jsonObjectParams.put("reimburseItems",new ArrayList<>()); + }else{ + JSONArray jsonArray=new JSONArray(); + for (GbiZbxmbEntity zbxmbEntity : gbiZbsyrecEntities) { + BigDecimal bigDecimalValueZbxmb = new BigDecimal(zbxmbEntity.getJe()); + BigDecimal roundedValueZbxmb = bigDecimalValueZbxmb.setScale(2, RoundingMode.HALF_UP); + JSONObject jsonObjectZbxm=new JSONObject(); + jsonObjectZbxm.put("thirdProjectCode",zbxmbEntity.getZbid()); + jsonObjectZbxm.put("amount",roundedValueZbxmb); + jsonObjectZbxm.put("financialCode",zbxmbEntity.getJjkmdm()); + jsonArray.add(jsonObjectZbxm); + } + jsonObjectParams.put("reimburseItems",jsonArray); + } + JSONArray jsonArray=new JSONArray(); + jsonArray.add(jsonObjectParams); + JSONObject jsonObjectData=new JSONObject(); + jsonObjectData.put("data",jsonArray); + String params = jsonObjectData.toJSONString(); + logger.info("调用商学院凭证保存接口请求参数:{}",params); + result = HttpRequest.post(URLTest + "/nky/service/zsApi/saveZJSYPZReimburse?accessToken="+token).header("Content-Type", "application/json;charset=UTF-8").timeout(30000).body(params).execute().body(); + logger.info("调用商学院凭证保存接口返回参数:{}",result); + } + JSONObject jsonObjectResult=new JSONObject(); + jsonObjectResult.put("status","200"); + jsonObjectResult.put("pzml",result); + return jsonObjectResult; + }catch (Exception e){ + logger.info("根据凭证idpzh:{}查询指标失败:{}",glPzmlEntity.getIdpzh(),e.getMessage()); + return BaseResult.getFailureMessageEntity("根据凭证查询指标失败"); } - return null; } @@ -713,7 +766,7 @@ public class SenderGlPzmlServiceImpl extends BaseService Date: Wed, 28 Aug 2024 10:19:42 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=94=9F=E6=88=90=E8=8F=9C=E5=8D=95=E7=9B=AE=E5=BD=95?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/mdmModule/service/impl/MdmModuleServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java index 82c9f218..7169f57f 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java @@ -351,7 +351,7 @@ public class MdmModuleServiceImpl extends BaseService i sysMenuConfigEntities.get(i).setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); } else { //2、单据 - sysMenuConfigEntities.get(i).setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + sysMenuConfigEntities.get(i).setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0"); } sysMenuConfigEntities.get(i).setMenuName(entity.getMdmName()); sysMenuConfigEntities.get(i).setMenuEnglishName("integrationOptionAdmin" + entity.getMdmCode()); @@ -1713,7 +1713,7 @@ public class MdmModuleServiceImpl extends BaseService i module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); } else { //2、单据 - module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + module.setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0"); } module.setMenuName(mdmModuleEntity.getMdmName()); module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); @@ -1785,7 +1785,7 @@ public class MdmModuleServiceImpl extends BaseService i module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c"); } else { //2、单据 - module.setParentMenuId("58714ddb7ec94f5da91df74efada042f"); + module.setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0"); } module.setMenuName(mdmModuleEntity.getMdmName()); module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode()); From a7b25fa268f38e04103c4cfeea8b309702d64932 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 28 Aug 2024 11:00:11 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-dev.yml | 7 +++++-- .../download/service/impl/FileDownloadServiceImpl.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/buildpackage/src/main/resources/application-dev.yml b/buildpackage/src/main/resources/application-dev.yml index 8dffa2d4..5e9c4b36 100644 --- a/buildpackage/src/main/resources/application-dev.yml +++ b/buildpackage/src/main/resources/application-dev.yml @@ -19,8 +19,11 @@ spring: savefile: # 文件保存路径 path: /home/webservice/zt/file - pluginpath: D:/local/plugin/ - tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\ +# path: D:\webservice\file +# pluginpath: D:\webservice\plugin + pluginpath: /home/webservice/zt/plugin +# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ + tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/ cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java index ccdd9f4e..036d31a7 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java @@ -90,7 +90,7 @@ public class FileDownloadServiceImpl extends BaseService< FileDownloadEntity,Lo } /** 拼接文件路径*/ String filePath = ""; - if(fileDownloadEntity.getFileType().equals("2")){ + if(fileDownloadEntity.getFileType() != null && fileDownloadEntity.getFileType().equals("2")){ filePath = PLUGINPATH + fileDownloadEntity.getFilepath().replace("/",File.separator).replace("\\",File.separator); }else{ filePath = DSK + fileDownloadEntity.getFilepath().replace("/",File.separator).replace("\\",File.separator); From 0f8232cee96b86308aee80c99820c85dd96c75f8 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 28 Aug 2024 11:54:54 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E7=BB=9F=E4=B8=80GrpU8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AcctVouchInfoServiceImpl.java | 1 + .../nxproof/glPzml/entity/SenderGlPzmlEntity.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/impl/AcctVouchInfoServiceImpl.java b/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/impl/AcctVouchInfoServiceImpl.java index 6835947a..21f9507d 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/impl/AcctVouchInfoServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/impl/AcctVouchInfoServiceImpl.java @@ -202,6 +202,7 @@ public class AcctVouchInfoServiceImpl extends BaseService list = senderGlPznrDao.querySenderGlPznrEntityByIdpzh(senderGlPznrEntity); + senderGlPzmlEntity.setSenderGlPznrEntities(list); //查询辅助核算 if(list != null && list.size() > 0){ GlFzxzlEntityDto glFzxzlEntityDto = new GlFzxzlEntityDto(); diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java index bcaf3369..8923dd0a 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/entity/SenderGlPzmlEntity.java @@ -1,8 +1,11 @@ package com.hzya.frame.grpU8.nxproof.glPzml.entity; +import com.hzya.frame.grpU8.nxproof.glPznr.entity.SenderGlPznrEntity; import com.hzya.frame.web.entity.BaseEntity; +import java.util.List; + /** * (GlPzml)实体类 * @@ -53,7 +56,7 @@ public class SenderGlPzmlEntity extends BaseEntity { private String pzsbm; private String stamp; private String yspzje; - + private List senderGlPznrEntities; public String getPzsbm() { return pzsbm; } @@ -366,6 +369,12 @@ public class SenderGlPzmlEntity extends BaseEntity { this.yspzzs = yspzzs; } + public List getSenderGlPznrEntities() { + return senderGlPznrEntities; + } + public void setSenderGlPznrEntities(List senderGlPznrEntities) { + this.senderGlPznrEntities = senderGlPznrEntities; + } } From ef85056b113803f7a3fd3a466efd1180fc431761 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 28 Aug 2024 14:06:50 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=85=88=E6=9F=A5=E8=AF=A2=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AD=98=E5=9C=A8=EF=BC=8C=E5=AD=98=E5=9C=A8=E5=88=99?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 247 +++++++++--------- 1 file changed, 124 insertions(+), 123 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index de8412fa..9b4c57ae 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -213,150 +213,151 @@ public class ComparisonServiceImpl extends BaseService //根据data_id判断数据是否已经保存在相关表中,避免重复保存 List fields = getFields(comparisonEntity); - Map mapDataId=new HashMap<>(); - mapDataId.put("data_id",jsonObjectMain.getString("data_id")); - ComparisonEntity comparisonDataId=new ComparisonEntity(); + Map mapDataId = new HashMap<>(); + mapDataId.put("data_id", jsonObjectMain.getString("data_id")); + ComparisonEntity comparisonDataId = new ComparisonEntity(); comparisonDataId.setMap(mapDataId); comparisonDataId.setDbName(comparisonEntity.getDbName()); comparisonDataId.setFields(fields); List> listDataId = comparisonDao.queryComparisonPage(comparisonDataId); - if(CollectionUtils.isNotEmpty(listDataId)){ - return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); - } - - //判断输入的主表字段是否是必填项 - for (ComparisonEntity entity : comparisonEntities) { - //如果必填字段不为空 - if(entity.getRuleValue()!=null && entity.getDbType().equals("1")){ + if (CollectionUtils.isNotEmpty(listDataId)) { + //return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); + updateEntity(json); + } else { + //判断输入的主表字段是否是必填项 + for (ComparisonEntity entity : comparisonEntities) { + //如果必填字段不为空 + if (entity.getRuleValue() != null && entity.getDbType().equals("1")) { //如果值为空,说明没有传这个字段或者这个字段的值为空 - if(jsonObjectMain.getString(entity.getEnName()) ==null || jsonObjectMain.getString(entity.getEnName()).equals("")){ + if (jsonObjectMain.getString(entity.getEnName()) == null || jsonObjectMain.getString(entity.getEnName()).equals("")) { //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2"); - return BaseResult.getFailureMessageEntity(entity.getDbName()+"表的"+entity.getEnName()+"字段不能为空"); + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2"); + return BaseResult.getFailureMessageEntity(entity.getDbName() + "表的" + entity.getEnName() + "字段不能为空"); } - } - } - - map.put("id", uuid); - map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - map.put("org_id", "0"); - map.put("create_time", new Date()); - map.put("modify_time", new Date()); - map.put("sts", "Y"); - map.put("data_status", "Y");//新增状态 - map.put("add_status", "0");//新增状态 - map.put("update_status", "1");//修改状态 - map.put("delete_status", "1");//删除状态 - ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); - //查询单据规则 只查询主表得,明细表不用 - try { - ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule); - String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1"; - logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule); - if (documentRule != null) { - //获取规则前缀 CK - String rulePrefix = documentRule.substring(0, documentRule.indexOf("-")); - //获取规则中间日期 yyyy-MM-dd - String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); - String ruleMiddle = getRuleDate(ruleDate); - //获取规则后缀 - String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1); - int ruleSuffix = ruleSuffixLength.length(); - //生成单据规则 - comparisonEntityRule.setRulePrefix(rulePrefix); - comparisonEntityRule.setRuleMiddle(ruleMiddle); - comparisonEntityRule.setRuleSuffix(ruleSuffix); - try { - //新生成单据规则保存到数据库 - ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); - map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 - map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 - comparisonEntityRule.setMap(map); - } catch (Exception e) { - logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2"); - - return BaseResult.getFailureMessageEntity("保存失败"); } } - } catch (Exception e) { - logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage()); - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2"); - return BaseResult.getFailureMessageEntity("保存失败"); - } - try { - List list = new ArrayList<>(); - JSONObject jsonObjectList = new JSONObject(); + map.put("id", uuid); + map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + map.put("org_id", "0"); + map.put("create_time", new Date()); + map.put("modify_time", new Date()); + map.put("sts", "Y"); + map.put("data_status", "Y");//新增状态 + map.put("add_status", "0");//新增状态 + map.put("update_status", "1");//修改状态 + map.put("delete_status", "1");//删除状态 + ComparisonEntity comparisonEntityRule = comparisonEntities.get(0); + //查询单据规则 只查询主表得,明细表不用 + try { + ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule); + String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1"; + logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule); + if (documentRule != null) { + //获取规则前缀 CK + String rulePrefix = documentRule.substring(0, documentRule.indexOf("-")); + //获取规则中间日期 yyyy-MM-dd + String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-")); + String ruleMiddle = getRuleDate(ruleDate); + //获取规则后缀 + String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1); + int ruleSuffix = ruleSuffixLength.length(); + //生成单据规则 + comparisonEntityRule.setRulePrefix(rulePrefix); + comparisonEntityRule.setRuleMiddle(ruleMiddle); + comparisonEntityRule.setRuleSuffix(ruleSuffix); + try { + //新生成单据规则保存到数据库 + ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); + map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 + map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 + comparisonEntityRule.setMap(map); + } catch (Exception e) { + logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage()); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2"); - //判断明细表字段是否是必填项 - if (arrayList != null && arrayList.size() > 0) { - for (JSONArray jsonArrayDetails : arrayList) { - for (Object object : jsonArrayDetails) { - JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object); - for (ComparisonEntity entity : comparisonEntities) { - if(entity.getRuleValue()!=null && entity.getDbType().equals("2")){ - //如果值为空,说明没有传这个字段或者这个字段的值为空 - if(jsonObjectDetails.getString(entity.getEnName())==null || jsonObjectDetails.getString(entity.getEnName()).equals("")){ - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2"); - return BaseResult.getFailureMessageEntity(entity.getDbName()+"表的"+entity.getEnName()+"字段不能为空"); + return BaseResult.getFailureMessageEntity("保存失败"); + } + } + } catch (Exception e) { + logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage()); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2"); + + return BaseResult.getFailureMessageEntity("保存失败"); + } + try { + List list = new ArrayList<>(); + JSONObject jsonObjectList = new JSONObject(); + + //判断明细表字段是否是必填项 + if (arrayList != null && arrayList.size() > 0) { + for (JSONArray jsonArrayDetails : arrayList) { + for (Object object : jsonArrayDetails) { + JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object); + for (ComparisonEntity entity : comparisonEntities) { + if (entity.getRuleValue() != null && entity.getDbType().equals("2")) { + //如果值为空,说明没有传这个字段或者这个字段的值为空 + if (jsonObjectDetails.getString(entity.getEnName()) == null || jsonObjectDetails.getString(entity.getEnName()).equals("")) { + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2"); + return BaseResult.getFailureMessageEntity(entity.getDbName() + "表的" + entity.getEnName() + "字段不能为空"); + } } } } } } - } - //保存主表数据 - ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); - jsonObjectList.put(comparisonEntityOne.getDbName(),map); - //保存子表数据 - if (arrayList != null && arrayList.size() > 0) { - mapDetails = spliceDetailMap(comparisonEntities, mapDetails, arrayList); - if(mapDetails.size()>0 && mapDetails!=null ){ - for (List> mapDetail : mapDetails) { - for (Map stringObjectMap : mapDetail) { - stringObjectMap.put("id", UUIDLong.longUUID()); - stringObjectMap.put("formmain_id", uuid); - stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); - stringObjectMap.put("org_id", "0"); - stringObjectMap.put("create_time", new Date()); - stringObjectMap.put("modify_time", new Date()); - stringObjectMap.put("sts", "Y"); - stringObjectMap.put("data_status", "Y");//新增状态 - comparisonDetailsEntity.setMapDetails(stringObjectMap); - comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name"))); - stringObjectMap.remove("table_name"); - ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); - comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); - //保存操作日志 - //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + //保存主表数据 + ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule); + jsonObjectList.put(comparisonEntityOne.getDbName(), map); + //保存子表数据 + if (arrayList != null && arrayList.size() > 0) { + mapDetails = spliceDetailMap(comparisonEntities, mapDetails, arrayList); + if (mapDetails.size() > 0 && mapDetails != null) { + for (List> mapDetail : mapDetails) { + for (Map stringObjectMap : mapDetail) { + stringObjectMap.put("id", UUIDLong.longUUID()); + stringObjectMap.put("formmain_id", uuid); + stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + stringObjectMap.put("org_id", "0"); + stringObjectMap.put("create_time", new Date()); + stringObjectMap.put("modify_time", new Date()); + stringObjectMap.put("sts", "Y"); + stringObjectMap.put("data_status", "Y");//新增状态 + comparisonDetailsEntity.setMapDetails(stringObjectMap); + comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name"))); + stringObjectMap.remove("table_name"); + ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity); + comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); + //保存操作日志 + //controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + } } + jsonObjectList.put(comparisonDetailsEntity.getDbName(), mapDetails); } - jsonObjectList.put(comparisonDetailsEntity.getDbName(), mapDetails); + } else { + jsonObjectList.put(comparisonDetailsEntity.getDbName(), new ArrayList<>()); } - } else { - jsonObjectList.put(comparisonDetailsEntity.getDbName(), new ArrayList<>()); - } - jsonObjectList.remove(null); - list.add(jsonObjectList); - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","1"); - JSONObject json1 = new JSONObject(); - json1.put("status","200"); - json1.put("list",list); - return json1; - } catch (Exception e) { - logger.info("保存通用数据时候错误:{}", e.getMessage()); - //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2"); + jsonObjectList.remove(null); + list.add(jsonObjectList); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "1"); + JSONObject json1 = new JSONObject(); + json1.put("status", "200"); + json1.put("list", list); + return json1; + } catch (Exception e) { + logger.info("保存通用数据时候错误:{}", e.getMessage()); + //保存操作日志 + controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2"); - return BaseResult.getFailureMessageEntity("保存失败"); + return BaseResult.getFailureMessageEntity("保存失败"); + } } } } From 9e54b38c9a2a852fad6d1a8624cf8374eafa77c4 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 28 Aug 2024 18:26:53 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E8=BF=94=E5=9B=9Ereturn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comparison/service/impl/ComparisonServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 9b4c57ae..72718c51 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -222,7 +222,7 @@ public class ComparisonServiceImpl extends BaseService List> listDataId = comparisonDao.queryComparisonPage(comparisonDataId); if (CollectionUtils.isNotEmpty(listDataId)) { //return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); - updateEntity(json); + return updateEntity(json); } else { //判断输入的主表字段是否是必填项 for (ComparisonEntity entity : comparisonEntities) { @@ -361,7 +361,7 @@ public class ComparisonServiceImpl extends BaseService } } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("保存失败","请检查传递参数"); } //更新通用数据数据 @@ -500,7 +500,7 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("更新失败"); } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("更新失败","请检查传递参数"); } private List getFields(ComparisonEntity comparisonEntity) { @@ -612,7 +612,7 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("删除失败"); } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("删除失败","请检查传递参数"); } //根据应用key和应用密钥获取应用编码和应用名称 From f6ee41cfe5090e50c1c840e42d4bd31e4a6c14e4 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 29 Aug 2024 10:19:01 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=87=AD=E8=AF=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-llg.yml | 21 +++++------- .../glPznr/entity/SenderGlPznrEntity.xml | 1 - .../nxproof/glfzxzl/entity/GlFzxzlEntity.xml | 33 +++---------------- .../frame/webapp/web/init/FlywayConfig.java | 2 +- 4 files changed, 14 insertions(+), 43 deletions(-) diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index 0a16527c..0b33d662 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -23,22 +23,19 @@ spring: dynamic: druid: filters: stat,log4j2 + validationQuery: SELECT 1 # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL datasource: master: -# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle -# username: hzyazt + +# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true +# username: root # password: 62e4295b615a30dbf3b8ee96f41c820b -# driver-class-name: dm.jdbc.driver.DmDriver -# type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true - username: root +# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + + url: jdbc:sqlserver://192.168.2.247:9433;DatabaseName=businesscenter;encrypt=false;trustServerCertificate=true + username: sa password: 62e4295b615a30dbf3b8ee96f41c820b - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 -# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle -# username: hzyazt -# password: 62e4295b615a30dbf3b8ee96f41c820b -# driver-class-name: dm.jdbc.driver.DmDriver + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml index 3d6087d0..cdd53c87 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml @@ -145,7 +145,6 @@ , ZBID , EDID , JFSQID - , fzdm10 , fzdm11 , fzdm12 , fzdm13 diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glfzxzl/entity/GlFzxzlEntity.xml b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glfzxzl/entity/GlFzxzlEntity.xml index fb4e35d0..de8a862a 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glfzxzl/entity/GlFzxzlEntity.xml +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glfzxzl/entity/GlFzxzlEntity.xml @@ -282,29 +282,6 @@ update GL_Fzxzl set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{m diff --git a/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java b/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java index 8630f562..4dda931a 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java @@ -48,7 +48,7 @@ public class FlywayConfig { @PostConstruct public void migrateOrder() { - if("false".equals(enabled)){ + if(!"false".equals(enabled)){ String pwd = AESUtil.decrypt(password); DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource; DataSource dsDatasource = null; From a1b601a41d4b2131385e8f6b5781457b34c4a777 Mon Sep 17 00:00:00 2001 From: username Date: Thu, 29 Aug 2024 15:08:08 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=A2=84=E8=AD=A6=EF=BC=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=87=8D=E6=96=B0=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ISysApplicationService.java | 3 + .../impl/SysApplicationServiceImpl.java | 523 ++++++++++++++++++ .../controler/EntranceController.java | 9 + 3 files changed, 535 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index c468ffe1..25ec9090 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java @@ -3,6 +3,7 @@ package com.hzya.frame.sysnew.application.service; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.web.entity.JsonResultEntity; import javax.servlet.ServletRequest; @@ -308,6 +309,8 @@ public interface ISysApplicationService extends IBaseService oldheaderMap = new HashMap<>(); + Iterator it = headerObject.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry entry = (Map.Entry) it.next(); + oldheaderMap.put(entry.getKey(), entry.getValue()); + } + + String oldId = resendLogEntity.getId(); + String oldbodys = bodyObject.toString(); + String oldquerys = ""; + //应用key + String publicKey = headerObject.getString("publickey"); + //应用密钥 + String secretKey = headerObject.getString("secretkey"); + //appId + String appId = headerObject.getString("appid"); + //apiCode + String apiCode = headerObject.getString("apicode"); + String ip = headerObject.getString("x-real-ip"); + if (publicKey == null || "".equals(publicKey)) { + return BaseResult.getFailureMessageEntity("请先传递公钥"); + } + if (secretKey == null || "".equals(secretKey)) { + return BaseResult.getFailureMessageEntity("请先传递密钥"); + } + if (appId == null || "".equals(appId)) { + return BaseResult.getFailureMessageEntity("请先传递接收方应用"); + } + if (apiCode == null || "".equals(apiCode)) { + return BaseResult.getFailureMessageEntity("请先传递发送接口"); + } + + logger.info("请求参数:publicKey:【" + publicKey + "】secretKey:【" + secretKey + "】appId:【" + appId + "】apiCode:【" + apiCode); + //根据请求a应用的公钥、密钥是否能查找到一条数据 + + SysApplicationEntity sendApp = getAppByPublicKeySecretKey(publicKey, secretKey); + if (sendApp == null) { + //saveLog(new SysApplicationEntity(), new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"公钥、密钥错误"); + return BaseResult.getFailureMessageEntity("公钥、密钥错误,请联系管理员"); + } + //判断应用是否启用 + if (sendApp.getAppStatus() == null || !"1".equals(sendApp.getAppStatus())) { + return BaseResult.getFailureMessageEntity(sendApp.getName() + "应用未启用,请联系管理员"); + } + + SysApplicationEntity receiveApp = getAppByAppId(appId); + if (receiveApp == null) { + return BaseResult.getFailureMessageEntity("根据appId:" + appId + "未匹配到应用,请联系管理员"); + } + //判断应用是否启用 + if (receiveApp.getAppStatus() == null || !"1".equals(receiveApp.getAppStatus())) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用未启用,请联系管理员"); + } + //判断应用接口是否启用 + if (receiveApp.getInterfaceStatus() == null || !"1".equals(receiveApp.getInterfaceStatus())) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用接口环境未启用,请联系管理员"); + } + + SysApplicationApiEntity receiveApi = getApiByAppIdApiCode(receiveApp.getId(), apiCode); + if (receiveApi == null) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + ":" + apiCode + "未启用或者未创建"); + } + + SysApplicationApiAuthEntity sysApplicationApiAuthEntity = getApiAuthByNameAppId(sendApp.getId(), receiveApp.getId()); + if (sysApplicationApiAuthEntity == null) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用权限配置错误"); + } + if (sysApplicationApiAuthEntity.getSystemAddress() != null && !"".equals(sysApplicationApiAuthEntity.getSystemAddress()) + && !sysApplicationApiAuthEntity.getSystemAddress().contains(ip)) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误"); + } + + SysApplicationApiAuthDetailEntity sysApplicationApiAuthDetailEntity = getApiAuthDetailByAppIdApiIdTripartiteSystemId(receiveApp.getId(), receiveApi.getId(), sysApplicationApiAuthEntity.getId()); + if (sysApplicationApiAuthDetailEntity == null) { + return BaseResult.getFailureMessageEntity(receiveApi.getApiName() + "未授权给" + sendApp.getName() + ",请联系管理员"); + } + SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity(); + + + List a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); + Map headers = new HashMap<>(); + if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) { + JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object1 = jsonArray.getJSONObject(i); + headers.put(object1.getString("parameterName"), object1.getString("example")); + } + } + } + if (oldheaderMap != null && oldheaderMap.size() > 0) { + for (Map.Entry entry : oldheaderMap.entrySet()) { + if (!a.contains(entry.getKey())) { + headers.put(entry.getKey(), entry.getValue()); + } + } + } + + sysExtensionApiEntity.setSendApp(sendApp); + sysExtensionApiEntity.setReceiveApp(receiveApp); + sysExtensionApiEntity.setReceiveApi(receiveApi); + sysExtensionApiEntity.setHeaders(headers); + sysExtensionApiEntity.setQuerys(oldquerys); + sysExtensionApiEntity.setBodys(oldbodys); + Method[] methods = null; + Object object = null; + + // 判断是否有内部api 是否扩展api 1、启用 2、停用 + if (receiveApi.getExtensionApi() != null && "1".equals(receiveApi.getExtensionApi()) + && receiveApi.getBeanName() != null && !"".equals(receiveApi.getBeanName()) + && receiveApi.getFunName() != null && !"".equals(receiveApi.getFunName()) + ) { + //获取类 + try { + object = ApplicationContextUtil.getBeanByName(receiveApi.getBeanName()); + } catch (SecurityException e) { + + } + //获取类下面的方法 + methods = object.getClass().getMethods(); + if (methods == null || methods.length == 0) { + return BaseResult.getFailureMessageEntity("未找到内部方法,请联系管理员"); + } + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim())) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + sysExtensionApiEntity = (SysExtensionApiEntity) m.invoke(object, sysExtensionApiEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + break; + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("内部方法执行错误,请联系管理员"); + } + } + } + } + + } + headers = sysExtensionApiEntity.getHeaders(); + String querys = sysExtensionApiEntity.getQuerys(); + String bodys = sysExtensionApiEntity.getBodys(); + //设置参数获取参数 + StringBuffer url = new StringBuffer(); + if(!receiveApi.getDestinationAddress().toLowerCase().startsWith("http")){ + url.append(receiveApp.getInterfaceAddress()); + } + url.append(receiveApi.getDestinationAddress()); + if (querys != null) { + url.append("?"); + url.append(querys); + } + Integer outTime = 6000; + if (receiveApi.getTimeoutPeriod() != null && !"".equals(receiveApi.getTimeoutPeriod())) { + outTime = Integer.valueOf(receiveApi.getTimeoutPeriod()); + } + //1、POST 2、GET + String method = "POST"; + if ("2".equals(receiveApi.getRequestMethod())) { + method = "GET"; + } + //List a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); + //Map headers = new HashMap<>(); + //if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) { + // JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + // if (jsonArray != null && jsonArray.size() > 0) { + // for (int i = 0; i < jsonArray.size(); i++) { + // JSONObject object1 = jsonArray.getJSONObject(i); + // headers.put(object1.getString("parameterName"), object1.getString("example")); + // } + // } + //} + //if (headerMap != null && headerMap.size() > 0) { + // for (Map.Entry entry : headerMap.entrySet()) { + // if (!a.contains(entry.getKey())) { + // headers.put(entry.getKey(), entry.getValue()); + // } + // } + //} + + + if ("POST".equals(method)) { + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("保存日志开始"); + //重写saveLog方法,利用他原有逻辑判断重推结果,根据重推结果,设置该条日志的状态 + SysMessageManageLogEntity sysMessageManageLogEntity = updateLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null,oldId); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", jsonObject); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", body); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + + } else {//GET + + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpGet get = new HttpGet(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + boolean flag = true; + try { + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + logger.info("保存日志开始"); + SysMessageManageLogEntity sysMessageManageLogEntity = updateLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null,oldId); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", jsonObject); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", body); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } + private SysApplicationApiAuthDetailEntity getApiAuthDetailByAppIdApiIdTripartiteSystemId(String appId, String apiId, String tripartiteSystemId) { String str = "appId" + appId + "apiId" + apiId + "tripartiteSystemId" + tripartiteSystemId; Object o = applicationCache.get("4", str); @@ -2276,6 +2641,161 @@ public class SysApplicationServiceImpl extends BaseService oldheaderMap,Map headerMap, + Map headers, + String oldquerys, String querys, + String body, boolean flag,String msg,String oldId) { + SysMessageManageLogEntity sysMessageManageLogEntity = new SysMessageManageLogEntity(); + //messageManageId 消息主表主键 + //theme 消息主题 + //messageCode 消息编码 + //sendApp + sysMessageManageLogEntity.setSendApp(sendApp.getId());//发送者应用 + //sendApi 发送者 + sysMessageManageLogEntity.setReceiveCode(receiveApi.getApiCode() != null ? receiveApi.getApiCode().toString() : null);//接收者编码 + sysMessageManageLogEntity.setReceiveApp(receiveApp.getId());//接收者应用 + sysMessageManageLogEntity.setReceiveApi(receiveApi.getId());//接收者 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("body", oldbodys); + jsonObject.put("header", oldheaderMap); + jsonObject.put("querys", oldquerys); + sysMessageManageLogEntity.setSourceData(jsonObject.toString());//源数据 + JSONObject send = new JSONObject(); + send.put("body", bodys); + send.put("header", headers); + send.put("querys", querys); + sysMessageManageLogEntity.setTargetData(send.toString());//目标data + if(receiveApp.getAppType() != null && "4".equals(receiveApp.getAppType())){//宁波银行 + JSONObject jsonObject1 = JSONObject.parseObject(body); + String retCode = jsonObject1.getString("retCode"); + if(retCode != null && "0000".equals(retCode)){ + JSONObject jsonObject2 = JSONObject.parseObject(jsonObject1.getString("data")); + String fileBytes = jsonObject2.getString("fileBytes"); + if(fileBytes != null && !"".equals(fileBytes)){ + jsonObject2.put("fileBytes",""); + jsonObject1.put("data",jsonObject2); + sysMessageManageLogEntity.setReturnData(jsonObject1.toJSONString());//返回信息 + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + + + //校验返回 + if (!flag) { + sysMessageManageLogEntity.setStatus("4");//返回信息 + sysMessageManageLogEntity.setRemark(msg);//返回信息 + } else { + if (receiveApi.getReturnSuccessField() != null && !"".equals(receiveApi.getReturnSuccessField()) + && receiveApi.getReturnSuccessValue() != null && !"".equals(receiveApi.getReturnSuccessValue())) { + if (JSONUtil.isTypeJSON(body)) { + JSONObject cheackdatas = JSONObject.parseObject(body); + JSONObject datas = JSONObject.parseObject(body); + String checkdata = cheackdatas.getString(receiveApi.getReturnSuccessField()); + if (checkdata != null && receiveApi.getReturnSuccessValue().equals(checkdata)) { + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else if(receiveApi.getReturnSuccessValue().equals("not null") && checkdata != null){ + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else { + String fieldname = receiveApi.getReturnSuccessField(); + if(fieldname.contains(".")){ + String[] fileds = fieldname.split("\\."); + boolean flags = false; + for (int i = 0; i < fileds.length; i++) { + if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) { + datas = datas.getJSONObject(fileds[i]); + if(fileds.length-2 == i ){ + String a = datas.getString(fileds[i+1]); + if (a != null && receiveApi.getReturnSuccessValue().equals(a)) { + flags = true; + break; + }else if(receiveApi.getReturnSuccessValue().equals("not null") && a != null){ + flags = true; + break; + }else { + break; + } + } + } + } + if(flags){ + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误");//返回信息 + } + } + + }else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误");//返回信息 + } + } + } + } else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + sysMessageManageLogEntity.setRemark("接口调用失败,返回格式错误,不是JSON");//返回信息 + } + } else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + if (JSONUtil.isTypeJSON(body)) { + JSONObject cheackdatas = JSONObject.parseObject(body); + String checkdata = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,api返回信息字段未配置,返回信息如下:" + checkdata);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回格式错误,不是JSON");//返回信息 + } + } else { + sysMessageManageLogEntity.setRemark("接口调用失败");//返回信息 + } + } + } + //remark 备注 + sysMessageManageLogEntity.setErrorStatus("2");//返回信息 + sysMessageManageLogEntity.setId(oldId); + sysMessageManageLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + sysMessageManageLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + //sysMessageManageLogEntity.setCreate_time(new Date()); + sysMessageManageLogEntity.setModify_time(new Date()); + sysMessageManageLogEntity.setSts("Y"); + taskExecutor.execute(() -> doEsbTaskNew(sysMessageManageLogEntity)); + return sysMessageManageLogEntity; + } + /** * @param manageLogEntities * @return void @@ -2286,6 +2806,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Thu, 29 Aug 2024 15:13:42 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=87=AD=E8=AF=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-llg.yml | 2 + .../service/IAcctVouchInfoService.java | 2 + .../impl/AcctVouchInfoServiceImpl.java | 132 +++++++++++++++++- .../glPzml/dao/impl/SenderGlPzmlDaoImpl.java | 6 +- .../glPznr/entity/SenderGlPznrEntity.java | 9 ++ .../glPznr/entity/SenderGlPznrEntity.xml | 8 ++ .../grpU8/service/impl/GrpU8ServiceImpl.java | 1 + 7 files changed, 154 insertions(+), 6 deletions(-) diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index 0b33d662..04576afa 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -39,6 +39,8 @@ spring: savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local + pluginpath: + tomcatpath: zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface cbs8: diff --git a/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/IAcctVouchInfoService.java b/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/IAcctVouchInfoService.java index bfa9d148..15425963 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/IAcctVouchInfoService.java +++ b/service/src/main/java/com/hzya/frame/grpU8/acctVouchInfo/service/IAcctVouchInfoService.java @@ -42,4 +42,6 @@ public interface IAcctVouchInfoService extends IBaseService 0) { glFzxzlEntityDto.setGlFzxzlNrEntityDtos(glFzxzlNrEntityDtos); - //todo 查询数据,设置值 + // 查询数据,设置值 List fzhss = glFzxzlDao.queryFzhs(glFzxzlEntityDto); if(fzhss != null && fzhss.size() > 0){ for (int i = 0; i < list.size(); i++) { @@ -296,4 +296,134 @@ public class AcctVouchInfoServiceImpl extends BaseService list = senderGlPzmlDao.querySenderGlPzmlEntity(entity); + PageInfo pageInfo = new PageInfo(list); + doPznrAndPzmlFzhs(list,entity.getDataSourceCode()); + JSONObject returnObject = new JSONObject(); + returnObject.put("status","success"); + returnObject.put("data",pageInfo); + returnObject.put("msg","查询成功"); + return returnObject; + }else { + JSONObject returnObject = new JSONObject(); + returnObject.put("status","false"); + returnObject.put("msg","请先传递分页参数"); + return returnObject; + } + } + + /** + * @Author lvleigang + * @Description 处理凭证内容和辅助核算 + * @Date 2:15 下午 2024/8/29 + * @param senderGlPzmlEntities + * @param dataSourceCode + * @return void + **/ + private void doPznrAndPzmlFzhs(List senderGlPzmlEntities, String dataSourceCode) { + if(senderGlPzmlEntities == null || senderGlPzmlEntities.size() == 0 ){ + return; + } + //查询凭证内容 + List idpzhs = new ArrayList<>(); + for (int i = 0; i < senderGlPzmlEntities.size(); i++) { + idpzhs.add(senderGlPzmlEntities.get(i).getIdpzh()); + } + SenderGlPznrEntity senderGlPznrEntity = new SenderGlPznrEntity(); + senderGlPznrEntity.setDataSourceCode(dataSourceCode); + senderGlPznrEntity.setIdpzhs(idpzhs); + List list = senderGlPznrDao.querySenderGlPznrEntityByIdpzh(senderGlPznrEntity); + if(list == null || list.size() == 0 ){ + return; + } + GlFzxzlEntityDto glFzxzlEntityDto = new GlFzxzlEntityDto(); + glFzxzlEntityDto.setDataSourceCode(dataSourceCode); + glFzxzlEntityDto.setSfyz("0"); + List glFzxzlNrEntityDtos = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if(list.get(i).getKjqj() != null && list.get(i).getKjqj().length() >= 4){ + GlFzxzlNrEntityDto glFzxzlNrEntityDto = new GlFzxzlNrEntityDto(); + glFzxzlNrEntityDto.setGsdm(list.get(i).getGsdm()); + glFzxzlNrEntityDto.setKjnd(list.get(i).getKjqj().substring(0,4)); + List glFzxzlNrDmEntityDtos = new ArrayList<>(); + + if(list.get(i).getFzhs() != null && !"".equals(list.get(i).getFzhs())){ + JSONObject jsonObject = (JSONObject) JSONObject.toJSON(list.get(i)); + String[] fzhs = list.get(i).getFzhs().split(","); + if(fzhs != null && fzhs.length > 0){ + for (int i1 = 0; i1 < fzhs.length; i1++) { + if(fzhs[i1] != null && !"".equals(fzhs[i1])){ + if(jsonObject.get("fzdm"+fzhs[i1]) != null && !"".equals(jsonObject.get("fzdm"+fzhs[i1]))){ + GlFzxzlNrDmEntityDto glFzxzlNrDmEntityDto = new GlFzxzlNrDmEntityDto(); + glFzxzlNrDmEntityDto.setLbdm(fzhs[i1]); + glFzxzlNrDmEntityDto.setFzdm(jsonObject.getString("fzdm"+fzhs[i1])); + glFzxzlNrDmEntityDtos.add(glFzxzlNrDmEntityDto); + } + } + } + } + } + if(glFzxzlNrDmEntityDtos.size() > 0){ + glFzxzlNrEntityDto.setGlFzxzlNrDmEntityDtos(glFzxzlNrDmEntityDtos); + glFzxzlNrEntityDtos.add(glFzxzlNrEntityDto); + } + } + } + if(glFzxzlNrEntityDtos.size() > 0) { + glFzxzlEntityDto.setGlFzxzlNrEntityDtos(glFzxzlNrEntityDtos); + // 查询数据,设置值 + List fzhss = glFzxzlDao.queryFzhs(glFzxzlEntityDto); + if(fzhss != null && fzhss.size() > 0){ + for (int i = 0; i < list.size(); i++) { + List fzhslist = new ArrayList<>(); + list.get(i).setFzhslist(fzhslist); + if (list.get(i).getKjqj() != null && list.get(i).getKjqj().length() >= 4) { + if (list.get(i).getFzhs() != null && !"".equals(list.get(i).getFzhs())) { + JSONObject jsonObject = (JSONObject) JSONObject.toJSON(list.get(i)); + String[] fzhs = list.get(i).getFzhs().split(","); + if (fzhs != null && fzhs.length > 0) { + for (int i1 = 0; i1 < fzhs.length; i1++) { + if (fzhs[i1] != null && !"".equals(fzhs[i1])) { + if (jsonObject.get("fzdm" + fzhs[i1]) != null && !"".equals(jsonObject.get("fzdm" + fzhs[i1]))) { + for (int i2 = 0; i2 < fzhss.size(); i2++) { + if(fzhss.get(i2).getString("lbdm").equals(fzhs[i1]) + && fzhss.get(i2).getString("gsdm").equals(list.get(i).getGsdm()) + && fzhss.get(i2).getString("kjnd").equals(list.get(i).getKjqj().substring(0,4)) + && fzhss.get(i2).getString("fzdm").equals(jsonObject.get("fzdm" + fzhs[i1])) + ){ + JSONObject a = new JSONObject(); + a.put("lbdm",fzhss.get(i2).getString("lbdm")); + a.put("fzdm",fzhss.get(i2).getString("fzdm")); + a.put("fzmc",fzhss.get(i2).getString("fzmc")); + fzhslist.add(a); + } + + } + } + } + } + } + } + } + } + } + } + + for (int i = 0; i < senderGlPzmlEntities.size(); i++) { + List senderGlPznrEntities = new ArrayList<>(); + for (int i1 = 0; i1 < list.size(); i1++) { + if(senderGlPzmlEntities.get(i).getIdpzh().equals(list.get(i1).getIdpzh())){ + senderGlPznrEntities.add(list.get(i1)); + } + } + senderGlPzmlEntities.get(i).setSenderGlPznrEntities(senderGlPznrEntities); + } + } } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java index c311f17d..8a228126 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPzml/dao/impl/SenderGlPzmlDaoImpl.java @@ -77,11 +77,7 @@ public class SenderGlPzmlDaoImpl extends MybatisGenericDao queryGlPzmlSxy(SenderGlPzmlEntity senderGlPzmlEntity) { - return (List) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity); - } + } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.java index 111e932b..fa5c46e0 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.java @@ -114,6 +114,7 @@ private String dqrq; private String glidpznr; private String fzhs; private List fzhslist; + private List idpzhs; public String getBxdid() { return bxdid; } @@ -833,5 +834,13 @@ private String fzhs; public void setFzhslist(List fzhslist) { this.fzhslist = fzhslist; } + + public List getIdpzhs() { + return idpzhs; + } + + public void setIdpzhs(List idpzhs) { + this.idpzhs = idpzhs; + } } diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml index cdd53c87..75c2fa5e 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/glPznr/entity/SenderGlPznrEntity.xml @@ -1036,6 +1036,14 @@ update gl_pznr set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{mo and pznr.ZBID like concat('%',#{zbid},'%') and pznr.EDID like concat('%',#{edid},'%') and pznr.JFSQID like concat('%',#{jfsqid},'%') + + AND pznr.idpzh in + + #{item} + + + diff --git a/service/src/main/java/com/hzya/frame/grpU8/service/impl/GrpU8ServiceImpl.java b/service/src/main/java/com/hzya/frame/grpU8/service/impl/GrpU8ServiceImpl.java index e393ab69..1b7b52b1 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/service/impl/GrpU8ServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/grpU8/service/impl/GrpU8ServiceImpl.java @@ -92,6 +92,7 @@ public class GrpU8ServiceImpl implements IGrpU8Service { returnObject = acctVouchInfoService.queryPz(object); break; case "13"://总账凭证查询分页接口 ml nr fzhs 分页 + returnObject = acctVouchInfoService.queryPzPage(object); break; default: JSONObject jsonObject1 = new JSONObject();