提交 644a06aa authored 作者: zhoushaopan's avatar zhoushaopan

[维修,配发,退回,维修退回]新增单据获取

上级 b98e23de
......@@ -7,6 +7,7 @@ import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.service.AllotBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.*;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
......@@ -40,6 +41,7 @@ import com.tykj.dev.misc.utils.*;
import com.tykj.dev.rfid.service.InputOutputDeviceService;
import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
......@@ -969,5 +971,11 @@ public class AllotBillController {
}
}
@GetMapping("getFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getFileList(Integer taskId){
return ResponseEntity.ok(allotBillService.getFileList(taskId));
}
}
......@@ -684,4 +684,11 @@ public class BackController {
return ResponseEntity.ok(messageBto);
}
@GetMapping("getFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getFileList(Integer taskId){
return ResponseEntity.ok(allotBackBillService.getFileList(taskId));
}
}
......@@ -2,10 +2,12 @@ package com.tykj.dev.device.allot.service;
import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSelectVo;
import com.tykj.dev.device.file.entity.FileRet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -29,4 +31,11 @@ public interface AllotBackBillService {
* 根据id删除 zsp
*/
void deleteByAllotBackId(Integer id);
/**
* 根据任务id查询单据
* @param taskId
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
}
......@@ -2,10 +2,12 @@ package com.tykj.dev.device.allot.service;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSelectVo;
import com.tykj.dev.device.file.entity.FileRet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -57,4 +59,11 @@ public interface AllotBillService {
// * *在配发存储的时候用到存储数据库
// */
// void updateAllot();
/**
* 根据任务id查询单据
* @param taskId
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
}
......@@ -5,10 +5,13 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.FileName;
import com.tykj.dev.device.allot.repository.AllotBackBillDao;
import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSelectVo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
......@@ -23,7 +26,9 @@ import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
......@@ -45,6 +50,9 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
@Autowired
private UserUtils userUtils;
@Autowired
private TaskService taskService;
@Override
public AllotBackBill addEntity(AllotBackBill allotBackBill) {
AllotBackBill allotBackBill1 = allotBackBillDao.save(allotBackBill);
......@@ -125,6 +133,22 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
allotBackBillDao.deleteById(id);
}
@Override
public Map<String, List<FileRet>> getFileList(Integer taskId) {
Map<String,List<FileRet>> map = new HashMap<>();
Integer billId = taskService.get(taskId).getBillId();
AllotBackBill allotBackBill = getOne(billId);
//收件方签收单集合
map.put(FileName.SIGN.name,allotBackBill.getReceiveFileList());
//申请文号文件集合
map.put(FileName.APPLY.name,allotBackBill.getApplyFileList());
//批复文号文件集合
map.put(FileName.RECEIPT.name,allotBackBill.getReplyFileList());
//发件方回执单集合
map.put(FileName.RECEIPT.name,allotBackBill.getSendFileList());
return map;
}
/**
* @param allotBillSelectVo 查询vo
* 查询统一筛选器
......
......@@ -5,10 +5,13 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.FileName;
import com.tykj.dev.device.allot.repository.AllotBillDao;
import com.tykj.dev.device.allot.service.AllotBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSelectVo;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.utils.JacksonUtil;
......@@ -21,7 +24,9 @@ import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
......@@ -43,6 +48,9 @@ public class AllotBillServiceImpl implements AllotBillService {
@Autowired
private UserUtils userUtils;
@Autowired
TaskService taskService;
@Override
public AllotBill addEntity(AllotBill allotBillEntity) {
AllotBill allotBill = allotBillDao.save(allotBillEntity);
......@@ -125,6 +133,22 @@ public class AllotBillServiceImpl implements AllotBillService {
allotBillDao.deleteById(id);
}
@Override
public Map<String, List<FileRet>> getFileList(Integer taskId) {
Map<String,List<FileRet>> map = new HashMap<>();
Integer billId = taskService.get(taskId).getBillId();
AllotBill allotBill = getOne(billId);
//收件方签收单集合
map.put(FileName.SIGN.name,allotBill.getReceiveFileList());
//申请文号文件集合
map.put(FileName.APPLY.name,allotBill.getApplyFileList());
//批复文号文件集合
map.put(FileName.RECEIPT.name,allotBill.getReplyFileList());
//发件方回执单集合
map.put(FileName.RECEIPT.name,allotBill.getSendFileList());
return map;
}
/**
* @param allotBillSelectVo 查询vo
* 查询统一筛选器
......
......@@ -16,10 +16,7 @@ import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.CustomOrder;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DeviceModelSort;
import com.tykj.dev.misc.utils.GetTreeUtils;
import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
......@@ -736,7 +733,6 @@ public class DeviceLibraryController {
if (bySeqNumber != null){
map.put("error","该序列号已经存在,请重新更换序列号");
}else {
//添加日志
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceSeqVo.getId(), "将装备序列号:"+deviceLibrary.getSeqNumber()+"改为"+seqNumber, null,null,null);
deviceLogService.addLog(deviceLogDto);
......@@ -750,4 +746,19 @@ public class DeviceLibraryController {
}
@ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情")
@PostMapping("/selectByIds1")
public List<DeviceNewVo> selectByIds1(@RequestBody DeviceSelectIdsVo deviceSelectIdsVo){
List<DeviceLibrary> byIds = deviceLibraryService.findByIds(deviceSelectIdsVo.getIds());
byIds.forEach(DeviceLibrary::setConfigName);
Map<String, List<DeviceLibrary>> map = byIds.stream().collect(Collectors.groupingBy(DeviceLibrary::getOwnUnit));
List<DeviceNewVo> deviceNewVoList = new ArrayList<>();
map.forEach((k,v)->{
DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(), v.get(0).getMatchingRangeName(), v.get(0).getTypeName(), v.size(), k);
deviceNewVoList.add(deviceNewVo);
});
return deviceNewVoList;
}
}
......@@ -609,7 +609,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return deviceLibraryDao.findBySeqNumber(seqNumber);
}
@Override
public void isNotLoss(List<Integer> ids) {
ids.forEach(integer -> {
......
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* DATE:2021-8-10
* Author:zsp
*/
@Data
@ApiModel("装备vo")
@AllArgsConstructor
@NoArgsConstructor
public class DeviceNewVo {
@ApiModelProperty(value = "型号", example = "bmxx")
public String model;
@ApiModelProperty(value = "名称", example = "BM-1")
public String name;
@ApiModelProperty(value = "配用范围")
public String matchingRangeName;
@ApiModelProperty(value = "装备形态")
public String typeName;
@ApiModelProperty(value = "数量")
public Integer num;
@ApiModelProperty(value = "所属单位", example = "省机要局")
private String ownUnit;
}
......@@ -131,6 +131,9 @@ public class RepairController {
@Autowired
private RepairSendBillService repairSendBillService;
@Autowired
private RepairBackBillService repairBackBillService;
@ApiOperation(value = "判断维修装备是否同一个送修单位", notes = "可以通过这个接口判断维修装备是否同一个送修单位")
@PostMapping(value = "/judge")
@Transactional(rollbackFor = Exception.class)
......@@ -2298,5 +2301,23 @@ public class RepairController {
}
/**
* 查看送修单据
*/
@GetMapping("getSendFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getSendFileList(Integer taskId){
return ResponseEntity.ok(repairSendBillService.getFileList(taskId));
}
/**
* 查看送修单据
*/
@GetMapping("getBackFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getBackFileList(Integer taskId){
return ResponseEntity.ok(repairSendBillService.getFileList(taskId));
}
}
package com.tykj.dev.device.repair.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.repair.subject.domin.RepairBackBill;
import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
public interface RepairBackBillService extends RepairPublicService<RepairBackBill> {
......@@ -19,5 +21,10 @@ public interface RepairBackBillService extends RepairPublicService<RepairBackBil
Page<RepairBackBill> getPage(RepairBillSelectVo deviceRepairBillSelectVo, Pageable pageable);
/**
* 根据taskId查询单据
* @param taskId
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
}
package com.tykj.dev.device.repair.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -27,4 +29,11 @@ public interface RepairSendBillService {
void delete(Integer id);
/**
* 根据taskId查询单据
* @param taskId
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
}
......@@ -5,10 +5,14 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.FileName;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.repair.repository.RepairBackBillDao;
import com.tykj.dev.device.repair.service.RepairBackBillService;
import com.tykj.dev.device.repair.subject.domin.RepairBackBill;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
......@@ -21,8 +25,11 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
......@@ -44,6 +51,9 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Autowired
UserUtils userUtils;
@Autowired
private TaskService taskService;
@Override
public RepairBackBill save(RepairBackBill deviceRepairBackBillEntity) {
RepairBackBill repairBackBill = deviceRepairBackBillDao.save(deviceRepairBackBillEntity);
......@@ -108,6 +118,18 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
return deviceRepairBackBillDao.findAll(getSelectSpecification(deviceRepairBillSelectVo), pageable);
}
@Override
public Map<String, List<FileRet>> getFileList(Integer taskId) {
Map<String, List<FileRet>> map = new HashMap<>();
Integer billId = taskService.get(taskId).getBillId();
RepairBackBill repairBackBill = getOne(billId);
//收件方签收单集合
map.put(FileName.SIGN.name,repairBackBill.getReceiveFileList());
//发件方回执单集合
map.put(FileName.RECEIPT.name,repairBackBill.getSendFileList());
return map;
}
private Specification<RepairBackBill> getSelectSpecification(RepairBillSelectVo deviceRepairBillSelectVo) {
PredicateBuilder<RepairBackBill> predicateBuilder = Specifications.and();
PredicateBuilder<RepairBackBill> predicateBuilder1 = Specifications.or();
......
......@@ -5,10 +5,13 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.FileName;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.repair.repository.RepairSendBillDao;
import com.tykj.dev.device.repair.service.RepairSendBillService;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.utils.JacksonUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,7 +23,9 @@ import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
......@@ -39,6 +44,9 @@ public class RepairSendBillServiceImpl implements RepairSendBillService {
@Autowired
private BlockChainUtil blockChainUtil;
@Autowired
private TaskService taskService;
@Override
public RepairSendBill addEntity(RepairSendBill deviceRepairSendBillEntity) {
RepairSendBill repairSendBill = deviceRepairSendBillDao.save(deviceRepairSendBillEntity);
......@@ -96,6 +104,18 @@ public class RepairSendBillServiceImpl implements RepairSendBillService {
deviceRepairSendBillDao.deleteById(id);
}
@Override
public Map<String, List<FileRet>> getFileList(Integer taskId) {
Map<String, List<FileRet>> map = new HashMap<>();
Integer billId = taskService.get(taskId).getBillId();
RepairSendBill repairSendBill = getOne(billId);
//收件方签收单集合
map.put(FileName.SIGN.name,repairSendBill.getReceiveFileList());
//发件方回执单集合
map.put(FileName.RECEIPT.name,repairSendBill.getSendFileList());
return map;
}
private Specification<RepairSendBill> getSelectSpecification(RepairBillSelectVo deviceRepairBillSelectVo) {
PredicateBuilder<RepairSendBill> predicateBuilder = Specifications.and();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论