增加pad接口:服务指令工单转单、协助执行
This commit is contained in:
parent
e1e1adc9c8
commit
6e2d793c18
|
|
@ -110,7 +110,22 @@ public class ServiceOrderApi {
|
|||
@ApiOperation(value="服务指令工单-转单", notes="服务指令工单-转单")
|
||||
@AutoLog(value = "服务指令工单-转单",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/transferOrder")
|
||||
public Result<String> transferOrder(@RequestBody DirectiveOrderEntity directiveOrderEntity) {
|
||||
public Result<String> transferOrder(@RequestBody DirectiveOrderSubEntity dto) {
|
||||
if(StringUtils.isBlank(dto.getMainId()) ){
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
directiveOrderApi.transferOrder(dto);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@ApiOperation(value="服务指令工单-协助执行", notes="服务指令工单-协助执行")
|
||||
@AutoLog(value = "服务指令工单-协助执行",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/assistOrder")
|
||||
public Result<String> assistOrder(@RequestBody DirectiveOrderSubEntity dto) {
|
||||
if(StringUtils.isBlank(dto.getMainId()) ){
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
directiveOrderApi.assistOrder(dto);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,4 +51,7 @@ public interface IDirectiveOrderApi {
|
|||
|
||||
Map<String, Object> generateOrdersInstant(DirectiveOrderEntity directiveOrderEntity);
|
||||
|
||||
void transferOrder(DirectiveOrderSubEntity dto);
|
||||
|
||||
void assistOrder(DirectiveOrderSubEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.biz.order.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -215,6 +216,7 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
|
||||
/**
|
||||
* 生成即时服务指令工单
|
||||
*
|
||||
* @param directiveOrderEntity
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -225,4 +227,59 @@ public class DirectiveOrderPadServiceImpl extends ServiceImpl<DirectiveOrderMapp
|
|||
return directiveOrderService.generateOrdersInstant(directiveOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferOrder(DirectiveOrderSubEntity dto) {
|
||||
DirectiveOrder main = new DirectiveOrder();
|
||||
DirectiveOrderSub sub = new DirectiveOrderSub();
|
||||
|
||||
String optType = "3";//转单
|
||||
|
||||
//执行类型
|
||||
main.setOptType(optType);
|
||||
sub.setOptType(optType);
|
||||
//主要执行人
|
||||
main.setEmployeeId(dto.getEmployeeId());
|
||||
main.setEmployeeName(dto.getEmployeeName());
|
||||
sub.setEmployeeId(dto.getEmployeeId());
|
||||
sub.setEmployeeName(dto.getEmployeeName());
|
||||
//实际执行人
|
||||
main.setOptIds(dto.getEmployeeId());
|
||||
main.setOptNames(dto.getEmployeeName());
|
||||
sub.setOptIds(dto.getEmployeeId());
|
||||
sub.setOptNames(dto.getEmployeeName());
|
||||
|
||||
//修改主表
|
||||
main.setId(dto.getMainId());
|
||||
directiveOrderService.updateById(main);
|
||||
//修改子表
|
||||
UpdateWrapper<DirectiveOrderSub> subUW = new UpdateWrapper<>();
|
||||
subUW.eq("main_id",dto.getMainId());
|
||||
directiveOrderSubMapper.update(sub,subUW);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void assistOrder(DirectiveOrderSubEntity dto) {
|
||||
DirectiveOrder main = new DirectiveOrder();
|
||||
DirectiveOrderSub sub = new DirectiveOrderSub();
|
||||
|
||||
String optType = "2";//协助
|
||||
|
||||
//执行类型
|
||||
main.setOptType(optType);
|
||||
sub.setOptType(optType);
|
||||
//实际执行人
|
||||
main.setOptIds(dto.getOptIds());
|
||||
main.setOptNames(dto.getOptNames());
|
||||
sub.setOptIds(dto.getOptIds());
|
||||
sub.setOptNames(dto.getOptNames());
|
||||
|
||||
//修改主表
|
||||
main.setId(dto.getMainId());
|
||||
directiveOrderService.updateById(main);
|
||||
//修改子表
|
||||
UpdateWrapper<DirectiveOrderSub> subUW = new UpdateWrapper<>();
|
||||
subUW.eq("main_id",dto.getMainId());
|
||||
directiveOrderSubMapper.update(sub,subUW);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue