bug修复
This commit is contained in:
parent
efdb0f0636
commit
50492b9fe2
|
|
@ -55,4 +55,6 @@ public interface PersonDao {
|
||||||
int deletePersonById(String id);
|
int deletePersonById(String id);
|
||||||
|
|
||||||
void updateOldUser(@Param("list")List<PersonBean> list);
|
void updateOldUser(@Param("list")List<PersonBean> list);
|
||||||
|
|
||||||
|
Integer getPerSonByPhone(PersonBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,6 @@ public interface ProjectDao {
|
||||||
int getProjectByName(ProjectBean projectBean);
|
int getProjectByName(ProjectBean projectBean);
|
||||||
|
|
||||||
Integer getTeamGroup(ProjectBean bean);
|
Integer getTeamGroup(ProjectBean bean);
|
||||||
|
|
||||||
|
int getProIsExistByDepartmentId(OrganizationalBean bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean;
|
||||||
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamEvaluateBean;
|
import com.bonus.gs.sub.evaluate.evaluate.beans.TeamEvaluateBean;
|
||||||
import com.bonus.gs.sub.evaluate.evaluate.controller.OrganizationalController;
|
import com.bonus.gs.sub.evaluate.evaluate.controller.OrganizationalController;
|
||||||
import com.bonus.gs.sub.evaluate.evaluate.dao.OrganizationalDao;
|
import com.bonus.gs.sub.evaluate.evaluate.dao.OrganizationalDao;
|
||||||
|
import com.bonus.gs.sub.evaluate.evaluate.dao.ProjectDao;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.CipherHelper;
|
import com.bonus.gs.sub.evaluate.manager.utils.CipherHelper;
|
||||||
import com.bonus.gs.sub.evaluate.manager.utils.StringHelper;
|
import com.bonus.gs.sub.evaluate.manager.utils.StringHelper;
|
||||||
|
|
@ -29,6 +30,8 @@ public class OrganizationalServiceImpl implements OrganizationalService {
|
||||||
private static final Logger logger = Logger.getLogger(String.valueOf(OrganizationalController.class));
|
private static final Logger logger = Logger.getLogger(String.valueOf(OrganizationalController.class));
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrganizationalDao mapper;
|
private OrganizationalDao mapper;
|
||||||
|
@Autowired
|
||||||
|
private ProjectDao projectDao;
|
||||||
public static String DEFEAT_P_ID = "0";
|
public static String DEFEAT_P_ID = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -125,17 +128,18 @@ public class OrganizationalServiceImpl implements OrganizationalService {
|
||||||
ar.setFailMsg("该班组名称已存在");
|
ar.setFailMsg("该班组名称已存在");
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
// String pwrs = "gsks@123";// 随机密码,以后发邮箱
|
|
||||||
// String pwrsMD5 = CipherHelper.generatePassword(pwrs);// 第一次加密md5,
|
|
||||||
// String salt = CipherHelper.createSalt();
|
|
||||||
// bean.setSalt(salt);
|
|
||||||
// bean.setPassword(pwrsMD5);
|
|
||||||
} else if (bean.getLevel() == 4) {
|
} else if (bean.getLevel() == 4) {
|
||||||
int count = mapper.getConsIsExistByPro(bean);
|
int count = mapper.getConsIsExistByPro(bean);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
ar.setFailMsg("该承包商在此项目下已存在");
|
ar.setFailMsg("该承包商在此项目下已存在");
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
} else if (bean.getLevel() == 3) {
|
||||||
|
int count = projectDao.getProIsExistByDepartmentId(bean);
|
||||||
|
if (count > 0) {
|
||||||
|
ar.setFailMsg("该项目在该事业部下已存在");
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int num = mapper.addData(bean);
|
int num = mapper.addData(bean);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,19 @@ public class PersonServiceImpl implements PersonService {
|
||||||
personBean.setDeptId(StringUtils.isBlank(personBean.getDeptId()) ? "0" : personBean.getDeptId());
|
personBean.setDeptId(StringUtils.isBlank(personBean.getDeptId()) ? "0" : personBean.getDeptId());
|
||||||
});
|
});
|
||||||
for (PersonBean personBean : list) {
|
for (PersonBean personBean : list) {
|
||||||
dao.addPersonInfo(personBean);
|
Integer num = dao.getPerSonByPhone(personBean);
|
||||||
|
if (num > 0) {
|
||||||
|
ar.setFailMsg("该手机号已存在");
|
||||||
|
return ar;
|
||||||
|
} else {
|
||||||
|
dao.addPersonInfo(personBean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dao.addPersonRole(list);
|
dao.addPersonRole(list);
|
||||||
dao.updateOldUser(list);
|
dao.updateOldUser(list);
|
||||||
ar.setSucceed(GlobalConst.SAVE_SUCCEED);
|
ar.setSucceed(GlobalConst.SAVE_SUCCEED);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(), e);
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
ar.setFailMsg("添加失败");
|
ar.setFailMsg("添加失败");
|
||||||
}
|
}
|
||||||
|
|
@ -69,6 +75,12 @@ public class PersonServiceImpl implements PersonService {
|
||||||
public AjaxRes updatePerson(PersonBean o) {
|
public AjaxRes updatePerson(PersonBean o) {
|
||||||
AjaxRes ar = new AjaxRes();
|
AjaxRes ar = new AjaxRes();
|
||||||
try {
|
try {
|
||||||
|
// 先查询该人员手机号是否有重复
|
||||||
|
Integer count = dao.getPerSonByPhone(o);
|
||||||
|
if (count > 0) {
|
||||||
|
ar.setFailMsg("该手机号已存在");
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
o.setDeptId(StringUtils.isBlank(o.getDeptId()) ? "0" : o.getDeptId());
|
o.setDeptId(StringUtils.isBlank(o.getDeptId()) ? "0" : o.getDeptId());
|
||||||
dao.deletePersonRole(o.getId());
|
dao.deletePersonRole(o.getId());
|
||||||
dao.updatePerson(o);
|
dao.updatePerson(o);
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,9 @@
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getPerSonByPhone" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from sys_user
|
||||||
|
where phone = #{phone}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -130,4 +130,15 @@
|
||||||
poi.STATUS = 1
|
poi.STATUS = 1
|
||||||
AND poi3.id = #{id}
|
AND poi3.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getProIsExistByDepartmentId" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
count(*)
|
||||||
|
FROM
|
||||||
|
pm_org_info poi
|
||||||
|
left join pm_org_info poi2 on poi2.id = poi.parent_id
|
||||||
|
WHERE
|
||||||
|
poi.name = #{name} and poi2.id = #{parentId}
|
||||||
|
AND poi.level = 3
|
||||||
|
AND poi.status = 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ function add() {
|
||||||
|
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: "新增企业",
|
title: "新增人员",
|
||||||
content: "./EvaluatePersonAdd.html?id=0",
|
content: "./EvaluatePersonAdd.html?id=0",
|
||||||
btn: ["确定"],
|
btn: ["确定"],
|
||||||
maxmin: false,
|
maxmin: false,
|
||||||
|
|
|
||||||
|
|
@ -92,14 +92,14 @@ var Base64 = {
|
||||||
// var filePreviewPath = "http://36.33.26.201:21624/GsSubEvaluate/statics/";
|
// var filePreviewPath = "http://36.33.26.201:21624/GsSubEvaluate/statics/";
|
||||||
var filePreviewPath = "http://192.168.0.14:1803/GsSubEvaluate/statics/"; // 测试环境
|
var filePreviewPath = "http://192.168.0.14:1803/GsSubEvaluate/statics/"; // 测试环境
|
||||||
|
|
||||||
// var filePreviewPath = "http://112.29.103.165:1618/GsSubEvaluate/statics/"; // 生产环境
|
// var filePreviewPath = "http://192.168.1.3:1803/GsSubEvaluate/statics/"; // 生产环境
|
||||||
|
|
||||||
|
|
||||||
// var filePreviewPath = "http://127.0.0.1:1803/GsSubEvaluate/statics/";
|
// var filePreviewPath = "http://127.0.0.1:1803/GsSubEvaluate/statics/";
|
||||||
// var filePreviewPath = "http://192.168.0.2:1803/GsSubEvaluate/statics/";
|
// var filePreviewPath = "http://192.168.0.2:1803/GsSubEvaluate/statics/";
|
||||||
|
|
||||||
var filePreviewPathAll = "http://192.168.0.14:8012/onlinePreview?url="; // 测试环境
|
var filePreviewPathAll = "http://192.168.0.14:8012/onlinePreview?url="; // 测试环境
|
||||||
// var filePreviewPathAll = "http://112.29.103.165:8012/onlinePreview?url="; // 生产环境
|
// var filePreviewPathAll = "http://192.168.1.3:8012/onlinePreview?url="; // 生产环境
|
||||||
|
|
||||||
function filePreview(url) {
|
function filePreview(url) {
|
||||||
let path;
|
let path;
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@
|
||||||
layer.msg('修改成功', {icon: 1});
|
layer.msg('修改成功', {icon: 1});
|
||||||
closePage();
|
closePage();
|
||||||
} else {
|
} else {
|
||||||
layer.msg(data.msg, {icon: 2});
|
layer.msg(data.resMsg, {icon: 2});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue