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

更新

上级 5aa5c7b5
......@@ -413,51 +413,72 @@ public class DeviceApplyController {
@PostMapping("/uploadFile")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity uploadFile(@RequestBody @Validated UploadApplyFile uploadApplyFile) {
if (uploadApplyFile.getReplyVos()!=null&&uploadApplyFile.getReplyVos().size()>0) {
for (ReplyVo replyVo : uploadApplyFile.getReplyVos()) {
ResponseEntity responseEntity = packingController.seqsExist(replyVo.getId(), replyVo.getNum(), replyVo.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
}
TaskBto taskBto = taskService.get(uploadApplyFile.getTaskId());
taskService.addInvolveUser(taskBto, userUtils.getCurrentUserId());
if (uploadApplyFile.getStatus()==0){
taskService.moveToEnd(taskBto);
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"申请不同意,业务办结",userIds,0);
messageService.add(messageBto);
DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
deviceApplyBill.setApplyStatus(1);
deviceApplyBill.setBackFiles(FilesUtil.stringFileToList(uploadApplyFile.getBackFiles()));
if (uploadApplyFile.getReplyVos() != null && uploadApplyFile.getReplyVos().size() > 0) {
deviceApplyBill.setReplyVos(JacksonUtil.toJSon(uploadApplyFile.getReplyVos()));
}
if (uploadApplyFile.getReplayNumber() != null) {
deviceApplyBill.setReplayNumber(uploadApplyFile.getReplayNumber());
}
if (uploadApplyFile.getReplyFiles() != null && uploadApplyFile.getReplyFiles().size() > 0) {
deviceApplyBill.setReplyFiles(FilesUtil.stringFileToList(uploadApplyFile.getReplyFiles()));
}
deviceApplyBillService.update(deviceApplyBill);
}
if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0) {
for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) {
ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
else {
if (uploadApplyFile.getReplyVos() != null && uploadApplyFile.getReplyVos().size() > 0) {
for (ReplyVo replyVo : uploadApplyFile.getReplyVos()) {
ResponseEntity responseEntity = packingController.seqsExist(replyVo.getId(), replyVo.getNum(), replyVo.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
}
}
}
}
TaskBto taskBto = taskService.get(uploadApplyFile.getTaskId());
taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToNext(taskBto);
DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
deviceApplyBill.setApplyStatus(4);
deviceApplyBill.setBackFiles(FilesUtil.stringFileToList(uploadApplyFile.getBackFiles()));
if(uploadApplyFile.getReplyVos()!=null&&uploadApplyFile.getReplyVos().size()>0){
deviceApplyBill.setReplyVos(JacksonUtil.toJSon(uploadApplyFile.getReplyVos()));
}
if (uploadApplyFile.getReplayNumber()!=null){
deviceApplyBill.setReplayNumber(uploadApplyFile.getReplayNumber());
}
if(uploadApplyFile.getReplyFiles()!=null&&uploadApplyFile.getReplyFiles().size()>0){
deviceApplyBill.setReplyFiles(FilesUtil.stringFileToList(uploadApplyFile.getReplyFiles()));
}
if (uploadApplyFile.getApplyBillDetailVos()!=null&&uploadApplyFile.getApplyBillDetailVos().size()>0){
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(uploadApplyFile.getApplyBillDetailVos()));
}
DeviceApplyBill deviceApplyBill1 = deviceApplyBillService.update(deviceApplyBill);
if (deviceApplyBill.getApplyType()>1){
List<String> seqs = new ArrayList<>();
List<ReplyVo> replyVos = JacksonUtil.readValue(deviceApplyBill1.getReplyVos(), new TypeReference<List<ReplyVo>>() {
});
if (replyVos!=null) {
for (ReplyVo r : replyVos) {
seqs.addAll(DeviceSeqUtil.selectDeviceSeqs(r.getSeqInterval()));
if (uploadApplyFile.getApplyBillDetailVos() != null && uploadApplyFile.getApplyBillDetailVos().size() > 0) {
for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) {
ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
}
}
}
taskService.moveToNext(taskBto);
DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
deviceApplyBill.setApplyStatus(4);
deviceApplyBill.setBackFiles(FilesUtil.stringFileToList(uploadApplyFile.getBackFiles()));
if (uploadApplyFile.getReplyVos() != null && uploadApplyFile.getReplyVos().size() > 0) {
deviceApplyBill.setReplyVos(JacksonUtil.toJSon(uploadApplyFile.getReplyVos()));
}
if (uploadApplyFile.getReplayNumber() != null) {
deviceApplyBill.setReplayNumber(uploadApplyFile.getReplayNumber());
}
if (uploadApplyFile.getReplyFiles() != null && uploadApplyFile.getReplyFiles().size() > 0) {
deviceApplyBill.setReplyFiles(FilesUtil.stringFileToList(uploadApplyFile.getReplyFiles()));
}
if (uploadApplyFile.getApplyBillDetailVos() != null && uploadApplyFile.getApplyBillDetailVos().size() > 0) {
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(uploadApplyFile.getApplyBillDetailVos()));
}
DeviceApplyBill deviceApplyBill1 = deviceApplyBillService.update(deviceApplyBill);
if (deviceApplyBill.getApplyType() > 1) {
List<String> seqs = new ArrayList<>();
List<ReplyVo> replyVos = JacksonUtil.readValue(deviceApplyBill1.getReplyVos(), new TypeReference<List<ReplyVo>>() {
});
if (replyVos != null) {
for (ReplyVo r : replyVos) {
seqs.addAll(DeviceSeqUtil.selectDeviceSeqs(r.getSeqInterval()));
}
}
deviceLibraryDao.upDateSeqNumbersApplyTaskId(taskBto.getId(), seqs);
}
deviceLibraryDao.upDateSeqNumbersApplyTaskId(taskBto.getId(),seqs);
}
return ResponseEntity.ok("ok");
}
......
......@@ -176,7 +176,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
messageBto.setBusinessType(taskBto.getBusinessType());
messageService.add(messageBto);
}
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(replyVos));
deviceApplyBill.setReplyVos(JacksonUtil.toJSon(replyVos));
update(deviceApplyBill);
}
}
......
......@@ -36,4 +36,7 @@ public class UploadApplyFile {
@ApiModelProperty(value = "申请批复详情")
private List<ApplyBillDetailVo> applyBillDetailVos;
@ApiModelProperty(value = "申请批复结果(0:未通过,1:通过)")
private Integer status;
}
......@@ -313,6 +313,7 @@ public enum LogType {
REPAIR_BACK_19(137,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, END.id, "盖电子签章并入库"),
REPAIR_BACK_20(138,REPAIR.id, REPAIR_BACK_WAIT_SIGN.id, WAIT_UPLOAD_BACK_FILE.id, "盖电子签章并入库"),
REPAIR_BACK_21(139,REPAIR.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, WAIT_BACK_RECEIVE.id, "拒绝电子签章申请"),
APPLY_7(140,APPLY.id, WAIT_APPLY_FILE.id, END.id, "申请不同意,业务办结"),
;
public Integer id;
......
......@@ -257,11 +257,19 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
scrappedNum++;
scrappedIds.add(d2.getId());
break;
case 17:
scrappedNum++;
scrappedIds.add(d2.getId());
break;
case 18:
scrappedNum++;
scrappedIds.add(d2.getId());
break;
case 6:
allotNum++;
allotIds.add(d2.getId());
retiredNum++;
retiredIds.add(d2.getId());
break;
case 15:
case 7:
retiredNum++;
retiredIds.add(d2.getId());
break;
......@@ -273,6 +281,14 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
destoryNum++;
destoryIds.add(d2.getId());
break;
case 19:
destoryNum++;
destoryIds.add(d2.getId());
break;
case 20:
destoryNum++;
destoryIds.add(d2.getId());
break;
case 13:
scrappedNum++;
scrappedIds.add(d2.getId());
......@@ -305,6 +321,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceStatisticsVo.setScrappedNum(scrappedNum);
deviceStatisticsVo.setRetiredNum(retiredNum);
deviceStatisticsVo.setUseNum(useNum);
deviceStatisticsVo.setOtherNum(num-allotNum-inLibraryNum-repairNum-destoryNum-scrappedNum-retiredNum-useNum);
deviceStatisticsVo.setSeqs(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(devSeqs)));
deviceStatisticsVos.add(deviceStatisticsVo);
}
......
......@@ -47,6 +47,9 @@ public class DeviceStatisticsVo {
@ApiModelProperty(value = "使用数量", example = "10")
private Integer useNum;
@ApiModelProperty(value = "其他数量", example = "10")
private Integer otherNum;
@ApiModelProperty(value = "该型号所有装备Id列表")
private List<Integer> deviceIds = new ArrayList<>();
......
......@@ -20,6 +20,7 @@ import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.ListUtil;
import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.TaskDisposeUtil;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLog;
......@@ -27,6 +28,7 @@ import com.tykj.dev.rfid.entity.domin.RfidChangeBill;
import com.tykj.dev.rfid.entity.domin.RfidChangeLog;
import com.tykj.dev.rfid.entity.enums.RfidChangeStatus;
import com.tykj.dev.rfid.entity.vo.*;
import com.tykj.dev.rfid.repository.LibraryWarningLogDao;
import com.tykj.dev.rfid.service.LibraryWarningLogService;
import com.tykj.dev.rfid.service.RfidChangeBillService;
import com.tykj.dev.rfid.service.RfidChangeLogService;
......@@ -48,6 +50,7 @@ import javax.transaction.Transactional;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -81,6 +84,8 @@ public class RfidController {
private AuthenticationUtils AuthenticationUtils;
@Autowired
private DeviceLogDao deviceLogDao;
@Autowired
private LibraryWarningLogDao libraryWarningLogDao;
public RfidController(RfidChangeLogService rfidChangeLogService, RfidService rfidService, LibraryWarningLogService libraryWarningLogService, RfidChangeBillService rfidChangeBillService, InventoryScheduled inventoryScheduled) {
this.rfidChangeLogService = rfidChangeLogService;
......@@ -268,6 +273,34 @@ public class RfidController {
return ResultUtil.success(inoutWarningDetailVo);
}
@ApiOperation(value = "查询所有出库告警装备列表", notes = "查询所有入库告警装备列表")
@PostMapping(value = "/out/all")
public ResponseEntity allOutDevice(@RequestBody WarningDetailSelectVo warningDetailSelectVo) {
Boolean hasModelDim = warningDetailSelectVo.getModelDim()!=null;
Boolean hasNameDim = warningDetailSelectVo.getNameDim()!=null;
Boolean hasSeqDim = warningDetailSelectVo.getSeqDim()!=null;
Boolean hasInventoryResultsDim = warningDetailSelectVo.getInventoryResultsDim()!=null;
Boolean hasCreateTimeDim = warningDetailSelectVo.getCreateTimeDim()!=null;
List<LibraryWarningLog> libraryWarningLogs = libraryWarningLogDao.findAll();
List<WarningDetailListVo> warningDetailListVos = new ArrayList<>();
for (LibraryWarningLog libraryWarningLog :libraryWarningLogs) {
List<WarningDetailListVo> warningDetails = libraryWarningLogService.getWarningDetail(libraryWarningLog.getId(), null);
warningDetailListVos.addAll(warningDetails);
}
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
if (hasModelDim||hasNameDim||hasInventoryResultsDim||hasSeqDim||hasCreateTimeDim) {
warningDetailListVos = warningDetailListVos.stream().filter(warningDetailListVo -> {
Boolean containModelDim = !hasModelDim||warningDetailListVo.getDeviceLibraryEntity().getModel().contains(warningDetailSelectVo.getModelDim());
Boolean containNameDim = !hasNameDim||warningDetailListVo.getDeviceLibraryEntity().getName().contains(warningDetailSelectVo.getNameDim());
Boolean containSeqDim = !hasSeqDim||warningDetailListVo.getDeviceLibraryEntity().getSeqNumber().contains(warningDetailSelectVo.getSeqDim());
Boolean containInventoryResultsDim = !hasInventoryResultsDim||warningDetailListVo.getInventoryResults().contains(warningDetailSelectVo.getInventoryResultsDim());
Boolean containCreateTimeDim = !hasCreateTimeDim||sdf.format(warningDetailListVo.getCreateTime()).contains(warningDetailSelectVo.getCreateTimeDim());
return containModelDim&&containNameDim&&containSeqDim&&containInventoryResultsDim&&containCreateTimeDim;
}).sorted(Comparator.comparing(WarningDetailListVo::getCreateTime).reversed()).collect(Collectors.toList());
}
return ResultUtil.success(PageUtil.getPerPage(warningDetailSelectVo.getPage(),warningDetailSelectVo.getSize(),warningDetailListVos,warningDetailSelectVo.getPageable()));
}
@ApiOperation(value = "库房告警日志详情", notes = "可以通过这个接口查询告警日志详情")
@PostMapping(value = "/warningDetail")
public ResponseEntity warningDetail(@RequestBody WarningDetailSelectVo warningDetailSelectVo) {
......
......@@ -18,4 +18,19 @@ public class WarningDetailSelectVo extends CustomPage {
@ApiModelProperty(value = "告警记录ID")
Integer warningId;
@ApiModelProperty(value = "型号模糊查询字段")
private String modelDim;
@ApiModelProperty(value = "名称模糊查询字段")
private String nameDim;
@ApiModelProperty(value = "序列号模糊查询字段")
private String seqDim;
@ApiModelProperty(value = "告警信息模糊查询字段")
private String inventoryResultsDim;
@ApiModelProperty(value = "告警时间模糊查询字段")
private String createTimeDim;
}
......@@ -52,7 +52,20 @@ public class TaskController {
@ApiOperation(value = "业务分页查询", notes = "可以通过这个接口分页查询业务")
@RequestMapping(method = RequestMethod.POST, value = "/manage/summary", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity getTaskPage(@RequestBody TaskSelectVo taskSelectVo) {
Boolean hasTitleDim = taskSelectVo.getTitleDim()!=null;
Boolean hasStatusDim = taskSelectVo.getStatusDim()!=null;
Boolean hasCreateUserDim = taskSelectVo.getCreateUserDim()!=null;
Boolean hasProcessingUserDim = taskSelectVo.getProcessingUserDim()!=null;
List<TaskUserVo> taskUserVos = taskService.getManageList(taskSelectVo);
if (hasTitleDim||hasStatusDim||hasCreateUserDim||hasProcessingUserDim) {
taskUserVos = taskUserVos.stream().filter(taskUserVo -> {
Boolean containTitleDim = !hasTitleDim||taskUserVo.getTitle().contains(taskSelectVo.getTitleDim());
Boolean containStatusDim = !hasStatusDim||taskUserVo.getStatus().contains(taskSelectVo.getStatusDim());
Boolean containCreateUserDim = !hasCreateUserDim||taskUserVo.getCreateUser().contains(taskSelectVo.getCreateUserDim());
Boolean containProcessingUserDim = !hasProcessingUserDim||taskUserVo.getProcessingUser().contains(taskSelectVo.getProcessingUserDim());
return containTitleDim&&containStatusDim&&containCreateUserDim&&containProcessingUserDim;
}).collect(Collectors.toList());
}
Page<TaskUserVo> taskUserVos1 = PageUtil.getPerPage(taskSelectVo.getPage(), taskSelectVo.getSize(), taskUserVos, taskSelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
Map<Integer,String> businessMap = GlobalMap.getBusinessMap();
......
......@@ -30,4 +30,18 @@ public class TaskSelectVo extends CustomPage {
private Integer billStatus;
@ApiModelProperty(value = "业务备注", example = "测试")
public List<String> remark;
@ApiModelProperty(value = "标题模糊查询字段")
private String titleDim;
@ApiModelProperty(value = "状态模糊查询字段")
private String statusDim;
@ApiModelProperty(value = "发起人模糊查询字段")
private String createUserDim;
@ApiModelProperty(value = "待办人模糊查询字段")
private String processingUserDim;
}
......@@ -390,6 +390,8 @@ public class TaskSelectController {
if (map.size()>0) {
p.setApplyNum(map.get(p.getId()).getNum());
p.setSeq(map.get(p.getId()).getSeqInterval());
p.setCompleteNum(map.get(p.getId()).getCompleteCount());
p.setWaitNum(p.getApplyNum()-p.getCompleteNum());
}
}
packingLibraryEntityList.add(p);
......
......@@ -21,4 +21,11 @@ public class MessageSelectVo extends CustomPage {
@ApiModelProperty(value = "已读/未读", example = "0")
private Integer isRead;
@ApiModelProperty(value = "内容模糊查询字段")
private String contentDim;
@ApiModelProperty(value = "状态模糊查询字段")
private String operatorDim;
}
......@@ -51,7 +51,16 @@ public class MessageController {
@ApiOperation(value = "所有阅知信息查询")
@PostMapping("/get/all")
public ResponseEntity getAllMessage(@RequestBody MessageSelectVo messageSelectVo){
Boolean hasContentDim = messageSelectVo.getContentDim()!=null;
Boolean hasOperatorDim = messageSelectVo.getOperatorDim()!=null;
List<MessageUserVo> messageUserVos = messageService.getAllList(messageSelectVo);
if (hasContentDim||hasOperatorDim) {
messageUserVos = messageUserVos.stream().filter(messageUserVo -> {
Boolean containContentDim = !hasContentDim||messageUserVo.getContent().contains(messageSelectVo.getContentDim());
Boolean containOperatorDim = !hasOperatorDim||messageUserVo.getOperator().contains(messageSelectVo.getOperatorDim());
return containContentDim&&containOperatorDim;
}).collect(Collectors.toList());
}
Page<MessageUserVo> taskUserVos1 = PageUtil.getPerPage(messageSelectVo.getPage(), messageSelectVo.getSize(), messageUserVos, messageSelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
Map<Integer,String> businessMap = GlobalMap.getBusinessMap();
......
package com.tykj.dev.device.user.subject.dao;
import com.tykj.dev.device.user.subject.entity.UserRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface UserRecordDao extends JpaRepository<UserRecord, Integer>, JpaSpecificationExecutor<UserRecord> {
}
package com.tykj.dev.device.user.subject.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
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 javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@ApiModel(value = "用户待办阅知记录对象", description = "用户记录")
public class UserRecord {
@Id
@GeneratedValue
@ApiModelProperty(value = "id", name = "id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id;
@ApiModelProperty(value = "用户id", name = "userId")
private Integer userId;
@ApiModelProperty(value = "待办任务id拼接", name = "taskIds")
@Column(name = "task_ids",columnDefinition = "TEXT")
private String taskIds;
@ApiModelProperty(value = "阅知任务id拼接", name = "readIds")
@Column(name = "read_ids",columnDefinition = "TEXT")
private String readIds;
@ApiModelProperty(value = "创建用户id")
@CreatedBy
private Integer createUserId;
@ApiModelProperty(value = "创建时间")
@CreatedDate
private Date createTime;
@ApiModelProperty(value = "更新用户id")
@LastModifiedBy
private Integer updateUserId;
@ApiModelProperty(value = "更新时间")
@LastModifiedDate
private Date updateTime;
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
}
package com.tykj.dev.device.user.subject.service;
import com.tykj.dev.device.user.subject.entity.UserRecord;
public interface UserRecordService extends PublicService<UserRecord>{
}
package com.tykj.dev.device.user.subject.service.impl;
import com.tykj.dev.device.user.subject.dao.UserRecordDao;
import com.tykj.dev.device.user.subject.entity.UserRecord;
import com.tykj.dev.device.user.subject.service.UserRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserRecordServiceImpl implements UserRecordService {
@Autowired
UserRecordDao userRecordDao;
/**
* 通用新增接口
*
* @param userRecord 对象
* @return 对象
*/
@Override
public UserRecord save(UserRecord userRecord) {
return userRecordDao.save(userRecord);
}
/**
* 根据id删除数据
*
* @param id 数据id
* @return 布尔
*/
@Override
public boolean delete(Integer id) {
return false;
}
/**
* 查询所有数据
*
* @return 数据集合
*/
@Override
public List<UserRecord> findAll() {
return userRecordDao.findAll();
}
/**
* 更新数据
*
* @param userRecord 对象
* @return 对象
*/
@Override
public UserRecord update(UserRecord userRecord) {
return userRecordDao.save(userRecord);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论