bug修复
This commit is contained in:
parent
433c117870
commit
e63a183aba
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.bonus.common.entity.bracelet.vo;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.bonus.common.core.annotation.Excel.ColumnType;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程杆塔表 tb_project_power
|
||||||
|
*
|
||||||
|
* @author bonus
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api("ProjectPowerVo")
|
||||||
|
@Data
|
||||||
|
public class ProjectTwoVo
|
||||||
|
{
|
||||||
|
/** 工程id */
|
||||||
|
@Excel(name = "工程id", cellType = ColumnType.NUMERIC)
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
/** 工程名称 */
|
||||||
|
@Excel(name = "工程名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -86,6 +86,18 @@ public class SidebandController extends BaseController {
|
||||||
return sidebandservice.getGtList(dto);
|
return sidebandservice.getGtList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/7/17 15:58
|
||||||
|
*/
|
||||||
|
@GetMapping("/getProList")
|
||||||
|
public AjaxResult getProList(ProjectTwoVo dto) {
|
||||||
|
return sidebandservice.getProList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据边带id获取详细信息
|
* 根据边带id获取详细信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,8 +115,8 @@ public class SidebandController extends BaseController {
|
||||||
@PostMapping("addSideband")
|
@PostMapping("addSideband")
|
||||||
@SysLog(title = "班组管理", businessType = OperaType.INSERT, module = "基础管理->班组管理", details = "新增班组")
|
@SysLog(title = "班组管理", businessType = OperaType.INSERT, module = "基础管理->班组管理", details = "新增班组")
|
||||||
public AjaxResult addSideband(@Validated @RequestBody SidebandVo vo) {
|
public AjaxResult addSideband(@Validated @RequestBody SidebandVo vo) {
|
||||||
String name = sidebandservice.queryProjectName(vo.getProjectName());
|
// String name = sidebandservice.queryProjectName(vo.getProjectName());
|
||||||
vo.setProjectName(name);
|
// vo.setProjectName(name);
|
||||||
return sidebandservice.addSideband(vo);
|
return sidebandservice.addSideband(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,8 +128,8 @@ public class SidebandController extends BaseController {
|
||||||
@PostMapping("editSideband")
|
@PostMapping("editSideband")
|
||||||
@SysLog(title = "边带管理", businessType = OperaType.UPDATE, module = "施工管控->边带管理", details = "修改边带")
|
@SysLog(title = "边带管理", businessType = OperaType.UPDATE, module = "施工管控->边带管理", details = "修改边带")
|
||||||
public AjaxResult editSideband(@Validated @RequestBody SidebandVo vo) {
|
public AjaxResult editSideband(@Validated @RequestBody SidebandVo vo) {
|
||||||
String name = sidebandservice.queryProjectName(vo.getProjectName());
|
// String name = sidebandservice.queryProjectName(vo.getProjectName());
|
||||||
vo.setProjectName(name);
|
// vo.setProjectName(name);
|
||||||
return sidebandservice.editSideband(vo);
|
return sidebandservice.editSideband(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,15 @@ public interface SidebandMapper {
|
||||||
*/
|
*/
|
||||||
List<ProjectPowerVo> getGtList(ProjectPowerVo dto);
|
List<ProjectPowerVo> getGtList(ProjectPowerVo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/7/17 15:58
|
||||||
|
*/
|
||||||
|
List<ProjectTwoVo> getProList(ProjectTwoVo dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据边带id获得详细信息
|
* 根据边带id获得详细信息
|
||||||
* @param sidebandId
|
* @param sidebandId
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,15 @@ public interface ISidebandService {
|
||||||
*/
|
*/
|
||||||
AjaxResult getGtList(ProjectPowerVo dto);
|
AjaxResult getGtList(ProjectPowerVo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/7/17 15:58
|
||||||
|
*/
|
||||||
|
AjaxResult getProList(ProjectTwoVo dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据边带id获得详细信息
|
* 根据边带id获得详细信息
|
||||||
* @param sidebandId
|
* @param sidebandId
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,17 @@ public class SidebandServiceImpl implements ISidebandService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getProList(ProjectTwoVo dto) {
|
||||||
|
try {
|
||||||
|
List<ProjectTwoVo> list = sidebandMapper.getProList(dto);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据边带id获得详细信息
|
* 根据边带id获得详细信息
|
||||||
* @param sidebandId
|
* @param sidebandId
|
||||||
|
|
@ -105,6 +116,12 @@ public class SidebandServiceImpl implements ISidebandService {
|
||||||
public AjaxResult selectSidebandById(Integer sidebandId) {
|
public AjaxResult selectSidebandById(Integer sidebandId) {
|
||||||
try {
|
try {
|
||||||
SidebandVo vo = sidebandMapper.selectSidebandById(sidebandId);
|
SidebandVo vo = sidebandMapper.selectSidebandById(sidebandId);
|
||||||
|
if(vo.getGtCode()==null){
|
||||||
|
vo.setGtCode("");
|
||||||
|
}
|
||||||
|
if(vo.getProjectName()==null){
|
||||||
|
vo.setProjectName("");
|
||||||
|
}
|
||||||
return AjaxResult.success(vo);
|
return AjaxResult.success(vo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("边带详情", e);
|
log.error("边带详情", e);
|
||||||
|
|
@ -152,7 +169,10 @@ public class SidebandServiceImpl implements ISidebandService {
|
||||||
if (resultTwo != null) {
|
if (resultTwo != null) {
|
||||||
return AjaxResult.error("边带编码已存在");
|
return AjaxResult.error("边带编码已存在");
|
||||||
}
|
}
|
||||||
|
// String name = sidebandMapper.queryProjectName(vo.getProjectName());
|
||||||
|
// vo.setProjectName(name);
|
||||||
int num = sidebandMapper.updateSideband(vo);
|
int num = sidebandMapper.updateSideband(vo);
|
||||||
|
|
||||||
if(num==1){
|
if(num==1){
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<mapper namespace="com.bonus.bracelet.mapper.SidebandMapper">
|
<mapper namespace="com.bonus.bracelet.mapper.SidebandMapper">
|
||||||
<!--边带列表-->
|
<!--边带列表-->
|
||||||
<select id="getSidebandLists" resultType="com.bonus.common.entity.bracelet.vo.SidebandVo">
|
<select id="getSidebandLists" resultType="com.bonus.common.entity.bracelet.vo.SidebandVo">
|
||||||
select ss.id as sidebandId,ss.sideband_name as sidebandName,ss.sideband_code as sidebandCode,project_name as projectName,
|
select ss.id as sidebandId,ss.sideband_name as sidebandName,ss.sideband_code as sidebandCode,tp.pro_name as projectName,
|
||||||
gt_code as gtCode,bind_time as bindTime,(count(distinct tb.id) + count(distinct tsb.id)) as bindNum,remarks as remarks
|
tpp.power_name as gtCode,bind_time as bindTime,(count(distinct tb.id) + count(distinct tsb.id)) as bindNum,remarks as remarks
|
||||||
from sys_sideband ss
|
from sys_sideband ss
|
||||||
left join tb_device tb on ss.id = tb.bind_id and tb.del_flag = 0
|
left join tb_device tb on ss.id = tb.bind_id and tb.del_flag = 0
|
||||||
left join tb_sh_box tsb on ss.id = tsb.bind_id and tsb.del_flag = 0
|
left join tb_sh_box tsb on ss.id = tsb.bind_id and tsb.del_flag = 0
|
||||||
|
left join tb_project_power tpp on ss.gt_code = tpp.id and tpp.del_flag = 0
|
||||||
|
left join tb_project tp on ss.project_name = tp.id and tp.del_flag = 0
|
||||||
where ss.del_flag = 0
|
where ss.del_flag = 0
|
||||||
<if test="sidebandName != null and sidebandName!=''">
|
<if test="sidebandName != null and sidebandName!=''">
|
||||||
AND INSTR(ss.sideband_name,#{sidebandName}) > 0
|
AND INSTR(ss.sideband_name,#{sidebandName}) > 0
|
||||||
|
|
@ -18,10 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND INSTR(ss.sideband_code,#{sidebandCode}) > 0
|
AND INSTR(ss.sideband_code,#{sidebandCode}) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="projectName != null and projectName!=''">
|
<if test="projectName != null and projectName!=''">
|
||||||
AND INSTR(ss.project_name,#{projectName}) > 0
|
AND INSTR(tp.pro_name,#{projectName}) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="gtCode != null and gtCode!=''">
|
<if test="gtCode != null and gtCode!=''">
|
||||||
AND INSTR(ss.gt_code,#{gtCode}) > 0
|
AND INSTR(tpp.power_name,#{gtCode}) > 0
|
||||||
</if>
|
</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date_format(ss.bind_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
and date_format(ss.bind_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||||
|
|
@ -118,6 +120,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where del_flag = 0
|
where del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--工程下拉选-->
|
||||||
|
<select id="getProList" resultType="com.bonus.common.entity.bracelet.vo.ProjectTwoVo">
|
||||||
|
select id,pro_name as projectName
|
||||||
|
from tb_project
|
||||||
|
where del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectSidebandById" parameterType="int" resultType="com.bonus.common.entity.bracelet.vo.SidebandVo">
|
<select id="selectSidebandById" parameterType="int" resultType="com.bonus.common.entity.bracelet.vo.SidebandVo">
|
||||||
select ss.id as sidebandId,ss.sideband_name as sidebandName,ss.sideband_code as sidebandCode,project_name as projectName,
|
select ss.id as sidebandId,ss.sideband_name as sidebandName,ss.sideband_code as sidebandCode,project_name as projectName,
|
||||||
gt_code as gtCode,bind_time as bindTime,remarks as remarks
|
gt_code as gtCode,bind_time as bindTime,remarks as remarks
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue