监理单位模块修改
This commit is contained in:
parent
3d161ee983
commit
44a96f1999
|
|
@ -83,6 +83,10 @@ public class SupervisoryUnit extends BaseBean {
|
|||
* 身份证
|
||||
*/
|
||||
private String directorsIdCard;
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String commUserCode;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,14 +155,14 @@
|
|||
<insert id="addSupervisoryUnit">
|
||||
insert into pt_sup_info(sup_name,
|
||||
sup_address, legal_name, legal_phone, sup_code, comm_user_id, comm_user_name,
|
||||
comm_user_phone,
|
||||
comm_user_phone,comm_user_code,
|
||||
create_user,
|
||||
create_id,
|
||||
uuid,
|
||||
create_time)
|
||||
values (#{unitName}, #{unitAddress}, #{corporateName}, #{corporatePhone}, #{socialUnifiedCreditCode}, #{id},
|
||||
#{directorsName},
|
||||
#{directorsPhone}, #{createPerson}, #{createPersonId}, #{uuid}, #{createTime})
|
||||
#{directorsPhone},#{directorsIdCard}, #{createPerson}, #{createPersonId}, #{uuid}, #{createTime})
|
||||
</insert>
|
||||
<insert id="insertEngineer">
|
||||
INSERT INTO pt_pro_address
|
||||
|
|
|
|||
|
|
@ -54,6 +54,24 @@ public class SupervisionUnitController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 总监
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("system:SupervisionUnit:list")
|
||||
@GetMapping("/listSupervisionUnitUser")
|
||||
@SysLog(title = "监理单位管理", businessType = OperaType.QUERY, logType = 0, module = "外来单位管理->监理单位管理", details = "查询监理单位列表")
|
||||
public TableDataInfo listSupervisionUnitUser(SupervisionUnit bean) {
|
||||
try {
|
||||
startPage();
|
||||
List<SupervisionUnit> list = suService.listSupervisionUnitUser(bean);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监理单位管理
|
||||
|
|
@ -65,13 +83,45 @@ public class SupervisionUnitController extends BaseController {
|
|||
@SysLog(title = "监理单位管理", businessType = OperaType.UPDATE, logType = 0, module = "外来单位管理->监理单位管理")
|
||||
public AjaxResult edit(@Validated @RequestBody SupervisionUnit bean) {
|
||||
try {
|
||||
return toAjax(suService.updateSupervisionUnit(bean));
|
||||
return suService.updateSupervisionUnit(bean);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监理单位管理
|
||||
*
|
||||
* @param bean 监理单位实体
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping("/updateSupervisionUnitUser")
|
||||
@SysLog(title = "监理单位管理", businessType = OperaType.UPDATE, logType = 0, module = "外来单位管理->监理单位总监")
|
||||
public AjaxResult updateSupervisionUnitUser(@Validated @RequestBody SupervisionUnit bean) {
|
||||
try {
|
||||
return suService.updateSupervisionUnitUser(bean);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
/**
|
||||
* 删除监理单位管理
|
||||
*
|
||||
* @param addressId 监理单位编号
|
||||
* @return 结果
|
||||
*/
|
||||
@DeleteMapping(value = "/delSupervisionUnitUser/{addressId}")
|
||||
@SysLog(title = "监理单位管理", businessType = OperaType.DELETE, logType = 0, module = "外来单位管理->监理单位管理")
|
||||
public AjaxResult delSupervisionUnitUser(@PathVariable Long[] addressId) {
|
||||
try {
|
||||
return suService.delSupervisionUnitUser(addressId);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
/**
|
||||
* 删除监理单位管理
|
||||
*
|
||||
|
|
@ -82,7 +132,7 @@ public class SupervisionUnitController extends BaseController {
|
|||
@SysLog(title = "监理单位管理", businessType = OperaType.DELETE, logType = 0, module = "外来单位管理->监理单位管理")
|
||||
public AjaxResult remove(@PathVariable Long[] addressId) {
|
||||
try {
|
||||
return toAjax(suService.deleteSupervisionUnitById(addressId));
|
||||
return suService.deleteSupervisionUnitById(addressId);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ public class SupervisionUnit extends BaseBean implements Serializable {
|
|||
@Excel(name = "监理单位名称")
|
||||
private String unitName;
|
||||
|
||||
private String userNum;
|
||||
|
||||
private String commUserCode;
|
||||
|
||||
/**
|
||||
* 监理单位地址
|
||||
*/
|
||||
|
|
@ -116,6 +120,7 @@ public class SupervisionUnit extends BaseBean implements Serializable {
|
|||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
private String intoStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.bonus.project.mapper;
|
||||
|
||||
import com.bonus.project.domain.Equipment;
|
||||
import com.bonus.project.domain.SupervisionUnit;
|
||||
import com.bonus.project.domain.SupervisorPerson;
|
||||
import com.bonus.project.domain.SupervisionOfAdmission;
|
||||
import com.bonus.project.domain.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -38,6 +36,8 @@ public interface SupervisionUnitMapper {
|
|||
*/
|
||||
int deleteSupervisionUnitById(Long[] addressId);
|
||||
|
||||
int delSupervisionUnitUser(Long[] addressId);
|
||||
|
||||
/**
|
||||
* 获取监理入场列表
|
||||
*
|
||||
|
|
@ -119,4 +119,53 @@ public interface SupervisionUnitMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
int updateSupIsExist(SupervisorPerson bean);
|
||||
|
||||
/**
|
||||
* 校验名称是否存在
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int getUnitNameById(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 查询供应商是否和工程关联
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Project> getSupProNum(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 修改用户名称
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int updateUnitUser(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 修改用户表数据
|
||||
* @param bean
|
||||
*/
|
||||
void updateUserInfo(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 修改工程表数据
|
||||
* @param bean
|
||||
*/
|
||||
void updateProUserInfo(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Project> getSupProUserNum(@Param("id") Long id);
|
||||
|
||||
List<SupervisionUnit> listSupervisionUnitUser(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int getUserMapper(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.project.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.project.domain.SupervisionUnit;
|
||||
import com.bonus.project.domain.SupervisionOfAdmission;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -19,6 +20,13 @@ public interface SupervisionUnitService {
|
|||
* @return 监理单位列表
|
||||
*/
|
||||
List<SupervisionUnit> listSupervisionUnit(SupervisionUnit bean);
|
||||
/**
|
||||
* 获取监理列表
|
||||
*
|
||||
* @param bean 监理单位实体
|
||||
* @return 监理单位列表
|
||||
*/
|
||||
List<SupervisionUnit> listSupervisionUnitUser(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 修改监理单位管理
|
||||
|
|
@ -26,7 +34,7 @@ public interface SupervisionUnitService {
|
|||
* @param bean 监理单位实体
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSupervisionUnit(SupervisionUnit bean);
|
||||
AjaxResult updateSupervisionUnit(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 删除监理单位管理
|
||||
|
|
@ -34,7 +42,7 @@ public interface SupervisionUnitService {
|
|||
* @param addressId 监理单位编号
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSupervisionUnitById(Long[] addressId);
|
||||
AjaxResult deleteSupervisionUnitById(Long[] addressId);
|
||||
|
||||
/**
|
||||
* 获取监理入场列表
|
||||
|
|
@ -63,4 +71,18 @@ public interface SupervisionUnitService {
|
|||
* @return 是否新增成功
|
||||
*/
|
||||
int addSupervisoryApply(MultipartFile[] enterpriseQualificationFiles, MultipartFile[] securityAgreementFiles, MultipartFile[] supervisionPlanningFiles, MultipartFile[] implementationRulesFiles, Map<String, String> allRequestParams);
|
||||
|
||||
/**
|
||||
* 修改监理单位人员
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updateSupervisionUnitUser(SupervisionUnit bean);
|
||||
|
||||
/**
|
||||
* 删除监理人员
|
||||
* @param addressId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult delSupervisionUnitUser(Long[] addressId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@ import com.bonus.common.core.domain.RequestEntity;
|
|||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StaticVariableUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.project.controller.GenericProcessor;
|
||||
import com.bonus.project.domain.Equipment;
|
||||
import com.bonus.project.domain.SupervisionUnit;
|
||||
import com.bonus.project.domain.SupervisorPerson;
|
||||
import com.bonus.project.domain.SupervisionOfAdmission;
|
||||
import com.bonus.project.domain.*;
|
||||
import com.bonus.project.mapper.CommonMapper;
|
||||
import com.bonus.project.mapper.SupervisionUnitMapper;
|
||||
import com.bonus.project.service.FlowTaskService;
|
||||
|
|
@ -58,7 +56,16 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
|
|||
public List<SupervisionUnit> listSupervisionUnit(SupervisionUnit bean) {
|
||||
return suMapper.listSupervisionUnit(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监理单位列表
|
||||
*
|
||||
* @param bean 监理单位实体
|
||||
* @return 监理单位列表
|
||||
*/
|
||||
@Override
|
||||
public List<SupervisionUnit> listSupervisionUnitUser(SupervisionUnit bean) {
|
||||
return suMapper.listSupervisionUnitUser(bean);
|
||||
}
|
||||
/**
|
||||
* 修改监理单位管理
|
||||
*
|
||||
|
|
@ -66,8 +73,16 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSupervisionUnit(SupervisionUnit bean) {
|
||||
return suMapper.updateSupervisionUnit(bean);
|
||||
public AjaxResult updateSupervisionUnit(SupervisionUnit bean) {
|
||||
int isActive= suMapper.getUnitNameById(bean);
|
||||
if(isActive>0){
|
||||
return AjaxResult.error("监理单位名称已存在");
|
||||
}
|
||||
int num= suMapper.updateSupervisionUnit(bean);
|
||||
if(num>0){
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -77,9 +92,27 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSupervisionUnitById(Long[] addressId) {
|
||||
return suMapper.deleteSupervisionUnitById(addressId);
|
||||
public AjaxResult deleteSupervisionUnitById(Long[] addressId) {
|
||||
for (Long id : addressId) {
|
||||
List<Project> list = suMapper.getSupProNum(id);
|
||||
if (StringUtils.isNotEmpty(list)) {
|
||||
return AjaxResult.success(list.get(0).getSupervisorUnit() + "存在工程信息,不允许删除");
|
||||
}
|
||||
int userNum=suMapper.getUserMapper(id);
|
||||
if(userNum>0){
|
||||
return AjaxResult.success(list.get(0).getSupervisorUnit() + "该监理下存在总监,不允许删除");
|
||||
}
|
||||
}
|
||||
|
||||
int num= suMapper.deleteSupervisionUnitById(addressId);
|
||||
if(num>0){
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取监理入场列表
|
||||
|
|
@ -336,6 +369,50 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
|
|||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改监理单位人员
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateSupervisionUnitUser(SupervisionUnit bean) {
|
||||
try{
|
||||
int num=suMapper.updateUnitUser(bean);
|
||||
if(num>0){
|
||||
suMapper.updateUserInfo(bean);
|
||||
suMapper.updateProUserInfo(bean);
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监理人员数据
|
||||
* @param addressId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult delSupervisionUnitUser(Long[] addressId) {
|
||||
if(addressId.length>0){
|
||||
for (Long id:addressId){
|
||||
List<Project> list = suMapper.getSupProUserNum(id);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
return AjaxResult.success(list.get(0).getSupervisorUnit()+"存在工程信息,不允许删除");
|
||||
}
|
||||
}
|
||||
}
|
||||
int num= suMapper.delSupervisionUnitUser(addressId);
|
||||
if(num>0){
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
return AjaxResult.error("删除失败");
|
||||
|
||||
}
|
||||
|
||||
private int qualificationMaterialsFile(@NotNull String filePath, int proId,
|
||||
long fileSize, String fromType,
|
||||
String informationType, String uuid) {
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
<insert id="addSupervisoryUnit">
|
||||
insert into pt_sup_info
|
||||
(sup_name, unit_id,unit_uuid, sup_address, legal_name, legal_phone, sup_code, comm_user_id, comm_user_name,
|
||||
comm_user_phone, create_user, create_id, uuid, create_time)
|
||||
comm_user_phone, comm_user_code,create_user, create_id, uuid, create_time)
|
||||
values (#{unitName}, #{jlId},#{jlUuid},#{unitAddress}, #{corporateName}, #{corporatePhone}, #{socialUnifiedCreditCode}, #{id},
|
||||
#{directorsName}, #{directorsPhone}, #{createPerson}, #{createPersonId}, #{uuid}, #{createTime})
|
||||
#{directorsName}, #{directorsPhone}, #{directorsIdCard},#{createPerson}, #{createPersonId}, #{uuid}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<insert id="addSupervisoryUnitUser" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
values(#{id}, #{roleId})
|
||||
</insert>
|
||||
<update id="updateSupervisionUnit">
|
||||
update pt_sup_info
|
||||
update pt_sup_info_data
|
||||
set sup_name = #{unitName},
|
||||
sup_address = #{unitAddress},
|
||||
legal_name = #{corporateName},
|
||||
legal_phone = #{corporatePhone},
|
||||
sup_code = #{socialUnifiedCreditCode}
|
||||
where sup_id = #{supId}
|
||||
where id = #{supId}
|
||||
</update>
|
||||
<update id="updateLinkRelation">
|
||||
update lk_pro_sup
|
||||
|
|
@ -72,7 +72,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
set is_exist_file = '1'
|
||||
where uuid = #{uuid}
|
||||
</update>
|
||||
<update id="updateUnitUser">
|
||||
update pt_sup_info
|
||||
set comm_user_name=#{directorsName}
|
||||
where sup_id=#{supId}
|
||||
</update>
|
||||
<update id="updateUserInfo">
|
||||
update sys_user
|
||||
set nick_name=#{directorsName}
|
||||
where user_id=#{commUserId}
|
||||
</update>
|
||||
<update id="updateProUserInfo">
|
||||
update pt_project_info
|
||||
set sup_user_name=#{directorsName}
|
||||
where sup_user_id=#{supId}
|
||||
|
||||
</update>
|
||||
<delete id="deleteSupervisionUnitById">
|
||||
update pt_sup_info_data set is_active = '0' where id in
|
||||
<foreach item="addressId" collection="array" open="(" separator="," close=")">
|
||||
#{addressId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delSupervisionUnitUser">
|
||||
update pt_sup_info set is_active = '0' where sup_id in
|
||||
<foreach item="addressId" collection="array" open="(" separator="," close=")">
|
||||
#{addressId}
|
||||
|
|
@ -81,26 +103,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="listSupervisionUnit" resultType="com.bonus.project.domain.SupervisionUnit">
|
||||
select (@rowNum := @rowNum + 1) as exportId,
|
||||
psi.sup_id as supId,
|
||||
psi.id as supId,
|
||||
psi.uuid as supUuid,
|
||||
psi.sup_name as unitName,
|
||||
psi.sup_address as unitAddress,
|
||||
psi.legal_name as corporateName,
|
||||
psi.legal_phone as corporatePhone,
|
||||
psi.sup_code as socialUnifiedCreditCode,
|
||||
psi.comm_user_id as commUserId,
|
||||
psi.comm_user_name as directorsName,
|
||||
psi.comm_user_phone as directorsPhone,
|
||||
ifnull(lps.sup_uuid,0) as status
|
||||
from (select @rowNum := 0) r,pt_sup_info psi
|
||||
IFNULL(us.num ,0) userNum,
|
||||
IFNULL(pro.num ,0) status
|
||||
from (select @rowNum := 0) r,
|
||||
pt_sup_info_data psi
|
||||
left join (
|
||||
select DISTINCT sup_uuid from lk_pro_sup
|
||||
) lps on psi.uuid = lps.sup_uuid
|
||||
select count(1) num , sup_unit_id
|
||||
from pt_project_info
|
||||
where sup_unit_id is not null and sup_unit_id!=''
|
||||
GROUP BY sup_unit_id
|
||||
)pro on pro.sup_unit_id=psi.id
|
||||
left join(
|
||||
select count(1) num ,unit_id
|
||||
FROM pt_sup_info
|
||||
GROUP BY unit_id
|
||||
)us on us.unit_id=psi.id
|
||||
where psi.is_active = 1
|
||||
<if test="unitName != null and unitName != ''">
|
||||
and psi.sup_name like concat('%',#{unitName},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="listSupervisionUnitUser" resultType="com.bonus.project.domain.SupervisionUnit">
|
||||
select (@rowNum := @rowNum + 1) as exportId,
|
||||
sup_id supId,
|
||||
comm_user_id commUserId,
|
||||
comm_user_name directorsName,
|
||||
comm_user_phone directorsPhone,
|
||||
comm_user_code commUserCode
|
||||
from (select @rowNum := 0) r,
|
||||
pt_sup_info
|
||||
where is_active=1 and unit_id=#{unitId}
|
||||
<if test="directorsName != null and directorsName != ''">
|
||||
and comm_user_phone like concat('%',#{directorsName},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="listSupEntry" resultType="com.bonus.project.domain.SupervisionOfAdmission">
|
||||
SELECT
|
||||
psi.sup_id as supId,
|
||||
|
|
@ -141,4 +184,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getRoleId" resultType="java.lang.String">
|
||||
select role_id from sys_role where role_key = 'sup_person' and del_flag = '0'
|
||||
</select>
|
||||
<select id="getUnitNameById" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from pt_sup_info_data
|
||||
where is_active=1 and id!=#{supId} and sup_name=#{supName}
|
||||
|
||||
</select>
|
||||
<select id="getSupProNum" resultType="com.bonus.project.domain.Project">
|
||||
select pro_id proId,sup_unit_name supervisorUnit
|
||||
from pt_project_info
|
||||
where is_active=1 and sup_unit_id=#{id}
|
||||
</select>
|
||||
<select id="getSupProUserNum" resultType="com.bonus.project.domain.Project">
|
||||
select pro_id proId,sup_user_name supervisorUnit
|
||||
from pt_project_info
|
||||
where is_active=1 and sup_user_id=#{id}
|
||||
</select>
|
||||
<select id="getUserMapper" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from pt_sup_info
|
||||
where is_active=1 and unit_id=#{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue