diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java index 54a3dc3f..8825215f 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java @@ -20,6 +20,16 @@ public class SysApplicationPluginDto { private Integer pageNum; private Integer pageSize; + private String typeId; + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + public String getAppId() { return appId; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java index 5929e14b..79b8c326 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java @@ -22,13 +22,33 @@ public class SysApplicationPluginEntity extends BaseEntity { private String pluginVersion; /** 描述 */ private String pluginRemark; + /** 插件类型id */ + private String typeId; + /** 插件类型名称 */ + private String typeName; /** 发布日期 */ private Date releaseDate; /** 启用停用(1启用2停用) */ private String pluginStatus; - + /** 附件id */ private String attachmentId; + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + public String getPluginPackageName() { return pluginPackageName; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml index 90b5444d..5ba4c199 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml @@ -20,6 +20,8 @@ + + @@ -40,6 +42,7 @@ ,org_id ,attachment_id ,plugin_package_name + ,type_id - select - - from sys_application_plugin + SELECT + p.*, + type.NAME AS type_name + FROM + sys_application_plugin p + LEFT JOIN sys_application_plugin_type type ON p.type_id = type.id - and id like concat('%',#{id},'%') - and app_id like concat('%',#{appId},'%') - and plugin_name like concat('%',#{pluginName},'%') - and plugin_code like concat('%',#{pluginCode},'%') - and plugin_version like concat('%',#{pluginVersion},'%') - and plugin_remark like concat('%',#{pluginRemark},'%') - and release_date like concat('%',#{releaseDate},'%') - and plugin_status like concat('%',#{pluginStatus},'%') - and sorts like concat('%',#{sorts},'%') - and create_user_id like concat('%',#{create_user_id},'%') - and create_time like concat('%',#{create_time},'%') - and modify_user_id like concat('%',#{modify_user_id},'%') - and modify_time like concat('%',#{modify_time},'%') - and sts like concat('%',#{sts},'%') - and org_id like concat('%',#{org_id},'%') - and attachment_id like concat('%',#{attachmentId},'%') - and plugin_package_name like concat('%',#{pluginPackageName},'%') - and sts='Y' + and p.id like concat('%',#{id},'%') + and p.app_id like concat('%',#{appId},'%') + and p.plugin_name like concat('%',#{pluginName},'%') + and p.plugin_code like concat('%',#{pluginCode},'%') + and p.plugin_version like concat('%',#{pluginVersion},'%') + and p.plugin_remark like concat('%',#{pluginRemark},'%') + and p.release_date like concat('%',#{releaseDate},'%') + and p.plugin_status like concat('%',#{pluginStatus},'%') + and p.sorts like concat('%',#{sorts},'%') + and p.create_user_id like concat('%',#{create_user_id},'%') + and p.create_time like concat('%',#{create_time},'%') + and p.modify_user_id like concat('%',#{modify_user_id},'%') + and p.modify_time like concat('%',#{modify_time},'%') + and p.sts like concat('%',#{sts},'%') + and p.org_id like concat('%',#{org_id},'%') + and p.attachment_id like concat('%',#{attachmentId},'%') + and p.plugin_package_name like concat('%',#{pluginPackageName},'%') + and p.type_id like concat('%',#{typeId},'%') + and p.sts='Y' - order by sorts asc + order by p.sorts asc order by ${sort} ${order} @@ -182,6 +190,7 @@ org_id , attachment_id , plugin_package_name , + type_id , sts, )values( @@ -203,6 +212,7 @@ #{org_id} , #{attachmentId} , #{pluginPackageName} , + #{typeId} , 'Y', ) @@ -254,9 +264,10 @@ update sys_application_plugin set modify_user_id = #{modify_user_id}, modify_time = #{modify_time}, sts = #{sts}, - org_id = #{org_id}, + org_id = #{org_id}, attachment_id = #{attachmentId}, plugin_package_name = #{pluginPackageName}, + type_id = #{typeId}, where id = #{id} @@ -291,16 +302,20 @@ update sys_application_plugin set sts= 'N' ,modify_time = #{modify_time},modify diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java new file mode 100644 index 00000000..2578639c --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.application.pluginType.dao; + +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 插件类型表(sys_application_plugin_type: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public interface ISysApplicationPluginTypeDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java new file mode 100644 index 00000000..78e7ac17 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.application.pluginType.dao.impl; + +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.sysnew.application.pluginType.dao.ISysApplicationPluginTypeDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 插件类型表(SysApplicationPluginType)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +@Repository(value = "SysApplicationPluginTypeDaoImpl") +public class SysApplicationPluginTypeDaoImpl extends MybatisGenericDao implements ISysApplicationPluginTypeDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java new file mode 100644 index 00000000..b8362993 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java @@ -0,0 +1,25 @@ +package com.hzya.frame.sysnew.application.pluginType.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 插件类型表(SysApplicationPluginType)实体类 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public class SysApplicationPluginTypeEntity extends BaseEntity { + + /** 插件类型名称 */ + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml new file mode 100644 index 00000000..f48b07c9 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + id + ,name + ,sorts + ,org_id + ,sts + ,create_time + ,create_user_id + ,modify_time + ,modify_user_id + + + + + + + + + + + + + + + + insert into sys_application_plugin_type( + + id , + name , + sorts , + org_id , + sts , + create_time , + create_user_id , + modify_time , + modify_user_id , + sts, + + )values( + + #{id} , + #{name} , + #{sorts} , + #{org_id} , + #{sts} , + #{create_time} , + #{create_user_id} , + #{modify_time} , + #{modify_user_id} , + 'Y', + + ) + + + + insert into sys_application_plugin_type(app_id, name, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) + values + + (#{entity.appId},#{entity.name},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') + + + + + insert into sys_application_plugin_type(app_id, name, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) + values + + (#{entity.appId},#{entity.name},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) + + on duplicate key update + app_id = values(app_id), + name = values(name), + org_id = values(org_id), + sts = values(sts), + create_time = values(create_time), + create_user_id = values(create_user_id), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id) + + +update sys_application_plugin_type set + + name = #{name}, + org_id = #{org_id}, + sts = #{sts}, + create_time = #{create_time}, + create_user_id = #{create_user_id}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + +where id = #{id} + + + +update sys_application_plugin_type set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_application_plugin_type set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and name = #{name} + and sorts = #{sorts} + and sts = #{sts} + and sts='Y' + + + + + delete from sys_application_plugin_type where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java new file mode 100644 index 00000000..dfee99d3 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.sysnew.application.pluginType.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 插件类型表(SysApplicationPluginType)表服务接口 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public interface ISysApplicationPluginTypeService extends IBaseService{ + JsonResultEntity queryPluginType(JSONObject jsonObject); + + JsonResultEntity savePluginType(JSONObject jsonObject); + + JsonResultEntity updatePluginType(JSONObject jsonObject); + + JsonResultEntity deletePluginType(JSONObject jsonObject); +} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java new file mode 100644 index 00000000..d6c00bc1 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java @@ -0,0 +1,106 @@ +package com.hzya.frame.sysnew.application.pluginType.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.plugin.dao.ISysApplicationPluginDao; +import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.sysnew.application.pluginType.dao.ISysApplicationPluginTypeDao; +import com.hzya.frame.sysnew.application.pluginType.service.ISysApplicationPluginTypeService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 插件类型表(SysApplicationPluginType)表服务实现类 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +@Service(value = "sysApplicationPluginTypeService") +public class SysApplicationPluginTypeServiceImpl extends BaseService implements ISysApplicationPluginTypeService { + + private ISysApplicationPluginTypeDao sysApplicationPluginTypeDao; + + @Resource + private ISysApplicationPluginDao sysApplicationPluginDao; + + @Autowired + public void setSysApplicationPluginTypeDao(ISysApplicationPluginTypeDao dao) { + this.sysApplicationPluginTypeDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryPluginType(JSONObject jsonObject){ + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + entity = new SysApplicationPluginTypeEntity(); + } + List list = sysApplicationPluginTypeDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功",list); + } + + @Override + public JsonResultEntity savePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getName() == null || "".equals(entity.getName())){ + return BaseResult.getFailureMessageEntity("插件类型名称不能为空"); + } + entity.setCreate(); + sysApplicationPluginTypeDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存数据成功",entity); + } + + @Override + public JsonResultEntity updatePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("ID不能为空"); + } + if(entity.getName() == null || "".equals(entity.getName())){ + return BaseResult.getFailureMessageEntity("插件类型名称不能为空"); + } + entity.setUpdate(); + sysApplicationPluginTypeDao.update(entity); + return BaseResult.getSuccessMessageEntity("更新数据成功",entity); + } + + @Transactional + @Override + public JsonResultEntity deletePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("ID不能为空"); + } + // 同步删除匹配插件中的插件类型,将其赋值为null + SysApplicationPluginEntity pluginEntity = new SysApplicationPluginEntity(); + pluginEntity.setTypeId(entity.getId()); + List pluginList = sysApplicationPluginDao.queryBase(pluginEntity); + for(SysApplicationPluginEntity plugin : pluginList){ + plugin.setTypeId("无"); + plugin.setUpdate(); + sysApplicationPluginDao.update(plugin); + } + entity.setUpdate(); + sysApplicationPluginTypeDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除数据成功"); + } + + +} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 95ff3251..053d3976 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -231,12 +231,12 @@ public class LoginServiceImpl implements ILoginService { body(); JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject attribute = resJsonObject.getJSONObject("attribute"); - String errcode = attribute.getString("errcode"); - String errmsg = attribute.getString("errmsg"); - if(!"0".equals(errcode)){ - return BaseResult.getFailureMessageEntity("请求错误:"+errmsg); + String attributeCode = attribute.getString("code"); + String attributeMsg = attribute.getString("msg"); + if(!"200".equals(attributeCode)){ + return BaseResult.getFailureMessageEntity("请求错误:"+attributeMsg); } - String weComUserid = attribute.getString("userid"); + String weComUserid = attribute.getString("data"); userEntity.setWxUserId(weComUserid); userEntity = sysUserDao.queryOne(userEntity); if(null == userEntity ){ diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml index b0e9b621..01decd67 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml @@ -94,14 +94,15 @@ and log.source_model_name = #{sourceModelName} and log.state = #{state} and log.result_message = #{resultMessage} - and app_id = #{appId} + and i.app_id = #{appId} and log.sts='Y' and p1.sts='Y' and p2.sts='Y' and i.sts='Y' - order by log.sorts asc - order by ${sort} ${order} + + + order by log.send_datetime desc @@ -178,8 +179,9 @@ and p2.sts='Y' and app.sts='Y' - order by log.sorts asc - order by ${sort} ${order} + + + order by log.send_datetime desc