提交 d5117f13 authored 作者: zjm's avatar zjm

Merge branch 'dev' of git.yfzx.zjtys.com.cn:matrix/device-back

# Conflicts: # dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java # dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
......@@ -11,6 +11,7 @@ import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.service.VerificationService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.FileVo;
......@@ -134,6 +135,9 @@ public class AllotBillController {
@Resource
private UnitsCache unitsCache;
@Resource
private VerificationService verificationService;
@ApiOperation(value = "导入二维码获取配发装备", notes = "可以通过这个接口导入二维码获取配发装备")
@PostMapping(value = "/load")
public ResponseEntity loadDevice(@RequestBody RfidVo rfidVo) {
......@@ -162,7 +166,9 @@ public class AllotBillController {
public ResponseEntity addAllotBill(@RequestBody @Validated AllotBillSaveVo allotBillSaveVo) {
//判断发起配发的装备的生命状态
if (allotBillSaveVo.getAllotCheckDetail() != null && allotBillSaveVo.getAllotCheckDetail().length() > 0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
// deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
//新增装备是否是自己的判断
verificationService.isLocal(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//1.添加配发单
AllotBill a = allotBillSaveVo.toDo();
......@@ -502,7 +508,7 @@ public class AllotBillController {
deviceLibraryEntity.setLifeStatus(2);
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setManageStatus(1);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
deviceIds.add(id);
//如果接收时填写了生产号
......@@ -531,7 +537,7 @@ public class AllotBillController {
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收入库丢失", fileVoList, taskBto.getId(), taskBto.getId());
deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
deviceLibraryService.update(deviceLibraryEntity);
deviceIds.add(id);
......@@ -587,7 +593,8 @@ public class AllotBillController {
public ResponseEntity saveAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
//判断装备的生命状态是否能配发
if (allotBillSaveVo.getAllotCheckDetail() != null && allotBillSaveVo.getAllotCheckDetail().length() > 0) {
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
// deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
verificationService.isLocal(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
}
//第一次保存(没有taskId)
if (allotBillSaveVo.getTaskId() == null) {
......@@ -891,7 +898,7 @@ public class AllotBillController {
deviceLibrary.setLifeStatus(2);
deviceLibrary.setOwnUnit(allotBill.getReceiveUnit());
deviceLibrary.setManageStatus(1);
deviceLibrary.setStorageLocationId(null);
deviceLibrary.setStorageLocationId(0);
deviceLibrary.setStorageLocation(null);
deviceLibraryService.update(deviceLibrary);
});
......
......@@ -323,7 +323,7 @@ public class BackController {
deviceLibraryEntity.setLifeStatus(2);
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setManageStatus(1);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
//判断是签字入库还是签章入库
DeviceLogDto deviceLogDto = new DeviceLogDto();
......@@ -345,7 +345,7 @@ public class BackController {
//改变装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(11);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
//存装备日志
// DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收入库丢失", fileVoList,taskBto.getId(),null);
......@@ -523,7 +523,7 @@ public class BackController {
deviceLibrary.setLifeStatus(2);
deviceLibrary.setOwnUnit(allotBackBill.getReceiveUnit());
deviceLibrary.setManageStatus(1);
deviceLibrary.setStorageLocationId(null);
deviceLibrary.setStorageLocationId(0);
deviceLibrary.setStorageLocation(null);
deviceLibraryService.update(deviceLibrary);
});
......
......@@ -373,7 +373,9 @@ public enum LogType {
//[业务操作日志]存储失败:找不到业务类型为+4,旧状态为400,新状态为8888的日志模板
SELF_CHECK_8(170,SELF_CHECK.id,WAIT_SELF_CHECK.id,ARCHIVE.id,"核查结束,系统发起的自查自动结束"),
REPAIR_BACK_21(171,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_UNDER_DRAFT.id, "省直属等待出库"),
ALLOT_BACK_21(172,ALLOT_BACK.id,ORIGIN_STATUS.id,BACK_UNDER_DRAFT.id,"省直属等待出库");
ALLOT_BACK_21(172,ALLOT_BACK.id,ORIGIN_STATUS.id,BACK_UNDER_DRAFT.id,"省直属等待出库"),
READ_SELF(173,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK.id,"开始进行盘点自查"),
READ_SELF_END(174,READMACHINE_SELFCHECK.id,ORIGIN_STATUS.id,READ_SELF_CHECK_END.id,"盘点自查结束");
public Integer id;
......
......@@ -111,7 +111,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.updateTime=current_timestamp,o.storageLocation=null ,o.storageLocationId=null where o.seqNumber in :seqNumbers")
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.updateTime=current_timestamp,o.storageLocation=null ,o.storageLocationId=0 where o.seqNumber in :seqNumbers")
int upDateSeqNumbersLeftStatusStorageLocationNull(Integer lifeStatus,@Param("seqNumbers") List<String> seqNumbers);
@Transactional
......@@ -137,13 +137,13 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName ,o.lockStatus=:lock ,o.updateTime=current_timestamp ,o.storageLocation =null ,o.storageLocationId=null where o.id in :idList")
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName ,o.lockStatus=:lock ,o.updateTime=current_timestamp ,o.storageLocation =null ,o.storageLocationId=0 where o.id in :idList")
int upDateLeftStatusAndUnitNameAndLockStatusStorageLocationNull(Integer lifeStatus,String unitName,Integer lock,@Param("idList") List<Integer> idList);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName,o.lockStatus=:lock ,o.updateTime=current_timestamp,o.storageLocationId = null,o.storageLocation=null where o.seqNumber in :seqNumbers")
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName,o.lockStatus=:lock ,o.updateTime=current_timestamp ,o.storageLocation =null ,o.storageLocationId=0 where o.seqNumber in :seqNumbers")
int upDateSeqNumbersLeftStatusAndUnitNameAndLockStatus(Integer lifeStatus,String unitName,Integer lock,@Param("seqNumbers") List<String> seqNumbers);
@Transactional
......
......@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import java.util.List;
import java.util.Map;
/**
* @author zsp
......@@ -69,4 +70,6 @@ public interface DeviceLibraryPositionService {
void fnUpdatePostionMessageList(UpdatePostionMessageVO updatePostionMessageVO);
List<DeviceLibraryPosition> findAll();
}
......@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.service;
import com.tykj.dev.config.UpdateCache;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.model.vo.QueryNotOnVo;
import com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo;
import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.user.util.DecryptMD5;
......@@ -564,5 +565,21 @@ public interface DeviceLibraryService {
*/
Map<String,Object> fnConditionQuery(QueryTheWarehouseVo queryTheWarehouseVo);
/**
* 查询为上架的商品
* @param queryNotOnVo 条件查询类
* @return
*/
Map<String,Object> fnNotOnDeviceQuery(QueryNotOnVo queryNotOnVo);
void batchUpdateDevicesByPackingIds(String newModel,List<Integer> packingIds);
void importData();
/**
* 配件的集合
* @param deviceId 装备id
* @return 配件的集合
*/
List<PartsVo> findAllParts(Integer deviceId);
}
package com.tykj.dev.device.library.service;
import java.util.List;
/**
* @author zsp
* @create 2022/2/14 13:21
*/
public interface VerificationService {
/**
* 判断装备是否所在是不是自己(若不是抛出303异常)
* @param ids 装备ID的集合
*/
void isLocal(List<Integer> ids);
}
package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.config.Log;
import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
......@@ -16,6 +21,7 @@ import java.util.stream.Collectors;
* @create 2021/12/13 16:23
*/
@Service
@Slf4j
public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionService {
@Autowired
......@@ -85,4 +91,14 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
deviceLibraryPositionDao.fnUpdatePostionMessageList(json, json1,updatePostionMessageVO.getUNum(), deviceIds);
}
@Override
public List<DeviceLibraryPosition> findAll() {
StopWatch stopWatch = new StopWatch("查询3D库的时间");
stopWatch.start();
List<DeviceLibraryPosition> deviceLibraryPositionList = deviceLibraryPositionDao.findAll();
stopWatch.stop();
log.info("查询3D库的时间:{}",stopWatch.getTotalTimeMillis()+"ms");
return deviceLibraryPositionList;
}
}
package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.VerificationService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zsp
* @create 2022/2/14 13:25
*/
@Service
public class VerificationServiceImpl implements VerificationService {
@Resource
private DeviceLibraryService deviceLibraryService;
@Resource
private UserUtils userUtils;
@Override
public void isLocal(List<Integer> ids) {
String currentUserUnitName = userUtils.getCurrentUserUnitName();
ids.forEach(integer -> {
DeviceLibrary library = deviceLibraryService.getOne(integer);
if (library.getLifeStatus()!=2 && library.getLifeStatus()!=15&&library.getLifeStatus()!=14 && !library.getLifeStatus().equals(DeviceLifeStatus.SEND_BACK.id)){
throw new ApiException(ResponseEntity.status(303).body("序列号"+library.getSeqNumber()+"的装备已被其他专管员操作"));
}
if (!currentUserUnitName.equals(library.getLocationUnit())){
throw new ApiException(ResponseEntity.status(303).body("序列号"+library.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
}
}
......@@ -287,6 +287,10 @@ public class DeviceLibrary implements Serializable {
@Transient
private Integer isInLibrary;
@Transient
@ApiModelProperty(value = "状态",notes = "1 读取到 0 未读取到")
private Integer status;
// @Transient
// private DeviceLibraryPosition deviceLibraryPosition;
......
package com.tykj.dev.device.library.subject.model.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
* @create 2021/12/30 13:05
*/
@Data
@ApiModel("未上架的装备查询类")
public class QueryNotOnVo extends CustomPage {
@ApiModelProperty(value = "型号", example = "bmxx")
public String model;
@ApiModelProperty(value = "名称", example = "BM-1")
public String name;
@ApiModelProperty(value = "装备序列号", example = "123-1")
public String seqNumber;
@ApiModelProperty(value = "装备ids")
private List<Integer> deviceIds;
}
......@@ -37,6 +37,9 @@ public class QueryTheWarehouseVo extends CustomPage {
@ApiModelProperty(value = "出库")
private Integer out;
@ApiModelProperty(value = "库房id")
private Integer nonStorageLocationId;
// @ApiModelProperty(value = "库房id")
// private Integer nonStorageLocationId;
@ApiModelProperty(value = "库房id的集合")
private List<Integer> StorageLocationIds;
}
......@@ -141,8 +141,8 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "库房ids")
private List<Integer> storageLocationIds;
@ApiModelProperty(value = "库房id")
private Integer nonStorageLocationId;
// @ApiModelProperty(value = "库房id")
// private Integer nonStorageLocationId;
@ApiModelProperty(value = "装备序列号", example = "123-1")
public String seqNumber;
......
......@@ -57,5 +57,8 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0;
@ApiModelProperty(value = "列装vo")
private PackingVo packingVo;
}
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
* @create 2022/1/26 10:41
*/
@Data
@ApiModel("列装库vo")
public class PackingVo {
@ApiModelProperty(value = "列装的id")
private Integer packingId;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
/**
* 名称
*/
@ApiModelProperty(value = "名称")
private String name;
/**
* 配用范围
*/
@ApiModelProperty(value = "配用范围",notes = "1 省以下纵向 2 中央到省 3 省以下横向 4 其他")
private Integer matchingRange;
/**
* 配用范围
*/
@ApiModelProperty(value = "配用范围",notes = "省以下纵向 中央到省 省以下横向 其他")
private String matchingRangeName;
/**
* 形态
*/
@ApiModelProperty(value = "形态")
private Integer type;
/**
* 形态
*/
@ApiModelProperty(value = "形态")
private String typeName;
}
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zsp
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("根据装备id查询配件的vo")
public class PartsVo {
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "序列号")
private String seqNumber;
}
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("库房位置的vo")
public class StorageLocationVo {
@ApiModelProperty(value = "id")
private Integer storageLocationId;
@ApiModelProperty(value = "名称")
private String storageLocation;
}
......@@ -121,7 +121,9 @@ public enum BusinessEnum {
SUSPENSION(29,"中止业务"),
READMACHINE(30,"盘存"),
READMACHINE(30,"盘存盘点"),
READMACHINE_SELFCHECK(31,"盘存自查"),
;
public Integer id;
......
......@@ -324,6 +324,12 @@ public enum StatusEnum {
*/
READ_DEAFT(3000, "保存盘存草稿"),
READ_End(3001, "结束盘存任务"),
/**
* 盘存自查状态
*/
READ_SELF_CHECK(3002,"开始进行盘点自查"),
READ_SELF_CHECK_END(3003,"盘点自查结束")
;
......
package com.tykj.dev.readmachine.devreadmachine.Entity;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.SpringUtils;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackJsonVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.DeviceVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.beans.BeanUtils;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.swing.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author zsp
* @create 2022/1/18 10:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@ApiModel("载体自查实体")
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update warehouse_inspection set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
public class WarehouseInspectionBill {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "主键id")
private Integer id;
@Column(name = "title",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查名称")
private String title;
@CreatedDate
@ApiModelProperty(value = "创建时间")
private Date createTime;
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "库房数量")
private Integer checkedCount;
@ApiModelProperty(value = "实查数量")
private Integer checkingCount;
@ApiModelProperty(value = "创建人的id")
private Integer createUserId;
@Column(name = "check_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查详情")
private String checkResult;
@Column(name = "un_check_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "自查详情")
private String unCheckResult;
@ApiModelProperty(value = "逻辑删除",notes = "0 未删除 1 已删除")
private Integer deleteTag = 0;
@ApiModelProperty(value = "创建人的名称")
@Transient
private String createUserName;
public WarehouseInspectionBill setConfig(){
UserCache initUserCache = SpringUtils.getBean("initUserCache");
assert initUserCache != null;
setCreateUserName(initUserCache.findById(this.createUserId).getName());
return this;
}
}
package com.tykj.dev.readmachine.devreadmachine.Vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
* @create 2022/1/14 17:00
*/
@Data
@ApiModel("读写机自查的vo")
public class ReadMachineSelefVo {
@ApiModelProperty(value = "装备的集合")
private List<DeviceLibrary> deviceLibraries;
@ApiModelProperty(value = "数量")
private Integer size;
}
package com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
* @create 2022/1/19 9:51
*/
@Data
@ApiModel("装备转换vo")
public class BackJsonVo {
@ApiModelProperty(value = "读取到的详情")
private List<DeviceLibrary> inDeviceLibraryList;
@ApiModelProperty(value = "未读取到的详情")
private List<DeviceLibrary> outDeviceLibraryList;
}
package com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zsp
* @create 2022/1/18 10:58
*/
@Data
@ApiModel("保存盘点自查vo")
public class BackSelfCheckVo {
@ApiModelProperty(value = "盘点自查的对象")
private WarehouseInspectionBill warehouseInspectionBill;
@ApiModelProperty(value = "装备转换的vo")
private BackJsonVo backJsonVo;
}
package com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author zsp
* @create 2022/1/18 13:01
*/
@Data
@ApiModel("查询装备的vo")
public class DeviceVo {
@ApiModelProperty(value = "装备状态为读取到的集合")
private List<Map<Integer,Integer>> inDevices;
@ApiModelProperty(value = "装备状态为未读取到的集合")
private List<Map<Integer,Integer>> outDevices;
}
package com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.Map;
/**
* @author zsp
* @create 2022/1/18 10:58
*/
@Data
@ApiModel("保存盘点自查vo")
public class SaveSelfCheckVo {
@ApiModelProperty(value = "自查名称")
private String title;
@ApiModelProperty(value = "创建人的id")
private Integer createUserId;
@ApiModelProperty(value = "创建人的名称")
private String createUserName;
@ApiModelProperty(value = "库房数量")
private Integer checkedCount;
@ApiModelProperty(value = "实查数量")
private Integer checkingCount;
@ApiModelProperty(value = "装备的详情")
private DeviceVo deviceVo;
public WarehouseInspectionBill toEntity(){
WarehouseInspectionBill warehouseInspection = new WarehouseInspectionBill();
BeanUtils.copyProperties(this,warehouseInspection);
List<Map<Integer, Integer>> inDevices = deviceVo.getInDevices();
//转换json
if (inDevices.size()>0){
String checkResult = JacksonUtil.toJSon(inDevices);
warehouseInspection.setCheckResult(checkResult);
}
List<Map<Integer, Integer>> outDevices = deviceVo.getOutDevices();
if (outDevices.size() >0){
String unCheckResult = JacksonUtil.toJSon(outDevices);
warehouseInspection.setUnCheckResult(unCheckResult);
}
return warehouseInspection;
}
}
package com.tykj.dev.readmachine.devreadmachine.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackJsonVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.SaveSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.service.WarehouseInspectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zsp
* @create 2022/1/18 10:32
*/
@RestController
@RequestMapping(value = "/warehouseInspectionBill")
@AutoDocument
@Api(tags = "盘存自查", description = "盘存自查")
@Validated
@Slf4j
public class WarehouseInspectionBillController {
@Resource
private WarehouseInspectionService warehouseInspectionService;
@PostMapping("/startSelfCheck")
@ApiOperation(value = "开启盘存自查业务")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<String> startSelfCheck(@RequestBody SaveSelfCheckVo saveSelfCheckVo){
warehouseInspectionService.startSelfCheck(saveSelfCheckVo);
return ResponseEntity.ok("盘点完成");
}
@GetMapping("/findByBillId")
@ApiOperation(value = "查看单个业务")
public ResponseEntity<BackSelfCheckVo> findByBillId(Integer id){
BackSelfCheckVo backSelfCheckVo = warehouseInspectionService.findById(id);
return ResponseEntity.ok(backSelfCheckVo);
}
@GetMapping("/findAllBillList")
@ApiOperation(value = "查看盘点自查业务列表")
public ResponseEntity<List<WarehouseInspectionBill>> findAllBillList(){
List<WarehouseInspectionBill> bills = warehouseInspectionService.findAll();
bills.forEach(WarehouseInspectionBill::setConfig);
return ResponseEntity.ok(bills);
}
@GetMapping("/findByTaskId")
@ApiOperation(value = "通过任务id查询详情")
public ResponseEntity<BackSelfCheckVo> findByTaskId(Integer taskId){
BackSelfCheckVo backSelfCheckVo = warehouseInspectionService.findByTaskId(taskId);
return ResponseEntity.ok(backSelfCheckVo);
}
@GetMapping("/findAllDevices")
@ApiOperation(value = "查询所有的装备")
public ResponseEntity<BackJsonVo> findAllDevices(){
List<DeviceLibrary> allDevices = warehouseInspectionService.findAllDevices();
allDevices.forEach(DeviceLibrary::setConfigName);
BackJsonVo backJsonVo = new BackJsonVo();
backJsonVo.setOutDeviceLibraryList(allDevices);
return ResponseEntity.ok(backJsonVo);
}
}
package com.tykj.dev.readmachine.devreadmachine.repository;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zsp
* @create 2022/1/18 10:37
*/
public interface WarehouseInspectionDao extends JpaRepository<WarehouseInspectionBill,Integer>, JpaSpecificationExecutor<WarehouseInspectionBill> {
}
package com.tykj.dev.readmachine.devreadmachine.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.SaveSelfCheckVo;
import java.util.List;
/**
* @author zsp
* @create 2022/1/18 10:32
*/
public interface WarehouseInspectionService {
/**
* 新增实体
* @param warehouseInspectionBill 盘存自查对象vo
* @return WarehouseInspectionBill 业务对象
*/
WarehouseInspectionBill addEntity(WarehouseInspectionBill warehouseInspectionBill);
/**
* 开始盘存自查任务
* @param selfCheckVo 发起自查对象
*/
void startSelfCheck(SaveSelfCheckVo selfCheckVo);
/**
* 更新实体
* @param warehouseInspection 盘存自查对象
*/
void updateEntity(WarehouseInspectionBill warehouseInspection);
/**
* 查询单个
* @param id 主键id
* WarehouseInspectionBill 业务对象
*/
BackSelfCheckVo findById(Integer id);
/**
* 查询单个
* @param id 主键id
* WarehouseInspectionBill 业务对象
*/
WarehouseInspectionBill findById1(Integer id);
// void findAllByContional();
/**
* 删除单个
* @param id 主键id
*/
void deleteById(Integer id);
/**
* 查询所有装备
* @return 所有的都是未读的装备对象
*/
List<DeviceLibrary> findAllDevices();
/**
* 查询所有的业务对象
* @return List<WarehouseInspectionBill> 业务列表
*/
List<WarehouseInspectionBill> findAll();
/**
* 根据任务id查询业务
* @param taskId 任务id
* @return BackSelfCheckVo
*/
BackSelfCheckVo findByTaskId(Integer taskId);
}
package com.tykj.dev.readmachine.devreadmachine.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.readmachine.devreadmachine.Entity.WarehouseInspectionBill;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackJsonVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.BackSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.Vo.selfCheckVo.SaveSelfCheckVo;
import com.tykj.dev.readmachine.devreadmachine.repository.WarehouseInspectionDao;
import com.tykj.dev.readmachine.devreadmachine.service.WarehouseInspectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author zsp
* @create 2022/1/18 10:36
*/
@Service
public class WarehouseInspectionServiceImpl implements WarehouseInspectionService {
@Resource
private WarehouseInspectionDao warehouseInspectionDao;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Resource
private TaskService taskService;
@Resource
private UserUtils userUtils;
@Override
public WarehouseInspectionBill addEntity(WarehouseInspectionBill warehouseInspectionBill) {
return warehouseInspectionDao.save(warehouseInspectionBill);
}
@Override
public void startSelfCheck(SaveSelfCheckVo selfCheckVo) {
Integer currentUserId = userUtils.getCurrentUserId();
Integer unitId = userUtils.getCurrentUnitId();
List<Integer> userList = new ArrayList<>();
userList.add(currentUserId);
//先进行对象的赋值
WarehouseInspectionBill warehouseInspectionBill = selfCheckVo.toEntity();
//然后保存
WarehouseInspectionBill warehouseInspectionBill1 = addEntity(warehouseInspectionBill);
TaskBto taskBto = new TaskBto(StatusEnum.READ_SELF_CHECK.id,selfCheckVo.getTitle(),".",
warehouseInspectionBill1.getId(), BusinessEnum.READMACHINE_SELFCHECK.id,unitId,0,userList);
taskService.start(taskBto);
taskService.moveToEnd(taskBto);
}
@Override
public void updateEntity(WarehouseInspectionBill warehouseInspection) {
warehouseInspectionDao.save(warehouseInspection);
}
@Override
public BackSelfCheckVo findById(Integer id) {
Optional<WarehouseInspectionBill> byId = warehouseInspectionDao.findById(id);
if (byId.isPresent()){
WarehouseInspectionBill warehouseInspectionBill = byId.get();
warehouseInspectionBill.setConfig();
return toBackSelfCheckVo(warehouseInspectionBill);
}else {
throw new ApiException(String.format("要查询的数据不存在,查询的billId为 %d,businessType为 %d", id, 30));
}
}
@Override
public WarehouseInspectionBill findById1(Integer id) {
Optional<WarehouseInspectionBill> byId = warehouseInspectionDao.findById(id);
if (byId.isPresent()){
WarehouseInspectionBill warehouseInspectionBill = byId.get();
warehouseInspectionBill.setConfig();
return warehouseInspectionBill;
}else {
throw new ApiException(String.format("要查询的数据不存在,查询的billId为 %d,businessType为 %d", id, 30));
}
}
@Override
public void deleteById(Integer id) {
warehouseInspectionDao.deleteById(id);
}
@Override
public List<DeviceLibrary> findAllDevices() {
String currentUserUnitName = userUtils.getCurrentUserUnitName();
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
// predicateBuilder.eq("ownUnit",currentUserUnitName);
predicateBuilder.eq("locationUnit",currentUserUnitName);
List<Integer> statusList = new ArrayList<>(Arrays.asList(5,10,12));
List<DeviceLibrary> allDevices = deviceLibraryService.findAllDevices().stream()
.filter(deviceLibrary -> deviceLibrary.getLocationUnit().equals(currentUserUnitName)
&& !statusList.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList());
allDevices.forEach(deviceLibrary -> deviceLibrary.setStatus(0));
return allDevices;
}
@Override
public List<WarehouseInspectionBill> findAll() {
return warehouseInspectionDao.findAll();
}
@Override
public BackSelfCheckVo findByTaskId(Integer taskId) {
TaskBto byTaskId = taskService.findByTaskId(taskId);
WarehouseInspectionBill inspectionBill = findById1(byTaskId.getBillId());
inspectionBill.setConfig();
BackSelfCheckVo backSelfCheckVo = new BackSelfCheckVo();
backSelfCheckVo.setWarehouseInspectionBill(inspectionBill);
backSelfCheckVo.setBackJsonVo(toBackSelfCheckVo(inspectionBill).getBackJsonVo());
return backSelfCheckVo;
}
private BackSelfCheckVo toBackSelfCheckVo(WarehouseInspectionBill warehouseInspectionBill){
//总的装备的map
List<DeviceLibrary> allDevices = findAllDevices();
BackSelfCheckVo backSelfCheckVo = new BackSelfCheckVo();
backSelfCheckVo.setWarehouseInspectionBill(warehouseInspectionBill);
List<Map<Integer, Integer>> inMaps = JacksonUtil.readValue(warehouseInspectionBill.getCheckResult(), new TypeReference<List<Map<Integer
, Integer>>>() {
});
List<Map<Integer, Integer>> outMaps = JacksonUtil.readValue(warehouseInspectionBill.getUnCheckResult(), new TypeReference<List<Map<Integer
, Integer>>>() {
});
BackJsonVo backJsonVo = new BackJsonVo();
//遍历已读的装备的集合
List<DeviceLibrary> readDeviceList = new ArrayList<>();
List<Integer> readKeyList = new ArrayList<>();
assert inMaps != null;
for (Map<Integer, Integer> inMap : inMaps) {
Set<Integer> integers = inMap.keySet();
readKeyList.addAll(integers);
}
readDeviceList = allDevices.stream().filter(deviceLibrary -> {
if (readKeyList.contains(deviceLibrary.getId())){
deviceLibrary.setStatus(1);
return true;
}else {
return false;
}
}).collect(Collectors.toList());
allDevices.removeAll(readDeviceList);
//遍历未读的装备的集合
List<DeviceLibrary> noReadDeviceList = new ArrayList<>();
List<Integer> noReadKeyList = new ArrayList<>();
assert outMaps != null;
for (Map<Integer, Integer> outMap : outMaps) {
Set<Integer> integers = outMap.keySet();
noReadKeyList.addAll(integers);
}
noReadDeviceList = allDevices.stream().filter(deviceLibrary -> {
if (noReadKeyList.contains(deviceLibrary.getId())){
deviceLibrary.setStatus(0);
return true;
}else {
return false;
}
}).collect(Collectors.toList());
backJsonVo.setInDeviceLibraryList(readDeviceList);
backJsonVo.setOutDeviceLibraryList(noReadDeviceList);
backSelfCheckVo.setBackJsonVo(backJsonVo);
return backSelfCheckVo;
}
}
......@@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
* @createTime 2020年08月19日 23:53:00
*/
@Slf4j
@ServerEndpoint(value = "/websocket/{userId}") //接受websocket请求路径
@ServerEndpoint(value = "/websocket/{userId}",encoders = {ServerEncoder.class}) //接受websocket请求路径
@Component //注册到spring容器中
@Data
public class ReadWebSocket {
......@@ -85,6 +85,8 @@ public class ReadWebSocket {
webSocketMap.remove(userId);
if (webSocketMap.size() == 0){
ReadMachineBillController.localFlag= false;
ReadMachineBillController.totalDeviceLibraries.clear();
ReadMachineBillController.theReadDeviceLibraries.clear();
}
log.info("用户退出:" + userId + ",当前在线人数为:" + webSocketMap.size());
}
......@@ -165,6 +167,14 @@ public class ReadWebSocket {
}
}
public void sendMessage3(Object o) {
try {
this.session.getBasicRemote().sendObject(o);
} catch (IOException | EncodeException e) {
e.printStackTrace();
}
}
public void sendMessage1() {
for (String i : webSocketMap.keySet()) {
webSocketMap.get(i).sendMessage("1");
......@@ -177,6 +187,12 @@ public class ReadWebSocket {
}
}
public void sendMessageForReadMachineForSelfCheck(Object o) {
for (String i : webSocketMap.keySet()) {
webSocketMap.get(i).sendMessage3(o);
}
}
public void sendMessageForReadMachine1(Object o,Integer userId) {
webSocketMap.get(String.valueOf(userId)).sendMessage2(o);
......
package com.tykj.dev.readmachine.devreadmachine.socket;
import com.alibaba.fastjson.JSONObject;
import com.tykj.dev.readmachine.devreadmachine.Vo.ReadMachineSelefVo;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;
/**
* @author zsp
* @create 2022/1/17 15:53
*/
public class ServerEncoder implements Encoder.Text<ReadMachineSelefVo> {
@Override
public String encode(ReadMachineSelefVo object) throws EncodeException {
return JSONObject.toJSONString(object);
}
@Override
public void init(EndpointConfig endpointConfig) {
}
@Override
public void destroy() {
}
}
......@@ -207,8 +207,8 @@ public class ReadUtils {
AntPower jaap=Jreader.new AntPower();
jaap.antid=i+1;
// jaap.readPower=2800;
jaap.readPower=1000;
jaap.writePower=1000;
jaap.readPower=2000;
jaap.writePower=1500;
// jaap.writePower=2750;
apcf.Powers[i]=jaap;
}
......@@ -456,8 +456,10 @@ public class ReadUtils {
{
AntPower jaap=Jreader.new AntPower();
jaap.antid=i+1;
jaap.readPower=2800;
jaap.writePower=2750;
// jaap.readPower=2800;
jaap.readPower=2000;
// jaap.writePower=2750;
jaap.writePower=1500;
apcf.Powers[i]=jaap;
}
AntPowerConf apcf2=Jreader.new AntPowerConf();
......@@ -528,7 +530,9 @@ public class ReadUtils {
//flen 0 为取消过滤
tfst.flen=2;
tfst.isInvert=0;
tfst.startaddr=2;
//修改起始地址
// tfst.startaddr=2;
tfst.startaddr=32;
TagFilter_ST tfst2=Jreader.new TagFilter_ST();
er=Jreader.ParamSet(Mtr_Param.MTR_PARAM_TAG_FILTER, tfst);
......@@ -609,7 +613,7 @@ public class ReadUtils {
//测试gpio
//mt.testgpio();
//测试参数
//mt.testrparams();
mt.testrparams();
//测试块操作
//mt.testblockop();
//测试特殊指令
......
......@@ -597,7 +597,7 @@ public class RepairController {
if (level == 1) {
deviceLibraryEntity.setLifeStatus(4);
deviceLibraryEntity.setLocationUnit(repairBillSaveVo.getReceiveUnit());
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
} else {
deviceLibraryEntity.setLifeStatus(4);
......@@ -780,7 +780,7 @@ public class RepairController {
deviceLibraryEntity.setLifeStatus(4);
deviceLibraryEntity.setLocationUnit(repairBill.getReceiveUnit());
deviceLibraryEntity.setManageStatus(1);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
//存装备日志
// DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收并发起入库", fileVoList, taskBto.getId());
......@@ -798,7 +798,7 @@ public class RepairController {
//改变装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(11);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
//存装备日志
// DeviceLogDto deviceLogDto = new DeviceLogDto(id, "接收入库丢失", fileVoList, taskBto.getId());
......@@ -1358,7 +1358,7 @@ public class RepairController {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLocationUnit(repairBackBill.getReceiveUnit());
deviceLibraryEntity.setStorageLocation(null);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
//如果所属和所在一致,状态改为在库
if (deviceLibraryEntity.getOwnUnit().equals(deviceLibraryEntity.getLocationUnit())) {
deviceLibraryEntity.setLifeStatus(2);
......@@ -2367,7 +2367,7 @@ public class RepairController {
deviceLogService.addLog(deviceLogDto);
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(integer);
deviceLibraryEntity.setLocationUnit(repairBackBill.getReceiveUnit());
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryEntity.setStorageLocation(null);
if (deviceLibraryEntity.getOwnUnit().equals(repairBackBill.getReceiveUnit())){
......@@ -2508,7 +2508,7 @@ public class RepairController {
deviceLibraryEntity.setManageStatus(1);
//设置为空
deviceLibraryEntity.setStorageLocation(null);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
deviceLibraryService.update(deviceLibraryEntity);
// DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传维修单", fileVoList, taskBto.getId());
DeviceLogDto deviceLogDto = new DeviceLogDto(integer, "上传维修单", fileVoList, taskBto.getId(),taskBto.getId());
......@@ -3059,7 +3059,7 @@ public class RepairController {
deviceLibraryEntity.setLifeStatus(4);
deviceLibraryEntity.setLocationUnit(repairBillSaveVo.getReceiveUnit());
deviceLibraryEntity.setStorageLocation(null);
deviceLibraryEntity.setStorageLocationId(null);
deviceLibraryEntity.setStorageLocationId(0);
}
deviceLibraryEntity.setManageStatus(0);
deviceLibraryService.update(deviceLibraryEntity);
......
......@@ -529,7 +529,9 @@ public class StatisticalServiceImpl implements StatisticalService {
workBench.setPackingNum(packingLibraryDao.findAllByIsRootAndPackingStatus(0,2).size());
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
List<DeviceLibrary> deviceLibraries = deviceLibraryService.getDeviceByUnitNameAll(unit);
workBench.setAllDeviceNum(deviceLibraries.size());
// workBench.setAllDeviceNum(deviceLibraries.size());
workBench.setAllDeviceNum(deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getLifeStatus()!=10)
.collect(Collectors.toList()).size());//把已销毁过滤掉
workBench.setSelfDeviceNum(Long.valueOf(deviceLibraries.stream().filter(deviceLibrary ->
deviceLibrary.getOwnUnit().equals(unitName)).count()).intValue());
//查询当前登录单位的配套设备 以及下级所有单位
......@@ -545,6 +547,7 @@ public class StatisticalServiceImpl implements StatisticalService {
workBench.setDailyDeviceNum(Long.valueOf(deviceLibraries.stream().filter(deviceLibrary ->
deviceLibrary.getOwnUnit().equals(unitName)&&Arrays.asList(2,14).contains(deviceLibrary.getLifeStatus()))
.count()).intValue());
List<Task> allTasks = taskDao.findAll();
List<Task> tasks = allTasks.stream().filter(task -> task.getBusinessType()==7).collect(Collectors.toList());
List<Task> tasks2 = allTasks.stream().filter(task -> task.getBusinessType()==4).collect(Collectors.toList());
......
......@@ -15,10 +15,19 @@ public class WorkBench {
private Integer packingNum;
/**
* 全省装备库
*/
private Integer allDeviceNum;
/**
* 省级装备库
*/
private Integer selfDeviceNum;
/**
* 本级管理库
*/
private Integer dailyDeviceNum;
private Integer matchingDeviceNum;
......
......@@ -916,8 +916,9 @@ public class StorageBillController {
}
log.info("saveDevices:{}",saveDevices.size());
List<DeviceLibraryPosition> deviceLibraryPositions = new ArrayList<>();
//开始存储装备的3D
saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
//开始存储装备的3D 修改需求 只渲染类型是密码机的设备 密码机的类型为1
// saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 0).collect(Collectors.toList());
saveDevices = saveDevices.stream().filter(deviceLibrary -> deviceLibrary.getType() == 1).collect(Collectors.toList());
saveDevices.forEach(deviceLibrary -> {
DeviceLibraryPosition deviceLibraryPosition = new DeviceLibraryPosition();
deviceLibraryPosition.setDeviceId(deviceLibrary.getId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论