删除图片和收藏夹

dev
liuguijing 2 years ago
parent 34913fe321
commit 511e3c006b

@ -315,4 +315,16 @@ public class TerminalController extends BaseController {
}
}
@ApiOperation(value = "新增收藏夹接口", notes = "新增收藏夹接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addFavorList")
@Log(title = "新增收藏夹接口", type = "新增")
public ResponseReult<String> addFavorList( @RequestBody FavorVo vo) {
ServiceBody<String> serviceBody = terminalService.addFavorList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
} }
}

@ -176,4 +176,17 @@ public class TerminalPhotoController extends BaseController {
}
}
@ApiOperation(value = "删除图片", notes = "删除图片接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/deletePicList")
@Log(title = "删除图片", type = "删除")
public ResponseReult<String> deletePicList(@RequestBody @Validated DeletePicVo vo) {
ServiceBody<String> serviceBody = terminalPhotoService.deletePicList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -54,7 +54,7 @@ public class TerminalsWithHeart implements Serializable {
private String equipmentType;
private Integer isfavor;
private static final long serialVersionUID = 1L;
}

@ -1,16 +1,14 @@
package com.shxy.xymanager_common.entity;
import com.shxy.xymanager_common.dto.TermChannelCoordinateDto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@Data
public class TerminalPhoto implements Serializable {
private Long id;
private BigInteger id;
private Integer termId;

@ -1,11 +1,11 @@
package com.shxy.xymanager_common.model;
import com.shxy.xymanager_common.dto.TermChannelCoordinateDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@ -29,7 +29,7 @@ public class TerminalPhotoListModel implements Serializable {
public static class PhotoBean {
@ApiModelProperty(value = "图片id", example = "12321")
private Long id;
private BigInteger id;
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;

@ -31,6 +31,9 @@ public class TerminalPhotoSelectListModel implements Serializable {
@Data
public static class PhotoBean {
@ApiModelProperty(value = "照片id", example = "123456")
private BigInteger picid;
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termid;

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel(value = "收藏对象", description = "收藏对象描述")
public class FavorVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "收藏对象数组", required = true, example = "A0001")
private List<Integer> list;
@ApiModelProperty(value = "是否收藏", example = "0--删除收藏 1--收藏")
private Integer type;
}

@ -73,4 +73,5 @@ public interface TerminalPhotoDao {
PhotoMarkDto selectPhotoWithoutPic(MarkReqVo vo);
int deletePicList(@Param("list") List<Integer> list);
}

@ -48,4 +48,6 @@ public interface TerminalsDao {
int updateCmd(TerminalIdUpdateVo vo);
int updateFavor(@Param("list") List<Integer> list ,@Param("status") Integer status);
}

@ -33,6 +33,7 @@
<result column="has_pan" jdbcType="INTEGER" property="hasPan"/>
<result column="phase" jdbcType="VARCHAR" property="phase"/>
<result column="equipment_type" jdbcType="VARCHAR" property="equipmentType"/>
<result column="isfavor" jdbcType="INTEGER" property="isfavor"/>
</collection>
</collection>
</resultMap>
@ -199,6 +200,7 @@
d.has_pan as has_pan,
d.phase as phase,
d.equipment_type as equipment_type,
d.isfavor as isfavor,
e.last_heartbeat as last_heartbeat
from ((((dy_level a left join `lines` b on a.id = b.dy_level_id )
left join towers c on b.id = c.line_id )

@ -540,4 +540,15 @@
where tpm.term_id = #{termId} and tpm.channel_id = #{channelId}
</select>
<delete id="deletePicList">
<if test="list != null and list.size > 0">
delete from terminal_photos
where id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</delete>
</mapper>

@ -59,6 +59,7 @@ public class DyLevelServiceImpl implements DyLevelService {
@Override
public ServiceBody<DyLineTreeListModel> getdyTreeList(Integer type, Integer lineid) {
DyLineTreeListModel model = new DyLineTreeListModel();
ArrayList<DyLineTreeListModel.TerminalBean> favorList = new ArrayList<>();
List<DyLineAndTerminalWithHeartDto> list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(),lineid);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
@ -107,6 +108,8 @@ public class DyLevelServiceImpl implements DyLevelService {
bean.setHasPan(terminalsWithHeart.getHasPan());
bean.setPhase(terminalsWithHeart.getPhase());
bean.setEquipmentType(terminalsWithHeart.getEquipmentType());
Integer isfavor = terminalsWithHeart.getIsfavor();
bean.setIsfavor(isfavor);
BigInteger lastheartbeat = terminalsWithHeart.getLastheartbeat();
boolean b = TerminalUtils.judgeTerminalStatus(lastheartbeat);
if (type == null || type.intValue() == -1) {//查询全部
@ -134,6 +137,9 @@ public class DyLevelServiceImpl implements DyLevelService {
bean.setOnlinestatus(CommonStatus.DELETE.value());
}
}
if (isfavor!=null && isfavor.intValue() == CommonStatus.EFFECTIVE.value()) {
favorList.add(bean);
}
}
lineBean.setList(beanlist);
lineBeans.add(lineBean);
@ -144,6 +150,7 @@ public class DyLevelServiceImpl implements DyLevelService {
model.setOnlineNum(onlinenum);
model.setTotalNum(totalnum);
model.setList(dyListBeans);
model.setFavorlist(favorList);
}
return Asserts.success(model);
}

@ -768,5 +768,19 @@ public class TerminalServiceImpl implements TerminalService {
}
@Override
public ServiceBody<String> addFavorList(FavorVo vo) {
Integer type = vo.getType();
List<Integer> list = vo.getList();
if (CollectionUtil.isNotEmpty(list)) {
if (type == null || type.intValue() == 0) {
terminalsDao.updateFavor(list, CommonStatus.DELETE.value());
} else {
terminalsDao.updateFavor(list, CommonStatus.EFFECTIVE.value());
}
}
return Asserts.success("修改成功");
}
}

@ -87,4 +87,10 @@ public interface TerminalPhotoService {
*/
ServiceBody<TerminalPhotoSelectListModel> getHistoryList(String requestIp, TermIdAndChannelIdVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<String> deletePicList(DeletePicVo vo);
}

@ -148,4 +148,11 @@ public interface TerminalService {
* @return
*/
ServiceBody<ProtocolListModel> getTermBasicInfoList(BasicTermVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<String> addFavorList(FavorVo vo);
}

Loading…
Cancel
Save