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

修改bug

上级 07848c81
......@@ -24,7 +24,7 @@ public enum LogType {
*/
PACKING_3(3,PACKING.id, PACKING_CONFIRM.id, ARCHIVE.id, "列装审核失败"),
STORAGE_1(4,STORAGE.id, ORIGIN_STATUS.id, STORAGE_CONFIRM.id, "发起入库"),
STORAGE_1(4,STORAGE.id, ORIGIN_STATUS.id, END.id, "发起装备入库"),
STORAGE_2(5,STORAGE.id, STORAGE_CONFIRM.id, END.id, "入库审核成功"),
......@@ -68,7 +68,7 @@ public enum LogType {
DESTROY_3(26,DESTROY.id, DESTROY_BUSINESS_NEED_CONFIRM.id, ARCHIVE.id, "销毁出库审核失败"),
MATCHING_1(27,ADD_MATCHING_DEVICE.id, ORIGIN_STATUS.id, ADD_MATCHING_DEVICE_CONFIRM.id, "发起新增配套设备"),
MATCHING_1(27,ADD_MATCHING_DEVICE.id, ORIGIN_STATUS.id, END.id, "发起新增配套设备"),
MATCHING_2(28,ADD_MATCHING_DEVICE.id, ADD_MATCHING_DEVICE_CONFIRM.id, END.id, "添加配套设备审核成功"),
......@@ -171,6 +171,7 @@ public enum LogType {
ALLOT_11(85,ALLOT.id, ALLOTING.id, ARCHIVE.id, "拒绝接收配发装备"),
ALLOT_BACK_5(86,ALLOT_BACK.id, ALLOT_BACKING.id, END.id, "接收配发退回装备"),
REPAIR_SEND_10(87,REPAIR.id, ORIGIN_STATUS.id, COUNTRY_REPAIRING.id, "向(%receiveUnit)发起装备维修"),
REPAIR_BACK_7(88,REPAIR_BACK.id, ORIGIN_STATUS.id, END.id, "维修退回装备接收并发起入库"),
;
public Integer id;
......
......@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
......@@ -97,8 +98,8 @@ public class FileController {
}
@ApiOperation(value = "上传图片转pdf")
@PostMapping("/print/pdf")
public ResponseEntity fileUpload(HttpServletRequest request) throws IOException, DocumentException {
@PostMapping("/print/pdf/{type}")
public ResponseEntity fileUpload(HttpServletRequest request, @PathVariable int type) throws IOException, DocumentException {
log.info("触发图片转pdf的接口");
List<MultipartFile> multipartFiles = ((MultipartHttpServletRequest) request).getFiles("file");
log.info("数量{}",multipartFiles.size());
......@@ -110,7 +111,13 @@ public class FileController {
File file = new File(url + "print/" + fileName);
// 第一步:创建一个document对象。
Document document = new Document();
Document document;
if (type==1) {
document = new Document();
}
else {
document = new Document(PageSize.A4.rotate());
}
document.setMargins(0, 0, 0, 0);
// 第二步:
// 创建一个PdfWriter实例,
......@@ -263,39 +270,4 @@ public class FileController {
return new FileRet(originalFilename, url + newName, preview + newName);
}
/**
* 等比压缩,获取压缩百分比(A4横向)
*
* @param height 图片的高度
* @param weight 图片的宽度
* @return 压缩百分比
*/
private static int getPercent(float height, float weight) {
float percent = 0.0F;
if (height > weight) {
percent = PageSize.A4.rotate().getHeight() / height * 100;
} else {
percent = PageSize.A4.rotate().getWidth() / weight * 100;
}
return Math.round(percent);
}
/**
* 等比压缩,获取压缩百分比(A4纵向)
*
* @param height 图片的高度
* @param weight 图片的宽度
* @return 压缩百分比
*/
private static int getPercent2(float height, float weight) {
float percent = 0.0F;
if (height > weight) {
percent = PageSize.A4.getHeight() / height * 100;
} else {
percent = PageSize.A4.getWidth() / weight * 100;
}
return Math.round(percent);
}
}
......@@ -20,7 +20,6 @@ import com.tykj.dev.device.matching.subject.vo.*;
import com.tykj.dev.device.task.service.TaskLogService;
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.TaskLogBto;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
......@@ -102,8 +101,8 @@ public class MatchingDeviceController {
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("新增确认单", matchingDeviceBillEntity.getFileName(), matchingDeviceBillEntity.getFileUrl()));
//添加业务日志
TaskLogBto taskLogBto2 = new TaskLogBto(taskBto1.getId(), "发起新增配套", fileVoList);
taskLogService.addLog(taskLogBto2);
// TaskLogBto taskLogBto2 = new TaskLogBto(taskBto1.getId(), "发起新增配套", fileVoList);
// taskLogService.addLog(taskLogBto2);
for (MatchingDeviceSaveVo matchingDeviceSaveVo : matchingDeviceBillSaveVo.getMatchingDeviceSaveVoList()) {
MatchingDeviceLibrary matchingDeviceLibraryEntity = matchingDeviceSaveVo.toDo();
MatchingDeviceLibrary saveEntity = matchingDeviceLibraryService.addEntity(matchingDeviceLibraryEntity);
......
......@@ -810,8 +810,8 @@ public class RepairController {
TaskBto taskBto1 = new TaskBto(StatusEnum.END.id, "维修退回", taskBto.getId(), taskBto.getNodeIdDetail() + taskBto.getId() + ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, null, userIds);
taskBto2 = taskService.start(taskBto1);
//添加业务日志
TaskLogBto taskLogBto2 = new TaskLogBto(taskBto2.getId(), "维修退回装备接收并发起入库", fileVoList);
taskLogService.addLog(taskLogBto2);
// TaskLogBto taskLogBto2 = new TaskLogBto(taskBto2.getId(), "维修退回装备接收并发起入库", fileVoList);
// taskLogService.addLog(taskLogBto2);
} else {
//任务推至下一阶段
// taskService.update(taskService.moveToNext(taskBto, repairReceiveVo.getReceiveUserbId()));
......
......@@ -162,6 +162,7 @@ public class SelfCheckController {
@ApiOperation(value = "装备比较", notes = "可以通过这个接口发起比较装备")
@PostMapping(value = "/compare")
public ResponseEntity compare(@RequestBody CompareVo compareVo) {
CompareResultVo compareResultVo = new CompareResultVo();
List<Integer> list = compareVo.getDeivceIdList();
List<String> list1 = new ArrayList<>();
List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>();
......@@ -176,12 +177,13 @@ public class SelfCheckController {
}
//list2存扫码得到的rfid卡号
List<String> list2 = compareVo.getRfidResultList();
if (list2.size()>0) {
//取交集
list1.retainAll(list2);
//遍历应查装备
for (DeviceLibrary d:deviceLibraryEntities) {
for (DeviceLibrary d : deviceLibraryEntities) {
//如果在交集中,检查结果为正常
if (list1.contains(d.getRfidCardId())){
if (list1.contains(d.getRfidCardId())) {
d.setCheckResult(1);
}
//否则检查结果为丢失
......@@ -190,19 +192,19 @@ public class SelfCheckController {
}
}
//遍历扫码结果
for (String s:list2) {
for (String s : list2) {
//如果不在交集中,则为新增
if (!list1.contains(s)){
if (!list1.contains(s)) {
List<DeviceLibrary> d = deviceLibraryDao.getAllByRfidCardId(s);
//如果新增的为系统中存在的装备
if (d.size()>0) {
for (DeviceLibrary deviceLibraryEntity:d) {
if (d.size() > 0) {
for (DeviceLibrary deviceLibraryEntity : d) {
deviceLibraryEntity.setCheckResult(2);
resultList.add(deviceLibraryEntity);
}
}
//如果为系统中不存在的装备,添加到newList
if (d.isEmpty()){
if (d.isEmpty()) {
DeviceLibrary deviceLibraryEntity = new DeviceLibrary();
deviceLibraryEntity.setCheckResult(2);
deviceLibraryEntity.setSeqNumber("-");
......@@ -217,20 +219,28 @@ public class SelfCheckController {
}
}
//在新增后面加丢失的装备
for (DeviceLibrary d:deviceLibraryEntities) {
if (d.getCheckResult()==0){
for (DeviceLibrary d : deviceLibraryEntities) {
if (d.getCheckResult() == 0) {
resultList.add(d);
}
}
//最后加正常的装备
for (DeviceLibrary d:deviceLibraryEntities) {
if (d.getCheckResult()==1){
for (DeviceLibrary d : deviceLibraryEntities) {
if (d.getCheckResult() == 1) {
resultList.add(d);
}
}
CompareResultVo compareResultVo = new CompareResultVo();
compareResultVo.setNewList(newList);
compareResultVo.setResultList(resultList);
}
else {
compareResultVo.setNewList(newList);
for (DeviceLibrary d:deviceLibraryEntities) {
d.setCheckResult(1);
resultList.add(d);
}
compareResultVo.setResultList(resultList);
}
return ResultUtil.success(compareResultVo);
}
......
......@@ -21,6 +21,7 @@ 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.entity.User;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.statistical.cache.StatisticalCache;
import com.tykj.dev.statistical.service.BigScreenService;
import com.tykj.dev.statistical.vo.*;
......@@ -142,6 +143,7 @@ public class BigScreenServiceImpl implements BigScreenService {
//新增设备数
centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> isPresentYear(deviceLibrary.getCreateTime())).count());
//故障率
Set<Integer> repairDeviceIds = new HashSet<>();
double num = 0;
List<Task> tasks = taskDao.findAllByBusinessType(BusinessEnum.REPAIR.id).stream().filter(task -> task.getParentTaskId()==null).collect(Collectors.toList());
List<RepairSendBill> repairSendBills = tasks.stream()
......@@ -149,8 +151,9 @@ public class BigScreenServiceImpl implements BigScreenService {
.map(repairBill -> repairSendBillDao.findByDeviceRepairBillId(repairBill.getId()))
.collect(Collectors.toList());
for (RepairSendBill r:repairSendBills) {
num+=r.getSendingCount();
repairDeviceIds.addAll(StringSplitUtil.split(r.getRepairDeviceCheckDetail()));
}
num = repairDeviceIds.size();
double faultPercent = num/centerNum.getDeviceCount()*100;
centerNum.setFaultPercent(faultPercent);
return centerNum;
......
package com.tykj.dev.statistical.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusinessNum {
/**
* 月份
*/
private Integer month;
/**
* 业务总数
*/
private Integer count = 0;
}
package com.tykj.dev.statistical.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepairDevice {
/**
* 类型
*/
private Integer type;
/**
* 型号
*/
private String model;
/**
* 所在单位
*/
private String locationUnit;
/**
* 维修状态
*/
private String repairStatus;
}
package com.tykj.dev.statistical.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepairNum {
/**
* 维修总数
*/
private Integer repairCount = 0;
/**
* 完成次数
*/
private Integer completeCount = 0;
/**
* 换新次数
*/
private Integer changeNewCount = 0;
/**
* 完成次数
*/
private Integer noCompleteCount = 0;
}
......@@ -9,7 +9,8 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo;
import com.tykj.dev.device.storage.subject.vo.StorageBillDetailVo;
......@@ -18,7 +19,6 @@ import com.tykj.dev.device.storage.subject.vo.StorageDetailVo;
import com.tykj.dev.device.task.service.TaskLogService;
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.TaskLogBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -169,9 +169,9 @@ public class StorageBillController {
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("配发单", storageBillEntity.getFileName(), storageBillEntity.getFileUrl()));
fileVoList.add(new FileVo("入库确认单", storageBillEntity.getReceiveFileName(), storageBillEntity.getReceiveFileUrl()));
//添加业务日志
TaskLogBto taskLogBto2 = new TaskLogBto(taskEntity1.getId(), "发起装备入库", fileVoList);
taskLogService.addLog(taskLogBto2);
// //添加业务日志
// TaskLogBto taskLogBto2 = new TaskLogBto(taskEntity1.getId(), "发起装备入库", fileVoList);
// taskLogService.addLog(taskLogBto2);
//3.存装备
Integer parentId = null;
for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) {
......
......@@ -265,7 +265,7 @@ public class LogAspect {
if (storageBillService != null) {
StorageBill storageBill = storageBillService.getOne(outPutTask.getBillId());
getFieldsParam(storageBill);
if (this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.PACKING_CONFIRM.id)) {
if (this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.END.id)) {
this.fileVos.add(new FileVo("配发单", storageBill.getFileName(), storageBill.getFileUrl()));
this.fileVos.add(new FileVo("入库确认单", storageBill.getReceiveFileName(), storageBill.getReceiveFileUrl()));
}
......@@ -355,7 +355,8 @@ public class LogAspect {
if ((this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.WAIT_BACK_RECEIVE.id))) {
this.fileVos.add(new FileVo("出库确认单", repairBackBill.getFileName(), repairBackBill.getFileUrl()));
}
if ((this.oldStatus.equals(StatusEnum.WAIT_BACK_RECEIVE.id) && this.newStatus.equals(StatusEnum.END.id))) {
if ((this.oldStatus.equals(StatusEnum.WAIT_BACK_RECEIVE.id) && this.newStatus.equals(StatusEnum.END.id))||
(this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.END.id))) {
this.fileVos.add(new FileVo("维修单", repairBackBill.getBillFileName(), repairBackBill.getBillFileUrl()));
this.fileVos.add(new FileVo("入库确认单", repairBackBill.getReceiveFileName(), repairBackBill.getReceiveFileUrl()));
}
......@@ -406,7 +407,7 @@ public class LogAspect {
if (matchingDeviceBillService != null) {
MatchingDeviceBill matchingDeviceBill = matchingDeviceBillService.getOne(outPutTask.getBillId());
getFieldsParam(matchingDeviceBill);
if ((this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.ADD_MATCHING_DEVICE_CONFIRM.id))) {
if ((this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id) && this.newStatus.equals(StatusEnum.END.id))) {
this.fileVos.add(new FileVo("新增确认单", matchingDeviceBill.getFileName(), matchingDeviceBill.getFileUrl()));
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论