update code
parent
e20b36b1e7
commit
645944e305
|
@ -211,7 +211,11 @@ public class BaseEntity implements Serializable
|
|||
}
|
||||
RequestContextHolder.setRequestAttributes(servletRequestAttributes,true);
|
||||
HttpServletRequest request = servletRequestAttributes.getRequest();
|
||||
return request.getHeader("proType");
|
||||
String str= request.getHeader("proType");
|
||||
if("0".equals(str)){
|
||||
str="";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public void setProType(String proType) {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ProjectController extends BaseController {
|
|||
private RedisCache redisCache;
|
||||
|
||||
@GetMapping("/findProjectByDept")
|
||||
public AjaxResult findProjectByDept(Long deptId,String proType){
|
||||
public AjaxResult findProjectByDept(Long deptId){
|
||||
SurProject surProject=new SurProject();
|
||||
if(deptId==-1){
|
||||
long roleId= SecurityUtils.getRoleId();
|
||||
|
@ -52,9 +52,6 @@ public class ProjectController extends BaseController {
|
|||
if(deptId!=null && deptId.longValue()>0){
|
||||
surProject.setDeptId(deptId);
|
||||
}
|
||||
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
|
||||
surProject.setProjectType(proType);
|
||||
}
|
||||
return success(isurProjectService.selectSurProjectList(surProject));
|
||||
}
|
||||
|
||||
|
@ -76,7 +73,7 @@ public class ProjectController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getProgressProjects")
|
||||
public AjaxResult getProgressProjects(long deptId,String proType){
|
||||
public AjaxResult getProgressProjects(long deptId){
|
||||
SurProject where=new SurProject();
|
||||
if(deptId<=0){
|
||||
if (SecurityUtils.isUserB()) {
|
||||
|
@ -85,15 +82,11 @@ public class ProjectController extends BaseController {
|
|||
}else{
|
||||
where.setDeptId(deptId);
|
||||
}
|
||||
String key="bgscreen_prj_getProgressProjects_"+deptId+"_"+proType+"_"+ Md5Utils.hash(where.getPrjIds());
|
||||
String key="bgscreen_prj_getProgressProjects_"+deptId+"_"+ Md5Utils.hash(where.getPrjIds());
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return success(obj);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
|
||||
where.setProjectType(proType);
|
||||
}
|
||||
List<SurProject> list= isurProjectService.selectProgressProjects(where);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return success(list);
|
||||
|
|
|
@ -59,7 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectSurProjectList" parameterType="SurProject" resultMap="SurProjectResult">
|
||||
select sp.id, sp.deptId, sp.projectName, sp.projectCode, sp.paretProjectName, sp.paretProjectCode, sp.simpleName, sp.projectType, sp.projiectLevel, sp.projectRegional, a.areaName as projectRegionalName, sp.projectAddress, sp.projectNature, sp.licenceNumber, sp.projectApproval, sp.projectPerson, sp.projectPhone, sp.longitude, sp.latitude, sp.projectTimeLimit, sp.totalInvestment, sp.floorArea, sp.totalOutputValue, sp.plannedCompletionTime, sp.scheduledStartTime, sp.actualOperatingTime, sp.actualCompletionTime, sp.contractAmount, sp.paidAmount, sp.onAccountAmount, sp.projectSchedule, sp.projectSummarize, sp.isDel, sp.projectStatus, sp.servicePersonnel, sp.supervisorPersonnel, sp.generalContractor, sp.create_by, sp.create_time, sp.update_by, sp.update_time, sp.remark, sp.weightType, sp.projectSort, sp.progressVisible, d.dept_name from sur_project sp
|
||||
select sp.id, sp.deptId, sp.projectName, sp.projectCode, sp.paretProjectName, sp.paretProjectCode, sp.simpleName, sp.projectType, sp.projiectLevel, sp.projectRegional, a.areaName as projectRegionalName, sp.projectAddress, sp.projectNature, sp.licenceNumber, sp.projectApproval, sp.projectPerson, sp.projectPhone, sp.longitude, sp.latitude, sp.projectTimeLimit, sp.totalInvestment, sp.floorArea, sp.totalOutputValue, sp.plannedCompletionTime, sp.scheduledStartTime, sp.actualOperatingTime, sp.actualCompletionTime, sp.contractAmount, sp.paidAmount, sp.onAccountAmount, sp.projectSchedule, sp.projectSummarize, sp.isDel, sp.projectStatus, sp.servicePersonnel, sp.supervisorPersonnel, sp.generalContractor, sp.create_by, sp.create_time, sp.update_by, sp.update_time, sp.remark, sp.weightType, sp.projectSort, sp.progressVisible, d.dept_name
|
||||
from sur_project sp
|
||||
left join sys_dept d on d.dept_id = sp.deptId
|
||||
left join china_area a on sp.projectRegional = a.id
|
||||
<!--监理单位/总包公司/分包单位-->
|
||||
|
@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectDeptId != null "> and sp.deptId = #{projectDeptId}</if>
|
||||
<!--子部门数据-->
|
||||
<if test='nowRole == "4"'> and sp.deptId = #{nowDept}</if>
|
||||
<if test='proType != null and proType !=""'> and sp.projectType = #{proType}</if>
|
||||
<!--监理单位/总包公司/分包单位查询当前关联数据-->
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
|
@ -368,6 +370,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select sp.id, sp.deptId, sp.projectName, sp.projectCode, sp.paretProjectName, sp.paretProjectCode, sp.simpleName, sp.projectType, sp.projiectLevel, sp.projectRegional, a.areaName as projectRegionalName, sp.projectAddress, sp.projectNature, sp.licenceNumber, sp.projectApproval, sp.projectPerson, sp.projectPhone, sp.longitude, sp.latitude, sp.projectTimeLimit, sp.totalInvestment, sp.floorArea, sp.totalOutputValue, sp.plannedCompletionTime, sp.scheduledStartTime, sp.actualOperatingTime, sp.actualCompletionTime, sp.contractAmount, sp.paidAmount, sp.onAccountAmount, sp.projectSchedule, sp.projectSummarize, sp.isDel, sp.projectStatus, sp.servicePersonnel, sp.supervisorPersonnel, sp.generalContractor, sp.create_by, sp.create_time, sp.update_by, sp.update_time, sp.remark, sp.weightType, sp.projectSort, sp.progressVisible, d.dept_name
|
||||
from (
|
||||
select * from sur_project sp where sp.isdel=0
|
||||
<if test="proType!='0'"></if>
|
||||
<if test="id!=null and id>0">
|
||||
and sp.id in (select spu.project_id from sur_project_userinfo spu where spu.user_id = #{id} and spu.is_del=0)
|
||||
</if>
|
||||
|
|
Loading…
Reference in New Issue