|
@@ -11,13 +11,12 @@ import com.winhc.repal.cloud.WinCoinService;
|
|
import com.winhc.repal.cloud.dto.WinCoinOrderFormDTO;
|
|
import com.winhc.repal.cloud.dto.WinCoinOrderFormDTO;
|
|
import com.winhc.repal.cloud.vo.WinCoinOrderFormVO;
|
|
import com.winhc.repal.cloud.vo.WinCoinOrderFormVO;
|
|
import com.winhc.repal.entity.RepalBill;
|
|
import com.winhc.repal.entity.RepalBill;
|
|
|
|
+import com.winhc.repal.entity.RepalCustomer;
|
|
import com.winhc.repal.entity.RepalDynamic;
|
|
import com.winhc.repal.entity.RepalDynamic;
|
|
import com.winhc.repal.entity.RepalGroup;
|
|
import com.winhc.repal.entity.RepalGroup;
|
|
import com.winhc.repal.enums.*;
|
|
import com.winhc.repal.enums.*;
|
|
import com.winhc.repal.model.bo.UserContextBO;
|
|
import com.winhc.repal.model.bo.UserContextBO;
|
|
-import com.winhc.repal.model.dto.DynamicContentDTO;
|
|
|
|
-import com.winhc.repal.model.dto.RepalLetterDTO;
|
|
|
|
-import com.winhc.repal.model.dto.RepalSmsDTO;
|
|
|
|
|
|
+import com.winhc.repal.model.dto.*;
|
|
import com.winhc.repal.model.vo.RepalLinkVO;
|
|
import com.winhc.repal.model.vo.RepalLinkVO;
|
|
import com.winhc.repal.model.vo.RepalSmsTemplateVO;
|
|
import com.winhc.repal.model.vo.RepalSmsTemplateVO;
|
|
import com.winhc.repal.repository.RepalDynamicMapper;
|
|
import com.winhc.repal.repository.RepalDynamicMapper;
|
|
@@ -55,6 +54,9 @@ public class RepalDynamicServiceImpl extends ServiceImpl<RepalDynamicMapper, Rep
|
|
@Autowired
|
|
@Autowired
|
|
private WinCoinService winCoinService;
|
|
private WinCoinService winCoinService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private RepalCustomerService repalCustomerService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Boolean addDynamic(DynamicContentDTO dto) {
|
|
public Boolean addDynamic(DynamicContentDTO dto) {
|
|
UserContextBO userContextBO = UserContextUtil.getUser();
|
|
UserContextBO userContextBO = UserContextUtil.getUser();
|
|
@@ -147,6 +149,7 @@ public class RepalDynamicServiceImpl extends ServiceImpl<RepalDynamicMapper, Rep
|
|
dynamic.setDynamicType(RepalDynamicTypeEnum.短信.getCode());
|
|
dynamic.setDynamicType(RepalDynamicTypeEnum.短信.getCode());
|
|
dynamic.setMemberId(userContextBO.getUserId());
|
|
dynamic.setMemberId(userContextBO.getUserId());
|
|
dynamic.setLinkMan(JSON.toJSONString(dto.getLinks()));
|
|
dynamic.setLinkMan(JSON.toJSONString(dto.getLinks()));
|
|
|
|
+ dynamic.setOrderId(rsp.getBody().getOrderId());
|
|
save(dynamic);
|
|
save(dynamic);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -161,6 +164,7 @@ public class RepalDynamicServiceImpl extends ServiceImpl<RepalDynamicMapper, Rep
|
|
if(!allFlag){
|
|
if(!allFlag){
|
|
throw new CommonException(CodeMsg.FORBIDDEN,"暂无此权限,可联系超级管理员在我的-成员管理页面开通");
|
|
throw new CommonException(CodeMsg.FORBIDDEN,"暂无此权限,可联系超级管理员在我的-成员管理页面开通");
|
|
}
|
|
}
|
|
|
|
+ //todo 扣减vip次数
|
|
RepalBill repalBill = repalBillService.getById(dto.getRepalBillId());
|
|
RepalBill repalBill = repalBillService.getById(dto.getRepalBillId());
|
|
if(ObjectUtil.isNull(repalBill)){
|
|
if(ObjectUtil.isNull(repalBill)){
|
|
throw new CommonException(CodeMsg.FAILED,"发送失败,账款不存在");
|
|
throw new CommonException(CodeMsg.FAILED,"发送失败,账款不存在");
|
|
@@ -186,6 +190,107 @@ public class RepalDynamicServiceImpl extends ServiceImpl<RepalDynamicMapper, Rep
|
|
dynamic.setDynamicType(RepalDynamicTypeEnum.律师函.getCode());
|
|
dynamic.setDynamicType(RepalDynamicTypeEnum.律师函.getCode());
|
|
dynamic.setMemberId(userContextBO.getUserId());
|
|
dynamic.setMemberId(userContextBO.getUserId());
|
|
dynamic.setLinkMan(JSON.toJSONString(dto.getLinks()));
|
|
dynamic.setLinkMan(JSON.toJSONString(dto.getLinks()));
|
|
|
|
+ dynamic.setOrderId(rsp.getBody().getOrderId());
|
|
|
|
+ save(dynamic);
|
|
|
|
+ return Boolean.TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean urgeByConsult(RepalConsultDTO dto) {
|
|
|
|
+ //校验权限
|
|
|
|
+ UserContextBO userContextBO = UserContextUtil.getUser();
|
|
|
|
+ boolean allFlag = repalRolePermissionService.checkUserPermission(userContextBO.getUserId(),PermissionEnum.URGE_BILL.getCode());
|
|
|
|
+ if(!allFlag){
|
|
|
|
+ throw new CommonException(CodeMsg.FORBIDDEN,"暂无此权限,可联系超级管理员在我的-成员管理页面开通");
|
|
|
|
+ }
|
|
|
|
+ //todo 扣减vip次数
|
|
|
|
+ RepalBill repalBill = repalBillService.getById(dto.getRepalBillId());
|
|
|
|
+ if(ObjectUtil.isNull(repalBill)){
|
|
|
|
+ throw new CommonException(CodeMsg.FAILED,"参数有误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String,Object> paraMap = new HashMap<>();
|
|
|
|
+ paraMap.put("province",dto.getProvince());
|
|
|
|
+ paraMap.put("city",dto.getCity());
|
|
|
|
+ paraMap.put("serviceType",dto.getServiceType());
|
|
|
|
+ paraMap.put("lawyerServiceSubType",102);
|
|
|
|
+ paraMap.put("lawyerServiceType",1);
|
|
|
|
+ paraMap.put("serviceDesc",dto.getServiceDesc());
|
|
|
|
+ paraMap.put("otherArea",dto.getOtherArea());
|
|
|
|
+ paraMap.put("source","REPAL");
|
|
|
|
+ WinCoinOrderFormDTO winCoinOrderFormDTO = new WinCoinOrderFormDTO();
|
|
|
|
+ winCoinOrderFormDTO.setUserId(userContextBO.getUserId());
|
|
|
|
+ winCoinOrderFormDTO.setProductCode("phone_consult");
|
|
|
|
+ winCoinOrderFormDTO.setPayMode("1");
|
|
|
|
+ winCoinOrderFormDTO.setTransAmt(BigDecimal.ZERO);
|
|
|
|
+ winCoinOrderFormDTO.setGoodsJson(JSON.toJSONString(paraMap));
|
|
|
|
+ BeanResponse<WinCoinOrderFormVO> rsp = winCoinService.createOrder(JSON.toJSONString(userContextBO),userContextBO.getAppVersion(),userContextBO.getAppPackageName(),winCoinOrderFormDTO);
|
|
|
|
+ if(!rsp.getIsSuccess().equals("T")){
|
|
|
|
+ throw new CommonException(CodeMsg.FAILED,rsp.getErrorMsg());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RepalDynamic dynamic = new RepalDynamic();
|
|
|
|
+ dynamic.setRepalBillId(dto.getRepalBillId());
|
|
|
|
+ dynamic.setDynamicType(RepalDynamicTypeEnum.咨询.getCode());
|
|
|
|
+ dynamic.setMemberId(userContextBO.getUserId());
|
|
|
|
+ dynamic.setOrderId(rsp.getBody().getOrderId());
|
|
|
|
+ save(dynamic);
|
|
|
|
+ return Boolean.TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean urgeByLawsuit(RepalLawDTO dto) {
|
|
|
|
+ //校验权限
|
|
|
|
+ UserContextBO userContextBO = UserContextUtil.getUser();
|
|
|
|
+ boolean allFlag = repalRolePermissionService.checkUserPermission(userContextBO.getUserId(),PermissionEnum.URGE_BILL.getCode());
|
|
|
|
+ if(!allFlag){
|
|
|
|
+ throw new CommonException(CodeMsg.FORBIDDEN,"暂无此权限,可联系超级管理员在我的-成员管理页面开通");
|
|
|
|
+ }
|
|
|
|
+ //todo 扣减vip次数
|
|
|
|
+ RepalBill repalBill = repalBillService.getById(dto.getRepalBillId());
|
|
|
|
+ RepalCustomer repalCustomer = repalCustomerService.getById(repalBill.getCustomerId());
|
|
|
|
+ if(ObjectUtil.isNull(repalBill) || ObjectUtil.isNull(repalCustomer)){
|
|
|
|
+ throw new CommonException(CodeMsg.FAILED,"参数有误");
|
|
|
|
+ }
|
|
|
|
+ String productCode = "205";
|
|
|
|
+ if(RepalBillStageEnum.NON_PROSECUTE.getCode().equals(dto.getCaseStage())){
|
|
|
|
+ productCode = "203";
|
|
|
|
+ }
|
|
|
|
+ Map<String,Object> defendantMap = new HashMap<>();
|
|
|
|
+ defendantMap.put("defendantName",repalCustomer.getCustName());
|
|
|
|
+ defendantMap.put("defendantType",1);
|
|
|
|
+ if(StrUtil.isNotBlank(repalCustomer.getCompanyId())){
|
|
|
|
+ defendantMap.put("companyId",repalCustomer.getCompanyId());
|
|
|
|
+ defendantMap.put("defendantType",2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String,Object> paraMap = new HashMap<>();
|
|
|
|
+ paraMap.put("province",dto.getProvince());
|
|
|
|
+ paraMap.put("city",dto.getCity());
|
|
|
|
+ paraMap.put("serviceType",dto.getServiceType());
|
|
|
|
+ paraMap.put("lawyerServiceSubType",productCode);
|
|
|
|
+ paraMap.put("lawyerServiceType",2);
|
|
|
|
+ paraMap.put("caseAmt",dto.getCaseAmt());
|
|
|
|
+ paraMap.put("caseStage",dto.getCaseStage());
|
|
|
|
+ paraMap.put("serviceDesc",dto.getServiceDesc());
|
|
|
|
+ paraMap.put("defendantList", Collections.singletonList(defendantMap));
|
|
|
|
+ paraMap.put("source","REPAL");
|
|
|
|
+ WinCoinOrderFormDTO winCoinOrderFormDTO = new WinCoinOrderFormDTO();
|
|
|
|
+ winCoinOrderFormDTO.setUserId(userContextBO.getUserId());
|
|
|
|
+ winCoinOrderFormDTO.setProductCode(productCode);
|
|
|
|
+ winCoinOrderFormDTO.setPayMode("1");
|
|
|
|
+ winCoinOrderFormDTO.setTransAmt(BigDecimal.ZERO);
|
|
|
|
+ winCoinOrderFormDTO.setGoodsJson(JSON.toJSONString(paraMap));
|
|
|
|
+ BeanResponse<WinCoinOrderFormVO> rsp = winCoinService.createOrder(JSON.toJSONString(userContextBO),userContextBO.getAppVersion(),userContextBO.getAppPackageName(),winCoinOrderFormDTO);
|
|
|
|
+ if(!rsp.getIsSuccess().equals("T")){
|
|
|
|
+ throw new CommonException(CodeMsg.FAILED,rsp.getErrorMsg());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RepalDynamic dynamic = new RepalDynamic();
|
|
|
|
+ dynamic.setRepalBillId(dto.getRepalBillId());
|
|
|
|
+ dynamic.setDynamicType(RepalDynamicTypeEnum.诉讼.getCode());
|
|
|
|
+ dynamic.setMemberId(userContextBO.getUserId());
|
|
|
|
+ dynamic.setOrderId(rsp.getBody().getOrderId());
|
|
save(dynamic);
|
|
save(dynamic);
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
}
|
|
}
|