bug修复

This commit is contained in:
liang.chao 2025-07-10 17:59:06 +08:00
parent 50492b9fe2
commit 40a0ca3db8
9 changed files with 60 additions and 10 deletions

View File

@ -38,5 +38,6 @@ public class TeamGroupBean {
private String faceUrl;
private String isTeamLeader;
private Integer teamId;
private Integer userId;
}

View File

@ -72,6 +72,19 @@ public class TeamGroupController extends BaseController<TeamGroupBean> {
return ar;
}
@PostMapping("updaTeteamGroup")
public AjaxRes updaTeteamGroup(@RequestBody TeamGroupBean teamGroupBean) {
AjaxRes ar = new AjaxRes();
try {
teamGroupService.updaTeteamGroup(teamGroupBean);
ar.setSucceedMsg("修改成功");
return ar;
} catch (Exception e) {
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
// 获取班组人员
@GetMapping("getTeamGroupPerson")
public AjaxRes getTeamGroupPerson(TeamGroupBean teamGroupBean) {
@ -213,7 +226,7 @@ public class TeamGroupController extends BaseController<TeamGroupBean> {
@RequestMapping(value = "importTeamPerson", method = RequestMethod.POST)
@ResponseBody
public AjaxRes importTeamPerson(@RequestParam String id, @RequestParam("file") MultipartFile file) {
return teamGroupService.importTeamPerson(id,file);
return teamGroupService.importTeamPerson(id, file);
}
}

View File

@ -137,7 +137,7 @@ public class OrganizationalServiceImpl implements OrganizationalService {
} else if (bean.getLevel() == 3) {
int count = projectDao.getProIsExistByDepartmentId(bean);
if (count > 0) {
ar.setFailMsg("该项目在事业部下已存在");
ar.setFailMsg("该项目在事业部下已存在");
return ar;
}
}

View File

@ -479,7 +479,9 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
BeanUtils.copyProperties(o, childBean);
childBean.setJsonData(list.get(i).toString());
childBean.setDeptId(deptId);
childBean.setUserId(userId);
if (!checkMapValuesAllEmpty(list.get(i))){
childBean.setUserId(userId);
}
childBean.setParentId(o.getId());
childBean.setProId(list.get(i).get("proId").toString());
childBean.setProName(list.get(i).get("proName").toString());
@ -499,7 +501,9 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
detailsBean.setEvaluateId(o.getEvaluateId());
detailsBean.setTemplateId(o.getTemplateId());
detailsBean.setDeptId(deptId);
detailsBean.setUserId(userId);
if (!checkMapValuesAllEmpty(map)){
detailsBean.setUserId(userId);
}
detailsBean.setParentId(o.getId());
detailsBean.setProId(map.get("proId").toString());
detailsBean.setProName(map.get("proName").toString());
@ -526,6 +530,33 @@ public class OutsourcerEvaluateServiceImpl implements OutsourcerEvaluateService
return ar;
}
public static boolean checkMapValuesAllEmpty(Map<String, Object> map) {
if (map == null || map.isEmpty()) {
return true; // 空map认为所有值都是空
}
for (Object value : map.values()) {
if (value == null) {
continue; // null 是空值继续检查下一个
}
if (value instanceof String) {
String strVal = (String) value;
if (!strVal.trim().isEmpty()) {
return false; // 发现非空字符串立即返回 false
}
} else if (value instanceof Boolean) {
return false; // boolean 类型true/false不为空
} else if (value instanceof Number) {
return false; // 数字类型0 也是有效值
} else {
// 其他对象只要不为null就认为是非空
return false;
}
}
return true; // 所有值都为空
}
@Override
public AjaxRes getAuditBtn(EvaluateDataBean o) {
AjaxRes ar = new AjaxRes();

View File

@ -170,7 +170,7 @@
org_type orgType
FROM pm_org_info
WHERE status = 1
AND level in (1, 2)
-- AND level in (1, 2)
</select>
<select id="getDataDetails" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean">
select id,
@ -294,6 +294,7 @@
poi.STATUS = 1
AND poi.LEVEL = 4
AND poi.lk_id = #{id}
AND poi2.id IS NOT NULL
</select>
<select id="getTeamGroupType" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean">
select id,

View File

@ -832,7 +832,7 @@
from
pj_evaluate_details_child
where
evaluate_id = #{evaluateId} and post_id = #{deptId} and details_id = #{detailsId} and (score is null or score = '')
evaluate_id = #{evaluateId} and post_id = #{deptId} and details_id = #{detailsId} and score is null
</select>
<update id="updateEvaluateRecordByEvaluateId">

View File

@ -43,6 +43,7 @@
SELECT
poi2.NAME subContractor,
poi3.NAME project,
poi3.user_id as userId,
poi.NAME teamGroupName,
poi.id as id,
poi.status as status,

View File

@ -101,8 +101,10 @@ function initTreeTable() {
let html = "";
html +=
'<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 15px" id="edit">修改</a>';
html +=
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px" id="del">删除</a>';
if (d.roleName !== "项目经理"){
html +=
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px;margin-left: 10px" id="del">删除</a>';
}
return html;
},
},

View File

@ -1,11 +1,12 @@
// 专责审批 js文件
let layer, laydate, table, form;
let layer, laydate, table, form, loginUser;
$(function () {
layui.use(["layer", "laydate", "table", "form"], function () {
layer = layui.layer;
laydate = layui.laydate;
form = layui.form;
table = layui.table;
loginUser = JSON.parse(localStorage.getItem("loginUser"));
laydate.render({
elem: "#startDate",
type: "month",
@ -135,7 +136,7 @@ function initTable() {
'<a lay-event="del" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' +
' id="del">删除</a>';
if (d.status == 1) {
if (d.status == 1 && loginUser.id === d.userId) {
text +=
'<a lay-event="exit" style="color: #009688;cursor: pointer;font-size:' +
' 15px;margin-left: 10px"' +