Commit 8acf8f2b by huangjinxin

feat:批量改约指派

1 parent df5ab310
...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
@RestController @RestController
@RequestMapping("/pea-order") @RequestMapping("/pea-order")
...@@ -50,6 +51,20 @@ public class OrderAssignController { ...@@ -50,6 +51,20 @@ public class OrderAssignController {
return res; return res;
} }
@PostMapping("/order/assign/list")
public Result<?> orderAssign(@RequestBody List<OrderAssignReq> assignReqList) {
// 服务单指派-指派提交
try {
for (OrderAssignReq assignReq : assignReqList) {
orderAssign.orderAssign(assignReq);
}
} catch (BusinessException e) {
return Result.failed(e.getMessage());
}
return Result.success();
}
@PostMapping("/order/revoke/assign") @PostMapping("/order/revoke/assign")
public Result<?> orderRevokeAssign(@RequestBody OrderRevokeAssign req) { public Result<?> orderRevokeAssign(@RequestBody OrderRevokeAssign req) {
// 放回工单池 // 放回工单池
...@@ -73,4 +88,23 @@ public class OrderAssignController { ...@@ -73,4 +88,23 @@ public class OrderAssignController {
} }
return res; return res;
} }
/**
* 批量改约
*
* @param rescheduleList
* @return
*/
@PostMapping("/order/rescheduling/list")
public Result<?> orderRescheduling(@RequestBody List<OrderReschedule> rescheduleList) {
// 订单改约
try {
for (OrderReschedule reschedule : rescheduleList) {
orderInfoService.orderReschedule(reschedule);
}
} catch (BusinessException e) {
return Result.failed(e.getMessage());
}
return Result.success();
}
} }
...@@ -91,6 +91,9 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -91,6 +91,9 @@ public class OrderCreateServiceImpl implements OrderCreateService {
private OrgGroupDao orgGroupDao; private OrgGroupDao orgGroupDao;
@Autowired @Autowired
private OrgBranchDao orgBranchDao;
@Autowired
private MsgService msgService; private MsgService msgService;
@Autowired @Autowired
...@@ -154,13 +157,12 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -154,13 +157,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
if (fendanResult.getCode().equals(StatusCodeEnum.FENDAN_IS_TRANSCEND.getCode())) { if (fendanResult.getCode().equals(StatusCodeEnum.FENDAN_IS_TRANSCEND.getCode())) {
entity.setTranscend(1); entity.setTranscend(1);
} }
OrgGroupEntity groupDaoByCitycodeListLike = orgGroupDao.getByCitycodeListLike(adminDistrict.getResult().getSubNames().getCounty()); OrgBranchEntity branchEntity = orgBranchDao.findByCitycodeListLike("%" + adminDistrict.getResult().getSubNames().getCounty() + "%");
entity.setOrgClusterId(groupDaoByCitycodeListLike.getClusterId()); entity.setOrgClusterId(branchEntity.getClusterId());
entity.setOrgBranchId(groupDaoByCitycodeListLike.getBranchId()); entity.setOrgBranchId(branchEntity.getBranchId());
entity.setOrgGroupId(groupDaoByCitycodeListLike.getGroupId());
//发送通知分部消息 //发送通知分部消息
MsgDTO msgDTO = new MsgDTO(); MsgDTO msgDTO = new MsgDTO();
msgDTO.setGroupId(groupDaoByCitycodeListLike.getGroupId()); msgDTO.setBranchId(branchEntity.getBranchId());
msgDTO.setType(0); msgDTO.setType(0);
msgDTO.setOrderIds(orderId); msgDTO.setOrderIds(orderId);
msgDTO.setContent("有1条预约日期在" + entity.getExpectTimeBegin().toLocalDate() + "的工单需人工外理"); msgDTO.setContent("有1条预约日期在" + entity.getExpectTimeBegin().toLocalDate() + "的工单需人工外理");
......
...@@ -256,7 +256,15 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -256,7 +256,15 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return Result.success(null); return Result.success(null);
} }
/**
* 改约
*
* @param req
* @return
* @throws BusinessException
*/
@Override @Override
@Transactional
public Result<?> orderReschedule(OrderReschedule req) throws BusinessException { public Result<?> orderReschedule(OrderReschedule req) throws BusinessException {
// 判断是否分配到人和是否是今天 // 判断是否分配到人和是否是今天
LocalDateTime expectBegin = TimeUtils.IsoDateTime2LocalDateTime(req.getExpectBegin()); LocalDateTime expectBegin = TimeUtils.IsoDateTime2LocalDateTime(req.getExpectBegin());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!