Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
God 2 years ago
parent
commit
a759639e53
  1. 2
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderDetailsVo.java
  2. 94
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java
  3. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderMapper.xml
  4. 3
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderDetailsVo.java

2
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderDetailsVo.java

@ -143,5 +143,7 @@ public class AppOrderDetailsVo implements Vo {
@ApiModelProperty("是否显示分享和评论")
private boolean showShareAndComment;
private String procDefId;
}

94
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -85,6 +85,7 @@ import com.yxt.anrui.flowable.api.flow.FlowableFeign;
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo;
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign;
@ -531,14 +532,6 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
return rb.setMsg(resultBean.getMsg());
}
String sid = resultBean.getData();
/*//将待出库中的车辆更改状态为出库申请0
List<String> stringList = busDeliveredApplyDetailsService.selectVinByApplySid(sid);
for (int i = 0; i < stringList.size(); i++) {
String vinNo = stringList.get(i);
busDeliveredService.updateState(vinNo, 0);
}
//更改申请的状态为待审核2
baseMapper.updateStateBySid(2, sid);*/
String businessSid = resultBean.getData();
//创建BusinessVariables实体对象
BusinessVariables bv = new BusinessVariables();
@ -581,14 +574,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
bv.setTaskDefKey(busDeliveredApply.getTaskDefKey());
bv.setComment("重新提交");
bv.setInstanceId(dto.getInstanceId());
//将待出库中的车辆更改状态为出库申请0
List<String> stringList = busDeliveredApplyDetailsService.selectVinByApplySid(sid);
for (int i = 0; i < stringList.size(); i++) {
String vinNo = stringList.get(i);
busDeliveredService.updateState(vinNo, 0);
}
//更改申请的状态为待审核2
baseMapper.updateStateBySid(2, sid);
return complete(bv);
}
return rb;
@ -677,8 +663,17 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
log.error("推送数据失败=========================" + e.getMessage());
return rb.setMsg("推送数据失败");
}
} else {
if ("重新提交".equals(bv.getComment())) {
//将待出库中的车辆更改状态为出库申请0
List<String> stringList = busDeliveredApplyDetailsService.selectVinByApplySid(bv.getBusinessSid());
for (int i = 0; i < stringList.size(); i++) {
String vinNo = stringList.get(i);
busDeliveredService.updateState(vinNo, 0);
}
//更改申请的状态为待审核2
baseMapper.updateStateBySid(2, bv.getBusinessSid());
}
}
return rb.success().setData(resultBean.getData());
} else {
@ -822,9 +817,23 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
if ("1".equals(busDeliveredApply.getPaymentMethodKey())) {
baseVehicleZSOutApplyDto.setSaleTypeKey("001");
baseVehicleZSOutApplyDto.setSaleTypeValue("全款车");
baseVehicleZSOutApplyDto.setCustomerName(busDeliveredApply.getName());
baseVehicleZSOutApplyDto.setCustomerSid(busDeliveredApply.getCustomerSid());
//客户编码
ResultBean<CrmCustomerTempVo> crmCustomerTempVoResultBean = crmCustomerTempFeign.fetchSid(busDeliveredApply.getCustomerSid());
if (crmCustomerTempVoResultBean.getData() != null) {
baseVehicleZSOutApplyDto.setCustomerNo(crmCustomerTempVoResultBean.getData().getCustomerNo());
}
} else {
baseVehicleZSOutApplyDto.setSaleTypeKey("002");
baseVehicleZSOutApplyDto.setSaleTypeValue("贷款车");
baseVehicleZSOutApplyDto.setCustomerName(busDeliveredApply.getLoanName());
baseVehicleZSOutApplyDto.setCustomerSid(busDeliveredApply.getLoanSid());
//客户编码
ResultBean<CrmCustomerTempVo> crmCustomerTempVoResultBean = crmCustomerTempFeign.fetchSid(busDeliveredApply.getLoanSid());
if (crmCustomerTempVoResultBean.getData() != null) {
baseVehicleZSOutApplyDto.setCustomerNo(crmCustomerTempVoResultBean.getData().getCustomerNo());
}
}
baseVehicleZSOutApplyDto.setSaleDate(DateUtil.today());
baseVehicleZSOutApplyDto.setOrgSid(busDeliveredApply.getStaffDeptSid());
@ -834,9 +843,9 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
baseVehicleZSOutApplyDto.setStaffName(busDeliveredApply.getStaffName());
baseVehicleZSOutApplyDto.setCustomerName(busDeliveredApply.getName());
baseVehicleZSOutApplyDto.setMobile(busDeliveredApply.getMobile());
baseVehicleZSOutApplyDto.setCustomerSid(busDeliveredApply.getCustomerSid());
//总成交价
baseVehicleZSOutApplyDto.setTotalDealPrice(new BigDecimal(busDeliveredApply.getPrice()).multiply(new BigDecimal(detailsList.size())).toString());
baseVehicleZSOutApplyDto.setCreateOrgSid(busDeliveredApply.getUseOrgSid());
@ -851,11 +860,7 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
//合同编号
baseVehicleZSOutApplyDto.setContractNo(busDeliveredApply.getContractNo());
//客户编码
ResultBean<CrmCustomerTempVo> crmCustomerTempVoResultBean = crmCustomerTempFeign.fetchSid(busDeliveredApply.getCustomerSid());
if (crmCustomerTempVoResultBean.getData() != null) {
baseVehicleZSOutApplyDto.setCustomerNo(crmCustomerTempVoResultBean.getData().getCustomerNo());
}
//实际购车人key
baseVehicleZSOutApplyDto.setBuyerTypeKey(busDeliveredApply.getTypeKey());
baseVehicleZSOutApplyDto.setBuyerTypeValue(busDeliveredApply.getType());
@ -972,10 +977,17 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData());
//更新业务中的流程相关的参数
updateFlowFiled(map);
//将该申请的车架号的待出库中的状态修改为出库中
List<String> vinSidList = busDeliveredApplyDetailsService.selectVinSidByApplySid(query.getBusinessSid());
//更新该合同的该车架号的状态为1
busDeliveredService.updateStateByContractNo(busDeliveredApply.getContractNo(), vinSidList, 1);
busDeliveredApply = fetchBySid(query.getBusinessSid());
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(busDeliveredApply.getProcInstId());
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_();
String nextName = listResultBean.getData().get(0).getName_();
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(","));
if ("发起申请".equals(nextName)) {
List<String> vinSidList = busDeliveredApplyDetailsService.selectVinSidByApplySid(query.getBusinessSid());
//更新该合同的该车架号的状态为1
busDeliveredService.updateStateByContractNo(busDeliveredApply.getContractNo(), vinSidList, 1);
}
return rb.success();
}
}
@ -990,7 +1002,6 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
* @return
*/
public ResultBean revokeProcess(BusDeliveredApplyTaskQuery query) {
ResultBean rb = ResultBean.fireFail();
if (StringUtils.isBlank(query.getUserSid())) {
return rb.setMsg("参数错误:userSid");
@ -1008,10 +1019,17 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
baseMapper.updateStateBySid(1, query.getBusinessSid());
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData()));
//将该申请的车架号的待出库中的状态修改为出库中
List<String> vinSidList = busDeliveredApplyDetailsService.selectVinSidByApplySid(query.getBusinessSid());
//更新该合同的该车架号的状态为0
busDeliveredService.updateStateByContractNo(busDeliveredApply.getContractNo(), vinSidList, 1);
busDeliveredApply = fetchBySid(query.getBusinessSid());
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(busDeliveredApply.getProcInstId());
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_();
String nextName = listResultBean.getData().get(0).getName_();
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(","));
if ("发起申请".equals(nextName)) {
List<String> vinSidList = busDeliveredApplyDetailsService.selectVinSidByApplySid(query.getBusinessSid());
//更新该合同的该车架号的状态为1
busDeliveredService.updateStateByContractNo(busDeliveredApply.getContractNo(), vinSidList, 1);
}
return rb.success().setData(resultBean.getData());
}
}
@ -1045,9 +1063,8 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
baseMapper.updateStateBySid(4, query.getBusinessSid());
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData()));
//将该申请的车架号的待出库中的状态修改为出库中
List<String> vinSidList = busDeliveredApplyDetailsService.selectVinSidByApplySid(query.getBusinessSid());
//更新该合同的该车架号的状态为0
//更新该合同的该车架号的状态为1
busDeliveredService.updateStateByContractNo(busDeliveredApply.getContractNo(), vinSidList, 1);
return rb.success().setData(resultBean.getData());
}
@ -1262,15 +1279,11 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
busDeliveredUseMessageService.insert(busDeliveredUseMessage);
busDeliveredApplyDetails.setUseMessageSid(busDeliveredUseMessage.getSid());
}
}
busDeliveredApplyDetailsService.insert(busDeliveredApplyDetails);
}
baseMapper.insert(busDeliveredApply);
sid = busDeliveredApply.getSid();
} else {
//根据出库申请sid查询出库申请是否存在
BusDeliveredApply busDeliveredApply = fetchBySid(sid);
@ -1348,7 +1361,6 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
busDeliveredDetailsDiscount.setDiscountExplain(busDeliveredDetailsDiscountsVo.getDiscountInfo());
//数量
BusSalesOrderDiscount busSalesOrderDiscount = busSalesOrderDiscountService.fetchBySid(busDeliveredDetailsDiscountsVo.getDiscountSid());
// busDeliveredDetailsDiscount.setNum(busDeliveredDetailsDiscountsVo.getTotalNum());
busDeliveredDetailsDiscount.setNum(busSalesOrderDiscount.getNum());
//本次赠送数量
busDeliveredDetailsDiscount.setGiveNum(busDeliveredDetailsDiscountsVo.getDiscountNum());

4
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderMapper.xml

@ -222,7 +222,9 @@
bo.purchaseSystemName,
bo.imagesFile,
bo.contractNo contractId,
bo.financePlan
bo.financePlan,
procDefId,
nodeId as taskDefKey
from bus_sales_order bo
where sid = #{sid}
</select>

3
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderDetailsVo.java

@ -110,5 +110,8 @@ public class OrderDetailsVo implements Vo {
@ApiModelProperty("是否显示分享和评论")
private boolean showShareAndComment;
private String procDefId;
private String taskDefKey;
}

Loading…
Cancel
Save