Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3a9b4bd239
|
|
@ -54,5 +54,29 @@ public class TbProjectController {
|
||||||
return tbProjectService.getTbProjectById(dto.getData());
|
return tbProjectService.getTbProjectById(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-新增
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "addTbProject")
|
||||||
|
@DecryptAndVerify(decryptedClass = TbProjectVo.class)//加解密统一管理
|
||||||
|
@LogAnnotation(operModul = "基础管理-线路工程管理", operation = "新增", operDesc = "系统级事件",operType="查询")
|
||||||
|
public ServerResponse addTbProject(EncryptedReq<TbProjectVo> dto) {
|
||||||
|
return tbProjectService.addTbProject(dto.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-修改
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "UpdateTbProject")
|
||||||
|
@DecryptAndVerify(decryptedClass = TbProjectVo.class)//加解密统一管理
|
||||||
|
@LogAnnotation(operModul = "基础管理-线路工程管理", operation = "修改", operDesc = "系统级事件",operType="查询")
|
||||||
|
public ServerResponse UpdateTbProject(EncryptedReq<TbProjectVo> dto) {
|
||||||
|
return tbProjectService.UpdateTbProject(dto.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,10 @@ public interface TbProjectMapper {
|
||||||
List<TbProjectVo> getTbProjectList(TbProjectVo data);
|
List<TbProjectVo> getTbProjectList(TbProjectVo data);
|
||||||
|
|
||||||
TbProjectVo getTbProjectById(TbProjectVo data);
|
TbProjectVo getTbProjectById(TbProjectVo data);
|
||||||
|
|
||||||
|
void UpdateTbProject(TbProjectVo data);
|
||||||
|
|
||||||
|
void addTbProject(TbProjectVo data);
|
||||||
|
|
||||||
|
TbProjectVo getTbProjectByProName(TbProjectVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,18 @@ public interface TbProjectService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ServerResponse getTbProjectById(TbProjectVo data);
|
ServerResponse getTbProjectById(TbProjectVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-修改
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse UpdateTbProject(TbProjectVo data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-新增
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse addTbProject(TbProjectVo data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,17 @@ import com.bonus.digitalSignage.basic.dao.TbProjectMapper;
|
||||||
import com.bonus.digitalSignage.basic.service.TbProjectService;
|
import com.bonus.digitalSignage.basic.service.TbProjectService;
|
||||||
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
||||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||||
|
import com.bonus.digitalSignage.utils.UserUtil;
|
||||||
|
import com.bonus.digitalSignage.webResult.StringUtils;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 马三炮
|
* @author 马三炮
|
||||||
|
|
@ -30,14 +35,76 @@ public class TbProjectServiceImpl implements TbProjectService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ServerResponse getTbProjectList(TbProjectVo data) {
|
public ServerResponse getTbProjectList(TbProjectVo data) {
|
||||||
List<TbProjectVo> tbProjectVoList = tbProjectMapper.getTbProjectList(data);
|
try {
|
||||||
PageInfo<TbProjectVo> pageInfo = new PageInfo<>(tbProjectVoList);
|
List<TbProjectVo> tbProjectVoList = tbProjectMapper.getTbProjectList(data);
|
||||||
return ServerResponse.createSuccessPage(pageInfo, data.getPageNum(), data.getPageSize());
|
PageInfo<TbProjectVo> pageInfo = new PageInfo<>(tbProjectVoList);
|
||||||
|
return ServerResponse.createSuccessPage(pageInfo, data.getPageNum(), data.getPageSize());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createErroe("查询列表失败");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-查询详情
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ServerResponse getTbProjectById(TbProjectVo data) {
|
public ServerResponse getTbProjectById(TbProjectVo data) {
|
||||||
TbProjectVo tbProject = tbProjectMapper.getTbProjectById(data);
|
try {
|
||||||
return ServerResponse.createSuccess(tbProject);
|
TbProjectVo tbProject = tbProjectMapper.getTbProjectById(data);
|
||||||
|
return ServerResponse.createSuccess(tbProject);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createErroe("查询详情失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-修改
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ServerResponse UpdateTbProject(TbProjectVo data) {
|
||||||
|
try {
|
||||||
|
TbProjectVo tbProjectVo = tbProjectMapper.getTbProjectByProName(data);
|
||||||
|
if (StringUtils.isNotNull(tbProjectVo) && data.getId()!=tbProjectVo.getId()){
|
||||||
|
return ServerResponse.createErroe("该项目部下以存在该工程");
|
||||||
|
}
|
||||||
|
Long userId = UserUtil.getLoginUser().getId();
|
||||||
|
data.setUpdateUserId(userId);
|
||||||
|
tbProjectMapper.UpdateTbProject(data);
|
||||||
|
return ServerResponse.createSuccess("修改成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createErroe("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线路工程管理-新增
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ServerResponse addTbProject(TbProjectVo data) {
|
||||||
|
try {
|
||||||
|
TbProjectVo tbProjectVo = tbProjectMapper.getTbProjectByProName(data);
|
||||||
|
if (StringUtils.isNotNull(tbProjectVo)){
|
||||||
|
return ServerResponse.createErroe("该项目部下以存在该工程");
|
||||||
|
}
|
||||||
|
Long userId = UserUtil.getLoginUser().getId();
|
||||||
|
data.setCreateUserId(userId);
|
||||||
|
data.setCreateTime(new Date());
|
||||||
|
tbProjectMapper.addTbProject(data);
|
||||||
|
return ServerResponse.createSuccess();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
return ServerResponse.createErroe("新增失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,12 +89,12 @@ public class TbProjectVo {
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
*/
|
*/
|
||||||
private Date createUserId;
|
private Long createUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改人
|
* 修改人
|
||||||
*/
|
*/
|
||||||
private Date updateUserId;
|
private Long updateUserId;
|
||||||
|
|
||||||
private int pageNum = 1;
|
private int pageNum = 1;
|
||||||
private int pageSize = 10;
|
private int pageSize = 10;
|
||||||
|
|
|
||||||
|
|
@ -128,4 +128,25 @@ public class DistinctController {
|
||||||
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> vo) {
|
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> vo) {
|
||||||
return service.isRepeat(vo);
|
return service.isRepeat(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dto
|
||||||
|
* @return ServerResponse
|
||||||
|
* @description 查询字典列表
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2023/11/1 15:06
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "getDistinctListByParentCode")
|
||||||
|
@DecryptAndVerify(decryptedClass = DistinctDto.class)//加解密统一管理
|
||||||
|
@LogAnnotation(operModul = "系统管理-字典管理", operation = "查询字典列表", operDesc = "业务级事件", operType = "查询")
|
||||||
|
@PreAuthorize("@pms.hasPermission('sys:dict:query')")
|
||||||
|
public ServerResponse getDistinctListByParentCode(EncryptedReq<DistinctDto> dto) {
|
||||||
|
List<DistinctVo> list = new ArrayList();
|
||||||
|
try {
|
||||||
|
list = service.getDistinctListByParentCode(dto.getData());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("字典列表", e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createSuccess(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,6 @@ public interface DistinctDao {
|
||||||
* @date 2023/10/13 15:18
|
* @date 2023/10/13 15:18
|
||||||
*/
|
*/
|
||||||
int isHasChild(String id);
|
int isHasChild(String id);
|
||||||
|
|
||||||
|
List<DistinctVo> getDistinctListByParentCode(DistinctDto data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,4 +57,14 @@ public interface DistinctService {
|
||||||
* @date 2023/10/13 15:09
|
* @date 2023/10/13 15:09
|
||||||
*/
|
*/
|
||||||
ServerResponse getDistinctById(DistinctVo data);
|
ServerResponse getDistinctById(DistinctVo data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param data
|
||||||
|
* @return ServerResponse
|
||||||
|
* @description 查询字典列表
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2023/11/1 15:06
|
||||||
|
*/
|
||||||
|
List<DistinctVo> getDistinctListByParentCode(DistinctDto data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,11 @@ public class DistinctServiceImpl implements DistinctService {
|
||||||
return ServerResponse.createSuccess("获取成功", vo);
|
return ServerResponse.createSuccess("获取成功", vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DistinctVo> getDistinctListByParentCode(DistinctDto data) {
|
||||||
|
return mapper.getDistinctListByParentCode(data);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> vo) {
|
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> vo) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,60 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.digitalSignage.basic.dao.TbProjectMapper">
|
<mapper namespace="com.bonus.digitalSignage.basic.dao.TbProjectMapper">
|
||||||
|
<insert id="addTbProject">
|
||||||
|
insert into tb_project
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="departId != null ">depart_id,</if>
|
||||||
|
<if test="proName != null ">pro_name,</if>
|
||||||
|
<if test="voltageLevel != null ">voltage_level,</if>
|
||||||
|
<if test="lineLength != null ">line_length,</if>
|
||||||
|
<if test="planStartTime != null">plan_start_time,</if>
|
||||||
|
<if test="planEndTime != null ">plan_end_time,</if>
|
||||||
|
<if test="lon != null ">lon,</if>
|
||||||
|
<if test="lat != null ">lat,</if>
|
||||||
|
<if test="address != null ">address,</if>
|
||||||
|
<if test="proStatus != null ">pro_status,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createUser != null ">create_user,</if>
|
||||||
|
is_active
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="departId != null ">#{departId},</if>
|
||||||
|
<if test="proName != null ">#{proName},</if>
|
||||||
|
<if test="voltageLevel != null ">#{voltageLevel},</if>
|
||||||
|
<if test="lineLength != null ">#{lineLength},</if>
|
||||||
|
<if test="planStartTime != null ">#{planStartTime},</if>
|
||||||
|
<if test="planEndTime != null ">#{planEndTime},</if>
|
||||||
|
<if test="lon != null ">#{lon},</if>
|
||||||
|
<if test="lat != null ">#{lat},</if>
|
||||||
|
<if test="address != null ">#{address},</if>
|
||||||
|
<if test="proStatus != null ">#{proStatus},</if>
|
||||||
|
<if test="createTime != null ">#{createTime},</if>
|
||||||
|
<if test="createUser != null ">#{createUser},</if>
|
||||||
|
1
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="UpdateTbProject">
|
||||||
|
update tb_project
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="departId != null">depart_id = #{departId},</if>
|
||||||
|
<if test="proName != null">pro_name = #{proName},</if>
|
||||||
|
<if test="voltageLevel != null">voltage_level = #{voltageLevel},</if>
|
||||||
|
<if test="lineLength != null">line_length = #{lineLength},</if>
|
||||||
|
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
|
||||||
|
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
|
||||||
|
<if test="lon != null">lon = #{lon},</if>
|
||||||
|
<if test="lat != null">lat = #{lat},</if>
|
||||||
|
<if test="address != null">address = #{address},</if>
|
||||||
|
<if test="proStatus != null">pro_status = #{proStatus},</if>
|
||||||
|
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
||||||
|
update_time = now()
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getTbProjectList" resultType="com.bonus.digitalSignage.basic.vo.TbProjectVo">
|
<select id="getTbProjectList" resultType="com.bonus.digitalSignage.basic.vo.TbProjectVo">
|
||||||
select tp.pro_name as proName,A.dict_name as voltageLevel,tp.line_length as lineLength,
|
select tp.id as id,tp.pro_name as proName,A.dict_name as voltageLevel,tp.line_length as lineLength,
|
||||||
tp.plan_start_time as planStartTime,tp.plan_end_time as planEndTime,tp.lon as lon,tp.lat as lat,
|
tp.plan_start_time as planStartTime,tp.plan_end_time as planEndTime,tp.lon as lon,tp.lat as lat,
|
||||||
tp.address as address,B.dict_name as pro_status
|
tp.address as address,B.dict_name as pro_status
|
||||||
from tb_project tp
|
from tb_project tp
|
||||||
|
|
@ -23,9 +74,15 @@
|
||||||
where tp.is_active = '1'
|
where tp.is_active = '1'
|
||||||
</select>
|
</select>
|
||||||
<select id="getTbProjectById" resultType="com.bonus.digitalSignage.basic.vo.TbProjectVo">
|
<select id="getTbProjectById" resultType="com.bonus.digitalSignage.basic.vo.TbProjectVo">
|
||||||
select tp.pro_name as proName,tp.voltage_level as voltageLevel,tp.line_length as lineLength,
|
select tp.id as id,tp.pro_name as proName,tp.voltage_level as voltageLevel,tp.line_length as lineLength,
|
||||||
tp.plan_start_time as planStartTime,tp.plan_end_time as planEndTime,tp.lon as lon,tp.lat as lat,
|
tp.plan_start_time as planStartTime,tp.plan_end_time as planEndTime,tp.lon as lon,tp.lat as lat,
|
||||||
tp.address as address,B.pro_status as pro_status
|
tp.address as address,B.pro_status as pro_status
|
||||||
from tb_project tp where id = #{id}
|
from tb_project tp where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getTbProjectByProName" resultType="com.bonus.digitalSignage.basic.vo.TbProjectVo">
|
||||||
|
select tp.id as id,tp.pro_name as proName,tp.voltage_level as voltageLevel,tp.line_length as lineLength,
|
||||||
|
tp.plan_start_time as planStartTime,tp.plan_end_time as planEndTime,tp.lon as lon,tp.lat as lat,
|
||||||
|
tp.address as address,B.pro_status as pro_status
|
||||||
|
from tb_project tp where pro_name = #{proName} and is_active ='1'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,19 @@
|
||||||
WHERE p_id = #{id}
|
WHERE p_id = #{id}
|
||||||
AND del_flag = 0
|
AND del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
<select id="getDistinctListByParentCode" resultType="com.bonus.digitalSignage.system.vo.DistinctVo">
|
||||||
|
SELECT sd.id,
|
||||||
|
sd.dict_code AS dictCode,
|
||||||
|
sd.dict_name AS dictName,
|
||||||
|
sd.dict_value AS dictValue,
|
||||||
|
sd.p_id AS parentId,
|
||||||
|
sd.dict_sort AS dictSort
|
||||||
|
FROM sys_distinct sd
|
||||||
|
left join sys_distinct sd2 on sd.p_id = sd2.id
|
||||||
|
WHERE sd.del_flag = 0 and sd2.dict_code = #{dictCode}
|
||||||
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
|
AND INSTR(sd.dict_name,#{keyWord}) > 0
|
||||||
|
</if>
|
||||||
|
ORDER BY sd.dict_sort
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue