联调问题
This commit is contained in:
parent
44c4bc3032
commit
f0a7dcd3cf
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -25,4 +25,6 @@ public interface PersonnelClassificationMapper {
|
|||
* 修改0:人员分类1:人员性质2:岗位列表
|
||||
*/
|
||||
int updateClassification(PersonnelClassificationVo personnelClassificationVo);
|
||||
|
||||
PersonnelClassificationVo getClassification(PersonnelClassificationVo personnelClassificationVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue