|
|
@ -42,6 +42,8 @@ import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.busvehicleorder.AppOrderReadyCar; |
|
|
|
import com.yxt.anrui.base.api.busvehicleorder.BusVehicleOrderFeign; |
|
|
|
import com.yxt.anrui.base.api.busvehicleorder.BusVehicleOrderVo; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractBuscenterVo; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousDto; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.*; |
|
|
@ -166,6 +168,8 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private BusSalesOrderSubmitService busSalesOrderSubmitService; |
|
|
|
@Autowired |
|
|
|
private CommonContractFeign commonContractFeign; |
|
|
|
|
|
|
|
/** |
|
|
|
* 构造查询条件 |
|
|
@ -360,7 +364,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
if (StringUtils.isNotBlank(platformNo)) { |
|
|
|
if (StringUtils.isNotBlank(lockingNum)) { |
|
|
|
useNum = Integer.parseInt(platformNo) - Integer.parseInt(lockingNum); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
useNum = Integer.parseInt(platformNo); |
|
|
|
} |
|
|
|
} |
|
|
@ -851,7 +855,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.FINISH.getCode()); |
|
|
|
//更新销售订单的状态为已通过的状态:审批通过1
|
|
|
|
//ToDo:
|
|
|
|
updateStateByBusinessSid(1, variables.get("businessSid").toString()); |
|
|
|
updateStateByBusinessSid(2, variables.get("businessSid").toString()); |
|
|
|
//通过后新增合同表中的信息。
|
|
|
|
|
|
|
|
|
|
|
@ -866,7 +870,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
/** |
|
|
|
* 更新销售订单的状态 |
|
|
|
* |
|
|
|
* @param state 状态,审批通过1,不通过2 |
|
|
|
* @param state 状态,审批通过2,不通过3 |
|
|
|
* @param businessSid |
|
|
|
*/ |
|
|
|
private void updateStateByBusinessSid(int state, String businessSid) { |
|
|
@ -897,12 +901,8 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
public ResultBean breakProcess(BusSalesOrderFlowDto dto) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(dto, flowTaskVo); |
|
|
|
//查询是否是最后一步
|
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(dto.getInstanceId()); |
|
|
|
if (listResultBean.getData().size() == 0) { |
|
|
|
//更新销售订单的状态为不通过
|
|
|
|
updateStateByBusinessSid(2, dto.getBusinessSid()); |
|
|
|
} |
|
|
|
//更新销售订单的状态为不通过
|
|
|
|
updateStateByBusinessSid(3, dto.getBusinessSid()); |
|
|
|
ResultBean resultBean = flowTaskFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
@ -1079,33 +1079,52 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
IPage<BusSalesOrder> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<AppBusSalesOrderVo> pagging = baseMapper.getSaleOrders(page, qw); |
|
|
|
for (AppBusSalesOrderVo record : pagging.getRecords()) { |
|
|
|
String saleOrderState = record.getSaleOrderState(); |
|
|
|
if (StringUtils.isNotBlank(saleOrderState)) { |
|
|
|
record.setShowUpdateBtn(false); |
|
|
|
record.setShowFinancialBtn(false); |
|
|
|
record.setShowDeleteBtn(false); |
|
|
|
} |
|
|
|
if (saleOrderState.equals("审批完成")) { |
|
|
|
record.setShowContractBtn(true); |
|
|
|
} else { |
|
|
|
record.setShowContractBtn(false); |
|
|
|
} |
|
|
|
int deposit = 0; |
|
|
|
if (StringUtils.isNotBlank(record.getDeposit())) { |
|
|
|
deposit = new Integer(record.getDeposit()); |
|
|
|
//根据销售订单sid查询是否有合同,有合同的话,查询合同是否审核。且需补交订金是否为0
|
|
|
|
String sid = record.getSid(); |
|
|
|
ResultBean<CommonContractBuscenterVo> buscenterVoResultBean = commonContractFeign.selectByBusSid(sid); |
|
|
|
//合同是否已审核通过
|
|
|
|
boolean isTrue = false; |
|
|
|
if (buscenterVoResultBean.getSuccess()) { |
|
|
|
Integer state = buscenterVoResultBean.getData().getState(); |
|
|
|
if (state == 2) { |
|
|
|
isTrue = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (saleOrderState.equals("审批完成") || deposit <= 0) { |
|
|
|
record.setShowApplyBtn(true); |
|
|
|
} else { |
|
|
|
record.setShowApplyBtn(false); |
|
|
|
//已交定金
|
|
|
|
String deposit = "-"; |
|
|
|
BigDecimal depositBig = new BigDecimal("0"); |
|
|
|
if (StringUtils.isNotBlank(record.getDepositAll())) { |
|
|
|
//需补交订金
|
|
|
|
if (StringUtils.isNotBlank(record.getMakeUpDeposit())) { |
|
|
|
depositBig = new BigDecimal(record.getDepositAll()).subtract(new BigDecimal(record.getMakeUpDeposit())); |
|
|
|
if ("0".equals(record.getMakeUpDeposit())) { |
|
|
|
if (isTrue) { |
|
|
|
record.setShowApplyBtn(true); |
|
|
|
} else { |
|
|
|
record.setShowApplyBtn(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
depositBig = new BigDecimal(record.getDepositAll()); |
|
|
|
if (isTrue) { |
|
|
|
record.setShowApplyBtn(true); |
|
|
|
} else { |
|
|
|
record.setShowApplyBtn(false); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//将已交订金转为string
|
|
|
|
deposit = depositBig.toString(); |
|
|
|
} |
|
|
|
AppModelInfo appModelInfo = baseMapper.selectModelInfoByOrderSid(record.getSaleOrderSid()); |
|
|
|
record.setDeposit(deposit); |
|
|
|
//查询车型信息
|
|
|
|
/* AppModelInfo appModelInfo = baseMapper.selectModelInfoByOrderSid(record.getSaleOrderSid()); |
|
|
|
if (appModelInfo == null) { |
|
|
|
AppModelInfo modelInfo = new AppModelInfo(); |
|
|
|
record.setModelInfo(modelInfo); |
|
|
|
} else { |
|
|
|
record.setModelInfo(appModelInfo); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
} |
|
|
|
PagerVo<AppBusSalesOrderVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|