|
@@ -17,6 +17,7 @@ import com.platform.dao.vo.export.repair.ExportRepairApplicationFormVO;
|
|
|
import com.platform.dao.vo.repair.RepairApplicationFormVO;
|
|
|
import com.platform.rest.log.annotation.SysLog;
|
|
|
import com.platform.service.repair.RepairApplicationFormService;
|
|
|
+import com.platform.service.repair.strategy.RepairBaseStrategy;
|
|
|
import com.platform.service.repair.strategy.RepairStrategyFactory;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -72,8 +73,7 @@ public class RepairApplicationFormController {
|
|
|
@PostMapping
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-add')")
|
|
|
public R save(@Validated({AddGroup.class}) @RequestBody RepairApplicationFormDTO repairApplicationFormDTO) {
|
|
|
- return new R<>(RepairStrategyFactory.getStrategy().callRepair(repairApplicationFormDTO));
|
|
|
- //return new R<>(repairApplicationFormService.saveModelByDTO(repairApplicationFormDTO));
|
|
|
+ return new R<>(RepairStrategyFactory.getStrategy(repairApplicationFormDTO.getCategory()).callRepair(repairApplicationFormDTO));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -101,7 +101,7 @@ public class RepairApplicationFormController {
|
|
|
public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairApplicationFormDTO) {
|
|
|
repairApplicationFormDTO.setId(id);
|
|
|
if(repairApplicationFormDTO.getType() == RepairApplicationFormTypeEnum.OUT.getValue()){
|
|
|
- RepairStrategyFactory.getStrategy().sendRepairToThird(repairApplicationFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairApplicationFormDTO.getCategory()).sendRepairToThird(repairApplicationFormDTO);
|
|
|
}else{
|
|
|
repairApplicationFormService.modModelByDTO(repairApplicationFormDTO);
|
|
|
}
|
|
@@ -117,7 +117,7 @@ public class RepairApplicationFormController {
|
|
|
//@PreAuthorize("@pms.hasPermission('repair-application-forms-edit')")
|
|
|
public R refusedRepair(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairApplicationFormDTO) {
|
|
|
repairApplicationFormDTO.setId(id);
|
|
|
- RepairStrategyFactory.getStrategy().refusedRepair(repairApplicationFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairApplicationFormDTO.getCategory()).refusedRepair(repairApplicationFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
@@ -199,7 +199,7 @@ public class RepairApplicationFormController {
|
|
|
@PutMapping("/finish/{id}")
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-examine')")
|
|
|
public R finish(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairFormDTO) {
|
|
|
- RepairStrategyFactory.getStrategy().handleRepair(repairFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairFormDTO.getCategory()).handleRepair(repairFormDTO);
|
|
|
//repairApplicationFormService.finish(repairFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
@@ -215,7 +215,7 @@ public class RepairApplicationFormController {
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-finish')")
|
|
|
public R examineApply(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairFormDTO) {
|
|
|
repairFormDTO.setId(id);
|
|
|
- RepairStrategyFactory.getStrategy().submitRepair(repairFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairFormDTO.getCategory()).submitRepair(repairFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
@@ -230,7 +230,7 @@ public class RepairApplicationFormController {
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-dispatch')")
|
|
|
public R dispatch(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairFormDTO) {
|
|
|
repairFormDTO.setId(id);
|
|
|
- RepairStrategyFactory.getStrategy().sendRepair(repairFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairFormDTO.getCategory()).sendRepair(repairFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
@@ -243,7 +243,7 @@ public class RepairApplicationFormController {
|
|
|
@PutMapping("/transfer")
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-transfer-apply')")
|
|
|
public R transfer(@Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairFormDTO) {
|
|
|
- RepairStrategyFactory.getStrategy().dispatchRepair(repairFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairFormDTO.getCategory()).dispatchRepair(repairFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
@@ -258,7 +258,7 @@ public class RepairApplicationFormController {
|
|
|
public R repairFormDeal(@PathVariable("id") String id) {
|
|
|
RepairApplicationFormDTO repairApplicationFormDTO = new RepairApplicationFormDTO();
|
|
|
repairApplicationFormDTO.setId(id);
|
|
|
- RepairStrategyFactory.getStrategy().sendRepair(repairApplicationFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairApplicationFormDTO.getCategory()).sendRepair(repairApplicationFormDTO);
|
|
|
//repairApplicationFormService.receive(id);
|
|
|
return new R<>();
|
|
|
}
|
|
@@ -266,20 +266,21 @@ public class RepairApplicationFormController {
|
|
|
@SysLog("接单维修单")
|
|
|
@PutMapping("/receive/repair")
|
|
|
public R receiveRepairForm(@RequestBody RepairApplicationFormDTO applicationFormDTO) {
|
|
|
- RepairStrategyFactory.getStrategy().receiveRepair(applicationFormDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(applicationFormDTO.getCategory()).receiveRepair(applicationFormDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
|
|
|
|
@SysLog("接单维修单")
|
|
|
@PutMapping("/report/repair")
|
|
|
public R reportRepairForm(@RequestBody RepairApplicationFormDTO applicationFormDTO) {
|
|
|
+ RepairBaseStrategy strategy = RepairStrategyFactory.getStrategy(applicationFormDTO.getCategory());
|
|
|
switch (applicationFormDTO.getReportHandleType()){
|
|
|
case 3:
|
|
|
- RepairStrategyFactory.getStrategy().stopRepairByPerson(applicationFormDTO);
|
|
|
+ strategy.stopRepairByPerson(applicationFormDTO);
|
|
|
break;
|
|
|
case 1:
|
|
|
case 2:
|
|
|
- RepairStrategyFactory.getStrategy().reportLeaderHandle(applicationFormDTO);
|
|
|
+ strategy.reportLeaderHandle(applicationFormDTO);
|
|
|
break;
|
|
|
}
|
|
|
return new R<>();
|
|
@@ -295,7 +296,7 @@ public class RepairApplicationFormController {
|
|
|
@PutMapping("/approve/{id}")
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-approve')")
|
|
|
public R approve(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairCheckDTO) {
|
|
|
- RepairStrategyFactory.getStrategy().verifyRepair(repairCheckDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairCheckDTO.getCategory()).verifyRepair(repairCheckDTO);
|
|
|
//repairApplicationFormService.approve(repairCheckDTO);
|
|
|
return new R<>();
|
|
|
}
|
|
@@ -310,7 +311,7 @@ public class RepairApplicationFormController {
|
|
|
@PutMapping("/returnRepair/{id}")
|
|
|
@PreAuthorize("@pms.hasPermission('repair-application-forms-reback')")
|
|
|
public R returnRepair(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody RepairApplicationFormDTO repairCheckDTO) {
|
|
|
- RepairStrategyFactory.getStrategy().verifyRefused(repairCheckDTO);
|
|
|
+ RepairStrategyFactory.getStrategy(repairCheckDTO.getCategory()).verifyRefused(repairCheckDTO);
|
|
|
//repairApplicationFormService.returnRepair(repairCheckDTO);
|
|
|
return new R<>();
|
|
|
}
|