|
@@ -12,6 +12,7 @@ import com.gree.mall.manager.bean.policy.*;
|
|
|
import com.gree.mall.manager.commonmapper.PolicyCMapper;
|
|
|
import com.gree.mall.manager.enums.IsYesNoEnum;
|
|
|
import com.gree.mall.manager.enums.PolicyOrderEmStutasEnum;
|
|
|
+import com.gree.mall.manager.enums.PolicyOrderInStutasEnum;
|
|
|
import com.gree.mall.manager.enums.PolicyOrderStatusEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
@@ -66,6 +67,9 @@ public class PolicyOrderLogic {
|
|
|
@Autowired
|
|
|
UserService userService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ WorkerManagerLogic workerManagerLogic;
|
|
|
+
|
|
|
public IPage<PolicyOrderVO> listPolicyOrder(Page page, ZfireParamBean zfireParam) {
|
|
|
//获取当前登录企业id
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
@@ -671,4 +675,53 @@ public class PolicyOrderLogic {
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void refundAC(String id) {
|
|
|
+ PolicyOrder policyOrder = policyOrderService.getById(id);
|
|
|
+ Date date = new Date();
|
|
|
+ policyOrder.setPolicyOrderStatus(PolicyOrderStatusEnum.YSX.getKey());
|
|
|
+ policyOrder.setEndTime(date);
|
|
|
+
|
|
|
+ policyOrder.updateById();
|
|
|
+
|
|
|
+
|
|
|
+ workerPolicyService.lambdaUpdate()
|
|
|
+ .eq(WorkerPolicy::getPolicyOrder,policyOrder.getId())
|
|
|
+ .set(WorkerPolicy::getEndTime,date)
|
|
|
+ .set(WorkerPolicy::getStatus,PolicyOrderStatusEnum.YSX.getKey())
|
|
|
+ .update();
|
|
|
+
|
|
|
+ workerManagerLogic.quit(policyOrder.getWebsitUserId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void refundEM(String id) {
|
|
|
+ PolicyOrder policyOrder = policyOrderService.getById(id);
|
|
|
+
|
|
|
+ Date date = new Date();
|
|
|
+ policyOrder.setPolicyOrderStatus(PolicyOrderStatusEnum.YSX.getKey());
|
|
|
+ policyOrder.setEndTime(date);
|
|
|
+
|
|
|
+ policyOrder.updateById();
|
|
|
+
|
|
|
+ workerPolicyService.lambdaUpdate()
|
|
|
+ .eq(WorkerPolicy::getPolicyOrder,policyOrder.getId())
|
|
|
+ .set(WorkerPolicy::getEndTime,date)
|
|
|
+ .set(WorkerPolicy::getStatus,PolicyOrderStatusEnum.YSX.getKey())
|
|
|
+ .update();
|
|
|
+ workerManagerLogic.quit(policyOrder.getWebsitUserId());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void delIN(String id) {
|
|
|
+
|
|
|
+ PolicyOrder policyOrder = policyOrderService.getById(id);
|
|
|
+ if (!policyOrder.getPolicyOrderStatus().equals(PolicyOrderInStutasEnum.DGM.getKey()))
|
|
|
+ throw new RemoteServiceException("师傅不属于待购买不可删除");
|
|
|
+
|
|
|
+ policyOrderService.removeById(id);
|
|
|
+
|
|
|
+ }
|
|
|
}
|