Browse Source

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

fix-sign
zhaoqiaobo 5 months ago
parent
commit
7c67bce220
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/WorkOrderStatusConstant.java
  2. 6
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  3. 15
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java
  4. 244
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  5. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  6. 107
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  7. 65
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  8. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/WorkOrderStatusConstant.java

@ -9,8 +9,9 @@ public enum WorkOrderStatusConstant {
daishenhe("待审核","40"),
yishenhe("已审核","50"),
chaoshiweichuli("超时未处理","60"),
zhongchaizhong("客服介入中","70"),
yiwanjei("仲裁中","80"),
// zhongchaizhong("客服介入中","70"),
zhongchaizhong("仲裁中","70"),
yiwanjie("完结","80"),
lipeijineweichu("理赔金额未出","90"),
shenshuzhong("申述中","100"),
yijeishu("已结束","110")

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

@ -25,6 +25,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -326,6 +327,11 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
private Integer packageFinish;
/**
* 赔款金额
*/
private BigDecimal compensationMoney;
/**

15
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java

@ -45,6 +45,21 @@ public class AftersalesWorkOrderVO extends AftersalesWorkOrderEntity {
* 提货名称
*/
private String discoveryNodeName;
/**
* 完成时间
*/
private String completeTime;
/**
* 是否申述
*/
private String isAppeal;
/**
* 申诉状态
*/
private String appealStatusName;
/**
* 责任方和处理方
*/

244
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -41,6 +41,7 @@ import javax.servlet.ServletOutputStream;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.aftersales.WorkOrderStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
@ -732,7 +733,92 @@ public class AftersalesWorkOrderController extends BladeController {
/**
* 导出数据
* 处理中导出数据
*
*/
@GetMapping("/exportWorkOrder0")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void allExportWorkOrder(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, BladeUser bladeUser, HttpServletResponse response) {
List<List<String>> basicTitle = aftersalesWorkOrderService.basicTitleBuild();
//查询数据
List<String> head1 = new ArrayList<>(Arrays.asList("总部处理客服"));
basicTitle.add(head1);
List<String> head2 = new ArrayList<>(Arrays.asList("处理结果"));
basicTitle.add(head2);
List<String> head3 = new ArrayList<>(Arrays.asList("理赔金额"));
basicTitle.add(head3);
List<String> head4 = new ArrayList<>(Arrays.asList("完结时间"));
basicTitle.add(head4);
List<String> head5 = new ArrayList<>(Arrays.asList("是否申诉"));
basicTitle.add(head5);
List<String> head6 = new ArrayList<>(Arrays.asList("申诉状态"));
basicTitle.add(head6);
List<String> head7 = new ArrayList<>(Arrays.asList("钉钉号"));
basicTitle.add(head7);
List<AftersalesWorkOrderVO> exportData = aftersalesWorkOrderService.getBasicExportData(aftersalesWorkOrder);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (!exportData.isEmpty()) {
List<List<String>> dataList = new ArrayList<>();
for (AftersalesWorkOrderVO exportDatum : exportData) {
List<String> data = new ArrayList<>();
data.add(0,exportDatum.getWorkOrderTypeName());
data.add(1,exportDatum.getDiscoveryNodeName());
data.add(2,exportDatum.getWarehouseName());
data.add(3,exportDatum.getWorkOrderNumber());
data.add(4,exportDatum.getWaybillNumber());
data.add(5,exportDatum.getOrderCode());
data.add(6,exportDatum.getPackageCode());
data.add(7,exportDatum.getBrandName());
data.add(8,exportDatum.getWaybillMall());
data.add(9,exportDatum.getFirst());
data.add(10,exportDatum.getWorkOrderStatusName());
data.add(11,exportDatum.getBusinessName());
data.add(12,sdf.format(exportDatum.getCreateTime()));
data.add(13,sdf.format(exportDatum.getEndCreateTime()));
data.add(14,Objects.isNull(exportDatum.getUpdateTime())?"":sdf.format(exportDatum.getUpdateTime()));
data.add(15,"");
data.add(16,exportDatum.getCustomerServiceName());
data.add(17,exportDatum.getHeadquartersName());
data.add(18,exportDatum.getResultTypes());
data.add(19,exportDatum.getTotalAmountNum());
data.add(20,exportDatum.getCompleteTime());
data.add(21,exportDatum.getIsAppeal());
data.add(22,exportDatum.getAppealStatusName());
data.add(23,exportDatum.getProcessNumber());
//查询此工单是否存在有责任方如果存在有责任方完善表头
// List<AftersalesPersonResponsibleEntity> entityList = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
// .eq(AftersalesPersonResponsibleEntity::getWordOrderId, exportDatum.getId())
// .eq(AftersalesPersonResponsibleEntity::getTypesOf, "1")
// );
// if (!entityList.isEmpty()) {
// handleResponsibility(basicTitle,entityList,data);
// }
dataList.add(data);
}
ServletOutputStream os = null;
try {
os = response.getOutputStream();
ExcelWriter excelWriter = EasyExcel.write(os).build();
WriteSheet sheet = EasyExcel.writerSheet()
// 这里放入动态头
.head(basicTitle)
// 当然这里数据也可以用 List<List<String>> 去传入
.build();
excelWriter.write(dataList,sheet);
excelWriter.finish();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
/**
* 处理中导出数据
*
*/
@GetMapping("/exportWorkOrder1")
@ -763,8 +849,150 @@ public class AftersalesWorkOrderController extends BladeController {
data.add(12,sdf.format(exportDatum.getCreateTime()));
data.add(13,sdf.format(exportDatum.getEndCreateTime()));
data.add(14,Objects.isNull(exportDatum.getUpdateTime())?"":sdf.format(exportDatum.getUpdateTime()));
data.add(15,null);
data.add(16,null);
data.add(15,"");
data.add(16,"");
//查询此工单是否存在有责任方如果存在有责任方完善表头
List<AftersalesPersonResponsibleEntity> entityList = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
.eq(AftersalesPersonResponsibleEntity::getWordOrderId, exportDatum.getId())
.eq(AftersalesPersonResponsibleEntity::getTypesOf, "1")
);
if (!entityList.isEmpty()) {
handleResponsibility(basicTitle,entityList,data);
}
dataList.add(data);
}
ServletOutputStream os = null;
try {
os = response.getOutputStream();
ExcelWriter excelWriter = EasyExcel.write(os).build();
WriteSheet sheet = EasyExcel.writerSheet()
// 这里放入动态头
.head(basicTitle)
// 当然这里数据也可以用 List<List<String>> 去传入
.build();
excelWriter.write(dataList,sheet);
excelWriter.finish();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
/**
* 处理中导出数据
*
*/
@GetMapping("/exportWorkOrder2")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void claimsCompensationExportWorkOrder(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, BladeUser bladeUser, HttpServletResponse response) {
List<List<String>> basicTitle = aftersalesWorkOrderService.basicTitleBuild();
//查询数据
List<String> head1 = new ArrayList<>(Arrays.asList("处理结果"));
basicTitle.add(head1);
List<String> head2 = new ArrayList<>(Arrays.asList("理赔金额"));
basicTitle.add(head2);
List<AftersalesWorkOrderVO> exportData = aftersalesWorkOrderService.getBasicExportData(aftersalesWorkOrder);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (!exportData.isEmpty()) {
List<List<String>> dataList = new ArrayList<>();
for (AftersalesWorkOrderVO exportDatum : exportData) {
List<String> data = new ArrayList<>();
data.add(0,exportDatum.getWorkOrderTypeName());
data.add(1,exportDatum.getDiscoveryNodeName());
data.add(2,exportDatum.getWarehouseName());
data.add(3,exportDatum.getWorkOrderNumber());
data.add(4,exportDatum.getWaybillNumber());
data.add(5,exportDatum.getOrderCode());
data.add(6,exportDatum.getPackageCode());
data.add(7,exportDatum.getBrandName());
data.add(8,exportDatum.getWaybillMall());
data.add(9,exportDatum.getFirst());
data.add(10,exportDatum.getWorkOrderStatusName());
data.add(11,exportDatum.getBusinessName());
data.add(12,sdf.format(exportDatum.getCreateTime()));
data.add(13,sdf.format(exportDatum.getEndCreateTime()));
data.add(14,Objects.isNull(exportDatum.getUpdateTime())?"":sdf.format(exportDatum.getUpdateTime()));
data.add(15,"");
data.add(16,"");
data.add(17,exportDatum.getResultTypes());
data.add(18,exportDatum.getTotalAmountNum());
//查询此工单是否存在有责任方如果存在有责任方完善表头
List<AftersalesPersonResponsibleEntity> entityList = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
.eq(AftersalesPersonResponsibleEntity::getWordOrderId, exportDatum.getId())
.eq(AftersalesPersonResponsibleEntity::getTypesOf, "1")
);
if (!entityList.isEmpty()) {
handleResponsibility(basicTitle,entityList,data);
}
dataList.add(data);
}
ServletOutputStream os = null;
try {
os = response.getOutputStream();
ExcelWriter excelWriter = EasyExcel.write(os).build();
WriteSheet sheet = EasyExcel.writerSheet()
// 这里放入动态头
.head(basicTitle)
// 当然这里数据也可以用 List<List<String>> 去传入
.build();
excelWriter.write(dataList,sheet);
excelWriter.finish();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
/**
* 处理中导出数据
*
*/
@GetMapping("/exportWorkOrder3")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void processingCompletedExportWorkOrder(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, BladeUser bladeUser, HttpServletResponse response) {
List<List<String>> basicTitle = aftersalesWorkOrderService.basicTitleBuild();
//查询数据
List<String> head1 = new ArrayList<>(Arrays.asList("营业部处理客服"));
basicTitle.add(head1);
List<String> head2 = new ArrayList<>(Arrays.asList("处理结果"));
basicTitle.add(head2);
List<String> head3 = new ArrayList<>(Arrays.asList("理赔金额"));
basicTitle.add(head3);
List<AftersalesWorkOrderVO> exportData = aftersalesWorkOrderService.getBasicExportData(aftersalesWorkOrder);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (!exportData.isEmpty()) {
List<List<String>> dataList = new ArrayList<>();
for (AftersalesWorkOrderVO exportDatum : exportData) {
List<String> data = new ArrayList<>();
data.add(0,exportDatum.getWorkOrderTypeName());
data.add(1,exportDatum.getDiscoveryNodeName());
data.add(2,exportDatum.getWarehouseName());
data.add(3,exportDatum.getWorkOrderNumber());
data.add(4,exportDatum.getWaybillNumber());
data.add(5,exportDatum.getOrderCode());
data.add(6,exportDatum.getPackageCode());
data.add(7,exportDatum.getBrandName());
data.add(8,exportDatum.getWaybillMall());
data.add(9,exportDatum.getFirst());
data.add(10,exportDatum.getWorkOrderStatusName());
data.add(11,exportDatum.getBusinessName());
data.add(12,sdf.format(exportDatum.getCreateTime()));
data.add(13,sdf.format(exportDatum.getEndCreateTime()));
data.add(14,Objects.isNull(exportDatum.getUpdateTime())?"":sdf.format(exportDatum.getUpdateTime()));
data.add(15,"");
data.add(16,exportDatum.getCustomerServiceName());
data.add(17,exportDatum.getHeadquartersName());
data.add(18,exportDatum.getResultTypes());
data.add(19,exportDatum.getTotalAmountNum());
//查询此工单是否存在有责任方如果存在有责任方完善表头
List<AftersalesPersonResponsibleEntity> entityList = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
.eq(AftersalesPersonResponsibleEntity::getWordOrderId, exportDatum.getId())
@ -802,12 +1030,16 @@ public class AftersalesWorkOrderController extends BladeController {
.orderByDesc(AftersaleSurveyRecordEntity::getCreateTime)
);
if (!recordEntities.isEmpty()) {
int size = 0;
if (!basicTitle.contains(Arrays.asList("最新消息回复内容")) ){
List<String> head5 = new ArrayList<>(Arrays.asList("最新消息回复内容"));
basicTitle.add(basicTitle.size(),head5);
basicTitle.add(head5);
size = basicTitle.size();
basicTitle.add(size,head5);
}else {
size = basicTitle.indexOf(Arrays.asList("最新消息回复内容"));
}
data.add(recordEntities.get(0).getContent());
data.add(size,recordEntities.get(0).getContent());
}
int aa = 0;

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

@ -125,5 +125,5 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
* @param ids
* @return
*/
List<AftersalesWorkOrderVO> getBasicExportData(@Param("param") AftersalesWorkOrderDTO workOrderDTO, List<Long> ids);
List<AftersalesWorkOrderVO> getBasicExportData(@Param("param") AftersalesWorkOrderDTO workOrderDTO,@Param("ids") List<Long> ids,@Param("warehouseIds")List<Long> warehouseIds);
}

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

@ -57,6 +57,7 @@
SELECT DISTINCT
lawo.id,
lawo.ceator,
lawo.warehouse_name,
lawo.work_order_type,
lawo.discovery_node,
lawo.work_order_number,
@ -113,8 +114,8 @@
AND b.is_deleted = 0
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
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0 AND lap.types_of != '3' AND lap.types_of != '3'
<where>
lawo.is_deleted = 0
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
@ -132,6 +133,7 @@
<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>
@ -188,12 +190,13 @@
<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 ">
<if test="warehouseIds != 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
@ -1106,26 +1109,28 @@
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
IFNULL( sum( lapr.money ), 0 ) AS totalAmountNum,
lawo.ceator,
IF(lawo.work_order_status = '80',lawo.update_time,'') AS '完结时间',
IF(lawo.work_order_status = '100','是','否') AS '是否申述',
IF(lawo.work_order_status = '80',lawo.update_time,'') AS completeTime,
IF(lawo.work_order_status = '100','是','否') AS isAppeal,
lawo.process_number,
IF(lawo.work_order_status = '100',(SELECT CASE types_of
WHEN 0 THEN '待处理'
WHEN 1 THEN '成立'
WHEN 2 THEN '驳回'
WHEN 3 THEN '取消'
ELSE
'未知审核状态'
END aaa
FROM logpm_aftersales_appeal WHERE word_order_id = lawo.id AND is_deleted = 0 AND types_of != 3 ORDER BY create_time DESC LIMIT 1),'未申述') AS '申述状态'
FROM logpm_aftersales_appeal WHERE word_order_id = lawo.id AND is_deleted = 0 AND types_of != 3 ORDER BY create_time DESC LIMIT 1),'未申述') AS appealStatusName,
lawo.warehouse_service_name,
lawo.headquarters_name
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 )
AND lap.is_deleted = 0
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
AND lacr.is_deleted = 0
LEFT JOIN (SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
@ -1143,7 +1148,93 @@
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_person_responsible AS laprr ON laprr.word_order_id = lawo.id
LEFT JOIN logpm_aftersales_person_responsible AS laprr ON laprr.word_order_id = lawo.id AND laprr.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="warehouseIds != null ">
and lap.business_id IN
<foreach collection="warehouseIds" item="warehouseId" open="(" separator="," close=")" >
#{warehouseId}
</foreach>
</if>
<if test="ids != null ">
and lawo.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")" >
#{id}
</foreach>
</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>
<if test="param.initiationIdentification != null and param.initiationIdentification != '' ">and lawo.initiation_identification = #{param.initiationIdentification } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if>
<if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if>
<if test="param.warehousingTime != null "> and date_format(from_unixtime(lawo.warehousing_time),'%Y-%m-%d') = date_format( #{param.warehousingTime},'%Y-%m-%d') </if>
<if test="param.deliveryTime != null ">and date_format(from_unixtime( lawo.delivery_time),'%Y-%m-%d') = date_format(#{param.deliveryTime} param.deliveryTime,'%Y-%m-%d') </if>
<if test="param.auditTime != null ">and date_format(from_unixtime(lawo.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if>
<if test="param.entryTime != null ">and date_format(from_unixtime(lawo.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if>
<if test="param.overTime != null ">and date_format(from_unixtime(lawo.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if>
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall like concat('%', #{param.waybillMall },'%') </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
<if test="param.customerServiceState != null and param.customerServiceState == 30 "> and lawo.work_order_status in ('40') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 40 "> and lawo.work_order_status in ('20') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 31 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 60 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('70','80','100') </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<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.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>
<if test="param.operator != null and param.operator != '' ">and lawo.operator = #{param.operator } </if>
<if test="param.responsiblePerson != null and param.responsiblePerson != '' ">and lawo.responsible_person = #{param.responsiblePerson } </if>
<if test="param.processedBy != null and param.processedBy != '' ">and lawo.processed_by = #{param.processedBy} </if>
<if test="param.investigationProcess != null and param.investigationProcess != '' ">and lawo.investigation_process = #{param.investigationProcess } </if>
<if test="param.relatedWorkOrdersId != null and param.relatedWorkOrdersId != '' ">and lawo.related_work_orders_id = #{param.relatedWorkOrdersId } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
<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') </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>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<if test="param.first != null and param.first != '' ">and t.first like concat('%',#{param.first},'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and t.secondary like concat('%',#{param.secondary},'%') </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.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>

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

@ -153,7 +153,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "80"); //55的待审核
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
@ -184,7 +184,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
@ -205,7 +205,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("customerServiceId", user.getUserId());
} else if (ObjectUtils.isNull(workOrderStatus)) {
aftersalesWorkOrder.put("customerIdentification", "1");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
@ -238,7 +238,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
@ -691,7 +691,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
throw new ServiceException("赔款方数据不能为空");
}
AftersalesWorkOrderEntity workOrderEntity1 = baseMapper.selectById(v.getId());
if (workOrderEntity1.getWorkOrderStatus().equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (workOrderEntity1.getWorkOrderStatus().equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
throw new ServiceException(" 包含已完结的异常工单!");
}
//添加赔付方信息
@ -773,7 +773,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yichuli.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "60"); //55的待审核
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "10");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
@ -804,7 +804,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesWorkOrder.put("handleStatus", "50");
// }
// //已完结
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "20");
// }
@ -825,7 +825,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesWorkOrder.put("customerServiceId", user.getUserId());
// } else if (ObjectUtils.isNull(workOrderStatus)) {
// aftersalesWorkOrder.put("customerIdentification", "1");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "10");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
@ -857,7 +857,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesWorkOrder.put("handleStatus", "50");
// }
// //已完结
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "20");
// }
@ -1010,7 +1010,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "60"); //55的待审核
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
@ -1044,7 +1044,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
@ -1064,7 +1064,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("customerServiceId", userId);
} else if (ObjectUtils.isNull(workOrderStatus)) {
aftersalesWorkOrder.put("customerIdentification", "1");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjie.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
@ -1089,7 +1089,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
@ -1642,7 +1642,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.yichuli.getValue())) {
throw new ServiceException("当前异常工单已处理!");
}
if (byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
if (byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.yiwanjie.getValue())) {
throw new ServiceException("当前异常工单已完结!!");
}
AftersalesProcessingResultsDTO aftersalesProcessingResultsDTO = aftersalesWorkOrder.getAftersalesProcessingResultsDTO();
@ -1912,13 +1912,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//处理赔付方式
aftersalesProcessingResultsDTO.setCompensationMethod(aftersalesProcessingResultsDTO.getCompensationMethod());
}
BigDecimal totalMoney = new BigDecimal(0);
aftersalesProcessingResultsDTO.setWarehouseId(aftersalesWorkOrderDTO.getWarehouseId());
if (!Objects.isNull(aftersalesProcessingResultsDTO.getProcessingMoneyEntityList())){
Iterator<AftersalesProcessingMoneyEntity> iterator = aftersalesProcessingResultsDTO.getProcessingMoneyEntityList().iterator();
while (iterator.hasNext()){
BigDecimal money = iterator.next().getMoney();
totalMoney.add(money);
}
}
aftersalesProcessingResultsService.ownSaveOrUpdate(aftersalesProcessingResultsDTO);
//修改异常工单处理信息!
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesWorkOrderDTO.getId());
workOrderEntity.setCompensationMoney(totalMoney);
//是否为已提交
if ("1".equals(aftersalesWorkOrderDTO.getResultIdentification())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue());
@ -2210,7 +2217,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//修改工单状态
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getTypesOf())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjie.getValue());
}
return baseMapper.updateById(workOrderEntity) > 0;
@ -2227,7 +2234,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
List<AftersalesSettlementEntity> settlementEntityList = baseMapper.getWholeListSettlement(settlementEntity);
List<AftersalesWorkOrderEntity> aftersalesWorkOrderEntities = baseMapper.selectList(Wrappers.<AftersalesWorkOrderEntity>query().lambda()
.eq(AftersalesWorkOrderEntity::getWorkOrderStatus, WorkOrderStatusConstant.yiwanjei.getValue())
.eq(AftersalesWorkOrderEntity::getWorkOrderStatus, WorkOrderStatusConstant.yiwanjie.getValue())
);
List<AftersalesWorkOrderEntity> list = new ArrayList<>();
@ -2382,7 +2389,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.getAssignList().forEach(i -> {
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(i);
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjie.getValue());
baseMapper.updateById(workOrderEntity);
});
@ -2406,7 +2413,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// //取消订单申述
// AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
// workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
// workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
// workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjie.getValue());
// baseMapper.updateById(workOrderEntity);
//
// if("2".equals(aftersalesAppeal.getTypesOf())){
@ -2452,7 +2459,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// 根据不同的申诉类型进行订单状态更新和申述记录添加
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjie.getValue());
baseMapper.updateById(workOrderEntity);
if ("2".equals(typesOf)) {
@ -2753,10 +2760,24 @@ 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("当前登录人无仓库信息,请联系管理人员!!!");
}
AftersalesWorkOrderDTO workOrderDTO = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderDTO.class);
List<AftersalesWorkOrderVO> exportData = baseMapper.getBasicExportData(workOrderDTO,ids);
List<AftersalesWorkOrderVO> exportData = baseMapper.getBasicExportData(workOrderDTO,ids,warehouseIds);
return exportData;
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1700,6 +1700,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// Map<String, List<DistributionReservationStockarticleEntity>> allStockArticle = reservationStockarticleEntityList.stream().filter(f -> Func.isNotEmpty(f.getIsZero())).collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getIsZero));
DistributionDeliverySelfEntity finalDistributionDeliverySelfEntity = distributionDeliverySelfEntity;
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>();
List<JSONObject> logList = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
switch (reservationStockarticleEntity.getIsZero()) {
@ -1781,6 +1782,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
orderCodes.add(parcelListEntity.getOrderCode());
//拼接包条码
// orderPackages.append(parcelListEntity.getOrderPackageCode()).append(",")
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "一键装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
logList.add(trunklinePackageTrackLog);
}
}
break;
@ -1987,6 +1991,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListMapper.updatePackageListByIds(packageIds);
}
}
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
return Resp.scanSuccess("操作成功", "装车成功");
}

Loading…
Cancel
Save