联调问题

This commit is contained in:
马三炮 2025-12-26 16:01:11 +08:00
parent 44c4bc3032
commit f0a7dcd3cf
7 changed files with 30 additions and 3 deletions

View File

@ -51,8 +51,10 @@ public class PersonnelClassificationController extends BaseController {
{
try {
int res = personnelClassificationService.addClassification(personnelClassificationVo);
if (res > 0) {
if (res == 1) {
return AjaxResult.success();
} else if (res == 2) {
return AjaxResult.error("名称已经存在");
}else {
return AjaxResult.error("新增失败");
}
@ -93,9 +95,12 @@ public class PersonnelClassificationController extends BaseController {
{
try {
int res = personnelClassificationService.updateClassification(personnelClassificationVo);
if (res > 0) {
if (res == 1) {
return AjaxResult.success();
}else {
}else if (res == 2) {
return AjaxResult.error("名称已经存在");
}
else {
return AjaxResult.error("修改失败");
}
}catch (Exception e) {

View File

@ -25,4 +25,6 @@ public interface PersonnelClassificationMapper {
* 修改0人员分类1人员性质2岗位列表
*/
int updateClassification(PersonnelClassificationVo personnelClassificationVo);
PersonnelClassificationVo getClassification(PersonnelClassificationVo personnelClassificationVo);
}

View File

@ -40,6 +40,7 @@ public class InspectionStationServiceImpl implements InspectionStationService {
Long userId = SecurityUtils.getUserId();
inspectionStationVo.setCreateUser(userId.toString());
inspectionStationVo.setCreateTime(new Date());
//查看是否存在同名的
InspectionStationVo res = inspectionStationMapper.getInspectionStation(inspectionStationVo);
if (res != null) {
return 2;
@ -63,6 +64,7 @@ public class InspectionStationServiceImpl implements InspectionStationService {
Long userId = SecurityUtils.getUserId();
inspectionStationVo.setUpdateUser(userId.toString());
inspectionStationVo.setUpdateTime(new Date());
//查看是否存在修改过后同名的
InspectionStationVo res = inspectionStationMapper.getInspectionStation(inspectionStationVo);
if (res != null && inspectionStationVo.getInspectionStationId()!=res.getInspectionStationId()) {
return 2;

View File

@ -46,6 +46,11 @@ public class PersonnelClassificationServiceImpl implements PersonnelClassificati
Long userId = SecurityUtils.getUserId();
personnelClassificationVo.setCreateUser(userId.toString());
personnelClassificationVo.setCreateTime(new Date());
//查看新增是否存在
PersonnelClassificationVo res = personnelClassificationMapper.getClassification(personnelClassificationVo);
if (res != null) {
return 2;
}
return personnelClassificationMapper.addClassification(personnelClassificationVo);
}
@ -69,6 +74,11 @@ public class PersonnelClassificationServiceImpl implements PersonnelClassificati
Long userId = SecurityUtils.getUserId();
personnelClassificationVo.setUpdateUser(userId.toString());
personnelClassificationVo.setUpdateTime(new Date());
//查看新增是否存在
PersonnelClassificationVo res = personnelClassificationMapper.getClassification(personnelClassificationVo);
if (res != null && personnelClassificationVo.getPersonnelClassificationId() != res.getPersonnelClassificationId()) {
return 2;
}
return personnelClassificationMapper.updateClassification(personnelClassificationVo);
}
}

View File

@ -43,6 +43,7 @@ public class PlanMajorServiceImpl implements PlanMajorService {
Long userId = SecurityUtils.getUserId();
planMajorVo.setCreateUser(userId.toString());
planMajorVo.setCreateTime(new Date());
return planMajorMapper.addPlanMajor(planMajorVo);
}

View File

@ -7,6 +7,7 @@
<insert id="addMonthlyPlan">
INSERT INTO tb_day_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monthlyPlanId != null and monthlyPlanId != ''">monthly_plan_id,</if>
<if test="dayPlan != null and dayPlan != ''">day_plan,</if>
<if test="plannedWorkload != null and plannedWorkload != ''">planned_workload,</if>
<if test="proposedPersonnel != null and proposedPersonnel != ''">proposed_personnel,</if>
@ -35,6 +36,7 @@
<if test="riskLevel != null and riskLevel != ''">risk_level,</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="monthlyPlanId != null and monthlyPlanId != ''">#{monthlyPlanId},</if>
<if test="dayPlan != null and dayPlan != ''">#{dayPlan},</if>
<if test="plannedWorkload != null and plannedWorkload != ''">#{plannedWorkload},</if>
<if test="proposedPersonnel != null and proposedPersonnel != ''">#{proposedPersonnel},</if>

View File

@ -37,4 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and personnel_classification_name like concat('%',#{personnelClassificationName},'%')
</if>
</select>
<select id="getClassification" resultType="com.bonus.digital.dao.PersonnelClassificationVo">
select personnel_classification_id,personnel_classification_name,remark,category
from tb_personnel_classification where category = #{category} and is_active = '1'
and personnel_classification_name = #{personnelClassificationName}
</select>
</mapper>