提交 55f19b44 作者: 李超杰

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

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