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

更新

上级 d6cb41a1
......@@ -10,22 +10,22 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum MatchingRange {
/**
* 省对下纵向
*/
PROVINCIAL_VERTICAL(1, "省对下纵向"),
/**
* 中央到省
*/
MATCHINGRANGE_2(2, "中央到省"),
/**
* 省对下纵向
*/
PROVINCIAL_VERTICAL(1, "省以下纵向"),
/**
* 省直横向
*/
MATCHINGRANGE_3(3, "省横向"),
MATCHINGRANGE_3(3, "省以下横向"),
/**
* 省对下
*/
MATCHINGRANGE_4(4, "省对下");
MATCHINGRANGE_4(4, "其它");
public Integer id;
......
......@@ -148,6 +148,7 @@ public class DeviceLibraryController {
@PostMapping("/core/feature/summary")
public ResponseEntity selectCoreDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceVo> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo).stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
resultList.forEach(deviceVo -> deviceVo.setChilds(null));
// List<Comparator<DeviceVo>> comparators = new ArrayList<>();
// if (deviceLibrarySelectVo.getOrders().size() > 0) {
// for (CustomOrder c:deviceLibrarySelectVo.getOrders()) {
......
......@@ -28,7 +28,7 @@ public class PageUtil {
int value = new Double(d).intValue();
//当前页数超出了最大页数
if (page >= value) {
return new PageImpl<>(new ArrayList<>(),pageable,0);
return new PageImpl<>(new ArrayList<>(),pageable,list.size());
} else {
//当前页的第一条记录的索引值
int index = page * size;
......
......@@ -20,7 +20,6 @@ import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DeviceSeqUtil;
import com.tykj.dev.misc.utils.PageUtil;
......@@ -31,7 +30,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -79,73 +77,6 @@ public class PackingController {
@Autowired
PackingLogService packingLogService;
@ApiOperation(value = "新增列装", notes = "可以通过这个接口发起列装")
@PostMapping("/addPackingLibrary")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addPackingLibrary(@RequestBody @Validated PackingLibrarySaveVo packingLibrarySaveVo) {
//添加列装装备信息
PackingLibrary p = packingLibrarySaveVo.toDo();
p.setUseraId(userUtils.getCurrentUserId());
PackingLibrary packingLibraryEntity = packingLibraryService.addEntity(p);
//添加列装配件信息
for (PartSaveVo part : packingLibrarySaveVo.getPartList()) {
PackingLibrary p2 = new PackingLibrary();
BeanUtils.copyProperties(p, p2);
BeanUtils.copyProperties(part, p2);
p2.setId(null);
p2.setIsPart(1);
p2.setPartParentId(packingLibraryEntity.getId());
}
//发起业务
Integer userId = userUtils.getCurrentUserId();
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
userIds.add(packingLibrarySaveVo.getUserbId());
TaskBto taskBto = new TaskBto(StatusEnum.PACKING_CONFIRM.id, "列装业务", null, ".", packingLibraryEntity.getId(), 1, userUtils.getCurrentUnitId(), 1, null, userIds);
TaskBto saveEntity = taskService.start(taskBto);
myWebSocket.sendMessage1();
return ResultUtil.success(saveEntity);
}
@ApiOperation(value = "列装审核", notes = "可以通过这个接口进行列装审核")
@PostMapping("/confirmPackingLibrary")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity confirmPackingLibrary(@RequestBody @Validated PackingLibraryConfirmVo packingLibraryConfirmVo) {
TaskBto taskBto = taskService.get(packingLibraryConfirmVo.getTaskId());
//审核通过
if (packingLibraryConfirmVo.getStatus() == 0) {
//业务完结
taskService.update(taskService.moveToEnd(taskBto));
//更改列装装备和配件的状态
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(taskBto.getBillId());
packingLibraryEntity.setPackingStatus(2);
for (PackingLibrary p : packingLibraryService.selectAllPart(taskBto.getBillId())) {
p.setPackingStatus(2);
packingLibraryService.update(p);
}
packingLibraryService.update(packingLibraryEntity);
myWebSocket.sendMessage1();
return ResultUtil.success("审核通过列装成功");
}
//审核失败
if (packingLibraryConfirmVo.getStatus() == 1) {
//业务封存
taskService.moveToArchive(taskBto);
//更改列装装备和配件的状态
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(taskBto.getBillId());
packingLibraryEntity.setPackingStatus(1);
for (PackingLibrary p : packingLibraryService.selectAllPart(taskBto.getBillId())) {
p.setPackingStatus(2);
packingLibraryService.update(p);
}
packingLibraryService.update(packingLibraryEntity);
myWebSocket.sendMessage1();
return ResultUtil.success("列装审核失败");
} else {
return ResultUtil.failed("status只能为0或1");
}
}
@ApiOperation(value = "查询列装详情", notes = "可以通过这个接口查询列装详情")
@GetMapping(value = "/detail/{billId}")
public ResponseEntity selectDetail(@PathVariable("billId") @Min(value = 1,message = "billId不能小于1") int billId) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论