Commit 8a020378 by liuhui

基础平台基本完成后台代码的拆分

parent 5b76913c
package com.sinobase.project.system.dict.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sinobase.framework.aspectj.lang.annotation.Excel;
import com.sinobase.framework.web.domain.BaseEntity;
/**
* 字典数据表 sys_dict_data
*
* @author sinobase
*/
public class DictData extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 字典编码 */
@Excel(name = "字典编码")
private String dictCode;
/** 字典排序 */
@Excel(name = "字典排序")
private Long dictSort;
/** 字典标签 */
@Excel(name = "字典标签")
private String dictLabel;
/** 字典键值 */
@Excel(name = "字典键值")
private String dictValue;
/** 字典类型 */
@Excel(name = "字典类型")
private String dictType;
/** 字典样式 */
@Excel(name = "字典样式")
private String cssClass;
/** 表格字典样式 */
private String listClass;
/** 是否默认(Y是 N否) */
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
private String isDefault;
/** 状态(1正常 0停用) */
@Excel(name = "状态", readConverterExp = "1=正常,0=停用")
private String status;
public String getDictCode() {
return dictCode;
}
public void setDictCode(String dictCode) {
this.dictCode = dictCode;
}
public Long getDictSort() {
return dictSort;
}
public void setDictSort(Long dictSort) {
this.dictSort = dictSort;
}
public String getDictLabel() {
return dictLabel;
}
public void setDictLabel(String dictLabel) {
this.dictLabel = dictLabel;
}
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public String getCssClass() {
return cssClass;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getListClass() {
return listClass;
}
public void setListClass(String listClass) {
this.listClass = listClass;
}
public String getIsDefault() {
return isDefault;
}
public void setIsDefault(String isDefault) {
this.isDefault = isDefault;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("dictCode", getDictCode()).append("dictSort", getDictSort()).append("dictLabel", getDictLabel())
.append("dictValue", getDictValue()).append("dictType", getDictType()).append("cssClass", getCssClass()).append("listClass", getListClass()).append("isDefault", getIsDefault())
.append("status", getStatus()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
.append("remark", getRemark()).toString();
}
}
package com.sinobase.project.system.dict.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sinobase.framework.aspectj.lang.annotation.Excel;
import com.sinobase.framework.web.domain.BaseEntity;
/**
* 字典类型对象 sys_dict_type
*
* @author sinobase
*/
public class DictType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 字典主键 */
@Excel(name = "字典主键")
private String dictId;
/** 字典名称 */
@Excel(name = "字典名称")
private String dictName;
/** 字典类型 */
@Excel(name = "字典类型 ")
private String dictType;
/** 状态(1正常 0停用) */
@Excel(name = "状态", readConverterExp = "1=正常,0=停用")
private String status;
public String getDictId()
{
return dictId;
}
public void setDictId(String dictId)
{
this.dictId = dictId;
}
public String getDictName()
{
return dictName;
}
public void setDictName(String dictName)
{
this.dictName = dictName;
}
public String getDictType()
{
return dictType;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dictId", getDictId())
.append("dictName", getDictName())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package com.sinobase.project.system.dict.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.sinobase.project.system.dict.domain.DictData;
/**
* 字典表 数据层
*
* @author sinobase
*/
public interface DictDataMapper {
/**
* 获取id
* @return
*/
public String getID();
/**
* 根据条件分页查询字典数据
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
public List<DictData> selectDictDataList(DictData dictData);
/**
* 根据字典类型查询字典数据
* @param dictType 字典类型
* @return 字典数据集合信息
*/
public List<DictData> selectDictDataByType(String dictType);
/**
* 根据字典类型和字典键值查询字典数据信息
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
/**
* 根据字典数据ID查询信息
* @param dictCode 字典数据ID
* @return 字典数据
*/
public DictData selectDictDataById(String dictCode);
/**
* 查询字典数据
*
* @param dictType 字典类型
* @return 字典数据
*/
public int countDictDataByType(String dictType);
/**
* 通过字典ID删除字典数据信息
* @param dictCode 字典数据ID
* @return 结果
*/
public int deleteDictDataById(String dictCode);
/**
* 批量删除字典数据
* @param ids 需要删除的数据
* @return 结果
*/
public int deleteDictDataByIds(String[] ids);
/**
* 新增字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public int insertDictData(DictData dictData);
/**
* 修改字典数据信息
* @param dictData 字典数据信息
* @return 结果
*/
public int updateDictData(DictData dictData);
/**
* 同步修改字典类型
* @param oldDictType 旧字典类型
* @param newDictType 新旧字典类型
* @return 结果
*/
public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
}
package com.sinobase.project.system.dict.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.sinobase.project.system.dict.domain.DictType;
/**
* 字典表 数据层
*
* @author sinobase
*/
@Mapper
public interface DictTypeMapper {
/**
* 获取id
* @return
*/
public String getID();
/**
* 根据条件分页查询字典类型
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
public List<DictType> selectDictTypeList(DictType dictType);
/**
* 根据所有字典类型
*
* @return 字典类型集合信息
*/
public List<DictType> selectDictTypeAll();
/**
* 根据字典类型ID查询信息
*
* @param dictId 字典类型ID
* @return 字典类型
*/
public DictType selectDictTypeById(String dictId);
/**
* 通过字典ID删除字典信息
*
* @param dictId 字典ID
* @return 结果
*/
public int deleteDictTypeById(String dictId);
/**
* 批量删除字典类型
*
* @param ids 需要删除的数据
* @return 结果
*/
public int deleteDictTypeByIds(String[] ids);
/**
* 新增字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int insertDictType(DictType dictType);
/**
* 修改字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int updateDictType(DictType dictType);
/**
* 校验字典类型称是否唯一
*
* @param dictType 字典类型
* @return 结果
*/
public DictType checkDictTypeUnique(String dictType);
}
package com.sinobase.project.system.dict.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sinobase.common.support.Convert;
import com.sinobase.project.system.dict.domain.DictData;
import com.sinobase.project.system.dict.mapper.DictDataMapper;
/**
* 字典 业务层处理
*
* @author sinobase
*/
@Service
public class DictDataServiceImpl implements IDictDataService {
@Autowired
private DictDataMapper dictDataMapper;
/**
* 根据条件分页查询字典数据
*
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
@Override
public List<DictData> selectDictDataList(DictData dictData) {
return dictDataMapper.selectDictDataList(dictData);
}
/**
* 根据字典类型查询字典数据
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
@Override
public List<DictData> selectDictDataByType(String dictType) {
return dictDataMapper.selectDictDataByType(dictType);
}
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
@Override
public String selectDictLabel(String dictType, String dictValue) {
return dictDataMapper.selectDictLabel(dictType, dictValue);
}
/**
* 根据字典数据ID查询信息
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
@Override
public DictData selectDictDataById(String dictCode) {
return dictDataMapper.selectDictDataById(dictCode);
}
/**
* 通过字典ID删除字典数据信息
*
* @param dictCode 字典数据ID
* @return 结果
*/
@Override
public int deleteDictDataById(String dictCode) {
return dictDataMapper.deleteDictDataById(dictCode);
}
/**
* 批量删除字典数据
*
* @param ids 需要删除的数据
* @return 结果
*/
@Override
public int deleteDictDataByIds(String ids) {
return dictDataMapper.deleteDictDataByIds(Convert.toStrArray(ids));
}
@Override
public int insertDictData(DictData dictData) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int updateDictData(DictData dictData) {
// TODO Auto-generated method stub
return 0;
}
}
package com.sinobase.project.system.dict.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sinobase.common.constant.UserConstants;
import com.sinobase.common.exception.BusinessException;
import com.sinobase.common.support.Convert;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.project.system.dict.domain.DictType;
import com.sinobase.project.system.dict.mapper.DictDataMapper;
import com.sinobase.project.system.dict.mapper.DictTypeMapper;
/**
* 字典 业务层处理
*
* @author sinobase
*/
@Service
public class DictTypeServiceImpl implements IDictTypeService {
@Autowired
private DictTypeMapper dictTypeMapper;
@Autowired
private DictDataMapper dictDataMapper;
/**
* 根据条件分页查询字典类型
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
@Override
public List<DictType> selectDictTypeList(DictType dictType) {
return dictTypeMapper.selectDictTypeList(dictType);
}
/**
* 根据所有字典类型
* @return 字典类型集合信息
*/
@Override
public List<DictType> selectDictTypeAll() {
return dictTypeMapper.selectDictTypeAll();
}
/**
* 根据字典类型ID查询信息
* @param dictId 字典类型ID
* @return 字典类型
*/
@Override
public DictType selectDictTypeById(String dictId) {
return dictTypeMapper.selectDictTypeById(dictId);
}
/**
* 通过字典ID删除字典信息
* @param dictId 字典ID
* @return 结果
*/
@Override
public int deleteDictTypeById(String dictId) {
return dictTypeMapper.deleteDictTypeById(dictId);
}
/**
* 批量删除字典类型
* @param ids 需要删除的数据
* @return 结果
*/
@Override
public int deleteDictTypeByIds(String ids) throws BusinessException {
String[] dictIds = Convert.toStrArray(ids);
for (String dictId : dictIds) {
DictType dictType = selectDictTypeById(dictId);
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
throw new BusinessException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
}
}
return dictTypeMapper.deleteDictTypeByIds(dictIds);
}
/**
* 校验字典类型称是否唯一
* @param dict 字典类型
* @return 结果
*/
@Override
public String checkDictTypeUnique(DictType dict) {
String dictId = StringUtils.isNull(dict.getDictId()) ? "-1" : dict.getDictId();
DictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && !dictId.equals(dictType.getDictId())) {
return UserConstants.DICT_TYPE_NOT_UNIQUE;
}
return UserConstants.DICT_TYPE_UNIQUE;
}
@Override
public int insertDictType(DictType dictType) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int updateDictType(DictType dictType) {
// TODO Auto-generated method stub
return 0;
}
}
package com.sinobase.project.system.dict.service;
import java.util.List;
import com.sinobase.project.system.dict.domain.DictData;
/**
* 字典 业务层
*
* @author sinobase
*/
public interface IDictDataService {
/**
* 根据条件分页查询字典数据
*
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
public List<DictData> selectDictDataList(DictData dictData);
/**
* 根据字典类型查询字典数据
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
public List<DictData> selectDictDataByType(String dictType);
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public String selectDictLabel(String dictType, String dictValue);
/**
* 根据字典数据ID查询信息
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
public DictData selectDictDataById(String dictCode);
/**
* 通过字典ID删除字典数据信息
*
* @param dictCode 字典数据ID
* @return 结果
*/
public int deleteDictDataById(String dictCode);
/**
* 批量删除字典数据
*
* @param ids 需要删除的数据
* @return 结果
*/
public int deleteDictDataByIds(String ids);
/**
* 新增保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public int insertDictData(DictData dictData);
/**
* 修改保存字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public int updateDictData(DictData dictData);
}
package com.sinobase.project.system.dict.service;
import java.util.List;
import com.sinobase.project.system.dict.domain.DictType;
/**
* 字典 业务层
*
* @author sinobase
*/
public interface IDictTypeService {
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
public List<DictType> selectDictTypeList(DictType dictType);
/**
* 根据所有字典类型
*
* @return 字典类型集合信息
*/
public List<DictType> selectDictTypeAll();
/**
* 根据字典类型ID查询信息
*
* @param dictId 字典类型ID
* @return 字典类型
*/
public DictType selectDictTypeById(String dictId);
/**
* 通过字典ID删除字典信息
*
* @param dictId 字典ID
* @return 结果
*/
public int deleteDictTypeById(String dictId);
/**
* 批量删除字典类型
*
* @param ids 需要删除的数据
* @return 结果
* @throws Exception 异常
*/
public int deleteDictTypeByIds(String ids) throws Exception;
/**
* 新增保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int insertDictType(DictType dictType);
/**
* 修改保存字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int updateDictType(DictType dictType);
/**
* 校验字典类型称是否唯一
*
* @param dictType 字典类型
* @return 结果
*/
public String checkDictTypeUnique(DictType dictType);
}
package com.sinobase.project.system.relation.domain;
/**
* ClassName:DeptAndUserRelation
* Package:com.sinobase.project.system.relation.domain
* Description:TODO
*
* @date:2019/3/15 11:06
* @author:Long
*/
/**
* 部门及用户关联关系
*/
public class DeptAndUserRelation {
/**
* 关系表id
*/
private String id;
/**
* 用户id
*/
private String userId;
/**
* 部门id
*/
private String deptId;
/**
*用戶状态
* @return
*/
private String status;
/**
* 用户排序号
*/
private String orderNo;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
@Override
public String toString() {
return "{" +
"id=" + id +
", userId=" + userId +
", deptId=" + deptId +
", status=" + status +
", orderNo=" + orderNo +
'}';
}
}
package com.sinobase.project.system.relation.mapper;
import com.sinobase.project.system.relation.domain.DeptAndUserRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* ClassName:DeptAndUerRelationMapper
* Package:com.sinobase.project.system.relation.mapper
* Description:TODO
*
* @date:2019/3/15 11:12
* @author:Long
*/
@Mapper
public interface DeptAndUserRelationMapper {
/**
* 批量添加部门以及用户的关联关系
* @param durList
* @return
*/
Integer insertRelation(@Param("list") List<DeptAndUserRelation> durList);
/**
* 获取本地库部门下的用户id
* @param deptid
* @return
*/
List<String> selectRelationUidByDeptId(String deptid);
/**
* 删除部门下多余的关联关系
* @param dur
* @return
*/
int deleteDurById(DeptAndUserRelation dur);
/**
* 获取部门排序最大值
* @param deptid
* @return
*/
Integer selectRelationOrderByDeptId(String deptid);
}
package com.sinobase.project.system.relation.service;
import com.sinobase.project.system.relation.domain.DeptAndUserRelation;
import java.util.List;
/**
* ClassName:DeptAndUerRelationService
* Package:com.sinobase.project.system.relation.service
* Description:TODO
*
* @date:2019/3/15 11:10
* @author:Long
*/
public interface DeptAndUserRelationService {
/**
* 批量添加部门以及用户的关联关系
* @param durList
* @return
*/
Integer insertRelation(List<DeptAndUserRelation> durList);
/**
* 获取本地库部门下的用户id
* @param deptid
* @return
*/
List<String> selectRelationUidByDeptId(String deptid);
/**
* 删除部门下多余的关联关系
* @param dur
* @return
*/
int deleteDurById(DeptAndUserRelation dur);
/**
* 获取部门排序最大值
* @param deptid
* @return
*/
Integer selectRelationOrderByDeptId(String deptid);
}
package com.sinobase.project.system.relation.service;
import com.sinobase.project.system.relation.domain.DeptAndUserRelation;
import com.sinobase.project.system.relation.mapper.DeptAndUserRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* ClassName:DeptAndUerRelationServiceImpl
* Package:com.sinobase.project.system.relation.service
* Description:TODO
*
* @date:2019/3/15 11:11
* @author:Long
*/
@Service
public class DeptAndUserRelationServiceImpl implements DeptAndUserRelationService{
@Autowired
private DeptAndUserRelationMapper deptAndUserRelationMapper;
/**
* 批量添加部门以及用户的关联关系
* @param durList
* @return
*/
@Override
@Transactional
public Integer insertRelation(List<DeptAndUserRelation> durList) {
return deptAndUserRelationMapper.insertRelation(durList);
}
/**
* 获取本地库部门下的用户id
* @param deptid
* @return
*/
@Override
public List<String> selectRelationUidByDeptId(String deptid) {
return deptAndUserRelationMapper.selectRelationUidByDeptId(deptid);
}
/**
* 删除部门下多余的关联关系
* @param dur
* @return
*/
@Override
@Transactional
public int deleteDurById(DeptAndUserRelation dur) {
return deptAndUserRelationMapper.deleteDurById(dur);
}
/**
* 获取部门排序最大值
* @param deptid
* @return
*/
@Override
public Integer selectRelationOrderByDeptId(String deptid) {
return deptAndUserRelationMapper.selectRelationOrderByDeptId(deptid);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sinobase.project.system.portal.mapper.DocSendMapper">
<sql id="selectDocSendVO">
select * from doc_send
</sql>
<select id="listDocSend"
parameterType="com.sinobase.project.system.portal.domain.DocSend"
resultType="com.sinobase.project.system.portal.domain.DocSend">
<include refid="selectDocSendVO"/>
<where>
<if test="relationId != null and relationId != ''">AND relation_id = #{relationId}</if>
<if test="relationTable != null and relationTable != ''">AND relation_table = #{relationTable}</if>
<if test="relationKey != null and relationKey != ''">AND relation_key = #{relationKey}</if>
<if test="viewUrl != null and viewUrl != ''">AND view_url = #{viewUrl}</if>
<if test="keyWord != null and keyWord != ''">AND keyword = #{keyWord}</if>
<if test="inUserId != null and inUserId != ''">AND in_user_id in (#{inUserId})</if>
<if test="creUserId != null and creUserId != ''">AND cre_user_id = #{creUserId}</if>
<if test="typeId != null and typeId != ''">AND type_id = #{typeId}</if>
<if test="seeFlag != null and seeFlag != ''">AND see_flag = #{seeFlag}</if>
<if test="sendTitle != null and sendTitle != ''">AND send_title = #{sendTitle}</if>
<if test="flag != null and flag != ''">AND flag = #{flag}</if>
<if test="userNotion != null and userNotion != ''">AND user_notion = #{userNotion}</if>
<if test="notionDate != null and notionDate != ''">AND notion_date = #{notionDate}</if>
<if test="filingCabinetId != null and filingCabinetId != ''">AND filing_cabinet_id = #{filingCabinetId}</if>
<if test="filingCabinetName != null and filingCabinetName != ''">AND filing_cabinet_name = #{filingCabinetName}</if>
<if test="inDeptId != null and inDeptId != ''">AND in_dept_id in (#{inDeptId})</if>
<if test="inDeptName != null and inDeptName != ''">AND in_dept_name in (#{inDeptName})</if>
<if test="delFlag != null and delFlag != ''">AND del_flag = #{delFlag}</if>
<if test="isGongGao != null and isGongGao != ''">AND is_gonggao = #{isGongGao}</if>
</where>
</select>
<delete id="deleteMessageByOldOASendMessage">
delete from sys_message where grant_user_id ='#{grantUserId}'
and data_source= '旧OA'
and is_old_oa_data ='yes'
and message_type='docSendWait'
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment