Commit 8acf8f2b by huangjinxin

feat:批量改约指派

1 parent df5ab310
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@RestController
@RequestMapping("/pea-order")
......@@ -50,6 +51,20 @@ public class OrderAssignController {
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")
public Result<?> orderRevokeAssign(@RequestBody OrderRevokeAssign req) {
// 放回工单池
......@@ -73,4 +88,23 @@ public class OrderAssignController {
}
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 {
private OrgGroupDao orgGroupDao;
@Autowired
private OrgBranchDao orgBranchDao;
@Autowired
private MsgService msgService;
@Autowired
......@@ -154,13 +157,12 @@ public class OrderCreateServiceImpl implements OrderCreateService {
if (fendanResult.getCode().equals(StatusCodeEnum.FENDAN_IS_TRANSCEND.getCode())) {
entity.setTranscend(1);
}
OrgGroupEntity groupDaoByCitycodeListLike = orgGroupDao.getByCitycodeListLike(adminDistrict.getResult().getSubNames().getCounty());
entity.setOrgClusterId(groupDaoByCitycodeListLike.getClusterId());
entity.setOrgBranchId(groupDaoByCitycodeListLike.getBranchId());
entity.setOrgGroupId(groupDaoByCitycodeListLike.getGroupId());
OrgBranchEntity branchEntity = orgBranchDao.findByCitycodeListLike("%" + adminDistrict.getResult().getSubNames().getCounty() + "%");
entity.setOrgClusterId(branchEntity.getClusterId());
entity.setOrgBranchId(branchEntity.getBranchId());
//发送通知分部消息
MsgDTO msgDTO = new MsgDTO();
msgDTO.setGroupId(groupDaoByCitycodeListLike.getGroupId());
msgDTO.setBranchId(branchEntity.getBranchId());
msgDTO.setType(0);
msgDTO.setOrderIds(orderId);
msgDTO.setContent("有1条预约日期在" + entity.getExpectTimeBegin().toLocalDate() + "的工单需人工外理");
......
......@@ -256,7 +256,15 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return Result.success(null);
}
/**
* 改约
*
* @param req
* @return
* @throws BusinessException
*/
@Override
@Transactional
public Result<?> orderReschedule(OrderReschedule req) throws BusinessException {
// 判断是否分配到人和是否是今天
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!