diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/WorkOrderTypeConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/WorkOrderTypeConstant.java new file mode 100644 index 000000000..c7aa1d1cc --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/WorkOrderTypeConstant.java @@ -0,0 +1,46 @@ +package org.springblade.common.constant.aftersales; + +public enum WorkOrderTypeConstant { + huosun("货损","1","HS"), + shaohuo("少货","2","SH"), + cuanhuo("窜货","3","CH"), + jiaji("加急","4","JJ"), + qita("其他","5","QT"), + + ; + + private String name; + private String value; + + private String anotherName; + + WorkOrderTypeConstant(String name, String value, String anotherName) { + this.name = name; + this.value = value; + this.anotherName = anotherName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getAnotherName() { + return anotherName; + } + + public void setAnotherName(String anotherName) { + this.anotherName = anotherName; + } +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index c2a76836f..1137a9370 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -144,12 +144,31 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl first = Arrays.stream(values).filter(i -> i.getValue().equals(workOrderType)).findFirst(); + + //查询客服岗位 + List pcWorkOrder = DictBizCache.getList("pc_work_order"); + //查询客服岗位 + List numberRules = DictBizCache.getList("work_order_number_rules"); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - return "YC"+name+format.format(new Date()); + if (numberRules.isEmpty()) { + log.info("注意,注意!工单号字典未配置!请配置!"); + } else { + Optional first2 = pcWorkOrder.stream().filter(i -> i.getDictKey().equals(workOrderType)).findFirst(); + //工单号规则待完善 - } + if(first2.isPresent()){ + DictBiz dictBiz = first2.get(); + Optional first1 = numberRules.stream().filter(i -> i.getDictValue().equals(dictBiz.getDictValue())).findFirst(); + return first1.map(DictBiz -> DictBiz.getDictKey() + name + format.format(new Date())).orElseGet(() -> "YC" + name + format.format(new Date())); + } + + } + return "YC" + name + format.format(new Date()); + } @@ -177,7 +196,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl