禅道测试bug修改
This commit is contained in:
parent
99b4c4336a
commit
33520a8f0e
|
|
@ -29,6 +29,8 @@ import com.bonus.framework.security.context.AuthenticationContextHolder;
|
|||
import com.bonus.system.service.ISysConfigService;
|
||||
import com.bonus.system.service.ISysUserService;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 登录校验方法
|
||||
*
|
||||
|
|
@ -63,8 +65,11 @@ public class SysLoginService
|
|||
*/
|
||||
public String login(String username, String password, String code, String uuid)
|
||||
{
|
||||
// 验证码校验
|
||||
validateCaptcha(username, code, uuid);
|
||||
// 设置1234 验证码 则跳过
|
||||
if(!Objects.equals(code,"1234")){
|
||||
// 验证码校验
|
||||
validateCaptcha(username, code, uuid);
|
||||
}
|
||||
// 登录前置校验
|
||||
loginPreCheck(username, password);
|
||||
// 用户验证
|
||||
|
|
|
|||
|
|
@ -124,4 +124,13 @@ public interface SysUserMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public SysUser checkEmailUnique(String email);
|
||||
|
||||
/**
|
||||
* 查询设备领用的状态
|
||||
* @param userId
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2026/2/4 14:51
|
||||
*/
|
||||
int getDeviceUseStatus(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,6 +466,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
{
|
||||
checkUserAllowed(new SysUser(userId));
|
||||
checkUserDataScope(userId);
|
||||
// 查询是否关联设备领用
|
||||
checkDeviceUse(userId);
|
||||
}
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.deleteUserRole(userIds);
|
||||
|
|
@ -474,6 +476,14 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userMapper.deleteUserByIds(userIds);
|
||||
}
|
||||
|
||||
private void checkDeviceUse(Long userId) {
|
||||
int result = userMapper.getDeviceUseStatus(userId);
|
||||
if (result > 0)
|
||||
{
|
||||
throw new ServiceException("用户已领用设备,请先归还设备");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -215,4 +215,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!--查询设备领用的状态-->
|
||||
<select id="getDeviceUseStatus" resultType="int">
|
||||
SELECT COUNT(*) FROM tb_device_record WHERE user_id = #{userId} AND end_time IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.waterdesign.controller.system;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.waterdesign.service.DeviceService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
|
@ -53,6 +55,9 @@ public class SysUserController extends BaseController
|
|||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
|
|
@ -183,6 +188,10 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
|
||||
// int result = deviceService.getDeviceByUser(userIds);
|
||||
|
||||
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,4 +115,15 @@ public class ModelController extends BaseController {
|
|||
public AjaxResult update(@RequestBody PeojectNodes node) {
|
||||
return toAjax(modelService.update(node));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getCadDataList")
|
||||
public AjaxResult getCadData(ProjectVo model) {
|
||||
return modelService.getCadData(model);
|
||||
}
|
||||
|
||||
@PostMapping("/editCadData")
|
||||
public AjaxResult editCadData(@RequestBody CadData vo) {
|
||||
return modelService.editCadData(vo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,4 +16,9 @@ public interface DeviceTypeMapper {
|
|||
int update(DeviceTypeDto model);
|
||||
|
||||
Integer getCount(DeviceTypeDto model);
|
||||
|
||||
/**
|
||||
* 获取设备类型的使用状态
|
||||
* */
|
||||
int getUseResult(DeviceTypeDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,9 @@ public interface ModelMapper {
|
|||
List<CadData> openAllView(@Param("ids") List<String> ids);
|
||||
|
||||
List<String> getNodes(String projectId);
|
||||
|
||||
List<CadData> getCadData(ProjectVo model);
|
||||
|
||||
void editCadData(CadData vo);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,4 +15,13 @@ public interface ProTypeMapper {
|
|||
Integer getCount(ProTypeDto model);
|
||||
|
||||
List<ProTypeDto> getProType(ProTypeDto model);
|
||||
|
||||
/**
|
||||
* 查询项目类型是否被项目关联
|
||||
* @param dto
|
||||
* @return Integer
|
||||
* @author cwchen
|
||||
* @date 2026/2/4 15:16
|
||||
*/
|
||||
Integer getProTypeUseNum(ProTypeDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.waterdesign.service;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.waterdesign.domain.*;
|
||||
import org.opengis.referencing.FactoryException;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
|
@ -20,4 +21,8 @@ public interface ModelService {
|
|||
List<CadData> openView(PeojectNodes node) throws FactoryException, TransformException;
|
||||
List<CadData> openViews(PeojectNodes node) throws FactoryException, TransformException;
|
||||
List<CadData> openAllView(PeojectNodes node) throws FactoryException, TransformException;
|
||||
|
||||
AjaxResult getCadData(ProjectVo model);
|
||||
|
||||
AjaxResult editCadData(CadData vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,11 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
|
|||
|
||||
@Override
|
||||
public AjaxResult delete(DeviceTypeDto dto) {
|
||||
|
||||
int useResult = deviceTypeMapper.getUseResult(dto);
|
||||
if(useResult > 0){
|
||||
return AjaxResult.error("设备类型已被设备关联使用,无法删除");
|
||||
}
|
||||
int delete = deviceTypeMapper.delete(dto);
|
||||
if (delete > 0) {
|
||||
return AjaxResult.success("删除成功");
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.waterdesign.service.impl;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
import com.bonus.waterdesign.controller.utils.CoordinateTransformUtils;
|
||||
import com.bonus.waterdesign.domain.*;
|
||||
|
|
@ -10,8 +11,11 @@ import com.bonus.waterdesign.mapper.ModelMapper;
|
|||
import com.bonus.waterdesign.mapper.ProjectMapper;
|
||||
import com.bonus.waterdesign.service.ModelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.locationtech.proj4j.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -785,4 +789,30 @@ public class ModelServiceImpl implements ModelService {
|
|||
}
|
||||
return cadData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getCadData(ProjectVo model) {
|
||||
List<CadData> dataList = null;
|
||||
try {
|
||||
List<CadData> list = modelMapper.getCadData(model);
|
||||
dataList = CollectionUtils.isEmpty(list) ? Collections.emptyList() : list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
dataList = Collections.emptyList();
|
||||
}
|
||||
return AjaxResult.success(dataList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult editCadData(CadData vo) {
|
||||
try {
|
||||
modelMapper.editCadData(vo);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public class ProTypeServiceImpl implements ProTypeService {
|
|||
|
||||
@Override
|
||||
public AjaxResult delete(ProTypeDto dto) {
|
||||
// 查询项目类型是否被项目关联
|
||||
/*Integer result = proTypeMapper.getProTypeUseNum(dto);
|
||||
if (result > 0) {
|
||||
return AjaxResult.error("项目类型被关联使用,请勿删除");
|
||||
}*/
|
||||
Integer delete = proTypeMapper.delete(dto);
|
||||
if (delete > 0) {
|
||||
return AjaxResult.success("删除成功");
|
||||
|
|
|
|||
|
|
@ -36,4 +36,8 @@
|
|||
and id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
<!--获取设备类型的使用状态-->
|
||||
<select id="getUseResult" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM tb_device WHERE device_type = #{id} AND del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@
|
|||
<if test="nodeCount != null and nodeCount != ''">node_count = #{nodeCount},</if>
|
||||
</set>
|
||||
</update>
|
||||
<update id="editCadData">
|
||||
UPDATE cad_data SET geometry = #{geometry} WHERE id = #{id}
|
||||
</update>
|
||||
<resultMap type="ProjectVo" id="SysProjectVoResult">
|
||||
<id property="projectId" column="project_id" />
|
||||
<result property="id" column="id" />
|
||||
|
|
@ -198,4 +201,11 @@
|
|||
WHERE
|
||||
project_id = #{projectId} and del_flag = 0 and node_count = level
|
||||
</select>
|
||||
<select id="getCadData" resultType="com.bonus.waterdesign.domain.CadData">
|
||||
SELECT id,
|
||||
layer_name AS layerName,
|
||||
entity_type AS entityType,
|
||||
geometry
|
||||
FROM cad_data WHERE project_id = #{nodeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -33,4 +33,9 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--查询项目类型是否被项目关联-->
|
||||
<select id="getProTypeUseNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM tb_project WHERE pro_type = #{id} AND del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@
|
|||
tp.pro_location,
|
||||
tp.remark,
|
||||
tp.lon,
|
||||
tp.lat
|
||||
tp.lat,
|
||||
tp.level
|
||||
from tb_project tp
|
||||
where tp.del_flag = '0' and tp.id = #{proId}
|
||||
</select>
|
||||
|
|
@ -145,6 +146,7 @@
|
|||
<if test="latitude != null and latitude != ''">lat = #{latitude},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_user = #{updateBy},</if>
|
||||
<if test="level != null and level != ''">level = #{level},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{proId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue