提交 55f19b44 作者: 李超杰

墙盒申请安装团队分页查询

父级 6fe099aa
......@@ -36,36 +36,28 @@ public class WallboxApplyImport implements Import {
String orderId = childList.get(0);
// 是否紧急
String ifEmergency = childList.get(1);
StringBuilder error = new StringBuilder();
if (StringUtils.isEmpty(orderId) || StringUtils.isEmpty(ifEmergency)) {
childList.add("error:" + MessageConstant.MISSING_PARAM);
continue;
error.append("error:" + MessageConstant.MISSING_PARAM);
}
if (StringUtils.isNotBlank(orderId)) {
Order order = orderService.get(orderId);
if (ObjectUtil.isNull(order)) {
childList.add("error:不存在安装订单号");
continue;
}
error.append("error:不存在安装订单号");
} else {
Integer status = order.getStatus();
// 检查订单状态是否在1-43之间
boolean allowed = status >= OrderStatus.DISPATCHING.getType() && status <= OrderStatus.INSTALLING.getType();
if (!allowed) {
childList.add("error:订单派单之后才能进行墙盒申请");
continue;
error.append("error:订单派单之后才能进行墙盒申请");
}
}
if (ObjectUtil.isNotNull(wallboxApplyService.selectWallboxDetail(orderId))) {
childList.add("error:重复订单申请");
continue;
error.append("error:重复订单申请");
}
}
childList.add(error.toString());
}
return list;
}
}
......@@ -94,7 +94,43 @@ public class WallboxApplyController {
wa.setReceiverWarehouseId(receiverWarehouseId);
wallboxApplyService.insertWallboxApply(wa);
return new BaseResponse<>(true);
}
/**
* 墙盒申请批量新增
*/
@ApiOperation(value = "批量新增")
@PostMapping("/addBatch")
public BaseResponse<Object> add(@RequestBody List<WallboxApplyAddVO> applyAddVOS) {
applyAddVOS.forEach(t -> {
Assert.notNull(t.getInstallOrder(), "订单id不能为空");
Order order = orderService.get(t.getInstallOrder());
if (ObjectUtil.isNull(order)) {
throw new ServiceException("订单不存在");
}
Integer status = order.getStatus();
// 检查订单状态是否在1-43之间
boolean allowed = status >= OrderStatus.DISPATCHING.getType() && status <= OrderStatus.INSTALLING.getType();
if (!allowed) {
throw new ServiceException("订单派单之后才能进行墙盒申请");
}
SessionInfo loginUser = tokenService.getUser();
String userId = loginUser.getUserId();
SupplierStaff infoByAccount = supplierStaffService.getByAccountId(Integer.valueOf(userId));
Supplier supplier = supplierService.getById(infoByAccount.getSupplierId());
if (supplier == null) {
throw new ServiceException("供应商不存在");
}
WallboxApply apply = new WallboxApply();
apply.setSupplierId(Long.valueOf(supplier.getId()));
apply.setSupplierTeam(supplier.getName());
apply.setOrderId(t.getInstallOrder());
apply.setIfEmergency(t.getLogisticOrder());
apply.setCreateAccount(loginUser.getUserId());
apply.setReceiverWarehouseId(t.getWarehouseId());
wallboxApplyService.insertWallboxApply(apply);
});
return new BaseResponse<>();
}
/**
......@@ -149,6 +185,7 @@ public class WallboxApplyController {
req.setSupplierId(supplier.getId());
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
wallboxApply.setCreateAccount(userId);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
......@@ -245,18 +282,6 @@ public class WallboxApplyController {
return new BaseResponse<>(JSON.parseObject(depponClient.newTraceQuery(paramMap)));
}
/**
* 新增墙盒申请
*/
@ApiOperation(value = "批量新增")
@PostMapping
public BaseResponse<Object> add(@RequestBody List<WallboxApply> tWallboxApply) {
tWallboxApply.forEach(t -> {
wallboxApplyService.insertWallboxApply(t);
});
return new BaseResponse<>();
}
@ApiOperation(value = "查询当前账号所属团队")
@GetMapping("/get-team")
public BaseResponse<Object> getTeamInfo() {
......
package com.boco.nbd.wios.manage.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class WallboxApplyAddVO {
@ApiModelProperty(value = "安装订单号")
private String installOrder;
@ApiModelProperty(value = "是否紧急:0:否,1:是")
private Integer logisticOrder;
@ApiModelProperty(value = "收货仓库id")
private String warehouseId;
}
......@@ -255,9 +255,7 @@ public class WarehouseService {
public List<WarehouseDTO> qryWarehouseList(WarehouseQuery warehouseQuery) {
warehouseQuery.setAppkey(appkey);
logger.info("qryWarehouseList请求数据:{}", JSONUtilsEx.serialize(warehouseQuery));
System.out.println("分页"+warehouseQuery.getPage());
if (warehouseQuery.getIsWarehousePage()==1){
if (warehouseQuery.getIsWarehousePage() == 1) {
PageLimitHolderFilter.setContext(warehouseQuery.getPage(), warehouseQuery.getPagecount(), 0);
}
List<String> serviceProviders = new ArrayList<>(1);
......@@ -266,7 +264,7 @@ public class WarehouseService {
}
List<WarehouseEx> warehouseList = warehouseMapperEx.qryWarehouseList(warehouseQuery.getId(), warehouseQuery.getAppkey(), warehouseQuery.getWarehouseLevenId(),
warehouseQuery.getName(), warehouseQuery.getIsEnable(), serviceProviders, warehouseQuery.getArea(),
warehouseQuery.getWarehouseAttribution(),warehouseQuery.getCreateAccount(),warehouseQuery.getSuperiorWarehouseId());
warehouseQuery.getWarehouseAttribution(), warehouseQuery.getCreateAccount(), warehouseQuery.getSuperiorWarehouseId());
BaseResponse<List<WarehouseDTO>> response;
......@@ -277,13 +275,13 @@ public class WarehouseService {
List<WarehouseDTO> result = new ArrayList<>();
for (WarehouseEx warehouseEx : warehouseList) {
//获取安装服务商的名字
Supplier supplier=supplierDao.selectById(Integer.valueOf(warehouseEx.getServiceProvider()));
if (supplier != null){
Supplier supplier = supplierDao.selectById(Integer.valueOf(warehouseEx.getServiceProvider()));
if (supplier != null) {
warehouseEx.setServiceProviderName(supplier.getName());
}
//获取上级仓库的名字
WarehouseEx warehouseEx1=warehouseMapperEx.wareHouseBySuperiorWarehouseId(warehouseEx.getSuperiorWarehouseId());
if (warehouseEx1 !=null){
WarehouseEx warehouseEx1 = warehouseMapperEx.wareHouseBySuperiorWarehouseId(warehouseEx.getSuperiorWarehouseId());
if (warehouseEx1 != null) {
warehouseEx.setSuperiorWarehouseName(warehouseEx1.getName());
}
WarehouseDTO warehouseDTO = JSONUtilsEx.deserialize(JSONUtilsEx.serialize(warehouseEx), WarehouseDTO.class);
......@@ -716,8 +714,8 @@ public class WarehouseService {
*/
public void delWarehouseById(String id) {
//仓库有子仓库则无法删除
int countId=warehouseMapper.selectBySuperiorWarehouseId(id);
if (countId>0){
int countId = warehouseMapper.selectBySuperiorWarehouseId(id);
if (countId > 0) {
throw new ServiceException("仓库下有子仓库,无法删除");
}
List<MaterialsDTO> materialList = getStockMaterialByWId(id);
......@@ -775,7 +773,7 @@ public class WarehouseService {
if (org.apache.commons.lang3.StringUtils.isNotBlank(warehouseQuery.getServiceProvider())) {
serviceProviders = Arrays.asList(warehouseQuery.getServiceProvider().split(CamsConstant.COMMA));
}
List<WarehouseEx> warehouseList = warehouseMapperEx.qryWarehouseList(warehouseQuery.getId(), warehouseQuery.getAppkey(), warehouseQuery.getWarehouseLevenId(), warehouseQuery.getName(), warehouseQuery.getIsEnable(), serviceProviders, warehouseQuery.getArea(), warehouseQuery.getWarehouseAttribution(),warehouseQuery.getCreateAccount(),warehouseQuery.getSuperiorWarehouseId());
List<WarehouseEx> warehouseList = warehouseMapperEx.qryWarehouseList(warehouseQuery.getId(), warehouseQuery.getAppkey(), warehouseQuery.getWarehouseLevenId(), warehouseQuery.getName(), warehouseQuery.getIsEnable(), serviceProviders, warehouseQuery.getArea(), warehouseQuery.getWarehouseAttribution(), warehouseQuery.getCreateAccount(), warehouseQuery.getSuperiorWarehouseId());
if (CollUtil.isNotEmpty(warehouseList)) {
......@@ -817,7 +815,7 @@ public class WarehouseService {
if (org.apache.commons.lang3.StringUtils.isNotBlank(warehouseQuery.getServiceProvider())) {
serviceProviders = Arrays.asList(warehouseQuery.getServiceProvider().split(CamsConstant.COMMA));
}
List<WarehouseEx> warehouseList = warehouseMapperEx.qryWarehouseList(warehouseQuery.getId(), warehouseQuery.getAppkey(), warehouseQuery.getWarehouseLevenId(), warehouseQuery.getName(), warehouseQuery.getIsEnable(), serviceProviders, warehouseQuery.getArea(), warehouseQuery.getWarehouseAttribution(),warehouseQuery.getCreateAccount(),warehouseQuery.getSuperiorWarehouseId());
List<WarehouseEx> warehouseList = warehouseMapperEx.qryWarehouseList(warehouseQuery.getId(), warehouseQuery.getAppkey(), warehouseQuery.getWarehouseLevenId(), warehouseQuery.getName(), warehouseQuery.getIsEnable(), serviceProviders, warehouseQuery.getArea(), warehouseQuery.getWarehouseAttribution(), warehouseQuery.getCreateAccount(), warehouseQuery.getSuperiorWarehouseId());
BaseResponse<List<WarehouseDTO>> warehouseResponse = new BaseResponse<>(new ArrayList<>());
List<WarehouseDTO> result = new ArrayList<>();
......@@ -958,6 +956,7 @@ public class WarehouseService {
warehouseQuery.setPagecount(1000);
warehouseQuery.setServiceProvider(supplierId);
warehouseQuery.setIsEnable(1);
warehouseQuery.setIsWarehousePage(1);
List<WarehouseDTO> warehouseList = qryWarehouseList(warehouseQuery);
List<String> warehouseIds = warehouseList.stream().map(WarehouseDTO::getId).collect(Collectors.toList());
if (!warehouseIds.isEmpty()) {
......
......@@ -136,7 +136,8 @@
t_wallbox_apply.modify_time,
t_order.shipno as tracking_number,
t_order.status as install_status,
td.logistic_order deliveryLogisticOrder,td.logistic_company logisticCompany,td.sender sender,td.sender_phone senderPhone,td.receiver receiver,
td.logistic_order deliveryLogisticOrder,td.logistic_company logisticCompany,td.sender sender,td.sender_phone
senderPhone,td.receiver receiver,
tc.name wallboxModelName,td.receiver_phone receiverPhone
FROM t_wallbox_apply
LEFT JOIN t_order ON t_wallbox_apply.order_id = t_order.id
......@@ -148,6 +149,9 @@
#{supplierTeam},
'%')
</if>
<if test="createAccount != null and createAccount != ''">
and t_wallbox_apply.create_account=#{createAccount}
</if>
<if test="checkStatus != null ">and t_wallbox_apply.check_status = #{checkStatus}</if>
<if test="supplierId != null and regionId != ''">and t_wallbox_apply.supplier_id = #{supplierId}</if>
<if test="trackingStatus != null ">and t_wallbox_apply.tracking_status = #{trackingStatus}</if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论