提交 fab1fb26 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 883e72ea
...@@ -8,7 +8,17 @@ ...@@ -8,7 +8,17 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-task</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-storage</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<artifactId>device-library</artifactId> <artifactId>device-library</artifactId>
......
package com.tykj.dev.device.library;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages={
"com.tykj.dev.*",
}
)
public class libraryApp {
public static void main(String[] args) {
SpringApplication.run(libraryApp.class, args);
}
}
package com.tykj.dev.device.library.repository;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* @author dengdiyi
*/
@SuppressWarnings("SqlResolve")
public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary,Integer>, JpaSpecificationExecutor<DeviceLibrary> {
List<DeviceLibrary> getAllByModel(String model);
List<DeviceLibrary> getAllByOwnUnit(String unit);
/**
* 根据装备型号与装备所在地(多个地区)查询装备数量
* @param model 装备型号
* @param locations 装备所在地列表
* @return 装备数量
*/
int countByModelAndLocationUnitContains(String model, List<String> locations);
/**
* 根据装备型号与装备所在地(一个地区)查询装备数量
* @param model 装备型号
* @param location 装备所在地
* @return 装备数量
*/
int countByModelAndLocationUnit(String model, String location);
List<DeviceLibrary> getAllByPartParentIdAndIsPart(Integer parentId,Integer isPart);
List<DeviceLibrary> getAllByRfidCardId(String rfidCardId);
@Query(nativeQuery = true ,value= "select * from device_library where id in :idList")
List<DeviceLibrary> getDeviceLibraryEntitiesByIdIn(@Param("idList")List<Integer> idList);
List<DeviceLibrary> getAllByRfidSurfaceId(String rfid);
}
package com.tykj.dev.device.library.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.task.subject.vo.BussinessLogVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* @author dengdiyi
*/
public interface DeviceLibraryService {
DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity);
List<DeviceLibrary> addEntityList(List<DeviceLibrary> list);
Page<DeviceLibrary> getPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable);
Page<DeviceLibrary> getTagPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable);
List<DeviceLibrary> getAllotPage(DeviceLibrarySelectVo deviceLibrarySelectVo);
Page<DeviceLibrary> getCoreDevicePage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable);
// Page<DeviceLibrary> getDeviceStatisticsPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable);
List<String> getAllName();
List<BussinessLogVo> getDeviceLog(Integer id);
List<DeviceLibrary> getList(DeviceLibrarySelectVo deviceLibrarySelectVo);
List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo);
List<DeviceLibrary> getCheckList();
List<DeviceLibrary> getAllotList(DeviceLibrarySelectVo deviceLibrarySelectVo);
List<DeviceLibrary> getListByBillId(Integer id);
DeviceLibrary update(DeviceLibrary deviceLibraryEntity);
DeviceLibrary getOne(Integer id);
void delete(Integer id);
List<DeviceLibrary> getListWithoutParent(DeviceLibrarySelectVo deviceLibrarySelectVo);
List<String> getAllUnit();
}
package com.tykj.dev.device.library.subject.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
/**
* entity class for device_library
* 装备库
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_library set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("装备库")
public class DeviceLibrary {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
/**
* 入库单id
*/
@ApiModelProperty(value = "入库单id")
private Integer storageBillId;
/**
* 列装id
*/
@ApiModelProperty(value = "列装id")
private Integer packingId;
/**
* 是不是配件(0:不是,1:是)
*/
@ApiModelProperty(value = "是不是配件(0:不是,1:是)")
private Integer isPart;
/**
* 配件对应装备id
*/
@ApiModelProperty(value = "配件对应装备id")
private Integer partParentId;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
/**
* 密级
*/
@ApiModelProperty(value = "密级")
private Integer secretLevel;
/**
* 装备名称
*/
@ApiModelProperty(value = "装备名称")
private String name;
/**
* 装备序列号
*/
@ApiModelProperty(value = "装备序列号")
private String seqNumber;
/**
* 生产序列号
*/
@ApiModelProperty(value = "生产序列号")
private String prodNumber;
/**
* rfid表面号
*/
@ApiModelProperty(value = "rfid表面号")
private String rfidSurfaceId;
/**
* rfid卡号
*/
@ApiModelProperty(value = "rfid卡号")
private String rfidCardId;
/**
* 所在单位
*/
@ApiModelProperty(value = "所在单位")
private String locationUnit;
/**
* 所属单位
*/
@ApiModelProperty(value = "所属单位")
private String ownUnit;
/**
* 配用范围,1-省对下纵向
*/
@ApiModelProperty(value = "配用范围,1-省对下纵向")
private Integer matchingRange;
/**
* 可见范围
*/
@ApiModelProperty(value = "可见范围")
private Integer invisibleRange;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private Integer type;
/**
* 入库类型,1-横向,2-纵向
*/
@ApiModelProperty(value = "入库类型,1-横向,2-纵向")
private Integer storageType;
/**
* 管理状态,0-不再所属单位,1-在所属单位
*/
@ApiModelProperty(value = "管理状态,0-不再所属单位,1-在所属单位")
private Integer manageStatus;
/**
* 生命状态,0-入库待审核,1-入库审核失败,2-在库,3-配发,4-维修,5,维修失败,6-退回,7-待退装,8-退装,9-待销毁,10-已销毁,11-丢失
*/
@ApiModelProperty(value = "生命状态,0-入库待审核,1-入库审核失败,2-在库,3-配发,4-维修,5,维修失败,6-退回,7-待退装,8-退装,9-待销毁,10-已销毁,11-丢失")
private Integer lifeStatus;
/**
* 锁定状态,0-未锁定可用,1-锁定不可用
*/
@ApiModelProperty(value = "锁定状态,0-未锁定可用,1-锁定不可用")
private Integer lockStatus = 0;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty(value = "更新用户id")
private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@ApiModelProperty(value = "入库操作人")
@Transient
private String storageProcessingUser;
@ApiModelProperty(value = "入库审核人")
@Transient
private String storageConfirmUser;
@ApiModelProperty(value = "从属于")
@Transient
private String parentDevice;
/**
* 检查结果(0:丢失,1:无误,2:新增)
*/
@ApiModelProperty(value = "检查结果(0:丢失,1:无误,2:新增)")
@Transient
private Integer checkResult;
@Transient
private List<DeviceLibrary> childs = new ArrayList<>();
public void addChildNode(DeviceLibrary deviceLibraryEntity) {
childs.add(deviceLibraryEntity);
}
}
package com.tykj.dev.device.library.subject.domin;
import com.tykj.dev.device.task.subject.vo.FileVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
/**
* entity class for device_log
* 设备履历日志
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_log set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("设备履历日志")
public class DeviceLog {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
/**
* 日志类型(默认0为装备日志,1为设备日志)
*/
@ApiModelProperty(value = "日志类型(默认0为装备日志,1为设备日志)")
private Integer type = 0;
/**
* 装备id
*/
@ApiModelProperty(value = "装备id")
private Integer deviceId;
/**
* 操作人主键id
*/
@ApiModelProperty(value = "操作人主键id")
private Integer userId;
/**
* 操作时间
*/
@ApiModelProperty(value = "操作时间")
private Date logTime;
/**
* 操作描述
*/
@ApiModelProperty(value = "操作描述")
private String remark;
/**
* 相关附件信息(Ǵ作为每个附件分隔符,Ǒ作为附件内部分隔符,例如name1Ǒurl1Ǒ配发单Ǵname2Ǒurl2Ǒ入库确认单Ǵ)
*/
@ApiModelProperty(value = "相关附件信息(Ǵ作为每个附件分隔符,Ǒ作为附件内部分隔符,例如name1Ǒurl1Ǒ配发单Ǵname2Ǒurl2Ǒ入库确认单Ǵ)")
private String fileDetail;
/**
* 创建用户id
*/
@ApiModelProperty(value = "创建用户id")
@CreatedBy
private Integer createUserId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@CreatedDate
private Date createTime;
/**
* 更新用户id
*/
@ApiModelProperty(value = "更新用户id")
@LastModifiedBy
private Integer updateUserId;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
@LastModifiedDate
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@ApiModelProperty(value = "操作用户")
@Transient
private String user;
@ApiModelProperty(value = "操作单位")
@Transient
private String unit;
@ApiModelProperty(value = "附件信息")
@Transient
private List<FileVo> fileVoList;
}
package com.tykj.dev.device.library.subject.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
/**
* entity class for device_use_report
* 装备使用报告
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_use_report set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("装备使用报告")
public class DeviceUseReport {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
/**
* 报告标题
*/
@ApiModelProperty(value = "报告标题")
private String title;
/**
* 报告所属单位
*/
@ApiModelProperty(value = "报告所属单位")
private String unit;
/**
* 报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数)
*/
@ApiModelProperty(value = "报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数)")
private String reportDetail;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty(value = "更新用户id")
private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
}
package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("装备查询类")
public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "操作人",example = "1")
public Integer UserAId;
@ApiModelProperty(value = "审核人",example = "1")
public Integer UserBId;
@ApiModelProperty(value = "型号",example = "bmxx")
public String model;
@ApiModelProperty(value = "类型",example = "1")
public Integer type;
@ApiModelProperty(value = "密级",example = "1")
public Integer secretLevel;
@ApiModelProperty(value = "可见范围(应用领域)",example = "1")
public Integer invisibleRange;
@ApiModelProperty(value = "名称",example = "BM-1")
public String name;
@ApiModelProperty(value = "配用范围",example = "1")
public Integer matchingRange;
@ApiModelProperty(value = "入库类型",example = "1")
public Integer storageType;
@ApiModelProperty(value = "管理状态",example = "1")
public Integer manageStatus;
@ApiModelProperty(value = "单位id",example = "1")
public Integer unitId;
@ApiModelProperty(value = "区域id",example = "1")
public Integer areaId;
@ApiModelProperty(value = "模糊查询内容",example = "测试")
public String content;
@ApiModelProperty(value = "发起时间",example = "2020-10-10 01:10:10")
public Date startTime;
@ApiModelProperty(value = "确认时间",example = "2020-10-10 01:10:10")
public Date endTime;
@ApiModelProperty(value = "装备状态",example = "1,2,3,4")
public List<Integer> lifeStatus;
@ApiModelProperty(value = "列装id")
private Integer packingId;
@ApiModelProperty(value = "所在单位")
private String locationUnit;
@ApiModelProperty(value = "所属单位")
private String ownUnit;
@ApiModelProperty(value = "rfid卡号")
private String rfidCardId;
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>device-stotage</artifactId> <artifactId>device-storage</artifactId>
</project> </project>
\ No newline at end of file
package com.tykj.dev.device.storage.repository;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface StorageBillDao extends JpaRepository<StorageBill, Integer>, JpaSpecificationExecutor<StorageBill> {
}
package com.tykj.dev.device.storage.service;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* @author dengdiyi
*/
public interface StorageBillService {
StorageBill addEntity(StorageBill storageBillEntity);
Page<StorageBill> getPage(StorageBill storageBillEntity, Pageable pageable);
List<StorageBill> getList(StorageBill storageBillEntity);
StorageBill update(StorageBill storageBillEntity);
StorageBill getOne(Integer id);
void delete(Integer id);
}
package com.tykj.dev.device.storage.service.impl;
import com.tykj.dev.device.storage.repository.StorageBillDao;
import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* @author dengdiyi
*/
@Service
public class StorageBillServiceImpl implements StorageBillService {
@Autowired
private StorageBillDao storageBillDao;
@Override
public StorageBill addEntity(StorageBill storageBillEntity) {
return storageBillDao.save(storageBillEntity);
}
@Override
public Page<StorageBill> getPage(StorageBill storageBillEntity, Pageable pageable) {
return null;
}
@Override
public List<StorageBill> getList(StorageBill storageBillEntity) {
return null;
}
@Override
public StorageBill update(StorageBill storageBillEntity) {
return storageBillDao.save(storageBillEntity);
}
@Override
public StorageBill getOne(Integer id) {
Optional<StorageBill> storageBillEntity = storageBillDao.findById(id);
return storageBillEntity.orElse(null);
}
@Override
public void delete(Integer id) {
storageBillDao.deleteById(id);
}
}
package com.tykj.dev.device.storage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages={
"com.tykj.dev.*",
}
)
public class storageApp {
public static void main(String[] args) {
SpringApplication.run(storageApp.class, args);
}
}
package com.tykj.dev.device.storage.subject.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
/**
* entity class for storage_bill
* 入库账单
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update storage_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("入库账单")
public class StorageBill {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
/**
* 申请文号
*/
@ApiModelProperty(value = "申请文号")
private String applyNumber;
/**
* 批复文号
*/
@ApiModelProperty(value = "批复文号")
private String replayNumber;
/**
* 配发单位
*/
@ApiModelProperty(value = "配发单位")
private String sendUnit;
/**
* 配发时间
*/
@ApiModelProperty(value = "配发时间")
private Date sendTime;
/**
* 发件方id
*/
@ApiModelProperty(value = "发件方")
private String sendUserId;
/**
* 收件方id(A岗位)
*/
@ApiModelProperty(value = "收件方id(A岗位)")
private Integer receiveUseraId;
/**
* 收件方id(B岗位)
*/
@ApiModelProperty(value = "收件方id(B岗位)")
private Integer receiveUserbId;
/**
* 入库状态(0:待审核,1:审核失败,2:已入库)
*/
@ApiModelProperty(value = "入库状态(0:待审核,1:审核失败,2:已入库)")
private Integer storageStatus;
/**
* 账单文件地址URL
*/
@ApiModelProperty(value = "账单文件地址URL")
private String fileName;
/**
* 账单文件地址URL
*/
@ApiModelProperty(value = "账单文件地址URL")
private String fileUrl;
/**
* 入库附件文件名
*/
@ApiModelProperty(value = "入库附件文件名")
private String receiveFileName;
/**
* 入库附件文件地址URL
*/
@ApiModelProperty(value = "入库附件文件地址URL")
private String receiveFileUrl;
/**
* 待入库装备数量
*/
@ApiModelProperty(value = "待入库装备数量")
private Integer storagingCount;
/**
* 已入库装备数量
*/
@ApiModelProperty(value = "已入库装备数量")
private Integer storagedCount;
/**
* 入库详情(列装主键idx列装数量x装备主键id(字符,作为不同列装的分隔符)),例如1x2x3x4,2x1x5,意为列装库中id为1的入库2件(装备id分别为3,4),列装库中id为2的入库1件(装备id为5)
*/
@ApiModelProperty(value = "入库详情(装备主键id+核对结果(0缺失1无误2不匹配,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的不匹配")
private String storageDetail;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private java.sql.Timestamp createTime;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty(value = "更新用户id")
private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private java.sql.Timestamp updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@ApiModelProperty(value = "经办人")
@Transient
private String receiveUserA;
@ApiModelProperty(value = "审核人")
@Transient
private String receiveUserB;
}
...@@ -30,7 +30,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -30,7 +30,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1, StatusEnum.END).id); taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1, StatusEnum.END).id);
//list add 0,point++ //list add 0,point++
taskBto.getInvoleUserIdList().add(0); taskBto.getInvolveUserIdList().add(0);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -48,7 +48,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -48,7 +48,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id); taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id);
//list add 0,point++ //list add 0,point++
taskBto.getInvoleUserIdList().add(0); taskBto.getInvolveUserIdList().add(0);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -67,7 +67,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -67,7 +67,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id); taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id);
//list add userId,point++ //list add userId,point++
taskBto.getInvoleUserIdList().add(userId); taskBto.getInvolveUserIdList().add(userId);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -86,7 +86,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -86,7 +86,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id); taskBto.setBillStatus(StatusMap.getHashMap().getOrDefault(taskBto.getBillStatus()+1,StatusEnum.END).id);
//list add userId,point++ //list add userId,point++
taskBto.getInvoleUserIdList().add(userId); taskBto.getInvolveUserIdList().add(userId);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -105,7 +105,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -105,7 +105,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(statusEnum.id); taskBto.setBillStatus(statusEnum.id);
//list add 0,point++ //list add 0,point++
taskBto.getInvoleUserIdList().add(0); taskBto.getInvolveUserIdList().add(0);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -124,7 +124,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -124,7 +124,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(statusEnum.id); taskBto.setBillStatus(statusEnum.id);
//list add 0,point++ //list add 0,point++
taskBto.getInvoleUserIdList().add(0); taskBto.getInvolveUserIdList().add(0);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -144,7 +144,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -144,7 +144,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(statusEnum.id); taskBto.setBillStatus(statusEnum.id);
//list add userId,point++ //list add userId,point++
taskBto.getInvoleUserIdList().add(userId); taskBto.getInvolveUserIdList().add(userId);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
...@@ -164,7 +164,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -164,7 +164,7 @@ public class TaskServiceImpl implements TaskService {
//status++ //status++
taskBto.setBillStatus(statusEnum.id); taskBto.setBillStatus(statusEnum.id);
//list add userId,point++ //list add userId,point++
taskBto.getInvoleUserIdList().add(userId); taskBto.getInvolveUserIdList().add(userId);
taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1); taskBto.setCurrentPoint(taskBto.getCurrentPoint()+1);
//set readList empty //set readList empty
taskBto.setUserReadDetailList(Collections.emptyList()); taskBto.setUserReadDetailList(Collections.emptyList());
......
...@@ -44,7 +44,7 @@ public class TaskBto { ...@@ -44,7 +44,7 @@ public class TaskBto {
private Integer billId; private Integer billId;
@ApiModelProperty(value = "业务类型主键id") @ApiModelProperty(value = "业务类型主键id")
private Integer bussinessType; private Integer businessType;
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
private Integer ownUnit; private Integer ownUnit;
...@@ -62,7 +62,7 @@ public class TaskBto { ...@@ -62,7 +62,7 @@ public class TaskBto {
private List<Integer> userReadDetailList; private List<Integer> userReadDetailList;
@ApiModelProperty(value = "工作涉及人员id") @ApiModelProperty(value = "工作涉及人员id")
private List<Integer> involeUserIdList; private List<Integer> involveUserIdList;
/** /**
* bto类转化为do类 * bto类转化为do类
...@@ -71,7 +71,7 @@ public class TaskBto { ...@@ -71,7 +71,7 @@ public class TaskBto {
//复制相同属性 //复制相同属性
ModelMapper modelMapper = BeanHelper.getUserMapper(); ModelMapper modelMapper = BeanHelper.getUserMapper();
Task task = modelMapper.map(this,Task.class); Task task = modelMapper.map(this,Task.class);
task.setInvolveUsers(StringSplitUtil.idListToString(this.involeUserIdList)); task.setInvolveUsers(StringSplitUtil.idListToString(this.involveUserIdList));
task.setUserReadDetail(StringSplitUtil.idListToString(this.userReadDetailList)); task.setUserReadDetail(StringSplitUtil.idListToString(this.userReadDetailList));
task.setTopFlagDetail(StringSplitUtil.idListToString(this.topFlagDetailList)); task.setTopFlagDetail(StringSplitUtil.idListToString(this.topFlagDetailList));
return task; return task;
......
...@@ -10,14 +10,14 @@ import java.util.stream.Collectors; ...@@ -10,14 +10,14 @@ import java.util.stream.Collectors;
*/ */
public class StatusMap { public class StatusMap {
private static Map<Integer, StatusEnum> hashMap; private static Map<Integer, StatusEnum> statusEnumMap;
static { static {
hashMap = Arrays.stream(StatusEnum.values()) statusEnumMap = Arrays.stream(StatusEnum.values())
.collect(Collectors.toMap(statusEnum -> statusEnum.id, Function.identity())); .collect(Collectors.toMap(statusEnum -> statusEnum.id, Function.identity()));
} }
public static Map<Integer, StatusEnum> getHashMap() { public static Map<Integer, StatusEnum> getHashMap() {
return hashMap; return statusEnumMap;
} }
} }
...@@ -75,7 +75,7 @@ public class Task { ...@@ -75,7 +75,7 @@ public class Task {
private Integer deleteTag = 0; private Integer deleteTag = 0;
@ApiModelProperty(value = "业务类型主键id") @ApiModelProperty(value = "业务类型主键id")
private Integer bussinessType; private Integer businessType;
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
private Integer ownUnit; private Integer ownUnit;
...@@ -139,7 +139,7 @@ public class Task { ...@@ -139,7 +139,7 @@ public class Task {
ModelMapper mapper = BeanHelper.getUserMapper(); ModelMapper mapper = BeanHelper.getUserMapper();
TaskBto taskBto = mapper.map(this,TaskBto.class); TaskBto taskBto = mapper.map(this,TaskBto.class);
//解析组合字段并添加 //解析组合字段并添加
taskBto.setInvoleUserIdList(StringSplitUtil.userIdSplit(this.involveUsers)); taskBto.setInvolveUserIdList(StringSplitUtil.userIdSplit(this.involveUsers));
taskBto.setTopFlagDetailList(StringSplitUtil.userIdSplit(this.topFlagDetail)); taskBto.setTopFlagDetailList(StringSplitUtil.userIdSplit(this.topFlagDetail));
taskBto.setUserReadDetailList(StringSplitUtil.userIdSplit(this.userReadDetail)); taskBto.setUserReadDetailList(StringSplitUtil.userIdSplit(this.userReadDetail));
return taskBto; return taskBto;
......
package com.tykj.dev.device.task.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("业务详情/装备详情日志返回类")
public class BussinessLogVo {
@ApiModelProperty(value = "时间")
private Date time;
@ApiModelProperty(value = "单位")
private String unit;
@ApiModelProperty(value = "用户")
private String user;
@ApiModelProperty(value = "操作")
private String operation;
@ApiModelProperty(value = "单据列表")
private List<FileVo> fileVoList;
}
package com.tykj.dev.device.task.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("附件信息返回类")
public class FileVo {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "附件名")
private String fileName;
@ApiModelProperty(value = "附件url")
private String fileUrl;
}
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<module>device-task</module> <module>device-task</module>
<module>device-train</module> <module>device-train</module>
<module>device-user</module> <module>device-user</module>
<module>device-storage</module>
</modules> </modules>
<name>device</name> <name>device</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
...@@ -156,6 +157,11 @@ ...@@ -156,6 +157,11 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.github.wenhao</groupId>
<artifactId>jpa-spec</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -6,7 +6,7 @@ import org.springframework.http.ResponseEntity; ...@@ -6,7 +6,7 @@ import org.springframework.http.ResponseEntity;
* 全局错误处理类,用于处理一些不容易定义的错误 * 全局错误处理类,用于处理一些不容易定义的错误
* @author HuangXiahao * @author HuangXiahao
**/ **/
public class ApiException extends Exception { public class ApiException extends RuntimeException {
private ResponseEntity responseEntity; private ResponseEntity responseEntity;
......
package com.tykj.dev.misc.utils;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author HuangXiahao
* @version V1.0
* @class getTreeUtils
* @packageName com.tykj.dev.device.utils
**/
public class GetTreeUtils {
/**
* 自底向上整理出树结构,并存放在Node对象中
* 利用Map将原始List的对象的位置重新整理,并将所有的指针都设置好
*
* @param originList 原始待整理的列表
* @param getId 列表里每个对象获取自身id的方法,用于避免重复计算
* @param getParent 列表里每个对象获取父对象的方法
* @param targetSetChild 用于最终对象设置子节点的方法,形如R.setChild(R),或者R.addChildList(R)
* @param <V> 原始对象
* @param <T> 主键类型
* @return 根节点对象集合
*/
public static <V, T extends Number> List<V> parseTreeFromDown(List<V> originList,
Function<V, T> getId,
Function<V, Optional<V>> getParent,
BiConsumer<V, V> targetSetChild) {
//K为主键id , Value 为最终对象
Map<T, V> map = new HashMap<>(32);
List<T> rootIds = new ArrayList<>();
for (V originNode : originList) {
//对于所有节点,如果已经遍历过了则直接取已经设置过子节点的引用
V targetNode = map.getOrDefault(getId.apply(originNode), originNode);
Optional<V> parentNode = getParent.apply(originNode);
//查询父节点,如果不存在父节点则证明该节点为根节点,直接放入map中
if (parentNode.isPresent()) {
//否则查询该父节点是否已经已经被连接过指针,如果连接过则取出连接过的继续连接,否则进行第一次连接并存入map
V parent = parentNode.get();
T parentId = getId.apply(parent);
V parentInMap = map.get(parentId);
if (parentInMap == null) {
targetSetChild.accept(parent, targetNode);
map.put(parentId, parent);
} else {
targetSetChild.accept(parentInMap, targetNode);
}
//连接完处理之后还需要将自身这个节点存入map
map.put(getId.apply(originNode), targetNode);
} else {
//root node
map.put(getId.apply(originNode), targetNode);
rootIds.add(getId.apply(originNode));
}
}
//根据rootIds返回所有的顶层节点
return rootIds.stream().map(map::get).collect(Collectors.toList());
}
}
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<dependency> <dependency>
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>device-stotage</artifactId> <artifactId>device-storage</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<module>dev-misc</module> <module>dev-misc</module>
<module>dev-rfid</module> <module>dev-rfid</module>
<module>dev-union</module> <module>dev-union</module>
<module>device-storage</module>
</modules> </modules>
<properties> <properties>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论