Commit a98de2b6 by huangjinxin

fix:G改约原因增加技能变更,

1 parent 04cc1926
package com.dituhui.pea.order.constant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 改约原因常量
*/
public class OrderReschedulingReason {
public static Map<String, List<String>> ReschedulingReasonMap = new HashMap<>() {
{
put("服务设备/工具相关", new ArrayList<>() {
{
add("缺少常用必备工具");
add("交通工具不可用");
}
});
put("服务物料/配件相关", new ArrayList<>() {
{
add("配件准备错误");
add("配件未到货");
add("加单服务,没有所需配件");
add("缺少可用的安装类附件");
add("缺少可用的清洁类产品");
add("缺少可用的清洁类产品");
add("缺少可用的消耗品(生料带、鞋套等)");
add("缺少服务所需纸质工单");
}
});
put("服务政策/流程相关", new ArrayList<>() {
{
add("超派");
add("重复单(工程师发起申请按钮,由CC校验取消)");
add("服务指派不准确");
add("转入车间服务流程");
add("退换机方案沟通中");
add("不接受退换机政策");
add("用户考虑费用问题");
add("用户不认可收费标准");
add("用户考虑安装/维修方案");
add("用户不接受维修标准");
add("用户考虑软性故障相关解释");
add("没有相关安装/维修操作指导(不提供此服务)");
}
});
put("安装、维修环境(极端天气)", new ArrayList<>() {
{
add("安装、维修环境不符");
add("极端天气,无法正常上门");
}
});
put("服务关联人员相关", new ArrayList<>() {
{
add("预约排期问题");
add("用户希望更换其他工程师上门");
add("服务工程师技能不符");
add("突发的事件导致工程师无法上门(如请假、生病、事故)");
add("等待支持岗位(投诉组、分部、技术支持)提供方案");
add("拉修/退换机的物流服务不到位");
add("售前送货的物流服务不到位");
}
});
put("暂无法关单,初始服务已完成", new ArrayList<>() {
{
add("用户希望观察使用一段时间");
add("用户本人不在现场");
add("TSS软件系统故障");
add("配件代码未维护进系统");
}
});
put("用户相关", new ArrayList<>() {
{
add("用户不接电话且已短信通知用户(改约3次以内)");
add("3天6次未联系上用户");
add("无法满足消费者夜间上门需求(非加单)");
add("用户期望的服务时间与其他用户冲突");
add("上门前得知外部人员已服务");
add("用户要求自行来分部购买配/附件(仅仓管可选)");
add("机器已退/换,不再需要上门服务(仅行政/用户/CC可选)");
add("非BSH产品");
add("用户主动提出往后改约(必须短信通知用户)");
add("机器故障已消除(仅行政/用户/CC可选)");
add("消费者希望提前上门");
}
});
put("其它原因", new ArrayList<>() {
{
}
});
}
};
}
...@@ -3,6 +3,8 @@ package com.dituhui.pea.order.dto; ...@@ -3,6 +3,8 @@ package com.dituhui.pea.order.dto;
import com.dituhui.pea.order.dto.param.Location; import com.dituhui.pea.order.dto.param.Location;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data @Data
public class OrderReschedule { public class OrderReschedule {
private String orderId; private String orderId;
...@@ -23,4 +25,27 @@ public class OrderReschedule { ...@@ -23,4 +25,27 @@ public class OrderReschedule {
* 备注 * 备注
*/ */
private String description; private String description;
/**
* 设备品牌(博世/西门子)
*/
private String brand;
/**
* 产品类别
*/
private String productType;
/**
* 服务类型
*/
private String serviceType;
/**
* 改约原因
*/
private String reschedulingReason;
} }
...@@ -199,6 +199,26 @@ public class OrderDTO { ...@@ -199,6 +199,26 @@ public class OrderDTO {
*/ */
private Location happenLocation; private Location happenLocation;
/**
* 设备品牌(博世/西门子)
*/
private String brand;
/**
* 产品类别
*/
private String productType;
/**
* 服务类型
*/
private String serviceType;
/**
* 改约原因
*/
private String reschedulingReason;
} }
/** /**
......
...@@ -240,4 +240,10 @@ public class OrderInfoEntity { ...@@ -240,4 +240,10 @@ public class OrderInfoEntity {
*/ */
@Column(name = "is_cutoff") @Column(name = "is_cutoff")
private Integer isCutoff = 0; private Integer isCutoff = 0;
/**
* 改约原因
*/
@Column(name = "rescheduling_reason")
private String reschedulingReason;
} }
...@@ -234,49 +234,50 @@ public class BeanRemoteServiceImpl { ...@@ -234,49 +234,50 @@ public class BeanRemoteServiceImpl {
} }
Department data = departmentBeanR.getData(); Department data = departmentBeanR.getData();
//处理大区,分部数据 //处理大区,分部数据
if (StringUtils.isNotBlank(data.getDeptLevel())) { if (StringUtils.isBlank(data.getDeptLevel())) {
if (data.getDeptLevel().equals(BeanOrgLevelEnum.REGION.getCode())) { return Result.failed("组织级别不能为空");
OrgClusterEntity clusterEntity = orgClusterDao.getByClusterId(data.getId()); }
if (ObjUtil.isNull(clusterEntity)) { if (data.getDeptLevel().equals(BeanOrgLevelEnum.REGION.getCode())) {
clusterEntity = new OrgClusterEntity(); OrgClusterEntity clusterEntity = orgClusterDao.getByClusterId(data.getId());
} if (ObjUtil.isNull(clusterEntity)) {
clusterEntity.setName(StringUtils.isNotBlank(data.getTagNameCn()) ? data.getTagNameCn() : data.getTagName()); clusterEntity = new OrgClusterEntity();
clusterEntity.setClusterId(data.getId()); }
clusterEntity.setAbbreviation(data.getAbbreviation()); clusterEntity.setName(StringUtils.isNotBlank(data.getTagNameCn()) ? data.getTagNameCn() : data.getTagName());
clusterEntity.setStatus(data.getEnable()); clusterEntity.setClusterId(data.getId());
clusterEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "{}" : JSONObject.toJSONString(data.getManageCityList())); clusterEntity.setAbbreviation(data.getAbbreviation());
clusterEntity.setMemo(data.getDesc()); clusterEntity.setStatus(data.getEnable());
clusterEntity.setCode(data.getCode()); clusterEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "{}" : JSONObject.toJSONString(data.getManageCityList()));
clusterEntity.setPhone(data.getPhone()); clusterEntity.setMemo(data.getDesc());
clusterEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled()); clusterEntity.setCode(data.getCode());
clusterEntity.setReserveTimeMax(data.getPartReserveTimeMax()); clusterEntity.setPhone(data.getPhone());
clusterEntity.setBsDeptId(data.getBsDeptId()); clusterEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
orgClusterDao.save(clusterEntity); clusterEntity.setReserveTimeMax(data.getPartReserveTimeMax());
} else if (data.getDeptLevel().equals(BeanOrgLevelEnum.BRANCH.getCode())) { clusterEntity.setBsDeptId(data.getBsDeptId());
OrgBranchEntity branchEntity = orgBranchDao.getByBranchId(data.getId()); orgClusterDao.save(clusterEntity);
if (ObjUtil.isNull(branchEntity)) { }
branchEntity = new OrgBranchEntity(); if (data.getDeptLevel().equals(BeanOrgLevelEnum.BRANCH.getCode())) {
} OrgBranchEntity branchEntity = orgBranchDao.getByBranchId(data.getId());
// branchEntity.setBranchName(data.getTagName()); if (ObjUtil.isNull(branchEntity)) {
branchEntity.setBranchName(StringUtils.isNotBlank(data.getTagNameCn()) ? data.getTagNameCn() : data.getTagName()); branchEntity = new OrgBranchEntity();
branchEntity.setBranchId(data.getId());
branchEntity.setAbbreviation(data.getAbbreviation());
branchEntity.setStatus(data.getEnable());
branchEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "{}" : JSONObject.toJSONString(data.getManageCityList()));
branchEntity.setMemo(data.getDesc());
branchEntity.setCode(data.getCode());
branchEntity.setPhone(data.getPhone());
branchEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
branchEntity.setReserveTimeMax(data.getPartReserveTimeMax());
branchEntity.setClusterId(data.getParentId());
branchEntity.setBsDeptId(data.getBsDeptId());
orgBranchDao.save(branchEntity);
branchMap.put(data.getBsDeptId(), branchEntity);
} }
// branchEntity.setBranchName(data.getTagName());
branchEntity.setBranchName(StringUtils.isNotBlank(data.getTagNameCn()) ? data.getTagNameCn() : data.getTagName());
branchEntity.setBranchId(data.getId());
branchEntity.setAbbreviation(data.getAbbreviation());
branchEntity.setStatus(data.getEnable());
branchEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "{}" : JSONObject.toJSONString(data.getManageCityList()));
branchEntity.setMemo(data.getDesc());
branchEntity.setCode(data.getCode());
branchEntity.setPhone(data.getPhone());
branchEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
branchEntity.setReserveTimeMax(data.getPartReserveTimeMax());
branchEntity.setClusterId(data.getParentId());
branchEntity.setBsDeptId(data.getBsDeptId());
orgBranchDao.save(branchEntity);
branchMap.put(data.getBsDeptId(), branchEntity);
} }
//处理分站外围数据 if ((data.getDeptLevel().equalsIgnoreCase(BeanOrgLevelEnum.STATION.getCode()))) {
if (StringUtils.isNotBlank(data.getDeptType()) && (data.getDeptType().equals(BeanOrgLevelEnum.STATION.getCode()) //处理分站外围数据
|| data.getDeptType().equals(BeanOrgLevelEnum.PERIPHERY.getCode()))) {
OrgGroupEntity groupEntity = orgGroupDao.getByGroupId(data.getId()); OrgGroupEntity groupEntity = orgGroupDao.getByGroupId(data.getId());
if (ObjUtil.isNull(groupEntity)) { if (ObjUtil.isNull(groupEntity)) {
groupEntity = new OrgGroupEntity(); groupEntity = new OrgGroupEntity();
...@@ -371,7 +372,7 @@ public class BeanRemoteServiceImpl { ...@@ -371,7 +372,7 @@ public class BeanRemoteServiceImpl {
//处理分站外围 //处理分站外围
groupEntity.setKind(CollectionUtils.isEmpty(data.getType()) ? 4 : BeanPointTypeEnum.getTypeByClazz(data.getType().get(0))); groupEntity.setKind(CollectionUtils.isEmpty(data.getType()) ? 4 : BeanPointTypeEnum.getTypeByClazz(data.getType().get(0)));
groupEntity.setCategory(2); groupEntity.setCategory(2);
groupEntity.setAddress(data.getBusinessAddress().getAddress()); groupEntity.setAddress(data.getBusinessAddress().getAll());
groupEntity.setX(data.getBusinessAddress().getLongitude()); groupEntity.setX(data.getBusinessAddress().getLongitude());
groupEntity.setY(data.getBusinessAddress().getLatitude()); groupEntity.setY(data.getBusinessAddress().getLatitude());
orgGroupDao.save(groupEntity); orgGroupDao.save(groupEntity);
......
...@@ -141,11 +141,14 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -141,11 +141,14 @@ public class OrderCreateServiceImpl implements OrderCreateService {
orderId = s.substring(s.length() - 9); orderId = s.substring(s.length() - 9);
} }
OrderInfoEntity byOrderId = orderInfoDao.getByOrderId(req.getOrderId()); OrderInfoEntity byOrderId = orderInfoDao.getByOrderId(req.getOrderId());
String peaBrand = fixBrand(req.getBrand());
if (ObjectUtil.isNotNull(byOrderId)) { if (ObjectUtil.isNotNull(byOrderId)) {
return Result.failed(StatusCodeEnum.ORDER_EXISTS); return Result.failed(StatusCodeEnum.ORDER_EXISTS);
} }
SkillInfoEntity skillInfoEntity = skillInfoDao.getByBrandAndTypeAndSkill(peaBrand, req.getProductType(), req.getServiceType());
String peaBrand = fixBrand(req.getBrand()); if (ObjectUtil.isNull(skillInfoEntity)) {
return Result.failed(StatusCodeEnum.ORDER_SKILL_NOT_EXISTS);
}
Location location = req.getLocation(); Location location = req.getLocation();
//预处理字段 //预处理字段
entity.setExpectTimeBegin(DateUtil.fromDate(req.getExpectBegin())); entity.setExpectTimeBegin(DateUtil.fromDate(req.getExpectBegin()));
...@@ -179,7 +182,7 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -179,7 +182,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
engineerName = engineerInfo.getName(); engineerName = engineerInfo.getName();
entity.setEngineerName(engineerInfo.getName()); entity.setEngineerName(engineerInfo.getName());
entity.setEngineerPhone(engineerInfo.getPhone()); entity.setEngineerPhone(engineerInfo.getPhone());
entity.setEngineerPhone(engineerInfo.getPhone()); entity.setEngineerCode(engineerInfo.getEngineerCode());
entity.setOrgClusterId(byTeamId.getClusterId()); entity.setOrgClusterId(byTeamId.getClusterId());
entity.setOrgBranchId(byTeamId.getBranchId()); entity.setOrgBranchId(byTeamId.getBranchId());
entity.setOrgGroupId(byTeamId.getGroupId()); entity.setOrgGroupId(byTeamId.getGroupId());
...@@ -189,7 +192,7 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -189,7 +192,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
//特殊时间段 //特殊时间段
Integer special = CommonUtil.isSpecial(entity.getExpectTimeBegin().toLocalTime(), Integer special = CommonUtil.isSpecial(entity.getExpectTimeBegin().toLocalTime(),
entity.getExpectTimeEnd().toLocalTime(), byTeamId.getWorkOn(), byTeamId.getWorkOff()); entity.getExpectTimeEnd().toLocalTime(), byTeamId.getWorkOn(), byTeamId.getWorkOff());
Integer cutoff = CommonUtil.isCutoff(LocalDateTime.now(), byTeamId.getWorkOff()); Integer cutoff = CommonUtil.isCutoff(entity.getExpectTimeBegin(), byTeamId.getWorkOff());
entity.setIsCutoff(cutoff); entity.setIsCutoff(cutoff);
entity.setIsSpecialTime(special); entity.setIsSpecialTime(special);
} else { } else {
...@@ -210,7 +213,7 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -210,7 +213,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
//发送通知分部消息 //发送通知分部消息
sendMsg(branchEntity.getBranchId(), orderId, entity.getExpectTimeBegin().toLocalDate()); sendMsg(branchEntity.getBranchId(), orderId, entity.getExpectTimeBegin().toLocalDate());
Integer cutoff = CommonUtil.isCutoff(LocalDateTime.now(), null); Integer cutoff = CommonUtil.isCutoff(entity.getExpectTimeBegin(), null);
entity.setIsCutoff(cutoff); entity.setIsCutoff(cutoff);
} else { } else {
// 根据分单工作队,填写clusterId/branchId/groupId/teamId等 // 根据分单工作队,填写clusterId/branchId/groupId/teamId等
...@@ -223,7 +226,7 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -223,7 +226,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
//特殊时间段 //特殊时间段
Integer special = CommonUtil.isSpecial(entity.getExpectTimeBegin().toLocalTime(), Integer special = CommonUtil.isSpecial(entity.getExpectTimeBegin().toLocalTime(),
entity.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff()); entity.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff());
Integer cutoff = CommonUtil.isCutoff(LocalDateTime.now(), teamInfo.getWorkOff()); Integer cutoff = CommonUtil.isCutoff(entity.getExpectTimeBegin(), teamInfo.getWorkOff());
// 处理cutoff 动态排班结束后创建的当日单和次日单 // 处理cutoff 动态排班结束后创建的当日单和次日单
boolean isTomorrow = DateUtil.judgeTimeIsisTomorrow(entity.getExpectTimeBegin()); boolean isTomorrow = DateUtil.judgeTimeIsisTomorrow(entity.getExpectTimeBegin());
//次日单自动批量 //次日单自动批量
...@@ -272,8 +275,6 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -272,8 +275,6 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity.setWorkshop(false); entity.setWorkshop(false);
// 处理技能和标签 // 处理技能和标签
SkillInfoEntity skillInfoEntity = skillInfoDao.getByBrandAndTypeAndSkill(peaBrand, req.getProductType(), req.getServiceType());
assert skillInfoEntity != null;
entity.setTakeTime(skillInfoEntity.getTakeTime()); entity.setTakeTime(skillInfoEntity.getTakeTime());
String joinTags = CollectionUtils.isEmpty(req.getOrderTags()) ? "" : String.join(",", req.getOrderTags()); String joinTags = CollectionUtils.isEmpty(req.getOrderTags()) ? "" : String.join(",", req.getOrderTags());
entity.setBeanTags(joinTags); entity.setBeanTags(joinTags);
......
...@@ -85,6 +85,7 @@ public class CommonUtil { ...@@ -85,6 +85,7 @@ public class CommonUtil {
/** /**
* 判断是否cutoff * 判断是否cutoff
* 今日单或今日cutoff之后的次日单
* *
* @return * @return
*/ */
...@@ -96,7 +97,7 @@ public class CommonUtil { ...@@ -96,7 +97,7 @@ public class CommonUtil {
return 0; return 0;
} }
LocalDateTime workOff = LocalDate.now().atTime(Integer.parseInt(strOff.split(":")[0]), Integer.parseInt(strOff.split(":")[1]), 0); LocalDateTime workOff = LocalDate.now().atTime(Integer.parseInt(strOff.split(":")[0]), Integer.parseInt(strOff.split(":")[1]), 0);
if (localTime.isAfter(workOff)) { if (LocalDateTime.now().isAfter(workOff) && DateUtil.judgeTimeIsisTomorrow(localTime)) {
return 1; return 1;
} }
return 0; return 0;
...@@ -111,4 +112,8 @@ public class CommonUtil { ...@@ -111,4 +112,8 @@ public class CommonUtil {
} }
} }
public static void main(String[] args) {
isCutoff(LocalDateTime.now(), "18:00");
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!