Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into frx
This commit is contained in:
commit
af80c047bc
@ -36,6 +36,9 @@ public class AuthMenuRespVO {
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "图标图片", example = "/menu/list")
|
||||
private String img;
|
||||
|
||||
@Schema(description = "是否可见", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
|
@ -78,6 +78,9 @@ public class AuthPermissionInfoRespVO {
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "图标图片", example = "/menu/list")
|
||||
private String img;
|
||||
|
||||
@Schema(description = "是否可见", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
|
@ -43,11 +43,11 @@ public class CommonlyUsedController {
|
||||
return success(commonlyUsedService.createCommonlyUsed(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/batchCreate")
|
||||
@Operation(summary = "批量创建用户常用应用配置")
|
||||
@PostMapping("/batchCreateOrEditOrDel")
|
||||
@Operation(summary = "批量创建编辑删除用户常用应用配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:commonly-used:create')")
|
||||
public CommonResult<?> batchCreate(@Valid @RequestBody List<CommonlyUsedSaveReqVO> list) {
|
||||
commonlyUsedService.batchCreate(list);
|
||||
public CommonResult<?> batchCreateOrEditOrDel(@Valid @RequestBody List<CommonlyUsedSaveReqVO> list) {
|
||||
commonlyUsedService.batchCreateOrEditOrDel(list);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.commonlyused.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 用户常用应用配置新增/修改 Request VO")
|
||||
@Data
|
||||
@ -13,9 +10,6 @@ public class CommonlyUsedSaveReqVO {
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18873")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "2072")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "类型 1流程 2菜单", example = "1")
|
||||
private Integer type;
|
||||
|
||||
|
@ -43,6 +43,9 @@ public class MenuRespVO {
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "图标图片", example = "/menu/list")
|
||||
private String img;
|
||||
|
||||
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index")
|
||||
@Size(max = 200, message = "组件路径不能超过255个字符")
|
||||
private String component;
|
||||
|
@ -42,6 +42,9 @@ public class MenuSaveVO {
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "图标图片", example = "/menu/list")
|
||||
private String img;
|
||||
|
||||
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index")
|
||||
@Size(max = 200, message = "组件路径不能超过255个字符")
|
||||
private String component;
|
||||
|
@ -6,6 +6,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
/**
|
||||
* 用户常用应用配置 DO
|
||||
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -70,6 +71,12 @@ public class MenuDO extends BaseDO {
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 图标图片
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
|
@ -61,13 +61,6 @@ public interface CommonlyUsedService {
|
||||
*/
|
||||
CommonlyUsedVO getCommonlyUsedList();
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
void batchCreate(List<CommonlyUsedSaveReqVO> list);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*
|
||||
@ -81,4 +74,11 @@ public interface CommonlyUsedService {
|
||||
* @param ids
|
||||
*/
|
||||
void batchDelete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 批量创建编辑删除
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
void batchCreateOrEditOrDel(List<CommonlyUsedSaveReqVO> list);
|
||||
}
|
||||
|
@ -142,11 +142,6 @@ public class CommonlyUsedServiceImpl implements CommonlyUsedService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchCreate(List<CommonlyUsedSaveReqVO> list) {
|
||||
List<CommonlyUsedDO> saveList = BeanUtils.toBean(list, CommonlyUsedDO.class);
|
||||
commonlyUsedMapper.insertBatch(saveList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchUpdate(List<CommonlyUsedSaveReqVO> list) {
|
||||
@ -159,4 +154,50 @@ public class CommonlyUsedServiceImpl implements CommonlyUsedService {
|
||||
commonlyUsedMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchCreateOrEditOrDel(List<CommonlyUsedSaveReqVO> list) {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
commonlyUsedMapper.delete(new LambdaQueryWrapper<CommonlyUsedDO>().eq(CommonlyUsedDO::getUserId, userId));
|
||||
return;
|
||||
}
|
||||
List<CommonlyUsedDO> oldList = commonlyUsedMapper.selectList(new LambdaQueryWrapper<CommonlyUsedDO>().eq(CommonlyUsedDO::getUserId, userId));
|
||||
List<CommonlyUsedDO> newList = BeanUtils.toBean(list, CommonlyUsedDO.class);
|
||||
if (CollectionUtil.isEmpty(oldList)) {
|
||||
commonlyUsedMapper.insertBatch(newList);
|
||||
return;
|
||||
}
|
||||
//根据类型和objectId 分组
|
||||
Map<String, CommonlyUsedDO> oldMap = oldList.stream().collect(Collectors.toMap(a -> a.getType() + "_" + a.getObjectId(), a -> a));
|
||||
Map<String, CommonlyUsedDO> newMap = newList.stream().collect(Collectors.toMap(a -> a.getType() + "_" + a.getObjectId(), a -> a));
|
||||
// -- 需要删除的
|
||||
List<String> delIds = new ArrayList<>(CollectionUtil.subtract(oldMap.keySet(), newMap.keySet()));
|
||||
if (CollectionUtil.isNotEmpty(delIds)) {
|
||||
List<Long> delIdList = new ArrayList<>();
|
||||
for (String delId : delIds) {
|
||||
delIdList.add(oldMap.get(delId).getId());
|
||||
}
|
||||
commonlyUsedMapper.deleteBatchIds(delIdList);
|
||||
}
|
||||
// -- 需要保存的
|
||||
List<String> saveIds = new ArrayList<>(CollectionUtil.subtract(newMap.keySet(), oldMap.keySet()));
|
||||
if (CollectionUtil.isNotEmpty(saveIds)) {
|
||||
List<CommonlyUsedDO> saveIdList = new ArrayList<>();
|
||||
for (String saveId : saveIds) {
|
||||
CommonlyUsedDO commonlyUsedDO = newMap.get(saveId);
|
||||
commonlyUsedDO.setUserId(userId);
|
||||
saveIdList.add(newMap.get(saveId));
|
||||
}
|
||||
commonlyUsedMapper.insertBatch(saveIdList);
|
||||
}
|
||||
// -- 需要编辑的
|
||||
List<String> editIds = new ArrayList<>(CollectionUtil.intersectionDistinct(newMap.keySet(), oldMap.keySet()));
|
||||
if (CollectionUtil.isNotEmpty(editIds)) {
|
||||
List<CommonlyUsedDO> editList = new ArrayList<>();
|
||||
for (String editId : editIds) {
|
||||
editList.add(newMap.get(editId));
|
||||
}
|
||||
commonlyUsedMapper.updateBatch(editList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*
|
||||
* @author: yj
|
||||
* @date: 2024年03月05日 13:55
|
||||
*/
|
||||
@Data
|
||||
public class CameraVO {
|
||||
@Schema(description = "工厂id")
|
||||
private Long factoryId;
|
||||
@Schema(description = "工厂名称")
|
||||
private String factoryName;
|
||||
@Schema(description = "数量")
|
||||
private Integer number;
|
||||
}
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.api.user.vo.AdminUserRpcVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -28,6 +29,8 @@ public class DataOverviewVO {
|
||||
|
||||
@Schema(description = "窑炉数量")
|
||||
private Integer ylNum;
|
||||
@Schema(description = "窑炉产能")
|
||||
private BigDecimal ylCapacity;
|
||||
@Schema(description = "窑炉信息列表")
|
||||
private List<FactoryKilnVO> factoryKilnList;
|
||||
|
||||
@ -55,9 +58,14 @@ public class DataOverviewVO {
|
||||
|
||||
@Schema(description = "绑带数")
|
||||
private Integer bdNum;
|
||||
@Schema(description = "托盘信息")
|
||||
@Schema(description = "绑带信息")
|
||||
private List<AssetsStockVO> strapsList;
|
||||
|
||||
@Schema(description = "摄像头数量")
|
||||
private Integer cameraNum;
|
||||
@Schema(description = "摄像头信息")
|
||||
private List<CameraVO> cameraVOS;
|
||||
|
||||
|
||||
@Schema(description = "出库")
|
||||
private Integer outTotalNum;
|
||||
|
@ -37,7 +37,7 @@ public interface CameraDeviceMapper extends BaseMapperX<CameraDeviceDO> {
|
||||
|
||||
default List<CameraDeviceDO> selectListCameraByFactoryId(Long factoryId) {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDeviceDO>()
|
||||
.eq(CameraDeviceDO::getFactoryId, factoryId)
|
||||
.eq(factoryId != null, CameraDeviceDO::getFactoryId, factoryId)
|
||||
.eq(CameraDeviceDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
||||
.eq(CameraDeviceDO::getIsShow, 1));
|
||||
}
|
||||
|
@ -137,6 +137,10 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
||||
|
||||
@Override
|
||||
public List<FactoryInfoDO> getFactoryList(Collection<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ids = ids.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
return factoryInfoMapper.selectList(new LambdaQueryWrapper<FactoryInfoDO>()
|
||||
.in(CollectionUtil.isNotEmpty(ids), FactoryInfoDO::getId, ids));
|
||||
}
|
||||
|
@ -300,6 +300,7 @@ public class ScreenDataServiceImpl implements ScreenDataService {
|
||||
// ---------------------------------- 窑炉 ----------------------------------
|
||||
List<FactoryKilnDO> factoryKilnDOS = factoryKilnService.getFactoryKilnByFactoryId(factoryId);
|
||||
vo.setYlNum(factoryKilnDOS.size());
|
||||
vo.setYlCapacity(factoryKilnDOS.stream().map(FactoryKilnDO::getCapacity).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
Map<Long, List<FactoryKilnDO>> factoryKilnMap = factoryKilnDOS.stream().collect(Collectors.groupingBy(FactoryKilnDO::getFactoryId));
|
||||
List<FactoryKilnVO> factoryKilnList = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<FactoryKilnDO>> entry : factoryKilnMap.entrySet()) {
|
||||
@ -384,12 +385,26 @@ public class ScreenDataServiceImpl implements ScreenDataService {
|
||||
vo.setTrayList(trayList);
|
||||
|
||||
|
||||
// ---------------------------------- 托盘 ----------------------------------
|
||||
// ---------------------------------- 绑带 ----------------------------------
|
||||
List<Long> strapsAssetsTypeIds = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.STRAPS).getData();
|
||||
List<AssetsStockVO> strapsList = screenDataMapper.getAssetsNumByFactoryIdAndTypeIds(Collections.singletonList(factoryId), strapsAssetsTypeIds);
|
||||
vo.setBdNum(strapsList.stream().mapToInt(AssetsStockVO::getStock).sum());
|
||||
vo.setStrapsList(strapsList);
|
||||
|
||||
// ---------------------------------- 摄像头 ----------------------------------
|
||||
List<CameraVO> cameraVOS = new ArrayList<>();
|
||||
List<CameraDeviceDO> cameraDeviceDOS = cameraDeviceService.getListCameraByFactoryId(factoryId);
|
||||
Map<Long, List<CameraDeviceDO>> cameraDeviceMaps = cameraDeviceDOS.stream().collect(Collectors.groupingBy(CameraDeviceDO::getFactoryId));
|
||||
for (Map.Entry<Long, List<CameraDeviceDO>> entry : cameraDeviceMaps.entrySet()) {
|
||||
CameraVO cameraVO = new CameraVO();
|
||||
cameraVO.setFactoryId(entry.getKey());
|
||||
cameraVO.setFactoryName(factoryMap.get(entry.getKey()).getName());
|
||||
cameraVO.setNumber(entry.getValue().size());
|
||||
cameraVOS.add(cameraVO);
|
||||
}
|
||||
vo.setCameraNum(cameraDeviceDOS.size());
|
||||
vo.setCameraVOS(cameraVOS);
|
||||
|
||||
//
|
||||
// vo.setForkliftTotal(list.stream().mapToInt(FactoryDataOverviewDO::getTruckTotalNum).sum());
|
||||
// vo.setTruckOnNum(extras.stream().mapToInt(ScreenFactoryExtraDO::getTruckOnNum).sum());
|
||||
|
Loading…
Reference in New Issue
Block a user