监理人员新增删除按钮
This commit is contained in:
parent
b02599f3a1
commit
c55848200e
|
|
@ -12,6 +12,7 @@ import com.bonus.project.domain.SupervisionOfAdmission;
|
|||
import com.bonus.project.domain.SupervisorPerson;
|
||||
import com.bonus.project.service.SupervisionUnitService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -221,6 +222,9 @@ public class SupervisionUnitController extends BaseController {
|
|||
@SysLog(title = "监理管理", businessType = OperaType.INSERT,logType = 0,module = "监理管理->监理入场-监理人员删除",details = "监理入场-监理人员删除")
|
||||
public AjaxResult delSupervisoryPersonApply(@RequestBody SupervisorPerson supervisorPerson) {
|
||||
try{
|
||||
if (StringUtils.isBlank(supervisorPerson.getIdCard()) || StringUtils.isBlank(supervisorPerson.getPhone())){
|
||||
return error("删除失败,身份证号码和手机号不能为空");
|
||||
}
|
||||
return toAjax(suService.delSupervisoryPersonApply(supervisorPerson));
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
|
|
|
|||
|
|
@ -172,4 +172,8 @@ public interface SupervisionUnitMapper {
|
|||
Integer delUser(SupervisorPerson supervisorPerson);
|
||||
|
||||
Integer delPtSupPerson(SupervisorPerson supervisorPerson);
|
||||
|
||||
Integer getsupUserId(SupervisorPerson supervisorPerson);
|
||||
|
||||
Integer delLkSupPerson(SupervisorPerson supervisorPerson);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,9 +423,18 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
|
|||
// 删除监理人员信息(user表)
|
||||
Integer i = suMapper.delUser(supervisorPerson);
|
||||
if (i > 0) {
|
||||
Integer supUserId = suMapper.getsupUserId(supervisorPerson);
|
||||
// 删除监理人员信息(pt_sup_person表)
|
||||
Integer i1 = suMapper.delPtSupPerson(supervisorPerson);
|
||||
if (i1 > 0) {
|
||||
return suMapper.delPtSupPerson(supervisorPerson);
|
||||
supervisorPerson.setSupId(supUserId);
|
||||
// 删除监理人员信息(lk_sup_person表)
|
||||
Integer i2 = suMapper.delLkSupPerson(supervisorPerson);
|
||||
if (i2 > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
throw new RuntimeException("删除失败");
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("删除失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
if(sex = '0','男','女') as sex,
|
||||
age,
|
||||
phone,
|
||||
id_card as idCard,
|
||||
sdd.dict_label as postName,
|
||||
face_path as faceUrl
|
||||
from (select @rowNum := 0) r,pt_sup_person psp
|
||||
|
|
|
|||
|
|
@ -104,7 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from sys_user where id_card = #{idCard} and phonenumber = #{phone} and del_flag = '0'
|
||||
</delete>
|
||||
<delete id="delPtSupPerson">
|
||||
delete from pt_sup_person where id_card = #{idCard} and phonen = #{phone} and is_active = '1'
|
||||
delete from pt_sup_person where id_card = #{idCard} and phone = #{phone} and is_active = '1'
|
||||
</delete>
|
||||
<delete id="delLkSupPerson">
|
||||
delete from lk_sup_person where sup_persion_id = #{supId}
|
||||
</delete>
|
||||
|
||||
<select id="listSupervisionUnit" resultType="com.bonus.project.domain.SupervisionUnit">
|
||||
|
|
@ -219,5 +222,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from pt_sup_info
|
||||
where is_active=1 and unit_id=#{id}
|
||||
</select>
|
||||
<select id="getsupUserId" resultType="java.lang.Integer">
|
||||
select sup_user_id
|
||||
from pt_sup_person
|
||||
where id_card = #{idCard} and phone = #{phone}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue