1
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
package com.kelp.plat.dao;
|
||||
|
||||
import com.kelp.base.dao.BaseDao;
|
||||
import com.kelp.plat.entity.Function;
|
||||
import com.kelp.plat.entity.U_RF;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface U_RFDao extends BaseDao<U_RF, Long> {
|
||||
|
||||
/**
|
||||
* 取得这个Role可以访问的资源
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public List<Function> getSRFByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 保存权限信息
|
||||
* @param roleId
|
||||
* @param functionIds
|
||||
*/
|
||||
public void setRFs(Long roleId,List<Long> functionIds);
|
||||
|
||||
/**
|
||||
* 取得这个Role的权限设置信息
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public List<U_RF> getRFsByRoleId(Long roleId);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.kelp.plat.dao;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.base.dao.BaseDao;
|
||||
import com.kelp.plat.entity.U_Role;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface U_RoleDao extends BaseDao<U_Role, Long>{
|
||||
|
||||
public Page<U_Role> getPage(int pageNumber, int pageSize,String name,Integer level);
|
||||
|
||||
public List<U_Role> getByLevel(Integer level);
|
||||
|
||||
public List<U_Role> getAll();
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.kelp.plat.dao.impl;
|
||||
|
||||
|
||||
import com.kelp.base.dao.impl.BaseDaoImpl;
|
||||
import com.kelp.common.utils.IdWorker;
|
||||
import com.kelp.plat.entity.E_RF;
|
||||
import com.kelp.plat.entity.Function;
|
||||
import com.kelp.plat.dao.U_RFDao;
|
||||
import com.kelp.plat.entity.U_RF;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@Transactional
|
||||
public class U_RFDaoImpl extends BaseDaoImpl<U_RF, Long> implements U_RFDao {
|
||||
|
||||
@Autowired
|
||||
private IdWorker idWorker;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Function> getSRFByRoleId(Long roleId) {
|
||||
String sql = "select o from Function o where o.id in (select functionId from U_RF where roleId = :roleId) order by moduleId";
|
||||
return em.createQuery(sql).setParameter("roleId", roleId).getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void setRFs(Long roleId, List<Long> functionIds) {
|
||||
//先删除
|
||||
String sql = "delete U_RF where roleId = :roleId";
|
||||
em.createQuery(sql).setParameter("roleId", roleId).executeUpdate();
|
||||
|
||||
//再添加
|
||||
for(Long functionId : functionIds){
|
||||
E_RF rf = new E_RF(roleId,functionId);
|
||||
rf.setId(idWorker.nextId());
|
||||
em.persist(rf);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<U_RF> getRFsByRoleId(Long roleId) {
|
||||
String sql = "select o from U_RF o where roleId = :roleId";
|
||||
return em.createQuery(sql).setParameter("roleId", roleId).getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.kelp.plat.dao.impl;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.base.dao.impl.BaseDaoImpl;
|
||||
import com.kelp.plat.dao.U_RoleDao;
|
||||
import com.kelp.plat.entity.U_Role;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@Transactional
|
||||
public class U_RoleDaoImpl extends BaseDaoImpl<U_Role, Long> implements U_RoleDao {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean delete(List<Long> ids) {
|
||||
|
||||
//处理RF
|
||||
String sql = "delete U_RF where roleId in(:roleIds)";
|
||||
em.createQuery(sql).setParameter("roleIds", ids).executeUpdate();
|
||||
|
||||
super.delete(ids);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<U_Role> getPage(int pageNumber, int pageSize,String name,Integer level) {
|
||||
|
||||
String sql = " from U_Role o where 1=1 ";
|
||||
List<Object> params = new ArrayList<Object>();
|
||||
|
||||
int i = 1;
|
||||
if(name == null || name.length() == 0){
|
||||
name = "";
|
||||
sql += " and name like ?" + i++;
|
||||
params.add("%" + name + "%");
|
||||
}
|
||||
|
||||
if(level != null) {
|
||||
sql += "and level = ?" + i++;
|
||||
params.add(level);
|
||||
}
|
||||
|
||||
sql += "order by level";
|
||||
|
||||
return getBeanPage(pageNumber, pageSize, sql, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<U_Role> getAll() {
|
||||
String sql = "select o from U_Role o order by level";
|
||||
return em.createQuery(sql).getResultList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<U_Role> getByLevel(Integer level) {
|
||||
String sql = "select o from U_Role o where level = :level ";
|
||||
|
||||
return em.createQuery(sql).setParameter("level", level).getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* enterpirse rf
|
||||
*/
|
||||
package com.kelp.plat.entity;
|
||||
|
||||
import com.kelp.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name="dt_user_rf")
|
||||
public class U_RF extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public U_RF() {}
|
||||
|
||||
public U_RF(Long roleId, Long functionId) {
|
||||
this.roleId = roleId;
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 资源id
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Long functionId;
|
||||
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getFunctionId() {
|
||||
return functionId;
|
||||
}
|
||||
public void setFunctionId(Long functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/**
|
||||
* enterpirse role
|
||||
*/
|
||||
package com.kelp.plat.entity;
|
||||
|
||||
import com.kelp.base.BaseEntity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name="dt_user_role")
|
||||
public class U_Role extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Column(length = 50, nullable = false)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Integer level = 0;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(length=128)
|
||||
private String description;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.kelp.plat.service;
|
||||
|
||||
import com.kelp.plat.entity.MF;
|
||||
import com.kelp.plat.entity.U_RF;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface U_RFService {
|
||||
|
||||
/**
|
||||
* 取得权限信息,key为url,value为roleId
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getSRFs(String roleId);
|
||||
|
||||
/**
|
||||
* 保存权限信息
|
||||
* @param roleId
|
||||
* @param functionIds
|
||||
*/
|
||||
public void setRFs(String roleId,String[] functionIds);
|
||||
|
||||
public List<MF> getMFs();
|
||||
|
||||
/**
|
||||
* 取得此角色所有的权限信息
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public List<U_RF> getRFs(String roleId);
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.kelp.plat.service;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.plat.entity.U_Role;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface U_RoleService {
|
||||
|
||||
public void add(U_Role role);
|
||||
|
||||
public void update(U_Role role);
|
||||
|
||||
public void delete(String[] ids);
|
||||
|
||||
public U_Role getById(String id);
|
||||
|
||||
public U_Role getByName(String name);
|
||||
|
||||
public Page<U_Role> getPage(int pageNumber, int pageSize,String name, Integer level);
|
||||
|
||||
///////////////////////////////////////////
|
||||
|
||||
public List<U_Role> getByLevel(Integer level);
|
||||
|
||||
public List<U_Role> getAll();
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.kelp.plat.service.impl;
|
||||
|
||||
import com.kelp.plat.dao.FunctionDao;
|
||||
import com.kelp.plat.dao.ModuleDao;
|
||||
import com.kelp.plat.entity.Function;
|
||||
import com.kelp.plat.entity.MF;
|
||||
import com.kelp.plat.entity.Module;
|
||||
import com.kelp.plat.dao.U_RFDao;
|
||||
import com.kelp.plat.entity.U_RF;
|
||||
import com.kelp.plat.service.U_RFService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class U_RFServiceImpl implements U_RFService {
|
||||
|
||||
@Resource
|
||||
private U_RFDao ufDao;
|
||||
|
||||
@Resource
|
||||
private FunctionDao functiondao;
|
||||
|
||||
@Resource
|
||||
private ModuleDao moduleDao;
|
||||
|
||||
@Override
|
||||
public Map<String, String> getSRFs(String roleId) {
|
||||
|
||||
List<Function> functions = ufDao.getSRFByRoleId(Long.valueOf(roleId));
|
||||
Map<String, String> rfMap = new HashMap<String, String>();
|
||||
for(Function function : functions){
|
||||
rfMap.put(function.getUrl(), roleId);
|
||||
}
|
||||
|
||||
return rfMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRFs(String roleId, String[] functionIds) {
|
||||
|
||||
List<Long> functionIds_ = new ArrayList<Long>();
|
||||
for(String functionId : functionIds){
|
||||
functionIds_.add(Long.valueOf(functionId));
|
||||
}
|
||||
ufDao.setRFs(Long.valueOf(roleId), functionIds_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MF> getMFs() {
|
||||
|
||||
List<MF> mfs = new ArrayList<MF>();
|
||||
List<Module> modules = moduleDao.getAll("00");
|
||||
List<Function> allFunctions = functiondao.getAll("moduleId","asc");
|
||||
|
||||
for(Module module : modules){
|
||||
MF mf = new MF();
|
||||
mf.setModule(module);
|
||||
List<Function> functions = new ArrayList<Function>();
|
||||
for(Function function : allFunctions){
|
||||
if(function.getModuleId().equals(module.getId())){
|
||||
functions.add(function);
|
||||
}
|
||||
}
|
||||
mf.setFunctions(functions);
|
||||
|
||||
mfs.add(mf);
|
||||
}
|
||||
|
||||
return mfs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<U_RF> getRFs(String roleId) {
|
||||
return ufDao.getRFsByRoleId(Long.valueOf(roleId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.kelp.plat.service.impl;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.common.utils.IdWorker;
|
||||
import com.kelp.plat.dao.U_RoleDao;
|
||||
import com.kelp.plat.entity.U_Role;
|
||||
import com.kelp.plat.service.U_RoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class U_RoleServiceImpl implements U_RoleService {
|
||||
|
||||
@Autowired
|
||||
private IdWorker idWorker;
|
||||
|
||||
@Resource
|
||||
private U_RoleDao roleDao;
|
||||
|
||||
@Override
|
||||
public void add(U_Role role) {
|
||||
role.setId(idWorker.nextId());
|
||||
roleDao.add(role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(U_Role role) {
|
||||
roleDao.update(role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String[] ids) {
|
||||
List<Long> ids_ = new ArrayList<Long>();
|
||||
for(String id : ids){
|
||||
ids_.add(Long.valueOf(id));
|
||||
}
|
||||
roleDao.delete(ids_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public U_Role getById(String id) {
|
||||
return roleDao.get(Long.valueOf(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<U_Role> getPage(int pageNumber, int pageSize,String name, Integer level) {
|
||||
|
||||
Page<U_Role> page = roleDao.getPage(pageNumber, pageSize,name,level);
|
||||
|
||||
if(page == null){
|
||||
page = new Page<U_Role>();
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public U_Role getByName(String name) {
|
||||
return roleDao.get("name", name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<U_Role> getAll() {
|
||||
return roleDao.getAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<U_Role> getByLevel(Integer level) {
|
||||
return roleDao.getByLevel(level);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.kelp.website.dao;
|
||||
|
||||
import com.kelp.base.dao.BaseDao;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 14:24
|
||||
*/
|
||||
public interface UAccountDao extends BaseDao<UAccount, Long> {
|
||||
public void setState(List<Long> ids, String state);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.kelp.website.dao;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.base.dao.BaseDao;
|
||||
import com.kelp.biz.entity.Dict;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
import com.kelp.website.entity.UContract;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/30 8:45
|
||||
*/
|
||||
public interface UContractDao extends BaseDao<UContract, Long> {
|
||||
public Page<UContract> getPage(int pageNumber, int pageSize, long id );
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.kelp.website.dao.impl;
|
||||
|
||||
import com.kelp.base.dao.impl.BaseDaoImpl;
|
||||
import com.kelp.website.dao.UAccountDao;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 14:25
|
||||
*/
|
||||
@Repository
|
||||
public class UAccountDaoImpl extends BaseDaoImpl<UAccount, Long> implements UAccountDao {
|
||||
@Transactional
|
||||
@Override
|
||||
public void setState(List<Long> ids ,String state) {
|
||||
String sql = "update EAccount set state = :state where id in (:ids)";
|
||||
em.createQuery(sql).setParameter("state", state).setParameter("ids", ids).executeUpdate();
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.kelp.website.dao.impl;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.base.dao.impl.BaseDaoImpl;
|
||||
import com.kelp.biz.entity.Dict;
|
||||
import com.kelp.website.dao.UAccountDao;
|
||||
import com.kelp.website.dao.UContractDao;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
import com.kelp.website.entity.UContract;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/30 8:45
|
||||
*/
|
||||
@Repository
|
||||
public class UContractDaoImpl extends BaseDaoImpl<UContract, Long> implements UContractDao {
|
||||
@Override
|
||||
public Page<UContract> getPage(int pageNumber, int pageSize, long id) {
|
||||
String sql = " from UContract o where 1 = 1 ";
|
||||
List<Object> params = new ArrayList<Object>();
|
||||
int index = 1;
|
||||
|
||||
sql += " and customerId = ?" + index++;
|
||||
params.add(id);
|
||||
// sql += " order by type,code,name ";
|
||||
|
||||
return getBeanPage(pageNumber, pageSize, sql, params);
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.kelp.website.entity;
|
||||
|
||||
import com.kelp.base.BaseEntity;
|
||||
import com.kelp.common.constant.KeyConstant;
|
||||
import com.kelp.common.utils.AESUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 14:16
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "dt_user_account")
|
||||
public class UAccount extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Column(name="name",nullable = false)
|
||||
private String name;
|
||||
@Column(name="password",nullable = false)
|
||||
private String password;
|
||||
@Column(name="telephone",nullable = false)
|
||||
private String telephone;
|
||||
@Column(name="enterpriseName",nullable = false)
|
||||
private String enterpriseName;
|
||||
@Column(name="roleId",nullable = false)
|
||||
private String roleId;
|
||||
|
||||
|
||||
public UAccount(String name, String password, String telephone, String enterpriseName, String roleId) {
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
this.telephone = telephone;
|
||||
this.enterpriseName = enterpriseName;
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public UAccount() {
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone != null ? AESUtil.decrypt(telephone, KeyConstant.TELEPHONE) : "";
|
||||
}
|
||||
public void setTelephone(String telephone) {
|
||||
if (!StringUtils.isEmpty(telephone)) {
|
||||
this.telephone = AESUtil.encrypt(telephone, KeyConstant.TELEPHONE);
|
||||
}
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package com.kelp.website.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 17:43
|
||||
*/
|
||||
|
||||
public class UAccountVo {
|
||||
private String id;
|
||||
@Column(name="name",nullable = false)
|
||||
private String name;
|
||||
@Column(name="password",nullable = false)
|
||||
private String password;
|
||||
@Column(name="realName",nullable = false)
|
||||
private String realName;
|
||||
@Column(name="telephone",nullable = false)
|
||||
private String telephone;
|
||||
@Column(name="enterpriseName",nullable = false)
|
||||
private String enterpriseName;
|
||||
@Column(name="enterpriseName",nullable = false)
|
||||
private String captcha;
|
||||
private String timestamp;
|
||||
|
||||
public UAccountVo(String name, String password, String realName, String telephone, String enterpriseName, String captcha, String timestamp) {
|
||||
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
this.realName = realName;
|
||||
this.telephone = telephone;
|
||||
this.enterpriseName = enterpriseName;
|
||||
this.captcha = captcha;
|
||||
this.timestamp=timestamp;
|
||||
}
|
||||
|
||||
public UAccountVo() {
|
||||
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRealName() {
|
||||
return realName;
|
||||
}
|
||||
|
||||
public void setRealName(String realName) {
|
||||
this.realName = realName;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getCaptcha() {
|
||||
return captcha;
|
||||
}
|
||||
|
||||
public void setCaptcha(String captcha) {
|
||||
this.captcha = captcha;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
@@ -1,255 +0,0 @@
|
||||
package com.kelp.website.entity;
|
||||
|
||||
import com.kelp.base.BaseEntity;
|
||||
import com.kelp.common.constant.KeyConstant;
|
||||
import com.kelp.common.utils.AESUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/30 8:47
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "dt_enterprise_contract")
|
||||
public class UContract extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 企业,目前不使用
|
||||
*/
|
||||
// @Column(nullable = false,name="enterpriseId")
|
||||
// private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 企业id path,目前不使用
|
||||
*/
|
||||
// @Column(nullable = false,length = 512)
|
||||
// private String eidPath;
|
||||
|
||||
/**
|
||||
* 部门,目前不使用
|
||||
*/
|
||||
// @Column(nullable = false,name="departmentId")
|
||||
// private Long departmentId;
|
||||
|
||||
/**
|
||||
* 部门id path,目前不使用
|
||||
*/
|
||||
// @Column(nullable = false,length = 512)
|
||||
// private String didPath;
|
||||
|
||||
|
||||
/**
|
||||
* 客户id,不可修改
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 客户名称,不可修改
|
||||
*/
|
||||
@Column(nullable = false,name="customerName",length = 128)
|
||||
private String customerName_;
|
||||
|
||||
/**
|
||||
* 录入人,不可修改
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 录入人姓名,不可修改
|
||||
*/
|
||||
@Column(length = 128,nullable = false,name="accountName")
|
||||
private String accountName_;
|
||||
|
||||
/**
|
||||
* 我方签订人
|
||||
*/
|
||||
@Column(length = 128,nullable = false,name="staffName")
|
||||
private String staffName_;
|
||||
|
||||
/**
|
||||
* 甲方签订人
|
||||
*/
|
||||
@Column(length = 128,nullable = false,name="customerSignatory")
|
||||
private String customerSignatory_;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private Long signTime;
|
||||
|
||||
/**
|
||||
* 合同终止时间
|
||||
*/
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 发票情况
|
||||
*/
|
||||
@Column(length = 1024)
|
||||
private String fapiao;
|
||||
|
||||
/**
|
||||
* 回款情况
|
||||
*/
|
||||
@Column(length = 1024)
|
||||
private String dso;
|
||||
|
||||
/**
|
||||
* 备注或内容
|
||||
*/
|
||||
@Column(length = 1024)
|
||||
private String content;
|
||||
|
||||
|
||||
/**
|
||||
* 状态:00-正常,10-删除
|
||||
*/
|
||||
@Column(nullable = false,length = 2)
|
||||
private String state;
|
||||
|
||||
// public Long getEnterpriseId() {
|
||||
// return enterpriseId;
|
||||
// }
|
||||
// public void setEnterpriseId(Long enterpriseId) {
|
||||
// this.enterpriseId = enterpriseId;
|
||||
// }
|
||||
|
||||
// public String getEidPath() {
|
||||
// return eidPath;
|
||||
// }
|
||||
// public void setEidPath(String eidPath) {
|
||||
// this.eidPath = eidPath;
|
||||
// }
|
||||
|
||||
// public Long getDepartmentId() {
|
||||
// return departmentId;
|
||||
// }
|
||||
// public void setDepartmentId(Long departmentId) {
|
||||
// this.departmentId = departmentId;
|
||||
// }
|
||||
|
||||
// public String getDidPath() {
|
||||
// return didPath;
|
||||
// }
|
||||
// public void setDidPath(String didPath) {
|
||||
// this.didPath = didPath;
|
||||
// }
|
||||
|
||||
public Long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
public void setAccountId(Long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName_ != null ? AESUtil.decrypt(accountName_, KeyConstant.REALNAME) : "";
|
||||
}
|
||||
public void setAccountName(String accountName) {
|
||||
if (!StringUtils.isEmpty(accountName)) {
|
||||
this.accountName_ = AESUtil.encrypt(accountName, KeyConstant.REALNAME);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStaffName() {
|
||||
return staffName_ != null ? AESUtil.decrypt(staffName_, KeyConstant.REALNAME) : "";
|
||||
}
|
||||
public void setStaffName(String staffName) {
|
||||
if (!StringUtils.isEmpty(staffName)) {
|
||||
this.staffName_ = AESUtil.encrypt(staffName, KeyConstant.REALNAME);
|
||||
}
|
||||
}
|
||||
|
||||
public Long getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
public void setCustomerId(Long customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public String getCustomerName() {
|
||||
return customerName_ != null ? AESUtil.decrypt(customerName_, KeyConstant.REALNAME) : "";
|
||||
}
|
||||
public void setCustomerName(String customerName) {
|
||||
if (!StringUtils.isEmpty(customerName)) {
|
||||
this.customerName_ = AESUtil.encrypt(customerName, KeyConstant.REALNAME);
|
||||
}
|
||||
}
|
||||
|
||||
public String getCustomerSignatory() {
|
||||
return customerSignatory_ != null ? AESUtil.decrypt(customerSignatory_, KeyConstant.REALNAME) : "";
|
||||
}
|
||||
public void setCustomerSignatory(String customerSignatory) {
|
||||
if (!StringUtils.isEmpty(customerSignatory)) {
|
||||
this.customerSignatory_ = AESUtil.encrypt(customerSignatory, KeyConstant.REALNAME);
|
||||
}
|
||||
}
|
||||
|
||||
public Long getSignTime() {
|
||||
return signTime;
|
||||
}
|
||||
public void setSignTime(Long signTime) {
|
||||
this.signTime = signTime;
|
||||
}
|
||||
|
||||
public Long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
public void setEndTime(Long endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getFapiao() {
|
||||
return fapiao;
|
||||
}
|
||||
public void setFapiao(String fapiao) {
|
||||
this.fapiao = fapiao;
|
||||
}
|
||||
|
||||
public String getDso() {
|
||||
return dso;
|
||||
}
|
||||
public void setDso(String dso) {
|
||||
this.dso = dso;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.kelp.website.service;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.crm.entity.EAccount;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 14:26
|
||||
*/
|
||||
public interface UAccountService {
|
||||
|
||||
public UAccount getByTelephone(String telephone);
|
||||
public void add(UAccount uAccount);
|
||||
public UAccount getById(String id);
|
||||
public void update(UAccount uAccount);
|
||||
public void delete(String[] ids);
|
||||
/**
|
||||
*
|
||||
* @param pageNumber
|
||||
* @param pageSize
|
||||
* @param name - 昵称
|
||||
* @param telephone
|
||||
* @param roleId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public Page<UAccount> getPage(int pageNumber, int pageSize, String enterpriseId, String departmentId, String name,
|
||||
String telephone, String roleId, String state);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.kelp.website.service;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.website.entity.UContract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/30 8:47
|
||||
*/
|
||||
public interface UContractService {
|
||||
|
||||
|
||||
public Page<UContract> getPage(int pageNumber, int pageSize,long id);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.kelp.website.service.impl;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.common.constant.KeyConstant;
|
||||
import com.kelp.common.utils.AESUtil;
|
||||
import com.kelp.common.utils.IdWorker;
|
||||
import com.kelp.crm.entity.EAccount;
|
||||
import com.kelp.website.dao.UAccountDao;
|
||||
import com.kelp.website.entity.UAccount;
|
||||
import com.kelp.website.service.UAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/28 14:26
|
||||
*/
|
||||
@Service
|
||||
public class UAccountServiceImpl implements UAccountService {
|
||||
@Autowired
|
||||
private UAccountDao uAccountDao;
|
||||
@Autowired
|
||||
private IdWorker idWorker;
|
||||
|
||||
@Override
|
||||
public UAccount getByTelephone(String telephone) {
|
||||
return uAccountDao.get("telephone", AESUtil.encrypt(telephone, KeyConstant.TELEPHONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(UAccount uAccount) {
|
||||
uAccount.setId(idWorker.nextId());
|
||||
uAccountDao.add(uAccount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UAccount getById(String id) {
|
||||
return uAccountDao.get(Long.valueOf(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(UAccount uAccount) {
|
||||
uAccountDao.update(uAccount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String[] ids) {
|
||||
List<Long> ids_ = new ArrayList<Long>();
|
||||
for(String id : ids){
|
||||
try {
|
||||
ids_.add(Long.valueOf(id));
|
||||
} catch (Exception e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
uAccountDao.setState(ids_, "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<UAccount> getPage(int pageNumber, int pageSize, String enterpriseId, String departmentId, String name, String telephone, String roleId, String state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.kelp.website.service.impl;
|
||||
|
||||
import com.kelp.base.Page;
|
||||
import com.kelp.common.utils.IdWorker;
|
||||
import com.kelp.common.utils.jwt.JwtUtil;
|
||||
import com.kelp.crm.service.EnterpriseService;
|
||||
import com.kelp.website.dao.UContractDao;
|
||||
import com.kelp.website.entity.UContract;
|
||||
import com.kelp.website.service.UContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2025/4/30 8:47
|
||||
*/
|
||||
@Service
|
||||
public class UContractServiceImpl implements UContractService {
|
||||
@Autowired
|
||||
UContractDao uContractDao;
|
||||
@Autowired
|
||||
private IdWorker idWorker;
|
||||
@Autowired
|
||||
EnterpriseService enterpriseService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Page<UContract> getPage(int pageNumber, int pageSize, long id ) {
|
||||
|
||||
Page<UContract> page = uContractDao.getPage(pageNumber, pageSize,id);
|
||||
|
||||
if(page == null){
|
||||
page = new Page<UContract>();
|
||||
}
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user