提交 a093721c authored 作者: zjm's avatar zjm

Merge branch 'dev' of git.yfzx.zjtys.com.cn:matrix/device-back

......@@ -367,9 +367,8 @@ public class AllotBillController {
// MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "发起配发业务:" + MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit()), idList, 1);
List<String> collect = allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList());
MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "发起配发出库:" +
MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit())+
"【型号:"+String.join(",",collect)+
"共"+allotBillSaveVo.getAllotCount()+"件装备】", idList, 1);
MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit())
+MessageFormatUtil.spellModelAndCount(collect,allotBill.getAllotedCount()), idList, 1);
// MessageBto messageBto = new MessageBto(saveEntity.getId(), saveEntity.getBusinessType(), "对" + userPublicService.getAreaNameByUnitName(allotBillEntity.getReceiveUnit()) + "发起配发", idList, 1);
messageService.add(messageBto);
log.info("[配发模块]:" + allotBillEntity.getSendUnit() + "对" + allotBillEntity.getReceiveUnit() + "发起配发");
......@@ -500,23 +499,23 @@ public class AllotBillController {
// messageService.add(messageBto);
// }
//签发人阅知
if (allotReceiveVo.getSendUserbId() != null && sendbIsExist) {
List<Integer> idList1 = new ArrayList<>();
idList1.add(allotReceiveVo.getSendUserbId());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
// if (allotReceiveVo.getSendUserbId() != null && sendbIsExist) {
// List<Integer> idList1 = new ArrayList<>();
// idList1.add(allotReceiveVo.getSendUserbId());
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
// messageService.add(messageBto);
// }
//根据status判断是否业务完结,发送不同的阅知message
// String message = allotReceiveVo.getStatus() == 0 ? "办结配发业务:" :"接收配发装备:";
String message = allotReceiveVo.getStatus() == 0 ? "办结配发业务:" :"接收配发入库:";
String message ="办结 配发业务";
if (allotReceiveVo.getStatus() ==0){
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), message+MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit()), ids, 1);
List<ScriptSaveVo> scriptSaveVos = JacksonUtil.readValue(allotBillEntity.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {});
List<String> collect = scriptSaveVos.stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(),
message+MessageFormatUtil.spellTwoWicket(allotBillEntity.getSendUnit(),allotBillEntity.getReceiveUnit())
+"【型号:"+String.join(",",collect)+
"共"+allotReceiveVo.getReceiveCount()+"件装备】", ids, 1);
+MessageFormatUtil.spellModelAndCount(collect,allotBillEntity.getAllotedCount()), ids, 1);
messageService.add(messageBto);
}
log.info("[配发模块]:接收并发起入库");
......@@ -718,12 +717,12 @@ public class AllotBillController {
deviceLogService.addLog(deviceLogDto);
});
//签发人阅知
if (fileUploadVo.getSendUserbId() != null) {
List<Integer> idList1 = new ArrayList<>();
idList1.add(fileUploadVo.getSendUserbId());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
// if (fileUploadVo.getSendUserbId() != null) {
// List<Integer> idList1 = new ArrayList<>();
// idList1.add(fileUploadVo.getSendUserbId());
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
// messageService.add(messageBto);
// }
//发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userId);
// ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBill.getSendUnit())).stream()
......@@ -736,13 +735,12 @@ public class AllotBillController {
// String content = "发起配发业务已办结";
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(),
// content, ids, 1);
String message = "接收配发入库";
String message = "接收 配发入库";
List<ScriptSaveVo> scriptSaveVos = JacksonUtil.readValue(allotBill.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {});
List<String> collect = scriptSaveVos.stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(),
message+MessageFormatUtil.spellTwoWicket(allotBill.getSendUnit(),allotBill.getReceiveUnit())
+"【型号:"+String.join(",",collect)+
"共"+allotBill.getReceiveCount()+"件装备】", ids, 1);
+MessageFormatUtil.spellModelAndCount(collect,allotBill.getAllotedCount()), ids, 1);
messageService.add(messageBto);
return ResponseEntity.ok("上传成功");
}
......@@ -773,14 +771,14 @@ public class AllotBillController {
idList.add(fileVo.getReceiveUserbId());
}
//签发人阅知
if (fileVo.getSendUserbId() != null) {
allotBill.setSendUserbId(fileVo.getSendUserbId());
allotBill.setAgent(userPublicService.getOne(fileVo.getSendUserbId()).getName());
List<Integer> idList1 = new ArrayList<>();
idList1.add(fileVo.getSendUserbId());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
// if (fileVo.getSendUserbId() != null) {
// allotBill.setSendUserbId(fileVo.getSendUserbId());
// allotBill.setAgent(userPublicService.getOne(fileVo.getSendUserbId()).getName());
// List<Integer> idList1 = new ArrayList<>();
// idList1.add(fileVo.getSendUserbId());
// MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
// messageService.add(messageBto);
// }
//保存账单
//回执单
allotBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getAllotFiles()));
......@@ -832,8 +830,7 @@ public class AllotBillController {
List<String> collect = scriptSaveVos.stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(),
content+MessageFormatUtil.spellTwoWicket(allotBill.getSendUnit(),allotBill.getReceiveUnit())
+"【型号:"+String.join(",",collect)+
"共"+allotBill.getAllotedCount()+"件装备】", ids, 1);
+MessageFormatUtil.spellModelAndCount(collect,allotBill.getAllotedCount()), ids, 1);
messageService.add(messageBto);
return ResponseEntity.ok("OK");
}
......
......@@ -212,18 +212,25 @@ public class DeviceApplyController {
String message;
switch (deviceApplySaveVo.getApplyType()){
case 2:
message = "发起退役申请";
message = "发起 退役申请";
break;
case 3:
message = "发起报废申请";
message = "发起 报废申请";
break;
case 4:
message = "发起销毁申请";
message = "发起 销毁申请";
break;
default:
message = "发起装备申请";
message = "发起 装备申请";
}
MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),message,userIds);
// MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),message,userIds);
//获取列装id 通过列装id获取型号
List<Integer> packingIds = deviceApplySaveVo.getStorageBillDetailVoList().stream().map(ApplyBillDetailVo::getPackingId).distinct()
.collect(Collectors.toList());
List<String> models = packingLibraryService.getModelsById(packingIds);
MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),message+
MessageFormatUtil.spellTwoWicket(deviceApplySaveVo.getApplyUnit(),deviceApplySaveVo.getApplyUnit())+
MessageFormatUtil.spellModelAndCount(models,deviceApplySaveVo.getApplyAllNum()),userIds);
messageService.add(messageBto);
log.info("[申请模块]:"+message);
myWebSocket.sendMessage1();
......@@ -259,7 +266,7 @@ public class DeviceApplyController {
deviceApplyBillService.update(applyBillEntity);
//发送阅知信息
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
"不同意申请业务:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "->【中办机要局】",ids);
"不同意 申请业务:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "->【中办机要局】",ids);
messageService.add(messageBto);
log.info("[申请模块]:装备申请驳回");
myWebSocket.sendMessage1();
......@@ -386,12 +393,12 @@ public class DeviceApplyController {
userIds.addAll(userDao.findAllByUnitsId(allotBillEntity.getReceiveUnitId()).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
if (deviceApplyAllotSaveVo.getSendUserbId()!=null) {
List<Integer> idList1 = new ArrayList<>();
idList1.add(deviceApplyAllotSaveVo.getSendUserbId());
MessageBto messageBto = new MessageBto(taskBto1.getId(), taskBto1.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
// if (deviceApplyAllotSaveVo.getSendUserbId()!=null) {
// List<Integer> idList1 = new ArrayList<>();
// idList1.add(deviceApplyAllotSaveVo.getSendUserbId());
// MessageBto messageBto = new MessageBto(taskBto1.getId(), taskBto1.getBusinessType(), "被选为签发人", idList1, 1);
// messageService.add(messageBto);
// }
MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),"对" + userPublicService.getAreaNameByUnitName(allotBillEntity.getReceiveUnit()) + "发起配发",userIds,1);
messageService.add(messageBto);
log.info("[申请模块]:装备申请后发起配发");
......@@ -466,9 +473,9 @@ public class DeviceApplyController {
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());
MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"申请不同意,申请业务办结",userIds,0);
messageService.add(messageBto);
deviceApplyBill.setApplyStatus(1);
deviceApplyBill.setBackFiles(FilesUtil.stringFileToList(uploadApplyFile.getBackFiles()));
if (uploadApplyFile.getReplyVos() != null && uploadApplyFile.getReplyVos().size() > 0) {
......@@ -664,7 +671,7 @@ public class DeviceApplyController {
}
}
@ApiOperation(value = "手动办结申请任务", notes = "手动办结申请任务")
@ApiOperation(value = "手动办结申请任务", notes = "手动办结申请任务")//不用了
@PostMapping("/over/{id}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity over(@PathVariable("id") int taskId) {
......
......@@ -80,6 +80,10 @@ public class DeviceApplySaveVo {
@ApiModelProperty(value = "选择试用装备详情类")
private List<ApplyTryVo> applyTryVos;
@NotNull(message = "applyAllNum不能为空")
@ApiModelProperty(value = "申请总数量")
private Integer applyAllNum;
/**
* 转实体
......
......@@ -622,6 +622,29 @@ public class DeviceLibraryController {
return ResultUtil.success(map);
}
// @ApiOperation(value = "本级模糊查询核心装备统计分页", notes = "可以通过这个接口查询装备列表")
// @PostMapping("/core/stat/local/summary")
// public ResponseEntity getLocalDeviceStatisticsPage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
// List<DeviceStatisticsVo> deviceStatisticsVoList = deviceLibraryService.getDeviceStatisticsPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable(),deviceLibrarySelectVo.getPageable().getSort());
// List<DeviceStatisticsVo> deviceStatisticsVoSorts = deviceStatisticsVoList.stream()
// .sorted(Comparator.comparing(DeviceStatisticsVo::getModel).thenComparing(DeviceStatisticsVo::getName))
// .collect(Collectors.toList());
// Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoSorts, deviceLibrarySelectVo.getPageable());
// Map<String,Object> map = new HashMap<>();
// Map<Integer, String> styleMap = configCache.getStyleMap();
// List<String> models = deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getModel).distinct().collect(Collectors.toList());
// List<String> modelToSort = DeviceModelSort.modelToSort(models);
// map.put("pages",deviceStatisticsVos);
// map.put("models",modelToSort);
// //名称排序
// map.put("names",deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getName).distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList()));
// //形态
// List<Integer> types = deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getType).distinct().collect(Collectors.toList());
// Collections.sort(types);
// map.put("types",types.stream().map(integer -> new TypeVo(integer,styleMap.get(integer))).collect(Collectors.toList()));
// return ResultUtil.success(map);
// }
@ApiOperation(value = "查询核心装备详情的详情", notes = "可以通过这个接口查询核心装备详情的详情")
@GetMapping("/core/feature/detail/{id}")
public ResponseEntity getDeviceDetail(@PathVariable("id") @Min(value = 1,message = "id不能小于1") int id) {
......
......@@ -240,7 +240,9 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
List<DeviceLibrary> libraryEntities = getCoreDevicePage(d);
if (libraryEntities.size() > 0) {
// Map<String, List<DeviceLibrary>> map = libraryEntities.stream().collect(groupingBy(deviceLibrary -> deviceLibrary.getModel()+"Ǵ"+deviceLibrary.getName()));
Map<String, List<DeviceLibrary>> map = libraryEntities.stream().collect(groupingBy(deviceLibrary -> deviceLibrary.getModel()+"Ǵ"+deviceLibrary.getName()+"Ǵ"+deviceLibrary.getType()+"Ǵ"+deviceLibrary.getMatchingRangeName()+"Ǵ"+deviceLibrary.getIsPart()));
Map<String, List<DeviceLibrary>> map = libraryEntities.stream().collect(groupingBy(deviceLibrary ->
deviceLibrary.getModel()+"Ǵ"+deviceLibrary.getName()+"Ǵ"+deviceLibrary.getType()+"Ǵ"
+deviceLibrary.getMatchingRangeName()+"Ǵ"+deviceLibrary.getIsPart()));
//按型号遍历统计各种状态的装备数量
for (String s : map.keySet()) {
String[] strings = s.split("Ǵ");
......
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("本级装备统计类")
public class LocalDeviceStatisticsVo {
@ApiModelProperty(value = "型号", example = "bmxx")
public String model;
@ApiModelProperty(value = "名称", example = "BM-1")
public String name;
@ApiModelProperty(value = "所属单位", example = "省机要局")
private String ownUnit;
@ApiModelProperty(value = "装备类型总数", example = "100")
private Integer deviceNumber;
@ApiModelProperty(value = "在库数量", example = "10")
private Integer inLibraryNum;
@ApiModelProperty(value = "维修数量", example = "10")
private Integer repairNum;
@ApiModelProperty(value = "销毁数量", example = "10")
private Integer destoryNum;
@ApiModelProperty(value = "退役数量", example = "10")
private Integer retiredNum;
@ApiModelProperty(value = "报废数量", example = "10")
private Integer scrappedNum;
@ApiModelProperty(value = "运输中数量", example = "10")
private Integer allotNum;
@ApiModelProperty(value = "使用数量", example = "10")
private Integer useNum;
@ApiModelProperty(value = "其他数量", example = "10")
private Integer otherNum;
@ApiModelProperty(value = "其他数量id", example = "10")
private List<Integer> otherNumIds = new ArrayList<>();
@ApiModelProperty(value = "该型号所有装备Id列表")
private List<Integer> deviceIds = new ArrayList<>();
@ApiModelProperty(value = "该型号在库装备Id列表")
private List<Integer> inLibraryIds = new ArrayList<>();
@ApiModelProperty(value = "该型号维修装备Id列表")
private List<Integer> repairIds = new ArrayList<>();
@ApiModelProperty(value = "该型号销毁装备Id列表")
private List<Integer> destoryIds = new ArrayList<>();
@ApiModelProperty(value = "该型号退役装备Id列表")
private List<Integer> retiredIds = new ArrayList<>();
@ApiModelProperty(value = "该型号报废装备Id列表")
private List<Integer> scrappedIds = new ArrayList<>();
@ApiModelProperty(value = "该型号运输中装备Id列表")
private List<Integer> allotIds = new ArrayList<>();
@ApiModelProperty(value = "该型号使用中装备Id列表")
private List<Integer> useIds = new ArrayList<>();
@ApiModelProperty(value = "序列号区间")
public String seqs;
@ApiModelProperty(value = "装备形态")
public Integer type;
@ApiModelProperty(value = "装备配用范围")
public String matchingRangeName;
@ApiModelProperty(value = "是不是配件(0:不是,1:是)")
private Integer isPart;
}
package com.tykj.dev.misc.utils;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
......@@ -29,6 +31,15 @@ public class MessageFormatUtil {
"】";
};
/**
* 阅知中拼接型号和数量
*/
public static String spellModelAndCount(List<String> models,Integer count) {
return "【型号:" +
String.join(",",models) +
"共"+count+"件装备】";
}
/**
* 一个【】填空内容的通用接口
......
......@@ -244,4 +244,11 @@ public interface PackingLibraryService{
*/
List<PackingLibrary> findByIds(@RequestBody List<Integer> ids);
/**
* 通过列装id获取型号
* @param ids 列装id的集合
* @return 型号的集合
*/
List<String> getModelsById(List<Integer> ids);
}
......@@ -1079,6 +1079,11 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return packingLibraryDao.findAllByIdIn(ids);
}
@Override
public List<String> getModelsById(List<Integer> ids) {
return packingLibraryDao.findAllByIdIn(ids).stream().map(PackingLibrary::getModel).distinct().collect(Collectors.toList());
}
private Specification<PackingLibrary> getSelectSpecification(PackingLibrarySelectVo packingLibrarySelectVo) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
Integer level = userUtils.getCurrentUnitLevel();
......
......@@ -47,4 +47,10 @@ public class FileUploadVo {
@ApiModelProperty(value = "接收单位B岗")
private Integer repairUserbId;
@ApiModelProperty(value = "型号的集合")
private List<String> models;
@ApiModelProperty(value = "接收维修装备的数量")
private Integer deviceCount;
}
......@@ -36,4 +36,7 @@ public class FileVo {
@ApiModelProperty(value = "发件单位B岗")
private Integer startUserbId;
@ApiModelProperty(value = "接收维修装备的数量")
private Integer deviceCount;
}
......@@ -101,4 +101,7 @@ public class RepairReceiveVo {
@ApiModelProperty(value = "收件单位Id")
private Integer receiveUnitId;
@ApiModelProperty(value = "接收维修装备的型号")
private List<String> models;
}
......@@ -7,4 +7,4 @@ spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin
spring.boot.admin.client.url=http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087w
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论