@@ -78,6 +78,6 @@ | |||
<classpathentry kind="lib" path="/TJLib/lib/oracle/ojdbc7.jar"/> | |||
<classpathentry kind="lib" path="/TJLib/lib/taiji/etc/tc/sso-fileprotocol-1.0.jar" sourcepath="/TJLib/lib/taiji/etc/tc/sso-fileprotocol-1.0-src.zip"/> | |||
<classpathentry kind="lib" path="/TJLib/lib/freemarker/2.3/freemarker-2.3.jar" sourcepath="/TJLib/lib/freemarker/2.3/freemarker-2.3-sources.jar"/> | |||
<classpathentry kind="lib" path="/TJLib/lib/mysql/8.0/mysql-connector-java-8.0.22.jar"/> | |||
<classpathentry kind="lib" path="/TJLib/lib/mysql/8.0/mysql-connector-java-8.0.jar"/> | |||
<classpathentry kind="output" path="war/WEB-INF/classes"/> | |||
</classpath> |
@@ -13,6 +13,13 @@ public enum ResourceType | |||
G_TEST2("测试g2", "xlgl.png","fa fa-cogs") {}, | |||
H_TEST2("测试h", "xlgl.png","fa fa-cogs") {}, | |||
I_TEST("测试i", "xlgl.png","fa fa-cogs") {}, | |||
J_SERVICE("测试j", "xlgl.png","fa fa-cogs") {}, | |||
L_SERVICE("测试L", "xlgl.png","fa fa-cogs") {}, | |||
M_GASCON("测试M", "xlgl.png","fa fa-cogs") {}, | |||
K_SERVICE("测试K", "xlgl.png","fa fa-cogs") {}, | |||
O_SERVICE("测试K", "xlgl.png","fa fa-cogs") {}, | |||
N_VEHICLE_MANAGEMENT("车辆管理", "xlgl.png","fa fa-cogs") {}, | |||
; | |||
@@ -4,6 +4,7 @@ import java.util.List; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.yskj.zfdm.entity.AppResource; | |||
@@ -12,12 +13,14 @@ import cn.com.yskj.zfdm.entity.AppResource.MenuType; | |||
public interface AppResourceRepo extends AbstractJpaRepo<AppResource, String> | |||
{ | |||
@Modifying | |||
@Transactional | |||
@Query("delete from AppResource where menuId=?1 and menuType=?2") | |||
public int deleteByMenu(String menuId, MenuType menuType); | |||
@Transactional | |||
@Query("from AppResource where menuId=?1 order by list asc") | |||
public List<AppResource> listResource(String menuId); | |||
@Transactional | |||
@Query("select count(id) from AppResource where menuId=?1 and menuType=?2") | |||
public long count(String menuId, MenuType menuType); | |||
} |
@@ -4,6 +4,7 @@ import java.util.List; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.yskj.zfdm.entity.RoleResource; | |||
@@ -12,12 +13,15 @@ import cn.com.yskj.zfdm.entity.dict.ResourceType; | |||
public interface RoleResourceRepo extends AbstractJpaRepo<RoleResource, String> { | |||
@Modifying | |||
@Transactional | |||
@Query("delete from RoleResource where role.id=?1") | |||
public int deleteByRole(String roleId); | |||
@Transactional | |||
@Query("from RoleResource where role.id=?1 and resource.id=?2") | |||
public RoleResource findByRoleResource(String roleId, String resourceId); | |||
@Transactional | |||
@Query("select resource.type from RoleResource where role.id=?1 and resource.menuType<>?2 group by resource.type order by resource.type ") | |||
public List<ResourceType> listResourceType(String roleId, MenuType menuType); | |||
@@ -41,10 +41,11 @@ public class ZfdAuditorPageRequest extends JpaPageableDataRequest<ZfdAuditor> { | |||
private String loginName; | |||
public ZfdAuditorPageRequest(){ | |||
orderBy = "updateTime"; | |||
// orderBy = "updateTime"; | |||
desc = true; | |||
} | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder(" from ZfdAuditor where 1=1 "); |
@@ -2,7 +2,6 @@ package cn.com.yskj.zfdm.repo.zfd; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.yskj.zfdm.entity.zfd.ZfdAuditor; | |||
import cn.com.yskj.zfdm.entity.zfd.ZfdLoginUser; | |||
public interface ZfdAuditorRepo extends AbstractJpaRepo<ZfdAuditor, String> { |
@@ -44,8 +44,8 @@ import spring.cn.com.taiji.common.annotation.PostInitializerRunner; | |||
*/ | |||
@Configuration | |||
// 启用spring data jpa | |||
@EnableJpaRepositories(basePackages = "cn.com.yskj." + AppConfig.APP_NAME | |||
+ ".repo.jpa", entityManagerFactoryRef = "entityManager", repositoryFactoryBeanClass = MyJpaRespositoryFactoryBean.class) | |||
@EnableJpaRepositories(basePackages = {"cn.com.yskj." + AppConfig.APP_NAME | |||
+ ".repo.jpa","cn.com.yskj." + AppConfig.APP_NAME+ ".repo.zfd"}, entityManagerFactoryRef = "entityManager", repositoryFactoryBeanClass = MyJpaRespositoryFactoryBean.class) | |||
@EnableTransactionManagement(mode = AdviceMode.ASPECTJ, proxyTargetClass = true) | |||
@ComponentScan(basePackages = { "cn.com.yskj." + AppConfig.APP_NAME + ".manager", | |||
"cn.com.yskj." + AppConfig.APP_NAME + ".dao.jpa", "cn.com.yskj." + AppConfig.APP_NAME + ".dao.jdbc" }) |
@@ -2,6 +2,8 @@ package cn.com.yskj.zfdm.manager; | |||
import javax.validation.Valid; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.yskj.zfdm.entity.zfd.ZfdAuditor; | |||
@@ -15,6 +17,7 @@ public interface ZfdAuditorManager { | |||
ZfdAuditor findById(String id); | |||
@Transactional | |||
void delete(String id); | |||
@@ -16,12 +16,14 @@ import cn.com.yskj.zfdm.model.zfdAuditor.AddModel; | |||
import cn.com.yskj.zfdm.repo.request.ZfdAuditorPageRequest; | |||
import cn.com.yskj.zfdm.repo.zfd.ZfdAuditorRepo; | |||
@Transactional | |||
@Service | |||
public class ZfdAuditorManagerImpl extends AbstractManager implements ZfdAuditorManager { | |||
@Autowired | |||
private ZfdAuditorRepo zfdAuditorRepo; | |||
@Transactional | |||
@Override | |||
public void add(@Valid AddModel add) { | |||
add.valid(); | |||
@@ -30,6 +32,7 @@ public class ZfdAuditorManagerImpl extends AbstractManager implements ZfdAuditor | |||
zfdAuditorRepo.persist(zfdAuditor); | |||
} | |||
@Transactional | |||
@Override | |||
public Pagination queryPage(ZfdAuditorPageRequest queryModel) { | |||
// TODO Auto-generated method stub | |||
@@ -43,6 +46,7 @@ public class ZfdAuditorManagerImpl extends AbstractManager implements ZfdAuditor | |||
zfdAuditorRepo.deleteById(id); | |||
} | |||
@Transactional | |||
@Override | |||
public ZfdAuditor findById(String id) { | |||
return zfdAuditorRepo.findById(id).orElse(null); |
@@ -46,6 +46,19 @@ public class AddModel extends BaseModel { | |||
public String getNamePy() { | |||
return namePy; | |||
} | |||
public void setNamePy(String namePy) { | |||
this.namePy = namePy; | |||
} | |||
public String getName() { | |||
return name; | |||
} |
@@ -41,7 +41,7 @@ import cn.com.yskj.zfdm.web.BaseLogController; | |||
@RequestMapping("/zfdAuditor") | |||
public class ZfdAuditorController extends BaseLogController { | |||
private static final String prefix = "Auditor/"; | |||
private static final String prefix = "zfdAuditor/"; | |||
@Autowired | |||
private ZfdAuditorManager zfdAuditorManager; | |||
@@ -1,18 +0,0 @@ | |||
<%@ page contentType="text/html;charset=utf-8"%> | |||
<%@ include file="/WEB-INF/jsp/include.jsp"%> | |||
<tr> | |||
<td> | |||
${fn:escapeXml(vo.name)} | |||
</td> | |||
<td> | |||
${fn:escapeXml(vo.loginName)} | |||
</td> | |||
<td> | |||
${fn:escapeXml(vo.male)} | |||
</td> | |||
<td> | |||
<a href="${rootUrl}app/Auditor/view/${vo.id}" class="taiji_modal taiji_acl">详情</a> | |||
<a href="${rootUrl}app/Auditor/delete/${vo.id}" class="taiji_remove {confirm_message:'你确定要删除吗? '} taiji_acl">删除</a> | |||
</td> | |||
</tr> |
@@ -66,8 +66,8 @@ color:#888; | |||
<h4 class="panel-title">审批人菜单</h4> | |||
</div> | |||
<div class="panel-body"> | |||
<a href="${rootUrl }app/Auditor/add" class="taiji_modal taiji_acl btn btn-success m-r-10"><i class="fa fa-plus m-r-5"></i>添加</a> | |||
<form:form modelAttribute="queryModel" cssClass="taiji_search_form form-inline m-t-5 " id="listForm" name="listForm" action="${rootUrl}app/zfdUser/manage" method="post"> | |||
<a href="${rootUrl }app/zfdAuditor/add" class="taiji_modal taiji_acl btn btn-success m-r-10"><i class="fa fa-plus m-r-5"></i>添加</a> | |||
<form:form modelAttribute="queryModel" cssClass="taiji_search_form form-inline m-t-5 " id="listForm" name="listForm" action="${rootUrl}app/zfdAuditor/manage" method="post"> | |||
<div class="form-group"> | |||
<form:input path="name" maxlength="100" cssClass="form-control" placeholder="名称" /> | |||
</div> | |||
@@ -75,7 +75,11 @@ color:#888; | |||
<form:input path="loginName" maxlength="100" cssClass="form-control" placeholder="登录名" /> | |||
</div> | |||
<div class="form-group"> | |||
<form:input path="status" maxlength="100" cssClass="form-control" placeholder="状态" /> | |||
<label class="control-label">状态</label> | |||
<form:select path="status" cssClass="selectpicker" data-style="btn-white" data-width="80px"> | |||
<form:option value="">全部</form:option> | |||
<form:options items="${statuses}" itemLabel="value"/> | |||
</form:select> | |||
</div> | |||
<div class="form-group"> | |||
<form:input path="mobile" maxlength="100" cssClass="form-control" placeholder="电话" /> |
@@ -0,0 +1,35 @@ | |||
<%@ page contentType="text/html;charset=utf-8"%> | |||
<%@ include file="/WEB-INF/jsp/include.jsp"%> | |||
<tr> | |||
<td> | |||
${fn:escapeXml(vo.name)} | |||
</td> | |||
<td> | |||
${fn:escapeXml(vo.loginName)} | |||
</td> | |||
<td> | |||
${fn:escapeXml(vo.status.value)} | |||
</td> | |||
<td> | |||
${fn:escapeXml(vo.mobile)} | |||
</td> | |||
<td> | |||
<div class="dropdown " style="display: inline-block;"> | |||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" ><i class="fa fa-navicon"></i></a> | |||
<ul class="dropdown-menu dropdown-menu-right" > | |||
<li> | |||
<c:if test="${vo.status=='NORMAL' }"> | |||
<a href="${rootUrl }app/zfdAuditor/status/${vo.id}/INVALID" data-selector="#userName" class="taiji_operate {confirm_message:'是否停用用户:${vo.name} ',refresh:true} taiji_acl">停用</a> | |||
</c:if> | |||
<c:if test="${vo.status=='INVALID' }"> | |||
<a href="${rootUrl }app/zfdAuditor/status/${vo.id}/NORMAL" data-selector="#userName" class="taiji_operate {confirm_message:'是否启用用户:${vo.name} ',refresh:true} taiji_acl">启用</a> | |||
</c:if> | |||
</li> | |||
</ul> | |||
</div> | |||
<a href="${rootUrl}app/zfdAuditor/view/${vo.id}" class="taiji_modal taiji_acl">详情</a> | |||
<a href="${rootUrl}app/zfdAuditor/delete/${vo.id}" class="taiji_remove {confirm_message:'你确定要删除吗? '} taiji_acl">删除</a> | |||
</td> | |||
</tr> |