设备上下架功能
This commit is contained in:
parent
16c608f99e
commit
baf144e412
|
|
@ -93,6 +93,17 @@ public class DevInfoController extends BaseController {
|
||||||
return success(devInfoService.selectDevInfoByMaId(maId));
|
return success(devInfoService.selectDevInfoByMaId(maId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上下架(批量)
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("equip:info:edit")
|
||||||
|
@ApiOperation(value = "上下架(批量)")
|
||||||
|
@PostMapping("updateUpDown")
|
||||||
|
public AjaxResult updateUp(@RequestBody DevInfo devInfo) {
|
||||||
|
return toAjax(devInfoService.updateUpDown(devInfo));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改设备信息
|
* 修改设备信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ public class DevInfo extends BaseEntity {
|
||||||
@Excel(name = "设备id")
|
@Excel(name = "设备id")
|
||||||
@ApiModelProperty(value = "设备id")
|
@ApiModelProperty(value = "设备id")
|
||||||
private Long maId;
|
private Long maId;
|
||||||
|
/** 设备id */
|
||||||
|
@ApiModelProperty(value = "设备id")
|
||||||
|
private List<Long> maIds;
|
||||||
|
|
||||||
/** 系统编码 */
|
/** 系统编码 */
|
||||||
@Excel(name = "系统编码")
|
@Excel(name = "系统编码")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.common.biz.domain.*;
|
||||||
import com.bonus.material.device.domain.DevInfo;
|
import com.bonus.material.device.domain.DevInfo;
|
||||||
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
import com.bonus.material.device.domain.dto.InfoMotionDto;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -105,5 +106,7 @@ public interface DevInfoMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BmCompanyInfo> selectCompanyList(BmCompanyInfo obj);
|
List<BmCompanyInfo> selectCompanyList(BmCompanyInfo obj);
|
||||||
|
|
||||||
|
int updateUpDown(@Param("maIds") List<Long> maIds, @Param("maStatus")String maStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,4 +88,6 @@ public interface DevInfoService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BmCompanyInfo> selectCompanyList(BmCompanyInfo obj);
|
List<BmCompanyInfo> selectCompanyList(BmCompanyInfo obj);
|
||||||
|
|
||||||
|
int updateUpDown(DevInfo devInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,9 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
List<BaseAddress> addressList = devInfoMapper.getBaseAddress();
|
List<BaseAddress> addressList = devInfoMapper.getBaseAddress();
|
||||||
for (DevInfoVo devInfoVo : list) {
|
for (DevInfoVo devInfoVo : list) {
|
||||||
for (BaseAddress address : addressList) {
|
for (BaseAddress address : addressList) {
|
||||||
if (devInfoVo.getCityId() == null || address.getCode() == null) { continue; }
|
if (devInfoVo.getCityId() == null || address.getCode() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) {
|
if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) {
|
||||||
devInfoVo.setCityStr(address.getName());
|
devInfoVo.setCityStr(address.getName());
|
||||||
break;
|
break;
|
||||||
|
|
@ -277,6 +279,7 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公司列表
|
* 查询公司列表
|
||||||
|
*
|
||||||
* @param obj
|
* @param obj
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -285,6 +288,17 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
return devInfoMapper.selectCompanyList(obj);
|
return devInfoMapper.selectCompanyList(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateUpDown(DevInfo devInfo) {
|
||||||
|
List<Long> maIds = devInfo.getMaIds();
|
||||||
|
String maStatus = devInfo.getMaStatus();
|
||||||
|
int i = 0;
|
||||||
|
if (CollectionUtil.isNotEmpty(maIds)) {
|
||||||
|
i = devInfoMapper.updateUpDown(maIds, maStatus);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertOutType(String devInfo) {
|
public void insertOutType(String devInfo) {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
|
||||||
|
|
@ -417,6 +417,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
set search_num = search_num + 1
|
set search_num = search_num + 1
|
||||||
where ma_id = #{maId}
|
where ma_id = #{maId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateUpDown">
|
||||||
|
<if test="maIds != null and maIds.size() > 0">
|
||||||
|
<choose>
|
||||||
|
<when test="maIds.size() == 1">
|
||||||
|
<!-- 单个ID更新 -->
|
||||||
|
update ma_dev_info
|
||||||
|
set ma_status = #{maStatus}
|
||||||
|
where ma_id = #{maIds[0]}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
<!-- 批量更新 -->
|
||||||
|
update ma_dev_info
|
||||||
|
set ma_status = #{maStatus}
|
||||||
|
where ma_id in
|
||||||
|
<foreach collection="maIds" item="maId" open="(" separator="," close=")">
|
||||||
|
#{maId}
|
||||||
|
</foreach>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getSysDic" resultType="com.bonus.common.biz.domain.SysDic">
|
<select id="getSysDic" resultType="com.bonus.common.biz.domain.SysDic">
|
||||||
select
|
select
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue