Browse Source

自提BUG修复

dev
汤建军 2 months ago
parent
commit
74ed0dfbff
  1. 1
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java
  2. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  3. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  4. 52
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

1
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java

@ -31,6 +31,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java

@ -70,7 +70,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
* @param workOrderEntity * @param workOrderEntity
* @return * @return
*/ */
IPage<AftersalesWorkOrderEntity> pageListOwn(IPage<Object> page,@Param("param") AftersalesWorkOrderEntity workOrderEntity); IPage<AftersalesWorkOrderEntity> pageListOwn(IPage<Object> page,@Param("param") AftersalesWorkOrderEntity workOrderEntity,@Param("warehouseIds") List<Long> warehouseIds);
boolean updateList(@Param("list") List<AftersalesWorkOrderEntity> list); boolean updateList(@Param("list") List<AftersalesWorkOrderEntity> list);

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -187,6 +187,12 @@
<if test="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if> <if test="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if> <if test="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if>
<if test="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if> <if test="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
<if test="param.warehouseId != null ">
and lap.business_id IN
<foreach collection="warehouseIds" item="warehouseId" open="(" separator="," close=")" >
#{warehouseId}
</foreach>
</if>
</where> </where>
group by lawo.id group by lawo.id
ORDER BY lawo.create_time DESC ORDER BY lawo.create_time DESC
@ -301,6 +307,8 @@
GROUP BY GROUP BY
a.id) AS t ON t.id = lawo.id a.id) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0 LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0
LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0
<where> <where>
lawo.is_deleted = 0 lawo.is_deleted = 0
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if> <if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>

52
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -902,7 +902,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} }
List<String> roleList = Arrays.asList(user.getRoleName().split(",")); List<String> roleList = Arrays.asList(user.getRoleName().split(","));
String tenantId = user.getTenantId(); String tenantId = user.getTenantId();
boolean b = judgeIsCustomerService(user);
// 查询 状态条件 // 查询 状态条件
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits"); List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
if (warehouseType.isEmpty()) { if (warehouseType.isEmpty()) {
@ -937,8 +937,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}else { }else {
throw new CustomerException("当前登录人无工单操作权限!!!"); throw new CustomerException("当前登录人无工单操作权限!!!");
} }
//进行仓库限制
List<Long> warehouseIds = new ArrayList<>();
if (!Objects.isNull(myCurrentWarehouse)){
warehouseIds.add(myCurrentWarehouse.getId());
}else {
//获取当前人所有仓权限信息
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
if (!warehouseList.isEmpty()) {
warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()));
}
}
if (warehouseIds.isEmpty()) {
throw new CustomerException("当前登录人无仓库信息,请联系管理人员!!!");
}
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity); IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity,warehouseIds);
if (iPage.getRecords().isEmpty()) { if (iPage.getRecords().isEmpty()) {
log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空"); log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空");
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage); IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
@ -1050,14 +1065,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} }
private void updateWorkOrderForOthers(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) { private void updateWorkOrderForOthers(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) {
// 对其他情况的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
} else {
throw new ServiceException("请选择仓库!");
}
//已处理 //已处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) { if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus"); aftersalesWorkOrder.remove("workOrderStatus");
@ -2634,4 +2641,29 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return list; return list;
} }
/**
* 判断是否是客服角色
* @param user
* @return
*/
private boolean judgeIsCustomerService(BladeUser user){
String roleName = user.getRoleName();
if (!Objects.isNull(roleName)){
List<String> roleList = Arrays.asList(user.getRoleName().split(","));
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
Optional<DictBiz> matchingDictBiz = warehouseType.stream()
.filter(i -> roleList.contains(i.getDictValue()))
.findFirst();
if (matchingDictBiz.isPresent()) {
return true;
}
return false;
}else {
log.error("当前登录人角色信息错误!!!");
}
return false;
}
} }

Loading…
Cancel
Save