联调问题

This commit is contained in:
马三炮 2025-12-29 13:35:17 +08:00
parent 82372b7f2d
commit 14fead47ea
3 changed files with 11 additions and 1 deletions

View File

@ -141,8 +141,10 @@ public class PersonnelController extends BaseController {
public AjaxResult updatePersonnel(@RequestBody PersonnelVo personnelVo) { public AjaxResult updatePersonnel(@RequestBody PersonnelVo personnelVo) {
try { try {
int res = personnelService.updatePersonnel(personnelVo); int res = personnelService.updatePersonnel(personnelVo);
if (res > 0) { if (res ==1) {
return AjaxResult.success(); return AjaxResult.success();
} else if (res ==2) {
return AjaxResult.error("手机号已存在");
} else { } else {
return AjaxResult.error("修改失败"); return AjaxResult.error("修改失败");
} }

View File

@ -72,6 +72,13 @@ public class PersonnelServiceImpl implements PersonnelService {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
personnelVo.setUpdateUser(userId.toString()); personnelVo.setUpdateUser(userId.toString());
personnelVo.setUpdateTime(new Date()); personnelVo.setUpdateTime(new Date());
if (StringUtils.isNotEmpty(personnelVo.getPhone())){
//判断该手机号是否存在
PersonnelVo personnelV = personnelMapper.getPersonnelListByPhone(personnelVo);
if (personnelV != null){
return 2;
}
}
return personnelMapper.updatePersonnel(personnelVo); return personnelMapper.updatePersonnel(personnelVo);
} }

View File

@ -121,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select personnel_classification_id as id, select personnel_classification_id as id,
name as name name as name
from tb_personnel where is_active = '1' and phone =#{phone} from tb_personnel where is_active = '1' and phone =#{phone}
and inspection_station_id= #{inspectionStationId}
</select> </select>
<select id="getPersonnelByInspection" resultType="com.bonus.digital.dao.PersonnelVo"> <select id="getPersonnelByInspection" resultType="com.bonus.digital.dao.PersonnelVo">
select tis.id, select tis.id,