|
@@ -45,6 +45,7 @@ import org.jeecg.modules.util.essutils.EssChannel;
|
|
|
import org.jeecg.modules.util.essutils.EssContractUtils;
|
|
import org.jeecg.modules.util.essutils.EssContractUtils;
|
|
|
import org.jeecg.modules.util.essutils.EssProperties;
|
|
import org.jeecg.modules.util.essutils.EssProperties;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -79,6 +80,9 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
private EssProperties essProperties;
|
|
private EssProperties essProperties;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private EssContractUtils essContractUtils;
|
|
private EssContractUtils essContractUtils;
|
|
|
|
|
+ @Lazy
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IHwOrderService hwOrderService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public HwOrder getOrder(String id) {
|
|
public HwOrder getOrder(String id) {
|
|
@@ -828,6 +832,7 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
// 用户信息
|
|
// 用户信息
|
|
|
HwUser hwUser = hwUserService.getById(userId);
|
|
HwUser hwUser = hwUserService.getById(userId);
|
|
|
//慧盈-查询所有服务商信息
|
|
//慧盈-查询所有服务商信息
|
|
|
|
|
+ String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
String requestUrl = OauthApi.SUBCONTRACTOR_LIST;
|
|
String requestUrl = OauthApi.SUBCONTRACTOR_LIST;
|
|
|
JSONObject jsonObjectParam = new JSONObject();
|
|
JSONObject jsonObjectParam = new JSONObject();
|
|
|
//1:不包含开心;2:包含开心
|
|
//1:不包含开心;2:包含开心
|
|
@@ -835,7 +840,7 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
log.info("param============{}", JSONObject.toJSONString(jsonObjectParam));
|
|
log.info("param============{}", JSONObject.toJSONString(jsonObjectParam));
|
|
|
//数据加密
|
|
//数据加密
|
|
|
String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObjectParam));
|
|
String biz_content = CryptTool.encode(JSONObject.toJSONString(jsonObjectParam));
|
|
|
- JSONObject jsonObjectResult = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, "");
|
|
|
|
|
|
|
+ JSONObject jsonObjectResult = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
log.info("查询所有服务商信息===={}", jsonObjectResult);
|
|
log.info("查询所有服务商信息===={}", jsonObjectResult);
|
|
|
List<HwSubcontractor> list = new ArrayList<>();
|
|
List<HwSubcontractor> list = new ArrayList<>();
|
|
|
if (jsonObjectResult != null) {
|
|
if (jsonObjectResult != null) {
|
|
@@ -870,7 +875,13 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
hwElectronicContractDto.setTransactionNo(flowIds[0]);
|
|
hwElectronicContractDto.setTransactionNo(flowIds[0]);
|
|
|
hwElectronicContractDto.setStatus(0);
|
|
hwElectronicContractDto.setStatus(0);
|
|
|
hwElectronicContractDto.setViewUrl(signUrl);
|
|
hwElectronicContractDto.setViewUrl(signUrl);
|
|
|
|
|
+ //类型(0:企业-企业/平台 1:企业-用户)
|
|
|
|
|
+ hwElectronicContractDto.setType(1);
|
|
|
hwElectronicContractService.save(hwElectronicContractDto);
|
|
hwElectronicContractService.save(hwElectronicContractDto);
|
|
|
|
|
+ // 更新订单表电签信息
|
|
|
|
|
+ hwOrder.setElectronicContractId(hwElectronicContractDto.getId());
|
|
|
|
|
+ hwOrder.setElectronicContractStatus(0);
|
|
|
|
|
+ hwOrderService.updateById(hwOrder);
|
|
|
returnMap.put("url", signUrl);
|
|
returnMap.put("url", signUrl);
|
|
|
} else {
|
|
} else {
|
|
|
returnMap.put("success", "1030");
|
|
returnMap.put("success", "1030");
|
|
@@ -1213,7 +1224,7 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
if (!HwElectronicEnum.ALL.getStatus().equals(oldStatus)
|
|
if (!HwElectronicEnum.ALL.getStatus().equals(oldStatus)
|
|
|
&& HwElectronicEnum.ALL.getStatus().equals(status)) {
|
|
&& HwElectronicEnum.ALL.getStatus().equals(status)) {
|
|
|
log.info("签署完成,确认订单");
|
|
log.info("签署完成,确认订单");
|
|
|
- this.contractSync(hwElectronicContract);
|
|
|
|
|
|
|
+ hwOrderService.contractSync(hwElectronicContract);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1225,15 +1236,19 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
*
|
|
*
|
|
|
* @param hwElectronicContract
|
|
* @param hwElectronicContract
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @Override
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
|
|
public void contractSync(HwElectronicContract hwElectronicContract) {
|
|
public void contractSync(HwElectronicContract hwElectronicContract) {
|
|
|
// 查询该订单
|
|
// 查询该订单
|
|
|
HwOrder hwOrder = baseMapper.getByElectronicContractId(hwElectronicContract.getId());
|
|
HwOrder hwOrder = baseMapper.getByElectronicContractId(hwElectronicContract.getId());
|
|
|
if (hwOrder != null) {
|
|
if (hwOrder != null) {
|
|
|
|
|
+ hwOrder.setElectronicContractStatus(2);
|
|
|
hwOrder.setStatus(2);
|
|
hwOrder.setStatus(2);
|
|
|
- this.updateById(hwOrder);
|
|
|
|
|
|
|
+ hwOrderService.updateById(hwOrder);
|
|
|
// 同步订单明细表
|
|
// 同步订单明细表
|
|
|
HwOrderProcessDetail hwOrderProcessDetail = new HwOrderProcessDetail();
|
|
HwOrderProcessDetail hwOrderProcessDetail = new HwOrderProcessDetail();
|
|
|
|
|
+ hwOrderProcessDetail.setRequirementId(hwOrder.getRequirementId());
|
|
|
|
|
+ hwOrderProcessDetail.setUserId(hwOrder.getUserId());
|
|
|
hwOrderProcessDetail.setOrderId(hwOrder.getId());
|
|
hwOrderProcessDetail.setOrderId(hwOrder.getId());
|
|
|
hwOrderProcessDetail.setStatus(hwOrder.getStatus());
|
|
hwOrderProcessDetail.setStatus(hwOrder.getStatus());
|
|
|
hwOrderProcessDetail.setGenerateTime(new Date());
|
|
hwOrderProcessDetail.setGenerateTime(new Date());
|
|
@@ -1241,7 +1256,7 @@ public class HwOrderServiceImpl extends ServiceImpl<HwOrderMapper, HwOrder> impl
|
|
|
hwOrderProcessDetail.setSysOrgCode(hwOrder.getSysOrgCode());
|
|
hwOrderProcessDetail.setSysOrgCode(hwOrder.getSysOrgCode());
|
|
|
hwOrderProcessDetailService.save(hwOrderProcessDetail);
|
|
hwOrderProcessDetailService.save(hwOrderProcessDetail);
|
|
|
// 同步慧盈订单状态
|
|
// 同步慧盈订单状态
|
|
|
- this.updateStatus(hwOrder);
|
|
|
|
|
|
|
+ hwOrderService.updateStatus(hwOrder);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|