Compare commits

..

No commits in common. "3e14466911bbfb1ea25991bf2cb4ec3a7f182d05" and "4ec7bd6e9802a045f1fbfac0e6d5fae1a3f6d006" have entirely different histories.

4 changed files with 12 additions and 19 deletions

View File

@ -96,7 +96,7 @@ public class SupervisionUnitController extends BaseController {
* @param bean 监理单位实体 * @param bean 监理单位实体
* @return 结果 * @return 结果
*/ */
@PostMapping("/updateSupervisionUnitUser") @PutMapping("/updateSupervisionUnitUser")
@SysLog(title = "监理单位管理", businessType = OperaType.UPDATE, logType = 0, module = "外来单位管理->监理单位总监") @SysLog(title = "监理单位管理", businessType = OperaType.UPDATE, logType = 0, module = "外来单位管理->监理单位总监")
public AjaxResult updateSupervisionUnitUser(@Validated @RequestBody SupervisionUnit bean) { public AjaxResult updateSupervisionUnitUser(@Validated @RequestBody SupervisionUnit bean) {
try { try {

View File

@ -237,9 +237,10 @@ public class ProjectServiceImpl implements ProjectService {
result = projectMapper.addSupervisoryUnit(bean); result = projectMapper.addSupervisoryUnit(bean);
if (result > 0) { if (result > 0) {
// 抛出异常触发事务回滚 // 抛出异常触发事务回滚
TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
return AjaxResult.success("添加成功"); return AjaxResult.success("添加成功");
} }
TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
// 返回操作结果可能是插入的记录数或者其他标识 // 返回操作结果可能是插入的记录数或者其他标识
} catch (Exception e) { } catch (Exception e) {
// 手动进行回滚 // 手动进行回滚

View File

@ -401,7 +401,7 @@ public class SupervisionUnitServiceImpl implements SupervisionUnitService {
for (Long id:addressId){ for (Long id:addressId){
List<Project> list = suMapper.getSupProUserNum(id); List<Project> list = suMapper.getSupProUserNum(id);
if(StringUtils.isNotEmpty(list)){ if(StringUtils.isNotEmpty(list)){
return AjaxResult.error(list.get(0).getSupervisorUnit()+"存在工程信息,不允许删除"); return AjaxResult.success(list.get(0).getSupervisorUnit()+"存在工程信息,不允许删除");
} }
} }
} }

View File

@ -117,13 +117,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ( left join (
select count(1) num , sup_unit_id select count(1) num , sup_unit_id
from pt_project_info from pt_project_info
where sup_unit_id is not null and sup_unit_id!='' and is_active=1 where sup_unit_id is not null and sup_unit_id!=''
GROUP BY sup_unit_id GROUP BY sup_unit_id
)pro on pro.sup_unit_id=psi.id )pro on pro.sup_unit_id=psi.id
left join( left join(
select count(1) num ,unit_id select count(1) num ,unit_id
FROM pt_sup_info FROM pt_sup_info
where is_active=1
GROUP BY unit_id GROUP BY unit_id
)us on us.unit_id=psi.id )us on us.unit_id=psi.id
where psi.is_active = 1 where psi.is_active = 1
@ -133,23 +132,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="listSupervisionUnitUser" resultType="com.bonus.project.domain.SupervisionUnit"> <select id="listSupervisionUnitUser" resultType="com.bonus.project.domain.SupervisionUnit">
select (@rowNum := @rowNum + 1) as exportId, select (@rowNum := @rowNum + 1) as exportId,
sup_id supId, sup_id supId,
comm_user_id commUserId, comm_user_id commUserId,
comm_user_name directorsName, comm_user_name directorsName,
comm_user_phone directorsPhone, comm_user_phone directorsPhone,
comm_user_code commUserCode, comm_user_code commUserCode
IFNULL(pro.num,0) status
from (select @rowNum := 0) r, from (select @rowNum := 0) r,
pt_sup_info psi pt_sup_info
left join (
select count(1) num , sup_user_id
from pt_project_info
where sup_user_id is not null and sup_user_id!='' and is_active=1
GROUP BY sup_user_id
)pro on pro.sup_user_id=psi.sup_id
where is_active=1 and unit_id=#{unitId} where is_active=1 and unit_id=#{unitId}
<if test="directorsName != null and directorsName != ''"> <if test="directorsName != null and directorsName != ''">
and comm_user_name like concat('%',#{directorsName},'%') and comm_user_phone like concat('%',#{directorsName},'%')
</if> </if>
</select> </select>
<select id="listSupEntry" resultType="com.bonus.project.domain.SupervisionOfAdmission"> <select id="listSupEntry" resultType="com.bonus.project.domain.SupervisionOfAdmission">