提交 65b29b24 authored 作者: 133's avatar 133

t

上级 39ba1cb8
......@@ -58,4 +58,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List<DeviceLibrary> getAllBySeqNumber(String seq);
boolean existsAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames);
}
......@@ -42,12 +42,22 @@ public class RepelDevController {
}
/**
* 选则装备等待审核
* 等待审核
*/
@ApiOperation(value = "选则装备等待审核", notes = "选择装备的接口")
@ApiOperation(value = "提交任务等待审核", notes = "选择装备的接口")
@PostMapping(value ="/resolveConfirm/{userId}/{taskId}")
public ResponseEntity resolveConfirm(@PathVariable Integer userId, @RequestBody ResolveConfirm resolveConfirm, @PathVariable Integer taskId){
repelBusinessService.resolveConfirm(taskId,resolveConfirm,userId);
public ResponseEntity resolveConfirm(@PathVariable Integer userId, @PathVariable Integer taskId){
repelBusinessService.resolveConfirm(taskId,userId);
return ResponseEntity.ok("提交任务成功,等待审核");
}
/**
* 选则装备等待审核
*/
@ApiOperation(value = "提交选择则的装备", notes = "选择装备的接口")
@PostMapping(value ="/submitChoose/{taskId}")
public ResponseEntity resolveConfirm1( @RequestBody ResolveConfirm resolveConfirm, @PathVariable Integer taskId){
repelBusinessService.submitChooseDevice(taskId,resolveConfirm);
return ResponseEntity.ok("选中装备提交成功");
}
......@@ -71,7 +81,7 @@ public class RepelDevController {
@PostMapping(value ="/sendBackOutCheck/{userId}/{taskId}")
public ResponseEntity sendBackOutCheck(@PathVariable Integer taskId, @RequestBody OrderOutData orderOutData, @PathVariable Integer userId){
repelBusinessService.sendBackOutCheck(taskId,userId,orderOutData);
return ResponseEntity.ok("审核成功");
return ResponseEntity.ok("出库成功");
}
/**
......
......@@ -8,6 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
......@@ -40,4 +42,16 @@ public class RepelQueryController {
public ResponseEntity findDeviceRepel(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findDeviceRepel(taskId));
}
@PostMapping(value ="/deviceChooseRepel/{unitId}")
@ApiOperation(value = "代办任务通知页面详情", notes = "代办任务通知页面详情")
public ResponseEntity findDeviceRepel(@RequestBody List<Integer> fielding, @PathVariable Integer unitId){
return ResponseEntity.ok(repelQueryService.findDeviceChooseRepel(fielding,unitId));
}
@GetMapping(value ="/deviceSendOut/{taskId}")
@ApiOperation(value = "出库查询装备", notes = "代办任务通知页面详情")
public ResponseEntity findDeviceSendOut(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findDeviceSendOut(taskId));
}
}
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceChooseRepel.java
* @Description TODO
* @createTime 2021年01月11日 10:11:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("选择选择页面")
public class DeviceChooseRepel {
private List<DeviceLibrary> deviceLibraries;
private List<DeviceLibrary> deviceLibrariesAbnormal;
}
......@@ -22,6 +22,7 @@ public class ResolveConfirm {
/**
* 选中装备的id集合
*/
private List<Integer> devIds;
/**
......
......@@ -25,7 +25,14 @@ public interface RepelBusinessService {
* 以及修改账单的详情把装备写入到实体中
*/
void resolveConfirm(Integer taskId, ResolveConfirm resolveConfirm,Integer userId);
void resolveConfirm(Integer taskId,Integer userId);
/**
* 选择装备 与账单和task关联
*/
void submitChooseDevice(Integer taskId, ResolveConfirm resolveConfirm);
/**
* 省市审核需要清退装备信息
......
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel;
import java.util.List;
......@@ -25,4 +27,16 @@ public interface RepelQueryService {
* 通知页面的查询接口
*/
DeviceRepel findDeviceRepel(Integer taskId);
/**
* 根据列装id,以及当前用户
*/
DeviceChooseRepel findDeviceChooseRepel(List<Integer> fielding,Integer unitId);
/**
* 区县出库界面查询接口 根据taskid查询出库装备列表
*/
List<DeviceLibrary> findDeviceSendOut(Integer taskId);
}
......@@ -43,6 +43,7 @@ public class DeviceRepelServiceImpl implements DeviceRepelService {
if (optional.isPresent()){
DeviceRepel deviceRepel = optional.get();
deviceRepel.setFileRets(FilesUtil.stringFileToList(deviceRepel.getFiles()));
deviceRepel.setFieldingIds(StringUtils.stringToList(deviceRepel.getFielding()));
List<String> unitNames= unitsService.findAllByIdIn(StringUtils.stringToList(deviceRepel.getTaskScope())).stream().map(Units::getName).collect(Collectors.toList());
deviceRepel.setUnitNames(unitNames);
return deviceRepel;
......
......@@ -181,9 +181,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
public void resolveConfirm(Integer taskId,ResolveConfirm resolveConfirm, Integer userId) {
List<ModelCount> modelCounts=new ArrayList<>();
Map<String,Integer> map=new HashMap<>();
public void resolveConfirm(Integer taskId,Integer userId) {
StringBuffer ids=new StringBuffer();
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
......@@ -192,6 +191,24 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1207,-1);
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(3);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
// 修改当前任务的状态 清退待提交装备审核
// 修改上级任务是否代办
// 修改账单详情信息,把装备加入
// 修改统计表中的数据信息 状态
}
@Override
public void submitChooseDevice(Integer taskId, ResolveConfirm resolveConfirm) {
List<ModelCount> modelCounts=new ArrayList<>();
Map<String,Integer> map=new HashMap<>();
StringBuffer ids=new StringBuffer();
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
List<DeviceLibrary> deviceLibraries=deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(resolveConfirm.getDevIds());
deviceLibraries.forEach(
deviceLibrary -> {
......@@ -218,12 +235,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setDeviceIds(ids.toString());
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
// 修改当前任务的状态 清退待提交装备审核
// 修改上级任务是否代办
// 修改账单详情信息,把装备加入
// 修改统计表中的数据信息 状态
}
@Override
......
......@@ -5,14 +5,18 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel;
import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
......@@ -37,6 +41,9 @@ public class RepelQueryServiceImpl implements RepelQueryService {
DeviceRepelService deviceRepelService;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Autowired
UnitsService unitsService;
@Override
public List<RepelTaskStatistical> findRepelTaskStatisticals(Integer taskId,Integer billId) {
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetailNoDev(billId);
......@@ -56,5 +63,38 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
}
@Override
public DeviceChooseRepel findDeviceChooseRepel(List<Integer> fielding, Integer unitId) {
List<DeviceLibrary> deviceLibraries=new ArrayList<>();
List<DeviceLibrary> deviceLibrariesAbnormal=new ArrayList<>();
Units units= unitsService.findById(unitId);
deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).forEach(
deviceLibrary -> {
if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
deviceLibraries.add(deviceLibrary);
}else {
deviceLibrariesAbnormal.add(deviceLibrary);
}
}
);
return new DeviceChooseRepel(deviceLibraries,deviceLibrariesAbnormal);
}
@Override
public List<DeviceLibrary> findDeviceSendOut(Integer taskId) {
TaskBto taskBto = taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetail(taskBto.getBillId());
return findInvoleDevice(deviceRepelDetail.getDeviceIds());
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){
List<String> idStringList = Arrays.asList(involeDevice.split(","));
List<String> idListString = idStringList.stream().filter(list2->!list2.equals("")).collect(Collectors.toList());
List<Integer> devIds = idListString.stream().map(Integer::parseInt).collect(Collectors.toList());
return deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(devIds);
}
}
......@@ -60,9 +60,9 @@ public class Units {
private Integer idDel;
/**
* 序列号 1.在系统单位
* 2.省直属单位
* 3.省上级单位
* 类型 1.在系统单位
* 2.省直属单位 areaid 0
* 3.省上级单位 areaid 0
*/
@ApiModelProperty(value = "序列号", name = "code", example = "12321L")
private String code;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论