|
@@ -1,15 +1,17 @@
|
|
package com.sd.business.flow;
|
|
package com.sd.business.flow;
|
|
|
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
import com.fjhx.flow.enums.FlowStatusEnum;
|
|
import com.fjhx.flow.enums.FlowStatusEnum;
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
+import com.sd.business.entity.order.dto.OrderFlowExampleDto;
|
|
import com.sd.business.entity.order.dto.OrderInfoDto;
|
|
import com.sd.business.entity.order.dto.OrderInfoDto;
|
|
import com.sd.business.entity.order.enums.OrderStatusEnum;
|
|
import com.sd.business.entity.order.enums.OrderStatusEnum;
|
|
|
|
+import com.sd.business.entity.order.po.OrderFlowExample;
|
|
import com.sd.business.entity.order.po.OrderInfo;
|
|
import com.sd.business.entity.order.po.OrderInfo;
|
|
|
|
+import com.sd.business.service.order.OrderFlowExampleService;
|
|
import com.sd.business.service.order.OrderService;
|
|
import com.sd.business.service.order.OrderService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -25,6 +27,9 @@ public class OrderFlow extends FlowDelegate {
|
|
@Autowired
|
|
@Autowired
|
|
private OrderService orderService;
|
|
private OrderService orderService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private OrderFlowExampleService orderFlowExampleService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public String getFlowKey() {
|
|
public String getFlowKey() {
|
|
return "order";
|
|
return "order";
|
|
@@ -43,6 +48,11 @@ public class OrderFlow extends FlowDelegate {
|
|
orderService.edit(dto);
|
|
orderService.edit(dto);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ OrderFlowExampleDto orderFlowExample = new OrderFlowExampleDto();
|
|
|
|
+ orderFlowExample.setOrderId(dto.getId());
|
|
|
|
+ orderFlowExample.setFlowId(flowId);
|
|
|
|
+ orderFlowExample.setFlowStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
|
|
+ orderFlowExampleService.add(orderFlowExample);
|
|
return dto.getId();
|
|
return dto.getId();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -58,6 +68,12 @@ public class OrderFlow extends FlowDelegate {
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ orderFlowExampleService.update(q -> q.eq(OrderFlowExample::getOrderId, businessId)
|
|
|
|
+ .eq(OrderFlowExample::getFlowId, flowId)
|
|
|
|
+ .set(OrderFlowExample::getFlowStatus, FlowStatusEnum.PASS.getKey())
|
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId()));
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -68,6 +84,11 @@ public class OrderFlow extends FlowDelegate {
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
);
|
|
);
|
|
|
|
+ orderFlowExampleService.update(q -> q.eq(OrderFlowExample::getOrderId, businessId)
|
|
|
|
+ .eq(OrderFlowExample::getFlowId, flowId)
|
|
|
|
+ .set(OrderFlowExample::getFlowStatus, flowStatus.getKey())
|
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId()));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -75,6 +96,11 @@ public class OrderFlow extends FlowDelegate {
|
|
OrderInfoDto dto = submitData.toJavaObject(OrderInfoDto.class);
|
|
OrderInfoDto dto = submitData.toJavaObject(OrderInfoDto.class);
|
|
dto.setFlowStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
dto.setFlowStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
orderService.edit(dto);
|
|
orderService.edit(dto);
|
|
|
|
+ orderFlowExampleService.update(q -> q.eq(OrderFlowExample::getOrderId, businessId)
|
|
|
|
+ .eq(OrderFlowExample::getFlowId, flowId)
|
|
|
|
+ .set(OrderFlowExample::getFlowStatus, FlowStatusEnum.IN_PROGRESS.getKey())
|
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId()));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|