新增项目编号
parent
14cf433af2
commit
0bd61986a1
|
@ -22,6 +22,8 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import top.jfunc.common.db.bean.Page;
|
||||||
|
import top.jfunc.common.utils.CollectionUtil;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -85,7 +87,15 @@ public class ProjectController extends BaseController {
|
||||||
model.put("admin", InterfaceUtil.getAdmin());
|
model.put("admin", InterfaceUtil.getAdmin());
|
||||||
model.put("deptList", deptService.findAll());
|
model.put("deptList", deptService.findAll());
|
||||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||||
model.put("pager", projectService.list(searchInfo, pageNumber, pageSize));
|
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
||||||
|
List<Project> list = page.getList();
|
||||||
|
if(CollectionUtil.isNotEmpty(list)){
|
||||||
|
int offset = (pageNumber - 1) * pageSize;
|
||||||
|
for (int i = 0 , size = list.size(); i < size; i++) {
|
||||||
|
list.get(i).setTempId(i+1 + offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.put("pager", page);
|
||||||
///
|
///
|
||||||
/*Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
/*Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
||||||
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");*/
|
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");*/
|
||||||
|
@ -584,6 +594,19 @@ public class ProjectController extends BaseController {
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存项目与用户的关系
|
||||||
|
*/
|
||||||
|
@RequestMapping("/checkProjectNo")
|
||||||
|
@ResponseBody
|
||||||
|
public ResponseMsg checkProjectNo(@RequestParam String projectNo, @RequestParam int id) {
|
||||||
|
Project project = projectRepository.findByProjectName(projectNo);
|
||||||
|
if (project != null && id != project.getId()) {
|
||||||
|
return ResponseMsg.buildFailedMsg("失败");
|
||||||
|
}
|
||||||
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目提交审核
|
* 项目提交审核
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,6 +23,15 @@ public class Project {
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||||
private int id;
|
private int id;
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
@Transient
|
||||||
|
private int tempId;
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String projectNo;
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
|
@ -181,6 +190,22 @@ public class Project {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTempId() {
|
||||||
|
return tempId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTempId(int tempId) {
|
||||||
|
this.tempId = tempId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectNo() {
|
||||||
|
return projectNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectNo(String projectNo) {
|
||||||
|
this.projectNo = projectNo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ public interface ProjectRepository extends JpaRepository<Project,Integer> {
|
||||||
@Query(value = "select * from project where name = ?1", nativeQuery = true)
|
@Query(value = "select * from project where name = ?1", nativeQuery = true)
|
||||||
Project findByProjectName(String projectName);
|
Project findByProjectName(String projectName);
|
||||||
|
|
||||||
|
@Query(value = "select * from project where project_no = ?1", nativeQuery = true)
|
||||||
|
Project findByProjectNo(String projectNo);
|
||||||
|
|
||||||
@Query(value = "select * from project where dept_id = ?1", nativeQuery = true)
|
@Query(value = "select * from project where dept_id = ?1", nativeQuery = true)
|
||||||
List<Project> findByDeptId(int deptId);
|
List<Project> findByDeptId(int deptId);
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,16 @@
|
||||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="am-g am-form-group am-margin-top">
|
||||||
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span><input readonly style="text-align: right;width: 69px;margin-bottom: 6px;" value="项目编号"></div>
|
||||||
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
<#--<textarea style="overflow:auto; background-attachment: fixed;
|
||||||
|
background-repeat: no-repeat; border-style: solid;border-color: #FFFFFF">${project.name}</textarea>-->
|
||||||
|
<input type="text" style="word-break: break-word; border:0 none;outline:none;" value="${project.projectNo}">
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="am-g am-form-group am-margin-top">
|
<div class="am-g am-form-group am-margin-top">
|
||||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span><input readonly style="text-align: right;width: 69px;margin-bottom: 6px;" value="项目名称"></div>
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span><input readonly style="text-align: right;width: 69px;margin-bottom: 6px;" value="项目名称"></div>
|
||||||
<div class="am-u-sm-6 am-u-md-6">
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
|
|
@ -54,7 +54,15 @@
|
||||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="am-g am-form-group am-margin-top">
|
||||||
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目编号</div>
|
||||||
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
<input type="text" id="projectNo" class="am-input" data-validate-async data-validation-message="请输入项目编号(50字符以内)"
|
||||||
|
name="projectNo" placeholder="请输入项目编号(50字符以内)" maxlength="50"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="am-g am-form-group am-margin-top">
|
<div class="am-g am-form-group am-margin-top">
|
||||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
|
||||||
|
@ -440,6 +448,7 @@
|
||||||
<script src="${base}/assets/js/project_estimate.js"></script>
|
<script src="${base}/assets/js/project_estimate.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var result = 0;
|
var result = 0;
|
||||||
|
var projectNoResult = 0;
|
||||||
var rateResult = 0;
|
var rateResult = 0;
|
||||||
var check = 0;
|
var check = 0;
|
||||||
$(function () {
|
$(function () {
|
||||||
|
@ -523,6 +532,19 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (projectNo.length <= 0) {
|
||||||
|
window.confirm('项目编号不能为空');
|
||||||
|
check = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkProjectNo();
|
||||||
|
if (projectNoResult == 1) {
|
||||||
|
window.confirm('项目编号已存在');
|
||||||
|
check = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (name.length <= 0) {
|
if (name.length <= 0) {
|
||||||
window.confirm('项目名称不能为空');
|
window.confirm('项目名称不能为空');
|
||||||
check = 1;
|
check = 1;
|
||||||
|
@ -653,6 +675,21 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function checkProjectNo () {
|
||||||
|
var projectNo = $("#projectNo").val();
|
||||||
|
var id = $("#id").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "${base}/project/checkProjectNo",
|
||||||
|
data: {projectNo: projectNo, id: id},
|
||||||
|
type: "post",
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function (data) {
|
||||||
|
projectNoResult = data.status;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function checkRate () {
|
function checkRate () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "${base}/sys/config/checkRate",
|
url: "${base}/sys/config/checkRate",
|
||||||
|
|
|
@ -62,7 +62,15 @@
|
||||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="am-g am-form-group am-margin-top">
|
||||||
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目编号</div>
|
||||||
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
<input type="text" id="projectNo" class="am-input" data-validate-async data-validation-message="请输入项目编号(50字符以内)"
|
||||||
|
name="projectNo" placeholder="请输入项目编号(50字符以内)" maxlength="50"
|
||||||
|
value="${project.projectNo}" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="am-g am-form-group am-margin-top">
|
<div class="am-g am-form-group am-margin-top">
|
||||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
|
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
|
||||||
|
@ -447,6 +455,7 @@
|
||||||
<script src="${base}/assets/js/project_estimate.js"></script>
|
<script src="${base}/assets/js/project_estimate.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var check = 0;
|
var check = 0;
|
||||||
|
var projectNoResult = 0;
|
||||||
var rateResult = 0;
|
var rateResult = 0;
|
||||||
var result = 0;
|
var result = 0;
|
||||||
$(function () {
|
$(function () {
|
||||||
|
@ -529,6 +538,19 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (projectNo.length <= 0) {
|
||||||
|
window.confirm('项目编号不能为空');
|
||||||
|
check = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkProjectNo();
|
||||||
|
if (projectNoResult == 1) {
|
||||||
|
window.confirm('项目编号已存在');
|
||||||
|
check = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (name.length <= 0) {
|
if (name.length <= 0) {
|
||||||
window.confirm('项目名称不能为空');
|
window.confirm('项目名称不能为空');
|
||||||
check = 1;
|
check = 1;
|
||||||
|
@ -661,6 +683,21 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function checkProjectNo () {
|
||||||
|
var projectNo = $("#projectNo").val();
|
||||||
|
var id = $("#id").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "${base}/project/checkProjectNo",
|
||||||
|
data: {projectNo: projectNo, id: id},
|
||||||
|
type: "post",
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function (data) {
|
||||||
|
projectNoResult = data.status;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function checkRate () {
|
function checkRate () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "${base}/sys/config/checkRate",
|
url: "${base}/sys/config/checkRate",
|
||||||
|
|
|
@ -177,8 +177,12 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="am-text-nowrap">
|
<tr class="am-text-nowrap">
|
||||||
<th class="table-title">序号</th>
|
<th class="table-title">序号</th>
|
||||||
|
<th class="table-title">项目编号</th>
|
||||||
<th class="table-title">项目名称</th>
|
<th class="table-title">项目名称</th>
|
||||||
<th class="table-title">项目类型</th>
|
<th class="table-title">项目类型</th>
|
||||||
|
<th class="table-title">项目合同金额</th>
|
||||||
|
<th class="table-title">华智产品金额</th>
|
||||||
|
<th class="table-title">其他产品金额</th>
|
||||||
<th class="table-title">项目状态</th>
|
<th class="table-title">项目状态</th>
|
||||||
<th class="table-title">审核状态</th>
|
<th class="table-title">审核状态</th>
|
||||||
<th class="table-title">当前审核人</th>
|
<th class="table-title">当前审核人</th>
|
||||||
|
@ -192,9 +196,13 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<#list pager.list as list>
|
<#list pager.list as list>
|
||||||
<tr>
|
<tr>
|
||||||
<td>${list.id!}</td>
|
<td>${list.tempId!}</td>
|
||||||
|
<td>${list.projectNo!}</td>
|
||||||
<td class="huanhang"><a style="cursor: pointer;text-decoration:none" onclick="location.href='${base}/project/approve?listFrom=list&type=1&id=${list.id}'">${list.name!}</a></td>
|
<td class="huanhang"><a style="cursor: pointer;text-decoration:none" onclick="location.href='${base}/project/approve?listFrom=list&type=1&id=${list.id}'">${list.name!}</a></td>
|
||||||
<td>${list.typeDesc!}</td>
|
<td>${list.typeDesc!}</td>
|
||||||
|
<td>${list.contractAmount!}</td>
|
||||||
|
<td>${list.huazhiProductAmount!}</td>
|
||||||
|
<td>${list.ziguangOtherAmount!}</td>
|
||||||
<td>${list.statusDesc!}</td>
|
<td>${list.statusDesc!}</td>
|
||||||
<td>${list.approveStatusDesc!}</td>
|
<td>${list.approveStatusDesc!}</td>
|
||||||
<td>${list.approveName!}</td>
|
<td>${list.approveName!}</td>
|
||||||
|
@ -211,6 +219,13 @@
|
||||||
onclick="location.href='${base}/project/selectRoleUser?projectId=${list.id}'"><span class="am-icon-pencil-square-o"></span>设置项目可见性
|
onclick="location.href='${base}/project/selectRoleUser?projectId=${list.id}'"><span class="am-icon-pencil-square-o"></span>设置项目可见性
|
||||||
</button>
|
</button>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
<#if adminId==1>
|
||||||
|
<button type="button"
|
||||||
|
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||||
|
onclick="location.href='${base}/project/selectRoleUser?projectId=${list.id}'"><span class="am-icon-pencil-square-o"></span>设置项目可见性
|
||||||
|
</button>
|
||||||
|
</#if>
|
||||||
<#--<@shiro.hasPermission name="PROJECT_EDIT">-->
|
<#--<@shiro.hasPermission name="PROJECT_EDIT">-->
|
||||||
|
|
||||||
<#-- 项目等于概算状态、概算审核为草稿和不通过状态-->
|
<#-- 项目等于概算状态、概算审核为草稿和不通过状态-->
|
||||||
|
@ -323,7 +338,7 @@
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<#if (pager.list)?exists && (pager.list?size>0) >
|
<#if (pager.list)?exists && (pager.list?size>0) >
|
||||||
<div class="am-fr">
|
<div class="am-fr">
|
||||||
<#include "../common/common_pager.ftl">
|
<#include "../common/project_pager.ftl">
|
||||||
</div>
|
</div>
|
||||||
<#else>
|
<#else>
|
||||||
<div class="am-kai" align="center">
|
<div class="am-kai" align="center">
|
||||||
|
|
Loading…
Reference in New Issue