提交 c7152438 authored 作者: 133's avatar 133

[丢失、找回] 添加新流程

上级 2399d974
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>equip</artifactId>
<groupId>com.tykj</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-loss</artifactId>
<dependencies>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-library</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-task</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-packing</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-file</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.loss;
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 LossApp {
public static void main(String[] args) {
SpringApplication.run(LossApp.class, args);
}
}
package com.tykj.dev.device.loss.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.service.LossBillService;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceLossController.java
* @Description TODO
* @createTime 2021年01月30日 16:07:00
*/
@RestController
@Api(tags = "装备丢失", description = "装备丢失上报接口")
@AutoDocument
@RequestMapping("/loss")
public class DeviceLossController {
@Autowired
LossBillService lossBillService;
@PostMapping(value ="/initiateLoss")
@ApiOperation(value = "丢失装备上报", notes = "丢失装备上报接口")
public ResponseEntity initiateLoss(@RequestBody DeviceLoss deviceLoss){
lossBillService.initiateLoss(deviceLoss);
return ResponseEntity.ok("上报成功");
}
@PostMapping(value ="/superiorAuditLoss")
@ApiOperation(value = "上报上级单位确认接口", notes = "上报上级单位确认接口")
public ResponseEntity initiateLoss(@RequestBody LossAuditvo lossAuditvo){
lossBillService.superiorAuditLoss(lossAuditvo);
return ResponseEntity.ok("确认成功");
}
}
package com.tykj.dev.device.loss.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.service.LossBillSelectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceLossSelectController.java
* @Description TODO
* @createTime 2021年01月30日 16:36:00
*/
@RestController
@Api(tags = "装备丢失查询模块", description = "装备丢失查询模块")
@AutoDocument
@RequestMapping("/loss/select")
public class DeviceLossSelectController {
@Autowired
LossBillSelectService lossBillSelectService;
@GetMapping(value ="/findDeviceLoss/{taskId}")
@ApiOperation(value = "上报上级单位确认接口", notes = "上报上级单位确认接口")
public ResponseEntity initiateLoss( @PathVariable Integer taskId){
return ResponseEntity.ok(lossBillSelectService.findDeviceLoss(taskId));
}
}
package com.tykj.dev.device.loss.entity.domain;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.loss.util.StringUtils;
import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Transient;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceLoss.java
* @Description TODO
* @createTime 2021年01月30日 10:36:00
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update send_back_bill_detail set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
public class DeviceLoss extends BaseEntity {
/**
* 类型
*/
@ApiModelProperty(value = "类型 1。丢失 2。找回")
private Integer type;
/**
* 发起单位id
*/
@ApiModelProperty(value = "发起单位id")
private Integer unitId;
/**
* 发起单位名称
*/
@ApiModelProperty(value = "发起单位名称")
private String unitName;
/**
* 装备id 使用逗号分隔
*/
@ApiModelProperty(value = "装备id 使用逗号分隔")
private String devIds;
/**
*县 备注
*/
@ApiModelProperty(value = "县 备注")
private String countyDes;
/**
* 备注单位名称 县
*/
@ApiModelProperty(value = "备注单位名称 县")
private String countyUnitName;
/**
* 市 备注
*/
@ApiModelProperty(value = "市 备注")
private String cityDes;
/**
* 备注单位名称 市
*/
@ApiModelProperty(value = "备注单位名称 市")
private String cityUnitName;
/**
* 省 备注
*/
@ApiModelProperty(value = "省 备注")
private String provinceDes;
/**
* 备注单位名称
*/
@ApiModelProperty(value = "备注单位名称 省")
private String provinceUnitName;
/**
* 丢失单据
*/
@ApiModelProperty(value = "丢失单据")
private String lossFile;
/**
* 找回业务状态
*/
@ApiModelProperty(value = "找回业务状态")
private Integer backStatus;
/**
* 单据集合
*/
@ApiModelProperty(value = "单据集合")
@Transient
private List<FileRet> fileRetList;
/**
* 装备集合
*/
@ApiModelProperty(value = "装备集合")
@Transient
private List<Integer> devIdsList;
public String getDevIds() {
return devIds;
}
public void setDevIds() {
this.devIds = StringUtils.ListToString(devIdsList);
}
public String getLossFile() {
return lossFile;
}
public void setLossFile() {
this.lossFile = FilesUtil.stringFileToList(fileRetList);
}
public List<FileRet> getFileRetList() {
return FilesUtil.stringFileToList(lossFile);
}
public void setFileRetList(List<FileRet> fileRetList) {
this.fileRetList = fileRetList;
}
public List<Integer> getDevIdsList() {
return StringUtils.stringToList(devIds);
}
public void setDevIdsList(List<Integer> devIdsList) {
this.devIdsList = devIdsList;
}
}
package com.tykj.dev.device.loss.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName LossAuditvo.java
* @Description 丢失审核vo
* @createTime 2021年01月30日 13:36:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LossAuditvo {
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private Integer taskId;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private Integer userId;
/**
* 用户单位id
*/
@ApiModelProperty(value = "用户单位id")
private Integer unitId;
/**
* 用户单位名称
*/
@ApiModelProperty(value = "用户单位名称")
private Integer unitName;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String des;
}
package com.tykj.dev.device.loss.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName LossAuditvo.java
* @Description 找回审核vo
* @createTime 2021年01月30日 13:36:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RetrieveAuditvo {
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private Integer taskId;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private Integer userId;
/**
* 用户单位id
*/
@ApiModelProperty(value = "用户单位id")
private Integer unitId;
/**
* 用户单位名称
*/
@ApiModelProperty(value = "用户单位名称")
private Integer unitName;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String des;
/**
* 审核状态
*/
@ApiModelProperty(value = "审核状态")
private Integer type;
}
package com.tykj.dev.device.loss.repository;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
public interface LossDao extends JpaRepository<DeviceLoss, Integer>, JpaSpecificationExecutor<DeviceLoss> {
List<DeviceLoss> findAllByUnitId(Integer unitId);
}
package com.tykj.dev.device.loss.service;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import java.util.List;
public interface DeviceLossService {
DeviceLoss save(DeviceLoss deviceLoss);
DeviceLoss findByDeviceLoss(Integer lossId);
List<DeviceLoss> findByListLoss();
List<DeviceLoss> findByListLossUnitId(Integer unitId);
}
package com.tykj.dev.device.loss.service;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
public interface LossBillSelectService {
/**
* 根据taskid查询业务详情
* @param taskId 任务id
* @return 业务详情
*/
DeviceLoss findDeviceLoss(Integer taskId);
}
package com.tykj.dev.device.loss.service;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo;
/**
* @author zjm
* @version 1.0.0
* @ClassName LossBillService.java
* @Description TODO
* @createTime 2021年01月30日 11:33:00
*/
public interface LossBillService {
/**
* 发起丢失
*/
void initiateLoss(DeviceLoss deviceLoss);
/**
*上级审核
*/
void superiorAuditLoss(LossAuditvo lossAuditvo);
/**
* 找回装备
*/
void initiateRetrieve(DeviceLoss deviceLoss);
/**
* 找回装备 审核
*/
void superiorAuditRetrieve(RetrieveAuditvo retrieveAuditvo);
}
package com.tykj.dev.device.loss.service.impl;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import com.tykj.dev.device.loss.repository.LossDao;
import com.tykj.dev.device.loss.service.DeviceLossService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceLossServiceImpl.java
* @Description TODO
* @createTime 2021年01月30日 11:17:00
*/
@Service
public class DeviceLossServiceImpl implements DeviceLossService {
@Autowired
LossDao lossDao;
@Override
public DeviceLoss save(DeviceLoss deviceLoss) {
return lossDao.save(deviceLoss);
}
@Override
public DeviceLoss findByDeviceLoss(Integer lossId) {
return lossDao.findById(lossId).get();
}
@Override
public List<DeviceLoss> findByListLoss() {
return lossDao.findAll();
}
@Override
public List<DeviceLoss> findByListLossUnitId(Integer unitId) {
return lossDao.findAllByUnitId(unitId);
}
}
package com.tykj.dev.device.loss.service.impl;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import com.tykj.dev.device.loss.service.DeviceLossService;
import com.tykj.dev.device.loss.service.LossBillSelectService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zjm
* @version 1.0.0
* @ClassName LossBillSelectServiceImpl.java
* @Description TODO
* @createTime 2021年01月30日 16:42:00
*/
@Service
public class LossBillSelectServiceImpl implements LossBillSelectService {
@Autowired
TaskService taskService;
@Autowired
DeviceLossService deviceLossService;
@Override
public DeviceLoss findDeviceLoss(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
return deviceLossService.findByDeviceLoss(taskBto.getBillId());
}
}
package com.tykj.dev.device.loss.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo;
import com.tykj.dev.device.loss.service.DeviceLossService;
import com.tykj.dev.device.loss.service.LossBillService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.DeviceLifeStatus;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* @author zjm
* @version 1.0.0
* @ClassName LossBillServiceImpl.java
* @Description TODO
* @createTime 2021年01月30日 14:08:00
*/
@Service
public class LossBillServiceImpl implements LossBillService {
@Autowired
TaskService taskService;
@Autowired
DeviceLossService deviceLossService;
@Autowired
UnitsService unitsService;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Autowired
AreaService areaService;
@Autowired
DeviceLogService deviceLogService;
@Override
public void initiateLoss(DeviceLoss deviceLoss) {
DeviceLoss deviceLossThis= deviceLossService.save(deviceLoss);
Units units=unitsService.findById(deviceLoss.getUnitId());
Area area=areaService.findByid(units.getAreaId());
if (units.getLevel() == 1) {
end(deviceLossThis.getCreateUserId(), deviceLossThis.getId(), units.getName() + "丢失装备任务", units.getUnitId());
} else {
Units parentUnits=unitsService.findByAreaId(area.getFatherId());
newLossTask(parentUnits.getUnitId(), deviceLossThis.getId(), units.getName() + "丢失装备任务");
}
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.LOSS.id,deviceLoss.getDevIdsList());
devLogAdd(deviceLoss.getDevIdsList(), deviceLoss.getCreateUserId());
}
@Override
public void superiorAuditLoss(LossAuditvo lossAuditvo) {
Units units=unitsService.findById(lossAuditvo.getUnitId());
Area area=areaService.findByid(units.getAreaId());
TaskBto taskBto=taskService.get(lossAuditvo.getTaskId());
DeviceLoss deviceLoss=deviceLossService.findByDeviceLoss(taskBto.getBillId());
if (units.getLevel()==1){
deviceLoss.setProvinceUnitName(units.getName());
deviceLoss.setProvinceDes(lossAuditvo.getDes());
taskService.moveToEnd(taskBto);
}else {
Units parentUnits=unitsService.findByAreaId(area.getFatherId());
deviceLoss.setCityUnitName(units.getName());
deviceLoss.setCityDes(lossAuditvo.getDes());
taskBto.setOwnUnit(parentUnits.getUnitId());
taskService.moveToSpecial(taskBto,StatusEnum.LOSS1300,0);
}
deviceLossService.save(deviceLoss);
}
@Override
public void initiateRetrieve(DeviceLoss deviceLoss) {
DeviceLoss deviceLossThis= deviceLossService.save(deviceLoss);
Units units=unitsService.findById(deviceLoss.getUnitId());
Area area=areaService.findByid(units.getAreaId());
if (units.getLevel() == 1) {
endRetrieve(deviceLossThis.getCreateUserId(), deviceLossThis.getId(), units.getName() + "丢失装备任务", units.getUnitId());
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,deviceLoss.getDevIdsList());
} else {
Units parentUnits=unitsService.findByAreaId(area.getFatherId());
newRetrieveTask(parentUnits.getUnitId(), deviceLossThis.getId(), units.getName() + "丢失装备任务");
}
devLogAdd(deviceLoss.getDevIdsList(), deviceLoss.getCreateUserId());
}
@Override
public void superiorAuditRetrieve(RetrieveAuditvo retrieveAuditvo) {
}
private void newRetrieveTask(Integer unitId, Integer lossId, String title){
List<Integer> list=new ArrayList<>();
list.add(0);
taskService.start(new TaskBto(StatusEnum.RETRIEVE.id, title, 0, ".", lossId, BusinessEnum.LOSS.id, unitId, 0, "", list));
}
private void endRetrieve(Integer userId, Integer lossId, String title, Integer unitId){
List<Integer> list=new ArrayList<>();
list.add(userId);
taskService.start(new TaskBto(StatusEnum.LOSS1300.id, title, 0, ".", lossId, BusinessEnum.LOSS.id, unitId, 0, "", list));
}
private void newLossTask(Integer unitId, Integer lossId, String title){
List<Integer> list=new ArrayList<>();
list.add(0);
taskService.start(new TaskBto(StatusEnum.LOSS1300.id, title, 0, ".", lossId, BusinessEnum.LOSS.id, unitId, 0, "", list));
}
private void end(Integer userId, Integer lossId, String title, Integer unitId){
List<Integer> list=new ArrayList<>();
list.add(userId);
taskService.start(new TaskBto(StatusEnum.LOSS1300.id, title, 0, ".", lossId, BusinessEnum.LOSS.id, unitId, 0, "", list));
}
private void devLogAdd(List<Integer> ids, Integer userId){
List<DeviceLog> logDtos=new ArrayList<>();
deviceLibraryDao.findAllById(ids).forEach(
deviceLibrary -> logDtos.add(new DeviceLogDto(deviceLibrary.getId(), "报备装备丢失",null,userId).toDo())
);
CompletableFuture.runAsync(() -> deviceLogService.saveAllLog(logDtos));
}
}
package com.tykj.dev.device.loss.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName StringUtils.java
* @Description TODO
* @createTime 2021年01月10日 16:20:00
*/
public class StringUtils {
public static String ListToString(List<Integer> idList){
StringBuffer stringBuffer=new StringBuffer();
idList.forEach(
i->stringBuffer.append(",").append(i)
);
return stringBuffer.toString();
}
public static List<Integer> stringToList(String idStirng){
if (idStirng!=null) {
List<String> idStringList = Arrays.asList(idStirng.split(","));
return idStringList.stream().filter(list2 -> !list2.equals("")).map(Integer::parseInt).collect(Collectors.toList());
}else {
return new ArrayList<>();
}
}
}
package com.tykj.dev.device.loss.util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;
/**
* @author zjm
* @version 1.0.0
* @ClassName runLoss.java
* @Description TODO
* @createTime 2021年01月30日 16:24:00
*/
@Service
@Slf4j
public class runLoss implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
log.info("12131231232131231231232");
}
}
...@@ -32,8 +32,8 @@ public class BaseEntity { ...@@ -32,8 +32,8 @@ public class BaseEntity {
* 主键id * 主键id
*/ */
@Id @Id
@GeneratedValue @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT") // @Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id; private Integer id;
/** /**
......
...@@ -96,7 +96,17 @@ public enum BusinessEnum { ...@@ -96,7 +96,17 @@ public enum BusinessEnum {
/** /**
* 报废 * 报废
*/ */
SCRAP(23, "报废业务"); SCRAP(23, "报废业务"),
/**
* 丢失
*/
LOSS(24,"丢失"),
/**
* 找回
*/
RETRIEVE(25,"找回");
public Integer id; public Integer id;
......
...@@ -22,7 +22,7 @@ public enum DeviceLifeStatus { ...@@ -22,7 +22,7 @@ public enum DeviceLifeStatus {
*/ */
IN_LIBRARY(2, "在库"), IN_LIBRARY(2, "在库"),
/** /**
* 运输 * 配发
*/ */
IN_TRANSIT(3, "配发中"), IN_TRANSIT(3, "配发中"),
/** /**
...@@ -56,7 +56,7 @@ public enum DeviceLifeStatus { ...@@ -56,7 +56,7 @@ public enum DeviceLifeStatus {
/** /**
* 丢失 * 丢失
*/ */
LOSE(11, "丢失"), LOSS(11, "丢失"),
/** /**
* 退役 * 退役
*/ */
...@@ -71,9 +71,10 @@ public enum DeviceLifeStatus { ...@@ -71,9 +71,10 @@ public enum DeviceLifeStatus {
USE(14, "使用"), USE(14, "使用"),
/** /**
* 待清退 * 待退役
*/ */
REPEL(15,"清退"); REPEL(15,"待退役");
public Integer id; public Integer id;
......
...@@ -88,6 +88,10 @@ public enum StatusEnum { ...@@ -88,6 +88,10 @@ public enum StatusEnum {
LOSS1300(1300,"丢失装备等待审核"),
RETRIEVE(1400,"装备找回等待审核"),
// SEND_BACK_1204(1204, "入库待审核"), // SEND_BACK_1204(1204, "入库待审核"),
......
...@@ -7,7 +7,6 @@ import com.tykj.dev.misc.base.BaseEntity; ...@@ -7,7 +7,6 @@ import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*; import javax.persistence.*;
......
...@@ -2,7 +2,6 @@ package com.tykj.dev.device.sendback.entity.vo; ...@@ -2,7 +2,6 @@ package com.tykj.dev.device.sendback.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.misc.base.BeanHelper; import com.tykj.dev.misc.base.BeanHelper;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -12,7 +11,6 @@ import lombok.NoArgsConstructor; ...@@ -12,7 +11,6 @@ import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper; import org.modelmapper.ModelMapper;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
......
package com.tykj.dev.device.sendback.repository; package com.tykj.dev.device.sendback.repository;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit; import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......
...@@ -12,7 +12,7 @@ public interface RepelBusinessService { ...@@ -12,7 +12,7 @@ public interface RepelBusinessService {
/** /**
* 发起清退任务 * 发起清退任务
*/ */
void initiateRepel(DeviceRepel deviceRepel,Integer userId); void initiateRepel(DeviceRepel deviceRepel, Integer userId);
/** /**
* 市分解任务 * 市分解任务
......
...@@ -4,7 +4,6 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary; ...@@ -4,7 +4,6 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.vo.*; import com.tykj.dev.device.sendback.entity.vo.*;
import org.springframework.http.ResponseEntity;
import java.util.List; import java.util.List;
......
...@@ -85,7 +85,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -85,7 +85,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
PackingLibraryDao packingLibraryDao; PackingLibraryDao packingLibraryDao;
@Override @Override
public void initiateRepel(DeviceRepel deviceRepel,Integer userId) { public void initiateRepel(DeviceRepel deviceRepel, Integer userId) {
User user = userService.findByUser(userId); User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId()); Units units=unitsService.findById(user.getUnitsId());
Area area=areaService.findByid(units.getAreaId()); Area area=areaService.findByid(units.getAreaId());
...@@ -324,6 +324,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -324,6 +324,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} }
public static void main(String[] args) { public static void main(String[] args) {
// String a="[{\"model\":\"BM-002\",\"count\":0},{\"model\":\"BM-001\",\"count\":0},{\"model\":\"aa\",\"count\":0},{\"model\":\"bb\",\"count\":0}]"; // String a="[{\"model\":\"BM-002\",\"count\":0},{\"model\":\"BM-001\",\"count\":0},{\"model\":\"aa\",\"count\":0},{\"model\":\"bb\",\"count\":0}]";
// List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {}); // List<ModelCount> modelCountList= JacksonUtil.readValue(a, new TypeReference<List<ModelCount>>() {});
// log.info("---{}",modelCountList.size()); // log.info("---{}",modelCountList.size());
......
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.*; import com.tykj.dev.device.sendback.entity.vo.*;
import com.tykj.dev.device.sendback.service.*; import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.sendback.util.StringUtils; import com.tykj.dev.device.sendback.util.StringUtils;
...@@ -15,15 +12,10 @@ import com.tykj.dev.device.task.service.TaskService; ...@@ -15,15 +12,10 @@ import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
import jdk.nashorn.internal.ir.IfNode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.Id;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
......
...@@ -6,13 +6,11 @@ import com.tykj.dev.device.sendback.entity.vo.ModelCount; ...@@ -6,13 +6,11 @@ import com.tykj.dev.device.sendback.entity.vo.ModelCount;
import com.tykj.dev.device.sendback.repository.RepelTaskStatisticalDao; import com.tykj.dev.device.sendback.repository.RepelTaskStatisticalDao;
import com.tykj.dev.device.sendback.service.RepelTaskStatisticalService; import com.tykj.dev.device.sendback.service.RepelTaskStatisticalService;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import jdk.nashorn.internal.ir.IfNode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zjm * @author zjm
......
//package com.tykj.dev.device.sendback.util;
//
//import com.tykj.dev.device.library.repository.DeviceLibraryDao;
//import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.CommandLineRunner;
//import org.springframework.stereotype.Service;
//
//import javax.swing.event.MenuKeyListener;
//
///**
// * @author zjm
// * @version 1.0.0
// * @ClassName test.java
// * @Description TODO
// * @createTime 2021年01月30日 14:18:00
// */
//@Service
//@Slf4j
//public class test implements CommandLineRunner {
// @Autowired
// DeviceLibraryDao deviceLibraryDao;
// @Override
// public void run(String... args) throws Exception {
// log.info("开始模拟数据");
// DeviceLibrary deviceLibrary= deviceLibraryDao.findById(13702).get();
// for (int i=1;i<20000;i++) {
// deviceLibrary.setId(null);
// deviceLibraryDao.save(deviceLibrary);
// }
// }
//}
...@@ -359,6 +359,7 @@ ...@@ -359,6 +359,7 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId> <artifactId>config</artifactId>
...@@ -370,6 +371,17 @@ ...@@ -370,6 +371,17 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-loss</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.tykj.dev</groupId>
<artifactId>union</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>com.tykj</groupId> <groupId>com.tykj</groupId>
<artifactId>dev-statistical</artifactId> <artifactId>dev-statistical</artifactId>
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<module>dev-usereport</module> <module>dev-usereport</module>
<module>dev-statistical</module> <module>dev-statistical</module>
<module>dev-es</module> <module>dev-es</module>
<module>dev-loss</module>
</modules> </modules>
<properties> <properties>
...@@ -149,6 +150,11 @@ ...@@ -149,6 +150,11 @@
<artifactId>dev-finalcheck</artifactId> <artifactId>dev-finalcheck</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-loss</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>com.tykj</groupId> <groupId>com.tykj</groupId>
<artifactId>dev-library</artifactId> <artifactId>dev-library</artifactId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论