提交 ed69d5c6 authored 作者: zhoushaopan's avatar zhoushaopan

提交代码

上级 8c3c4bcf
...@@ -791,4 +791,47 @@ public class AllotBillController { ...@@ -791,4 +791,47 @@ public class AllotBillController {
allotBill.setSendUserbId(agentVo.getSendUserbId()); allotBill.setSendUserbId(agentVo.getSendUserbId());
return ResponseEntity.ok(allotBillService.update(allotBill)); return ResponseEntity.ok(allotBillService.update(allotBill));
} }
@ApiOperation(value = "配发撤回", notes = "根据任务id撤回配发")
@GetMapping("/revokeTask/taskId")
public ResponseEntity revokeTask(Integer taskId){
//根据任务id查询子任务 发件方是子任务 收件方是主任务
TaskBto taskBto = taskService.get(taskId);
Integer parentTaskId = taskBto.getParentTaskId();
TaskBto parentTask = taskService.get(parentTaskId);
//父任务未被完成 可以被撤回
Integer billId = taskBto.getBillId();
String title = taskBto.getTitle();
AllotBill allotBill = allotBillService.getOne(billId);
if (allotBill.getAllotCheckDetail()!=null){
List<Integer> ids = StringSplitUtil.split(allotBill.getAllotCheckDetail());
List<DeviceLibrary> deviceLibraryList = new ArrayList<>();
for (Integer id : ids) {
//通过id装备
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(id);
deviceLibrary.setLifeStatus(2);
deviceLibraryService.update(deviceLibrary);
deviceLibraryList.add(deviceLibrary);
}
allotBill.setDeviceLibraries(deviceLibraryList);
}
// List<DeviceLibrary> deviceLibraryList = deviceLibraryService.getListByBillId(billId);
//
// for (DeviceLibrary deviceLibrary : deviceLibraryList) {
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// }
//将任务都完结
taskService.moveToArchive(taskBto);
taskService.moveToArchive(parentTask);
return ResponseEntity.ok(title + "的任务撤回成功");
}
} }
...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.service.AllotBackBillService; import com.tykj.dev.device.allot.service.AllotBackBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBackBill; import com.tykj.dev.device.allot.subject.domin.AllotBackBill;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.AgentVo; import com.tykj.dev.device.allot.subject.vo.AgentVo;
import com.tykj.dev.device.allot.subject.vo.AllotBackReceiveVo; import com.tykj.dev.device.allot.subject.vo.AllotBackReceiveVo;
import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo; import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo;
...@@ -610,4 +611,48 @@ public class BackController { ...@@ -610,4 +611,48 @@ public class BackController {
} }
return ResponseEntity.ok(allotBillEntity); return ResponseEntity.ok(allotBillEntity);
} }
@ApiOperation(value = "退回撤回", notes = "根据任务id撤回配发")
@GetMapping("/revokeTask/taskId")
public ResponseEntity revokeTask(Integer taskId){
//根据任务id查询子任务 发件方是子任务 收件方是主任务
TaskBto taskBto = taskService.get(taskId);
Integer parentTaskId = taskBto.getParentTaskId();
TaskBto parentTask = taskService.get(parentTaskId);
//父任务未被完成 可以被撤回
Integer billId = taskBto.getBillId();
String title = taskBto.getTitle();
AllotBackBill allotBackBill = allotBackBillService.getOne(billId);
if (allotBackBill.getBackCheckDetail()!=null){
List<Integer> ids = StringSplitUtil.split(allotBackBill.getBackCheckDetail());
List<DeviceLibrary> deviceLibraryList = new ArrayList<>();
for (Integer id : ids) {
//通过id装备
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(id);
// deviceLibrary.setOwnUnit(allotBackBill.getSendUnit());
// deviceLibrary.setLocationUnit(allotBackBill.getSendUnit());
deviceLibrary.setLifeStatus(2);
deviceLibraryService.update(deviceLibrary);
deviceLibraryList.add(deviceLibrary);
}
allotBackBill.setDeviceLibraries(deviceLibraryList);
}
// List<DeviceLibrary> deviceLibraryList = deviceLibraryService.getListByBillId(billId);
//
// for (DeviceLibrary deviceLibrary : deviceLibraryList) {
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// }
//将任务都完结
taskService.moveToArchive(taskBto);
taskService.moveToArchive(parentTask);
return ResponseEntity.ok(title + "的任务撤回成功");
}
} }
...@@ -308,7 +308,8 @@ public enum LogType { ...@@ -308,7 +308,8 @@ public enum LogType {
REPAIR_SEND_16(126,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_DRAFT.id, "拒绝电子签章申请"), REPAIR_SEND_16(126,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_DRAFT.id, "拒绝电子签章申请"),
REPAIR_SEND_17(127,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_WAIT_SIGN.id, "同意电子签章申请"), REPAIR_SEND_17(127,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, REPAIR_SEND_WAIT_SIGN.id, "同意电子签章申请"),
REPAIR_SEND_18(128,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_RECEIVE.id, "盖电子签章并出库"), REPAIR_SEND_18(128,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_RECEIVE.id, "盖电子签章并出库"),
REPAIR_SEND_19(129,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, END.id, "盖电子签章并入库"), // REPAIR_SEND_19(129,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, END.id, "盖电子签章并入库"),
REPAIR_SEND_19(129,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, END.id, "盖电子签章并出库"),
REPAIR_SEND_20(130,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_UPLOAD_FILE.id, "盖电子签章并入库"), REPAIR_SEND_20(130,REPAIR.id, REPAIR_SEND_WAIT_SIGN.id, WAIT_UPLOAD_FILE.id, "盖电子签章并入库"),
REPAIR_SEND_21(131,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, WAIT_RECEIVE.id, "拒绝电子签章申请"), REPAIR_SEND_21(131,REPAIR.id, REPAIR_SEND_SIGN_WAIT_CONFIRM.id, WAIT_RECEIVE.id, "拒绝电子签章申请"),
...@@ -330,7 +331,11 @@ public enum LogType { ...@@ -330,7 +331,11 @@ public enum LogType {
// REPAIR_BACK_22(145,REPAIR_BACK.id, ORIGIN_STATUS.id, REPAIR_BACK_DRAFT.id, "维修退回等待出库"), // REPAIR_BACK_22(145,REPAIR_BACK.id, ORIGIN_STATUS.id, REPAIR_BACK_DRAFT.id, "维修退回等待出库"),
REPAIR_BACK_23(146,REPAIR_BACK.id, REPAIR_BACK_DRAFT.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, "申请签章待审核"), REPAIR_BACK_23(146,REPAIR_BACK.id, REPAIR_BACK_DRAFT.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, "申请签章待审核"),
// REPAIR_SEND_22(147,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_DRAFT.id, "送修等待出库"), // REPAIR_SEND_22(147,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_DRAFT.id, "送修等待出库"),
REPAIR_SEND_23(148,REPAIR.id, ORIGIN_STATUS.id, WAIT_UPLOAD_SEND_FILE.id, "等待上传回执单"),; REPAIR_SEND_23(148,REPAIR.id, ORIGIN_STATUS.id, WAIT_UPLOAD_SEND_FILE.id, "等待上传回执单"),
ALLOT_25(149,ALLOT.id,ALLOT_DRAFT.id,ALLOT_DRAFT.id,"申请电子签章被拒绝"),
ALLOT_26(150,ALLOT.id,SIGN_WAIT_CONFIRM.id,ARCHIVE.id,"该业务已经被撤回"),
ALLOT_27(151,REPAIR_BACK.id,ORIGIN_STATUS.id,WAIT_UPLOAD_BACK_SEND_FILE.id,"等待上传回执单")
;
public Integer id; public Integer id;
......
package com.tykj.dev.device.destroy.repository; package com.tykj.dev.device.destroy.repository;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill; import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -12,5 +16,7 @@ import java.util.Optional; ...@@ -12,5 +16,7 @@ import java.util.Optional;
public interface DeviceDestroyBillDao extends JpaRepository<DeviceDestroyBill, Integer>, JpaSpecificationExecutor<DeviceDestroyBill> { public interface DeviceDestroyBillDao extends JpaRepository<DeviceDestroyBill, Integer>, JpaSpecificationExecutor<DeviceDestroyBill> {
Optional<DeviceDestroyBill> findByApplyId(Integer applyId); Optional<DeviceDestroyBill> findByApplyId(Integer applyId);
@Query("select o from DeviceDestroyBill o where o.unitId= :unitId and o.createTime >= :startTime and o.createTime <= :endTime")
List<DeviceDestroyBill> findAllByUnitBetweenTime(Integer unitId, Date startTime, Date endTime);
} }
...@@ -30,31 +30,31 @@ public class FinalDetailVo { ...@@ -30,31 +30,31 @@ public class FinalDetailVo {
private String type; private String type;
@ApiModelProperty("纵向") @ApiModelProperty("纵向")
private Integer vertical; private Integer vertical = 0;
@ApiModelProperty("横向") @ApiModelProperty("横向")
private Integer horizontal; private Integer horizontal = 0;
@ApiModelProperty("委托") @ApiModelProperty("委托")
private Integer commission; private Integer commission = 0;
@ApiModelProperty("其他") @ApiModelProperty("其他")
private Integer other; private Integer other = 0;
@ApiModelProperty("合计") @ApiModelProperty("合计")
private Integer total; private Integer total = 0;
@ApiModelProperty("代管") @ApiModelProperty("代管")
private Integer hosting; private Integer hosting = 0;
@ApiModelProperty("收到") @ApiModelProperty("收到")
private Integer received; private Integer received = 0;
@ApiModelProperty("发出") @ApiModelProperty("发出")
private Integer sending; private Integer sending = 0;
@ApiModelProperty("报废") @ApiModelProperty("报废")
private Integer scrapped; private Integer scrapped = 0;
} }
...@@ -23,6 +23,8 @@ public interface FinalCheckService { ...@@ -23,6 +23,8 @@ public interface FinalCheckService {
*/ */
FinalReportVo generateReport(LocalDate startTime, LocalDate endTime); FinalReportVo generateReport(LocalDate startTime, LocalDate endTime);
FinalReportVo generateReport1(LocalDate startTime, LocalDate endTime);
/** /**
* 根据关键字查询报告列表(不附带detail) * 根据关键字查询报告列表(不附带detail)
* @return {@link FinalReportVo} 's List * @return {@link FinalReportVo} 's List
......
...@@ -110,7 +110,7 @@ public class DeviceLibrary { ...@@ -110,7 +110,7 @@ public class DeviceLibrary {
/** /**
* 配用范围,1-省对下纵向 * 配用范围,1-省对下纵向
*/ */
@ApiModelProperty(value = "配用范围,1-省对下纵向") @ApiModelProperty(value = "配用范围,1-省对下纵向",notes = "1 省以下纵向 2 中央到省 3 省以下横向 4 其他")
private Integer matchingRange; private Integer matchingRange;
/** /**
* 可见范围 * 可见范围
......
package com.tykj.dev.device.repair.repository; package com.tykj.dev.device.repair.repository;
import com.tykj.dev.device.repair.subject.domin.RepairBackBill; import com.tykj.dev.device.repair.subject.domin.RepairBackBill;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/** /**
* @author zjm * @author zjm
...@@ -13,5 +18,8 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; ...@@ -13,5 +18,8 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
*/ */
public interface RepairBackBillDao extends JpaRepository<RepairBackBill, Integer>, JpaSpecificationExecutor<RepairBackBill> { public interface RepairBackBillDao extends JpaRepository<RepairBackBill, Integer>, JpaSpecificationExecutor<RepairBackBill> {
RepairBackBill findByDeviceRepairBillId(Integer repairBillId); RepairBackBill findByDeviceRepairBillId(Integer repairBillId);
@Query("select o from RepairBackBill o where o.receiveUnit= :unitName and o.createTime >= :startTime and o.createTime <= :endTime")
List<RepairBackBill> findAllByUnitBetweenTime(String unitName, Date startTime, Date endTime);
} }
...@@ -3,6 +3,10 @@ package com.tykj.dev.device.repair.repository; ...@@ -3,6 +3,10 @@ package com.tykj.dev.device.repair.repository;
import com.tykj.dev.device.repair.subject.domin.RepairBill; import com.tykj.dev.device.repair.subject.domin.RepairBill;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
......
...@@ -3,10 +3,17 @@ package com.tykj.dev.device.repair.repository; ...@@ -3,10 +3,17 @@ package com.tykj.dev.device.repair.repository;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill; import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
public interface RepairSendBillDao extends JpaRepository<RepairSendBill, Integer>, JpaSpecificationExecutor<RepairSendBill> { public interface RepairSendBillDao extends JpaRepository<RepairSendBill, Integer>, JpaSpecificationExecutor<RepairSendBill> {
RepairSendBill findByDeviceRepairBillId(Integer id); RepairSendBill findByDeviceRepairBillId(Integer id);
@Query("select o from RepairSendBill o where o.sendUnit= :unitName and o.createTime >= :startTime and o.createTime <= :endTime")
List<RepairSendBill> findAllByUnitBetweenTime(String unitName, Date startTime, Date endTime);
} }
...@@ -3,9 +3,16 @@ package com.tykj.dev.device.scrap.repository; ...@@ -3,9 +3,16 @@ package com.tykj.dev.device.scrap.repository;
import com.tykj.dev.device.scrap.subject.domin.ScrapBill; import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
public interface ScrapBillDao extends JpaRepository<ScrapBill, Integer>, JpaSpecificationExecutor<ScrapBill> { public interface ScrapBillDao extends JpaRepository<ScrapBill, Integer>, JpaSpecificationExecutor<ScrapBill> {
@Query("select o from ScrapBill o where o.scrapUnit= :unitName and o.createTime >= :startTime and o.createTime <= :endTime")
List<ScrapBill> findAllByUnitBetweenTime(String unitName, Date startTime, Date endTime);
} }
...@@ -66,6 +66,7 @@ public class TaskController { ...@@ -66,6 +66,7 @@ public class TaskController {
@Autowired @Autowired
private DeviceLibraryService deviceLibraryService; private DeviceLibraryService deviceLibraryService;
@ApiOperation(value = "业务分页查询", notes = "可以通过这个接口分页查询业务") @ApiOperation(value = "业务分页查询", notes = "可以通过这个接口分页查询业务")
@RequestMapping(method = RequestMethod.POST, value = "/manage/summary", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(method = RequestMethod.POST, value = "/manage/summary", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity getTaskPage(@RequestBody TaskSelectVo taskSelectVo) { public ResponseEntity getTaskPage(@RequestBody TaskSelectVo taskSelectVo) {
...@@ -312,68 +313,61 @@ public class TaskController { ...@@ -312,68 +313,61 @@ public class TaskController {
Integer businessType = taskBusinessTypeVo.getBusinessType(); Integer businessType = taskBusinessTypeVo.getBusinessType();
Integer taskId = taskBusinessTypeVo.getTaskId(); Integer taskId = taskBusinessTypeVo.getTaskId();
//当前状态
Integer billStatus = taskService.get(taskId).getBillStatus();
List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId2(taskId); List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId2(taskId);
switch(businessType){ switch(businessType){
case 3 : case 3 :
return ResponseEntity.ok(allot(taskLogUserVos)); return ResponseEntity.ok(allot(taskLogUserVos,billStatus));
case 22 : case 22 :
//语句 //语句
return ResponseEntity.ok(backAllot(taskLogUserVos)); return ResponseEntity.ok(backAllot(taskLogUserVos,billStatus));
case 10 : case 10 :
//语句 //语句
return ResponseEntity.ok(repairBack(taskLogUserVos)); return ResponseEntity.ok(repairBack(taskLogUserVos,billStatus));
case 11 : case 11 :
//语句 //语句
return ResponseEntity.ok(repair(taskLogUserVos)); return ResponseEntity.ok(repair(taskLogUserVos,billStatus));
default : //可选 default : //可选
return ResponseEntity.ok(defaults(taskLogUserVos)); return ResponseEntity.ok(defaults(taskLogUserVos));
} }
// for (TaskLogUserVo taskLogUserVo : taskLogUserVos) { }
// @ApiOperation(value = "任务撤回", notes = "根据任务id撤回任务")
// @GetMapping("/revokeTask/taskId")
// public ResponseEntity revokeTask(Integer taskId){
//
// //根据任务id查询子任务 发件方是子任务 收件方是主任务
// TaskBto taskBto = taskService.get(taskId);
// Integer parentTaskId = taskBto.getParentTaskId();
//
// TaskBto parentTask = taskService.get(parentTaskId);
// //父任务未被完成 可以被撤回
// Integer billId = taskBto.getBillId();
// String title = taskBto.getTitle();
//
// //
// if (taskLogUserVo.getOldStatus()!=null){ // List<DeviceLibrary> deviceLibraryList = deviceLibraryService.getListByBillId(billId);
// if (!map.containsKey(taskLogUserVo.getOldStatus()+"")){
// map.put(taskLogUserVo.getOldStatus()+"", taskLogUserVo.getUser());
// }else {
// map.put(taskLogUserVo.getOldStatus()+"-1",taskLogUserVo.getUser());
// }
// //
// }else {
// map.put("",taskLogUserVo.getUser());
// }
// //
//
// for (DeviceLibrary deviceLibrary : deviceLibraryList) {
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// } // }
// //将任务都完结
// taskService.moveToArchive(taskBto);
//
// taskService.moveToArchive(parentTask);
// return ResponseEntity.ok(title + "的任务撤回成功");
//
//
// }
} private Map<String, String> allot(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){
@ApiOperation(value = "任务撤回", notes = "根据任务id撤回任务")
@GetMapping("/revokeTask/taskId")
public ResponseEntity revokeTask(Integer taskId){
//根据任务id查询子任务 发件方是子任务 收件方是主任务
TaskBto taskBto = taskService.get(taskId);
Integer parentTaskId = taskBto.getParentTaskId();
//查询父任务
TaskBto parentTask = taskService.get(parentTaskId);
//父任务未被完成 可以被撤回
Integer billId = taskBto.getBillId();
String title = taskBto.getTitle();
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.getListByBillId(billId);
for (DeviceLibrary deviceLibrary : deviceLibraryList) {
deviceLibrary.setLifeStatus(2);
}
//将任务都完结
taskService.moveToArchive(taskBto);
taskService.moveToArchive(parentTask);
return ResponseEntity.ok(title + "的任务撤回成功");
}
private Map<String, String> allot(List<TaskLogUserVo> taskLogUserVos){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
for (TaskLogUserVo taskLogUserVo : taskLogUserVos) { for (TaskLogUserVo taskLogUserVo : taskLogUserVos) {
if (taskLogUserVo.getOldStatus()!=null){ if (taskLogUserVo.getOldStatus()!=null){
...@@ -382,16 +376,22 @@ public class TaskController { ...@@ -382,16 +376,22 @@ public class TaskController {
if (map.containsKey("340")){ if (map.containsKey("340")){
map.put("340j",taskLogUserVo.getUser()); map.put("340j",taskLogUserVo.getUser());
}else { }else {
//存在 //存在 配发中
if (map.containsKey("302")){ if (map.containsKey("302")){
map.put("340j",taskLogUserVo.getUser()); map.put("340j",taskLogUserVo.getUser());
}else { }else {
map.put("340",taskLogUserVo.getUser()); if (billStatus == 333 && taskLogUserVo.getOldStatus() == 340){
map.clear();
}else {
map.put("340",taskLogUserVo.getUser());
}
} }
} }
}else { } else {
//0 333
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser()); map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
} }
} }
} }
...@@ -399,7 +399,7 @@ public class TaskController { ...@@ -399,7 +399,7 @@ public class TaskController {
} }
private Map<String, String> backAllot(List<TaskLogUserVo> taskLogUserVos){ private Map<String, String> backAllot(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
for (TaskLogUserVo taskLogUserVo : taskLogUserVos) { for (TaskLogUserVo taskLogUserVo : taskLogUserVos) {
if (taskLogUserVo.getOldStatus()!=null){ if (taskLogUserVo.getOldStatus()!=null){
...@@ -412,7 +412,12 @@ public class TaskController { ...@@ -412,7 +412,12 @@ public class TaskController {
if (map.containsKey("900")){ if (map.containsKey("900")){
map.put("930j",taskLogUserVo.getUser()); map.put("930j",taskLogUserVo.getUser());
}else { }else {
map.put("930",taskLogUserVo.getUser()); if (billStatus == 922 && taskLogUserVo.getOldStatus() ==930){
map.clear();
}else {
map.put("930",taskLogUserVo.getUser());
}
} }
} }
}else { }else {
...@@ -424,7 +429,7 @@ public class TaskController { ...@@ -424,7 +429,7 @@ public class TaskController {
return map; return map;
} }
private Map<String, String> repair(List<TaskLogUserVo> taskLogUserVos){ private Map<String, String> repair(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
for (TaskLogUserVo taskLogUserVo : taskLogUserVos) { for (TaskLogUserVo taskLogUserVo : taskLogUserVos) {
if (taskLogUserVo.getOldStatus()!=null){ if (taskLogUserVo.getOldStatus()!=null){
...@@ -437,7 +442,12 @@ public class TaskController { ...@@ -437,7 +442,12 @@ public class TaskController {
if (map.containsKey("703")){ if (map.containsKey("703")){
map.put("790j",taskLogUserVo.getUser()); map.put("790j",taskLogUserVo.getUser());
}else { }else {
map.put("790",taskLogUserVo.getUser()); if (billStatus == 788 && taskLogUserVo.getOldStatus() == 790){
map.clear();
}else {
map.put("790",taskLogUserVo.getUser());
}
} }
} }
}else { }else {
...@@ -450,7 +460,7 @@ public class TaskController { ...@@ -450,7 +460,7 @@ public class TaskController {
} }
private Map<String, String> repairBack(List<TaskLogUserVo> taskLogUserVos){ private Map<String, String> repairBack(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
for (TaskLogUserVo taskLogUserVo : taskLogUserVos) { for (TaskLogUserVo taskLogUserVo : taskLogUserVos) {
if (taskLogUserVo.getOldStatus()!=null){ if (taskLogUserVo.getOldStatus()!=null){
...@@ -463,7 +473,12 @@ public class TaskController { ...@@ -463,7 +473,12 @@ public class TaskController {
if (map.containsKey("801")){ if (map.containsKey("801")){
map.put("820j",taskLogUserVo.getUser()); map.put("820j",taskLogUserVo.getUser());
}else { }else {
map.put("820",taskLogUserVo.getUser()); if (billStatus == 888 && taskLogUserVo.getOldStatus() == 820){
map.clear();
}else {
map.put("820",taskLogUserVo.getUser());
}
} }
} }
}else { }else {
......
...@@ -29,7 +29,7 @@ public interface TaskLogService { ...@@ -29,7 +29,7 @@ public interface TaskLogService {
/** /**
* @param taskId 业务id * @param taskId 业务id
* 获取业务日志 * 获取业务日志 按照时间升序排列
*/ */
List<TaskLogUserVo> getByTaskId2(Integer taskId); List<TaskLogUserVo> getByTaskId2(Integer taskId);
......
...@@ -58,6 +58,8 @@ public interface DeviceUseReportService { ...@@ -58,6 +58,8 @@ public interface DeviceUseReportService {
*/ */
List<DeviceStatistics> getStorageStatistics(Date startDate, Date endDate); List<DeviceStatistics> getStorageStatistics(Date startDate, Date endDate);
List<DeviceStatistics> getAllotStatistics(Date startDate, Date endDate);
/** /**
* @param startDate 开始时间 * @param startDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
...@@ -65,6 +67,14 @@ public interface DeviceUseReportService { ...@@ -65,6 +67,14 @@ public interface DeviceUseReportService {
*/ */
List<DeviceStatistics> getRepairStatistics(Date startDate, Date endDate); List<DeviceStatistics> getRepairStatistics(Date startDate, Date endDate);
/**
* @param startDate 开始时间
* @param endDate 结束时间
* @return 这一段时间省送国家维修的统计
*/
List<DeviceStatistics> getRepairBackStatistics(Date startDate, Date endDate);
/** /**
* @param startDate 开始时间 * @param startDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
......
...@@ -14,8 +14,10 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary; ...@@ -14,8 +14,10 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo; import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.packing.repository.PackingLibraryDao; import com.tykj.dev.device.packing.repository.PackingLibraryDao;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary; import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.repair.repository.RepairBackBillDao;
import com.tykj.dev.device.repair.repository.RepairDetailDao; import com.tykj.dev.device.repair.repository.RepairDetailDao;
import com.tykj.dev.device.repair.repository.RepairSendBillDao; import com.tykj.dev.device.repair.repository.RepairSendBillDao;
import com.tykj.dev.device.repair.subject.domin.RepairBackBill;
import com.tykj.dev.device.repair.subject.domin.RepairDetail; import com.tykj.dev.device.repair.subject.domin.RepairDetail;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill; import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.scrap.repository.ScrapBillDao; import com.tykj.dev.device.scrap.repository.ScrapBillDao;
...@@ -43,6 +45,7 @@ import javax.persistence.Transient; ...@@ -43,6 +45,7 @@ import javax.persistence.Transient;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
...@@ -77,6 +80,9 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -77,6 +80,9 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
@Autowired @Autowired
private RepairSendBillDao repairSendBillDao; private RepairSendBillDao repairSendBillDao;
@Autowired
private RepairBackBillDao repairBackBillDao;
@Autowired @Autowired
private ScrapBillDao scrapBillDao; private ScrapBillDao scrapBillDao;
...@@ -276,6 +282,11 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -276,6 +282,11 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
return getDeviceStatistics(deviceLibraries); return getDeviceStatistics(deviceLibraries);
} }
@Override
public List<DeviceStatistics> getAllotStatistics(Date startDate, Date endDate) {
return null;
}
/** /**
* @param startDate 开始时间 * @param startDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
...@@ -291,7 +302,33 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -291,7 +302,33 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
//获取所有维修的装备 //获取所有维修的装备
if (repairSendBills.size() > 0) { if (repairSendBills.size() > 0) {
for (RepairSendBill s : repairSendBills) { for (RepairSendBill s : repairSendBills) {
String[] strings = s.getRepairDeviceCheckResult().split("x"); // String[] strings = s.getRepairDeviceCheckResult().split("x");
String[] strings = s.getRepairDeviceCheckDetail().split("x");
for (String s1 : strings) {
if (s1.length() >= 2) {
//出库无误装备
if ("1".equals(s1.substring(s1.length() - 1))) {
Integer id = Integer.parseInt(s1.substring(0, s1.length() - 1));
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraries.add(deviceLibraryEntity);
}
}
}
}
}
return getDeviceStatistics(deviceLibraries);
}
@Override
public List<DeviceStatistics> getRepairBackStatistics(Date startDate, Date endDate) {
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
List<RepairBackBill> backBills = repairBackBillDao.findAll().stream()
.filter(repairBackBill -> repairBackBill.getBackStatus() == 5 && userPublicService.findByUnitsToname(1).equals(repairBackBill.getReceiveUnit()) && repairBackBill.getCreateTime().after(startDate) && repairBackBill.getCreateTime().before(endDate))
.collect(toList());
//获取所有的装备维修退回的
if (backBills.size()>0){
for (RepairBackBill backBill : backBills) {
String[] strings = backBill.getBackCheckDetail().split("x");
for (String s1 : strings) { for (String s1 : strings) {
if (s1.length() >= 2) { if (s1.length() >= 2) {
//出库无误装备 //出库无误装备
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论