设备异常响应转维修

赵嘉伟 4 years ago
parent 4148378a4b
commit cc34317921

@ -326,9 +326,14 @@ public class AbnormalBillController {
return R.ok(abnormalBillService.getNextNumber(type));
}
@GetMapping("/test")
public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){
anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes);
return R.ok();
// @GetMapping("/test")
// public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){
// anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes);
// return R.ok();
// }
@GetMapping("/anomalyReveseRepair")
public R anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){
return R.ok(abnormalBillService.anomalyReveseRepair(abnormalBill,abnormalBillDispose));
}
}

@ -119,4 +119,6 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
String getNextNumber(String type);
HashMap<String,Object> anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose);
}

@ -613,7 +613,31 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes) {
public HashMap<String,Object> anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
if(!Constants.RESPONSE.equals(abnormalBill.getStatus())){
throw BusinessException.build("该异常单的状态必须是响应中才能转维修");
}
if(StringUtil.isBlank(abnormalBillDispose.getAbnormalMethod())){
throw BusinessException.build("转维修时方案分类必须填写");
}
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
abnormalBill.setStatus(Constants.SHUT_DOWN);
abnormalBillDispose.setResolveUser(user);
abnormalBillDispose.setResolveDateTime(now);
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("abnormalBill",abnormalBillMapper.selectById(abnormalBill.getHandle()));
hashMap.put("abnormalBillDispose",abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle()));
return hashMap;
}
@Override
public void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes,String position,String ncQty,String ncDescription) {
String site = CommonMethods.getSite();
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
@ -630,6 +654,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalNo = this.getNextNumber(category);
abnormalBill.setType(category);
}
abnormalBill.setSite(site);
abnormalBill.setAbnormalNo(abnormalNo);
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalNo));
@ -637,6 +662,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBill.setSfc(sfc);
abnormalBill.setShopOrder(shopOrder);
abnormalBill.setResrce(resource);
abnormalBill.setEntityLocation(position);
abnormalBill.setNcQty(ncQty);
abnormalBill.setPbDescription(ncDescription);
abnormalBill.setDiscover(Constants.SELF_MADE);
abnormalBill.setReportFrom(Constants.REPORT);
AbnormalBillDispose abnormalBillDispose = new AbnormalBillDispose();

@ -39,6 +39,17 @@ public interface Constants {
String ARRIVAL = "D";//到货
String CUSTOMER = "K";//客户
//异常方案
String OFFLINE_REFUELING = "X";//线下换料
String TEST_EQUIPMENT = "S";//试装
String CONCESSION = "R";//让步放行
String PRODUCT_SCRAP = "C";//产品报废
String MATCH = "P"; //配作
String REPAIR = "F";//返修
String REGULAR_REPAIR = "CG";//常规维修
String PLAN_REPAIR = "JH";//计划维修
String MAJOR_REPAIR = "DX";//大项修
//任务编号常量
String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK";
//报修任务单号

@ -16,5 +16,5 @@ public interface AnomalyService {
* @param sfc
* @param ncCodes
*/
void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes);
void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes,String position,String ncQty,String ncDescription);
}

Loading…
Cancel
Save