oms预约单修改
This commit is contained in:
+6
@@ -14,11 +14,17 @@ import java.util.List;
|
||||
public class BusinessAuditDTO {
|
||||
|
||||
private List<Long> ids;
|
||||
//业务主管
|
||||
private String salesManager;
|
||||
//审核意见
|
||||
private String reviewOpinion;
|
||||
private Long reviewStatus;
|
||||
private String salesManagerName;
|
||||
private String reviewOpinionName;
|
||||
@ApiModelProperty("组织id")
|
||||
private Long organizationId;
|
||||
private List<String> goodsNumber;
|
||||
//业务员
|
||||
private String salesmanName;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationAddressMulti;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationCargoInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -29,6 +31,10 @@ public class OmsOrderDTO {
|
||||
//
|
||||
// @ApiModelProperty(value = "运距(千米)")
|
||||
// private BigDecimal haulDistance;
|
||||
@ApiModelProperty(value = "订单创建时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
@ApiModelProperty(value = "订单开始时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@@ -786,5 +792,22 @@ public class OmsOrderDTO {
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
private String businessOrderNumber;
|
||||
|
||||
@ApiModelProperty("货物信息")
|
||||
private List<ReservationCargoInfo> reservationCargoInfo;
|
||||
|
||||
@ApiModelProperty("装货地址")
|
||||
private ReservationAddressMulti loadingAddressMulti;
|
||||
|
||||
@ApiModelProperty("卸货地址")
|
||||
private ReservationAddressMulti unloadAddressMulti;
|
||||
|
||||
@ApiModelProperty("业务主管")
|
||||
private String salesManager;
|
||||
@ApiModelProperty("审核意见")
|
||||
private String reviewOpinion;
|
||||
@ApiModelProperty("起运时间")
|
||||
private Date departureTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+109
-8
@@ -1,12 +1,18 @@
|
||||
package com.mhd.oms.interfaces.facade.resevationOrder;
|
||||
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.utils.sms.CommonConstant;
|
||||
import com.mhd.common.core.utils.sms.Result;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.domain.reservationOrder.entity.ReservationOrder;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.facade.IOmsAddressMultiService;
|
||||
import com.mhd.oms.domain.reservationOrder.repository.po.ReservationOrderPO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentAddressMulti.BusinessAuditDTO;
|
||||
import com.mhd.oms.interfaces.dto.businessDocumentOrder.BusinessDocumentOrderDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderAddDTO;
|
||||
import com.mhd.oms.interfaces.dto.resevationOrder.OmsOrderDTO;
|
||||
import com.mhd.system.api.domain.TmsTransportNote;
|
||||
@@ -17,6 +23,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
//import static com.mhd.common.core.utils.PageUtils.startPage;
|
||||
|
||||
@@ -80,19 +88,80 @@ public class ResevationOrderApi extends BaseController{
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改预约单
|
||||
*
|
||||
* @param tmsOrderAddDTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "货源表-修改预约单", notes = "货源表-修改预约单")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody OmsOrderAddDTO tmsOrderAddDTO) {
|
||||
Result<?> result = new Result<TmsTransportNote>();
|
||||
try {
|
||||
// 获取当前登录用户的组织信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
// 设置组织ID
|
||||
if (loginUser.getUserPo().getOrganizationId() != null) {
|
||||
tmsOrderAddDTO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
}
|
||||
// 设置组织名称
|
||||
if (loginUser.getUserPo().getOrganizationName() != null) {
|
||||
tmsOrderAddDTO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
}
|
||||
// 设置上级组织ID
|
||||
if (loginUser.getUserPo().getTopOrganizationId() != null) {
|
||||
tmsOrderAddDTO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
|
||||
omsAddressMultiService.update(tmsOrderAddDTO);
|
||||
|
||||
result.success("修改成功");
|
||||
result.setCode(CommonConstant.SC_OK_200);
|
||||
} catch (ServiceException e) {
|
||||
e.printStackTrace();
|
||||
result.error500("修改失败:"+e.getErrorMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.error500("修改失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ApiOperation("获取预约单详情")
|
||||
@GetMapping("/getResevationOrderInfo")
|
||||
public Result<?> getResevationOrderInfo(@RequestParam("goodsNumber") String goodsNumber) {
|
||||
try {
|
||||
OmsOrderDTO detail = omsAddressMultiService.getResevationOrderInfo(goodsNumber);
|
||||
if (detail == null) {
|
||||
return Result.error("未查询到该预约单信息");
|
||||
}
|
||||
return Result.ok(detail);
|
||||
} catch (Exception e) {
|
||||
return Result.error("查询预约单详情失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询【预约单】列表
|
||||
*/
|
||||
@ApiOperation("查询【预约单】列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OmsOrderDTO omsOrderDTO)
|
||||
public TableDataInfo list(OmsOrderDTO omsOrderDTO,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize)
|
||||
{
|
||||
//转换实体
|
||||
startPage();
|
||||
PageHelper.startPage(pageNo, pageSize);
|
||||
List<ReservationOrderPO> list = omsAddressMultiService.queryList(omsOrderDTO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,16 +169,12 @@ public class ResevationOrderApi extends BaseController{
|
||||
*/
|
||||
@ApiOperation("批量确认预约单")
|
||||
@PostMapping("/batchConfirm")
|
||||
public Result<?> batchConfirm(@RequestBody List<String> goodsNumbers) {
|
||||
public Result<?> batchConfirm(@RequestBody BusinessAuditDTO businessAuditDTO) {
|
||||
Result<?> result = new Result<>();
|
||||
try {
|
||||
if (goodsNumbers == null || goodsNumbers.isEmpty()) {
|
||||
result.error500("预约单号列表不能为空");
|
||||
return result;
|
||||
}
|
||||
|
||||
// 调用服务层方法 - 现在服务层直接返回Result
|
||||
return omsAddressMultiService.batchConfirmReservationOrder(goodsNumbers);
|
||||
return omsAddressMultiService.batchConfirmReservationOrder(businessAuditDTO);
|
||||
} catch (ServiceException e) {
|
||||
result.error500("批量确认失败: " + e.getErrorMessage());
|
||||
} catch (Exception e) {
|
||||
@@ -139,5 +204,41 @@ public class ResevationOrderApi extends BaseController{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单状态(orderType)统计各状态的数量
|
||||
*/
|
||||
@ApiOperation("根据订单状态统计数量")
|
||||
@GetMapping("/countByOrderType")
|
||||
public Result<Map<Integer, Long>> countByOrderType() {
|
||||
Result<Map<Integer, Long>> result = new Result<>();
|
||||
try {
|
||||
Map<Integer, Long> countMap = omsAddressMultiService.countByOrderType();
|
||||
result.success("统计成功");
|
||||
result.setResult(countMap);
|
||||
result.setCode(CommonConstant.SC_OK_200);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.error500("统计失败: " + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ApiOperation("取消预约")
|
||||
@PostMapping("/cancelReserve")
|
||||
public Result<?> cancelReserve(@RequestBody List<String> goodsNumbers) {
|
||||
Result<?> result = new Result<>();
|
||||
try {
|
||||
Integer count = omsAddressMultiService.cancelReserve(goodsNumbers);
|
||||
if (count > 0) {
|
||||
return Result.ok("取消预约成功,共处理:" + count + "条");
|
||||
} else {
|
||||
return Result.error("取消预约失败,订单不存在或已取消");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("取消预约失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user