|
|
|
@ -11,10 +11,16 @@ import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.entity.DictBiz; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@ -57,5 +63,130 @@ public class BillladingController {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
@PostMapping("/findChargeTypeList") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "查询所有计费方式", notes = "传入waybillDTO") |
|
|
|
|
public R findChargeTypeList(@RequestBody BillladingDTO billladingDTO) { |
|
|
|
|
String method = "############findChargeTypeList: "; |
|
|
|
|
log.info(method + "请求参数{}", billladingDTO); |
|
|
|
|
try{ |
|
|
|
|
List<DictBiz> list = DictBizCache.getList(DictBizConstant.BILLLADING_CHARGE_TYPE); |
|
|
|
|
return R.data(list); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
|
log.error(e.message,e); |
|
|
|
|
return R.fail(e.code,e.message); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("############sendOrders: 系统异常",e); |
|
|
|
|
return R.fail(500,"############sendOrders: 系统异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
@PostMapping("/saveNew") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "新增提货单", notes = "传入waybillDTO") |
|
|
|
|
public R saveNew(@RequestBody BillladingDTO billladingDTO) { |
|
|
|
|
String method = "############saveNew: "; |
|
|
|
|
log.info(method + "请求参数{}", billladingDTO); |
|
|
|
|
Long driverId = billladingDTO.getDriverId(); |
|
|
|
|
String driverName = billladingDTO.getDriverName(); |
|
|
|
|
String driverPhone = billladingDTO.getDriverPhone(); |
|
|
|
|
String carNumber = billladingDTO.getCarNumber(); |
|
|
|
|
String carrierName = billladingDTO.getCarrierName(); |
|
|
|
|
String chargeType = billladingDTO.getChargeType(); |
|
|
|
|
Integer planNum = billladingDTO.getPlanNum(); |
|
|
|
|
BigDecimal planWeight = billladingDTO.getPlanWeight(); |
|
|
|
|
BigDecimal planVolume = billladingDTO.getPlanVolume(); |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
|
|
|
|
//当前登录人选择的仓库
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); |
|
|
|
|
return R.fail(403,"仓库信息为空"); |
|
|
|
|
} |
|
|
|
|
billladingDTO.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
billladingDTO.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(driverId)){ |
|
|
|
|
log.warn(method+"司机id不能为空 driverId={}",driverId); |
|
|
|
|
return R.fail(405,"司机id不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(driverName)){ |
|
|
|
|
log.warn(method+"司机名称不能为空 driverName={}",driverName); |
|
|
|
|
return R.fail(405,"司机名称不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(driverPhone)){ |
|
|
|
|
log.warn(method+"司机电话不能为空 driverPhone={}",driverPhone); |
|
|
|
|
return R.fail(405,"司机电话不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(carNumber)){ |
|
|
|
|
log.warn(method+"车牌不能为空 carNumber={}",carNumber); |
|
|
|
|
return R.fail(405,"车牌不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(carrierName)){ |
|
|
|
|
log.warn(method+"承运商不能为空 carrierName={}",carrierName); |
|
|
|
|
return R.fail(405,"承运商不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(chargeType)){ |
|
|
|
|
log.warn(method+"计费模式不能为空 chargeType={}",chargeType); |
|
|
|
|
return R.fail(405,"计费模式不能为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(planNum)){ |
|
|
|
|
log.warn(method+"预计件数不能为空 planNum={}",planNum); |
|
|
|
|
return R.fail(405,"预计件数不能为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(planWeight)){ |
|
|
|
|
log.warn(method+"预计重量不能为空 planWeight={}",planWeight); |
|
|
|
|
return R.fail(405,"预计重量不能为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(planVolume)){ |
|
|
|
|
log.warn(method+"预计体积不能为空 planVolume={}",planVolume); |
|
|
|
|
return R.fail(405,"预计体积不能为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
trunklineBillladingService.saveNew(billladingDTO,myCurrentWarehouse.getCode()); |
|
|
|
|
return R.success("新增成功"); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
|
log.error(e.message,e); |
|
|
|
|
return R.fail(e.code,e.message); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("############sendOrders: 系统异常",e); |
|
|
|
|
return R.fail(500,"############sendOrders: 系统异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
@PostMapping("/pageWaybillList") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "分页查询运单", notes = "传入waybillDTO") |
|
|
|
|
public R pageWaybillList(@RequestBody BillladingDTO billladingDTO) { |
|
|
|
|
String method = "############findChargeTypeList: "; |
|
|
|
|
log.info(method + "请求参数{}", billladingDTO); |
|
|
|
|
try{ |
|
|
|
|
//当前登录人选择的仓库
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); |
|
|
|
|
return R.fail(403,"仓库信息为空"); |
|
|
|
|
} |
|
|
|
|
billladingDTO.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
|
|
IPage<TrunklineBillladingVO> pages = trunklineBillladingService.pageList(billladingDTO); |
|
|
|
|
|
|
|
|
|
return R.data(pages); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
|
log.error(e.message,e); |
|
|
|
|
return R.fail(e.code,e.message); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("############sendOrders: 系统异常",e); |
|
|
|
|
return R.fail(500,"############sendOrders: 系统异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|