线路工程管理
This commit is contained in:
parent
56f7c85d85
commit
1e72c39e3c
|
|
@ -54,5 +54,17 @@ public class TbProjectController {
|
|||
return tbProjectService.getTbProjectById(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,6 @@ public interface TbProjectMapper {
|
|||
List<TbProjectVo> getTbProjectList(TbProjectVo data);
|
||||
|
||||
TbProjectVo getTbProjectById(TbProjectVo data);
|
||||
|
||||
void UpdateTbProject(TbProjectVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,11 @@ public interface TbProjectService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse getTbProjectById(TbProjectVo data);
|
||||
|
||||
/**
|
||||
* 线路工程管理-修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse UpdateTbProject(TbProjectVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,15 @@ import com.bonus.digitalSignage.basic.dao.TbProjectMapper;
|
|||
import com.bonus.digitalSignage.basic.service.TbProjectService;
|
||||
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||
import com.bonus.digitalSignage.utils.UserUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -30,14 +33,49 @@ public class TbProjectServiceImpl implements TbProjectService {
|
|||
*/
|
||||
@Override
|
||||
public ServerResponse getTbProjectList(TbProjectVo data) {
|
||||
List<TbProjectVo> tbProjectVoList = tbProjectMapper.getTbProjectList(data);
|
||||
PageInfo<TbProjectVo> pageInfo = new PageInfo<>(tbProjectVoList);
|
||||
return ServerResponse.createSuccessPage(pageInfo, data.getPageNum(), data.getPageSize());
|
||||
try {
|
||||
List<TbProjectVo> tbProjectVoList = tbProjectMapper.getTbProjectList(data);
|
||||
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
|
||||
public ServerResponse getTbProjectById(TbProjectVo data) {
|
||||
TbProjectVo tbProject = tbProjectMapper.getTbProjectById(data);
|
||||
return ServerResponse.createSuccess(tbProject);
|
||||
try {
|
||||
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 {
|
||||
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("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 pageSize = 10;
|
||||
|
|
|
|||
|
|
@ -128,4 +128,25 @@ public class DistinctController {
|
|||
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> 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
|
||||
*/
|
||||
int isHasChild(String id);
|
||||
|
||||
List<DistinctVo> getDistinctListByParentCode(DistinctDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,4 +57,14 @@ public interface DistinctService {
|
|||
* @date 2023/10/13 15:09
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DistinctVo> getDistinctListByParentCode(DistinctDto data) {
|
||||
return mapper.getDistinctListByParentCode(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse isRepeat(EncryptedReq<RepeatEntity> vo) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,24 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.digitalSignage.basic.dao.TbProjectMapper">
|
||||
<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 tp.pro_name as proName,A.dict_name as voltageLevel,tp.line_length as lineLength,
|
||||
|
|
|
|||
|
|
@ -66,4 +66,19 @@
|
|||
WHERE p_id = #{id}
|
||||
AND del_flag = 0
|
||||
</select>
|
||||
<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