班组管理功能开发
This commit is contained in:
parent
72ade4a49e
commit
acacc5f98e
|
|
@ -68,4 +68,5 @@ public class OrganizationalBean {
|
|||
private String title;
|
||||
|
||||
private String orgType;
|
||||
private Integer pParentId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ public class TeamGroupBean {
|
|||
// 所属项目
|
||||
private String project;
|
||||
private String projectId;
|
||||
private String pParentId;
|
||||
private String parentId;
|
||||
// 班组名称
|
||||
private String teamGroupName;
|
||||
// 班组长
|
||||
|
|
|
|||
|
|
@ -187,4 +187,8 @@ public interface OrganizationalDao{
|
|||
List<OrganizationalBean> getProjectSelect(OrganizationalBean bean);
|
||||
|
||||
int getUser(OrganizationalBean bean);
|
||||
|
||||
int addData2(OrganizationalBean bean);
|
||||
|
||||
Integer getpParentId(OrganizationalBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,6 @@ public interface TeamGroupDao {
|
|||
TeamGroupBean selectTeamLeaser(TeamGroupBean groupBean);
|
||||
|
||||
List<TeamGroupBean> getTeamGroupPersons(TeamGroupBean teamGroupBean);
|
||||
|
||||
String getSubContractorName(TeamGroupBean groupBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,8 @@ public class OrganizationalServiceImpl implements OrganizationalService {
|
|||
ar.setResMsg("外包商退场暂未开放!");
|
||||
return ar;
|
||||
}
|
||||
|
||||
Integer pParentId = mapper.getpParentId(bean);
|
||||
bean.setPParentId(pParentId);
|
||||
int num = mapper.userOutData(bean);
|
||||
// mapper.theTeamExits(bean);
|
||||
if (num > 0) {
|
||||
|
|
@ -366,8 +367,13 @@ public class OrganizationalServiceImpl implements OrganizationalService {
|
|||
ar.setFailMsg("该班组名称已存在");
|
||||
return ar;
|
||||
}
|
||||
int num;
|
||||
if (StringUtils.isBlank(bean.getParentId())) {
|
||||
num = mapper.addData2(bean);
|
||||
} else {
|
||||
num = mapper.addData(bean);
|
||||
}
|
||||
|
||||
int num = mapper.addData(bean);
|
||||
if (num > 0) {
|
||||
// 新增班组类型
|
||||
mapper.insetTeamGroupType(bean);
|
||||
|
|
|
|||
|
|
@ -75,12 +75,6 @@ public class PersonServiceImpl implements PersonService {
|
|||
public AjaxRes updatePerson(PersonBean o) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
try {
|
||||
// 先查询该人员手机号是否有重复
|
||||
Integer count = dao.getPerSonByPhone(o);
|
||||
if (count > 0) {
|
||||
ar.setFailMsg("该手机号已存在");
|
||||
return ar;
|
||||
}
|
||||
o.setDeptId(StringUtils.isBlank(o.getDeptId()) ? "0" : o.getDeptId());
|
||||
dao.deletePersonRole(o.getId());
|
||||
dao.updatePerson(o);
|
||||
|
|
@ -89,7 +83,7 @@ public class PersonServiceImpl implements PersonService {
|
|||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
e.printStackTrace();
|
||||
ar.setFailMsg("修改失败");
|
||||
ar.setFailMsg("修改失败,该手机号已存在");
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.gs.sub.evaluate.evaluate.service;
|
||||
|
||||
import com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean;
|
||||
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamGroupBean;
|
||||
import com.bonus.gs.sub.evaluate.evaluate.dao.OrganizationalDao;
|
||||
import com.bonus.gs.sub.evaluate.evaluate.dao.TeamGroupDao;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||
|
|
@ -27,16 +29,25 @@ public class TeamGroupServiceImpl implements TeamGroupService {
|
|||
|
||||
@Autowired
|
||||
private TeamGroupDao teamGroupDao;
|
||||
@Autowired
|
||||
private OrganizationalDao mapper;
|
||||
|
||||
@Override
|
||||
public List<TeamGroupBean> getTeamGroupList(TeamGroupBean teamGroupBean) {
|
||||
if (!UserUtil.getLoginUser().getRoleId().equals("1")){
|
||||
if (!UserUtil.getLoginUser().getRoleId().equals("1")) {
|
||||
teamGroupBean.setUserId(Integer.parseInt(String.valueOf(UserUtil.getLoginUser().getId())));
|
||||
}
|
||||
List<TeamGroupBean> teamGroupList = teamGroupDao.getTeamGroupList(teamGroupBean);
|
||||
for (TeamGroupBean groupBean : teamGroupList) {
|
||||
/*if ((StringUtils.isBlank(groupBean.getParentId()) && groupBean.getStatus() == 0) || StringUtils.isBlank(groupBean.getSubContractor())) {
|
||||
groupBean.setSubContractor(teamGroupDao.getSubContractorName(groupBean));
|
||||
}*/
|
||||
if (groupBean.getStatus() == 0) {
|
||||
// groupBean.setSubContractor(teamGroupDao.getSubContractorName(groupBean));
|
||||
groupBean.setProject(null);
|
||||
}
|
||||
TeamGroupBean bean = teamGroupDao.selectTeamLeaser(groupBean);
|
||||
if (bean != null){
|
||||
if (bean != null) {
|
||||
groupBean.setName(bean.getName());
|
||||
String phone = bean.getPhone();
|
||||
if (StringUtils.isNotBlank(phone)) {
|
||||
|
|
@ -49,6 +60,15 @@ public class TeamGroupServiceImpl implements TeamGroupService {
|
|||
|
||||
@Override
|
||||
public void updaTeteamGroup(TeamGroupBean teamGroupBean) {
|
||||
if (StringUtils.isNotBlank(teamGroupBean.getParentId())) {
|
||||
// 根据外包商id(project_assignment)和项目id获取组织架构(pm_org_info)中外包商id
|
||||
OrganizationalBean organizationalBean = new OrganizationalBean();
|
||||
organizationalBean.setParentId(teamGroupBean.getParentId());
|
||||
organizationalBean.setId(teamGroupBean.getPParentId());
|
||||
String id = mapper.getsubcontractorId(organizationalBean);
|
||||
teamGroupBean.setParentId(id);
|
||||
teamGroupBean.setStatus(1);
|
||||
}
|
||||
teamGroupDao.updaTeteamGroup(teamGroupBean);
|
||||
Integer i = teamGroupDao.selectTeteamType(teamGroupBean);
|
||||
if (i > 0) {
|
||||
|
|
@ -285,7 +305,7 @@ public class TeamGroupServiceImpl implements TeamGroupService {
|
|||
private boolean validateHeader(Row headerRow) {
|
||||
if (headerRow == null) return false;
|
||||
|
||||
return "姓名".equals(getCellValue(headerRow.getCell(0))) &&
|
||||
return "姓名".equals(getCellValue(headerRow.getCell(0))) &&
|
||||
"身份证".equals(getCellValue(headerRow.getCell(1))) &&
|
||||
"电话".equals(getCellValue(headerRow.getCell(2))) &&
|
||||
"性别".equals(getCellValue(headerRow.getCell(3))) &&
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
<!--更新 退场-->
|
||||
<update id="userOutData">
|
||||
update pm_org_info
|
||||
set status=2
|
||||
set status = 0,p_parent_id = #{pParentId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateDept">
|
||||
|
|
@ -234,6 +234,39 @@
|
|||
insert into team_person(team_id, name, id_card, phone,sex,work_type,face_url,is_team_leader)
|
||||
values (#{id}, #{userName},#{idCard}, #{userPhone}, #{sex}, #{workType}, #{faceUrl}, #{isTeamLeader})
|
||||
</insert>
|
||||
<insert id="addData2" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pm_org_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="parentId != null and parentId != ''">parent_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userId != null and userId != ''">user_id,</if>
|
||||
<if test="idCard != null">id_card,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="userPhone != null">user_phone,</if>
|
||||
<if test="orgType != null">org_type,</if>
|
||||
<if test="lkId != null">lk_id,</if>
|
||||
<if test="tableSource != null">table_source,</if>
|
||||
<if test="id != null and id != ''">p_parent_id,</if>
|
||||
status
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="parentId != null and parentId != ''">#{parentId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
|
||||
<if test="orgType != null">#{orgType},</if>
|
||||
<if test="lkId != null">#{lkId},</if>
|
||||
<if test="tableSource != null">#{tableSource},</if>
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
0
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="getUserList" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean">
|
||||
select NAME userName, LOGIN_NAME idCard, SEX, TELPHONE userPhone, dept_id tableId
|
||||
FROM gs_exam.pm_user
|
||||
|
|
@ -326,4 +359,18 @@
|
|||
from team_person
|
||||
where id_card = #{idCard} or phone = #{userPhone}
|
||||
</select>
|
||||
<select id="getpParentId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
lk_id
|
||||
FROM
|
||||
pm_org_info
|
||||
WHERE
|
||||
id in (
|
||||
SELECT
|
||||
parent_id
|
||||
FROM
|
||||
pm_org_info
|
||||
WHERE
|
||||
id = #{id})
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,15 @@
|
|||
</update>
|
||||
|
||||
<update id="updaTeteamGroup">
|
||||
update pm_org_info set name = #{teamGroupName} where id = #{id}
|
||||
UPDATE pm_org_info
|
||||
SET name = #{teamGroupName}
|
||||
<if test="parentId != null and parentId != ''">
|
||||
, parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateTeamPerson">
|
||||
update team_person set name = #{name},id_card = #{idCard},phone = #{phone},sex = #{sex},work_type = #{workType},face_url = #{faceUrl}
|
||||
|
|
@ -46,6 +54,8 @@
|
|||
poi3.user_id as userId,
|
||||
poi.NAME teamGroupName,
|
||||
poi.id as id,
|
||||
poi.parent_id as parentId,
|
||||
poi.p_parent_id as pParentId,
|
||||
poi.status as status,
|
||||
td.id as teamTypeId,
|
||||
td.val teamType,
|
||||
|
|
@ -59,7 +69,6 @@
|
|||
left join team_person tp on poi.id = tp.team_id
|
||||
WHERE
|
||||
poi.`level` = 5
|
||||
AND poi.`status` IN (1,2)
|
||||
<if test="userId != null ">
|
||||
and poi3.user_id = #{userId}
|
||||
</if>
|
||||
|
|
@ -174,4 +183,9 @@
|
|||
phone
|
||||
FROM team_person WHERE team_id = #{id} and is_team_leader = 0
|
||||
</select>
|
||||
<select id="getSubContractorName" resultType="java.lang.String">
|
||||
SELECT pa.enterpriseName FROM pm_org_info poi
|
||||
left join project_assignment pa on poi.p_parent_id = pa.id
|
||||
WHERE poi.p_parent_id = #{pParentId} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -68,8 +68,12 @@ function initTable() {
|
|||
{field: "corporateName", align: "center", title: "法人"},
|
||||
{ field: 'phone', title: '法人联系方式', width: '15%', align: "center",
|
||||
templet: function (d) {
|
||||
let phone = decryptCBC(d.phone);
|
||||
return maskSensitiveInfo(phone, "phone");
|
||||
if (d.phone) {
|
||||
let phone = decryptCBC(d.phone);
|
||||
return maskSensitiveInfo(phone, "phone");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ function setParams(obj, layerIndex) {
|
|||
objParam = JSON.parse(obj);
|
||||
window.layerIndex = layerIndex;
|
||||
getTeamGroupType(objParam.teamTypeId);
|
||||
if (objParam.status == 0){
|
||||
$("#projectDiv").css("display", "");
|
||||
getPromanagerSelect(objParam.pparentId);
|
||||
}
|
||||
// 字段回显
|
||||
$("#teamGroupName").val(objParam.teamGroupName);
|
||||
id = objParam.id;
|
||||
|
|
@ -25,7 +29,19 @@ function setParams(obj, layerIndex) {
|
|||
function saveData2() {
|
||||
$("#formSubmit").trigger("click");
|
||||
}
|
||||
|
||||
// 根据外包商获取项目下拉数据(支持传参)
|
||||
function getPromanagerSelect(subContractorId) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ctxPath + '/organizational/getProjectBySubContractor',
|
||||
data: {
|
||||
id: subContractorId
|
||||
},
|
||||
success: function (data) {
|
||||
setSelectValue(data.obj, 'project');
|
||||
}
|
||||
});
|
||||
}
|
||||
// 提交
|
||||
function updateName(data, id) {
|
||||
let loadingMsg = layer.msg("正在提交保存,请稍等...", {
|
||||
|
|
@ -38,6 +54,8 @@ function updateName(data, id) {
|
|||
id: id,
|
||||
teamGroupName: data.field.teamGroupName,
|
||||
teamType: data.field.teamType,
|
||||
parentId: data.field.project,
|
||||
pparentId: objParam.pparentId,
|
||||
};
|
||||
// console.log(JSON.stringify(data)+"data")
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@
|
|||
</div>
|
||||
<!-- 所属项目 -->
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<label class="layui-form-label"><span class="required_icon">*</span>所属项目</label>
|
||||
<label class="layui-form-label"><span class="required_icon"></span>所属项目</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="project" name="project" class="layui-select" lay-search
|
||||
lay-verify="required" style="height: 36px;"></select>
|
||||
style="height: 36px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 班组类型 -->
|
||||
|
|
|
|||
|
|
@ -78,6 +78,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;height: 100%;display: none;" id="projectDiv">
|
||||
<div class="layui-form-item" style="margin-top: 1%;display: flex;width: 100%">
|
||||
<label class="layui-form-label"><span class="required_icon"></span>所属项目</label>
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<select id="project" name="project" class="layui-select" lay-search
|
||||
style="height: 36px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
|
||||
style="display: none;"></button>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue