Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fix-sign
pref_mail@163.com 5 months ago
parent
commit
d2ea18e2a6
  1. 10
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java
  2. 16
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  3. 1
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java
  4. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java
  5. 15
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  6. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  7. 65
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  8. 52
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

10
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java

@ -1,5 +1,6 @@
package com.logpm.aftersales.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@ -68,7 +69,14 @@ public class AftersalesSettlementEntity extends TenantEntity {
private Date overTime;
@TableField(exist=false)
private String workOrderNumbers;
@TableField(exist=false)
private String orderCodes;
@TableField(exist=false)
private Date startCreateTime;
@TableField(exist=false)
private Date endCreateTime;

16
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -19,15 +19,14 @@ package com.logpm.aftersales.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
/**
* 客服异常工单 实体类
*
@ -332,6 +331,15 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
/**
* 金额总和
*/
@TableField(exist=false)
private String workOrderNumbers;
@TableField(exist=false)
private String orderCodes;
@TableField(exist=false)
private Date startCreateTime;
@TableField(exist=false)
private Date endCreateTime;
@TableField(exist=false)
private String totalAmountNum;
@TableField(exist=false)

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.mp.support.Condition;
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.utils.Func;
import org.springframework.web.bind.annotation.*;

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java

@ -21,6 +21,7 @@ import com.logpm.aftersales.entity.AftersalesAppealPeopleEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
@ -66,5 +67,12 @@ public class AftersalesAppealDTO extends AftersalesAppealEntity {
*/
private Long createUserId;
/** 范围查找工单 */
private String workOrderNumbers;
/** 范围查找订单 */
private String orderCodes;
/** 范围查找创建时间 */
private Date startCreateTime;
private Date endCreateTime;
}

15
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml

@ -57,6 +57,21 @@
LEFT JOIN logpm_aftersales_completion_record lacr on laa.work_order_id = lacr.work_order_id
LEFT JOIN logpm_aftersales_work_order lawo ON lawo.id = lacr.work_order_id
<where> laa.is_deleted = 0
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
and lawo.work_order_number in
<foreach collection="param.workOrderNumbers.split(',')" item="workOrderNumber" separator="," open="(" close=")">
#{workOrderNumber}
</foreach>
</if>
<if test="param.orderCodes != null and param.orderCodes != '' ">
and lawo.order_code in
<foreach collection="param.orderCodes.split(',')" item="orderCode" separator="," open="(" close=")">
#{orderCode}
</foreach>
</if>
<if test="param.startCreateTime != null and param.endCreateTime != null ">
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
</if>
<if test="param.warehouseId != null and param.warehouseId != '' ">
and (lacr.warehouse_id = #{param.warehouseId } or laa.create_user = #{param.createUserId})
</if>

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
* @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);

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

@ -96,9 +96,6 @@
GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
AND lap.types_of = '2'
AND lap.conditions IN ( 1, 2 )
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
LEFT JOIN (SELECT
@ -117,8 +114,24 @@
GROUP BY
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_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0
<where>
lawo.is_deleted = 0
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
and lawo.work_order_number in
<foreach collection="param.workOrderNumbers.split(',')" item="workOrderNumber" separator="," open="(" close=")">
#{workOrderNumber}
</foreach>
</if>
<if test="param.orderCodes != null and param.orderCodes != '' ">
and lawo.order_code in
<foreach collection="param.orderCodes.split(',')" item="orderCode" separator="," open="(" close=")">
#{orderCode}
</foreach>
</if>
<if test="param.startCreateTime != null and param.endCreateTime != null ">
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
</if>
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>
<if test="param.id != null and param.id != '' ">and lawo.id = #{param.id } </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
@ -147,7 +160,6 @@
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != null ">and (lap.warehouse_id = #{param.warehouseId} OR lap.business_id = #{param.warehouseId}) </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -160,10 +172,9 @@
<if test="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') </if>
<if test="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100,70) </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
@ -177,6 +188,12 @@
<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.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>
group by lawo.id
ORDER BY lawo.create_time DESC
@ -291,6 +308,8 @@
GROUP BY
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_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0
<where>
lawo.is_deleted = 0
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>
@ -559,6 +578,21 @@
<where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30')
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
and law.work_order_number in
<foreach collection="param.workOrderNumbers.split(',')" item="workOrderNumber" separator="," open="(" close=")">
#{workOrderNumber}
</foreach>
</if>
<if test="param.orderCodes != null and param.orderCodes != '' ">
and law.order_code in
<foreach collection="param.orderCodes.split(',')" item="orderCode" separator="," open="(" close=")">
#{orderCode}
</foreach>
</if>
<if test="param.startCreateTime != null and param.endCreateTime != null ">
and law.create_time between #{param.startCreateTime} and #{param.endCreateTime}
</if>
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and law.work_order_status = #{param.workOrderStatusNameS } </if>
<if test="param.operator != null and param.operator != '' ">and law.operator = #{param.operator } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.workOrderStatus}</if>
@ -686,6 +720,21 @@
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lapr.work_order_id
<where>
lawo.work_order_status = 90 and lap.is_deleted = 0
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
and lawo.work_order_number in
<foreach collection="param.workOrderNumbers.split(',')" item="workOrderNumber" separator="," open="(" close=")">
#{workOrderNumber}
</foreach>
</if>
<if test="param.orderCodes != null and param.orderCodes != '' ">
and lawo.order_code in
<foreach collection="param.orderCodes.split(',')" item="orderCode" separator="," open="(" close=")">
#{orderCode}
</foreach>
</if>
<if test="param.startCreateTime != null and param.endCreateTime != null ">
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
</if>
<if test="param.businessId != null"> and lap.business_id =#{param.businessId}</if>
<if test="param.businessName != null and param.businessName != ''"> and lap.business_name LIKE CONCAT( #{param.businessName}, '%')</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != ''"> and lawo.work_order_number LIKE CONCAT( #{param.workOrderNumber}, '%')</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(","));
String tenantId = user.getTenantId();
boolean b = judgeIsCustomerService(user);
// 查询 状态条件
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
if (warehouseType.isEmpty()) {
@ -937,8 +937,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}else {
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);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity,warehouseIds);
if (iPage.getRecords().isEmpty()) {
log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空");
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) {
// 对其他情况的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
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())) {
aftersalesWorkOrder.remove("workOrderStatus");
@ -2634,4 +2641,29 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
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