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

t

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