|
|
@ -32,6 +32,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelVo; |
|
|
|
import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.AppBusDepositBusDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.BusDeposit; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositcustomer.AppBusDepositCustomerListDto; |
|
|
@ -88,10 +91,12 @@ import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.xml.crypto.Data; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
@ -184,7 +189,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.and(wrapper -> wrapper.like("bd.draweeName", query.getName()).or().like("bdv.customerName", query.getName())); |
|
|
|
qw.and(wrapper -> wrapper.like("bd.draweeName", query.getName()).or().like("bdvc.customerName", query.getName())); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getStartTime())) { |
|
|
@ -702,70 +707,94 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean |
|
|
|
saveDepositInfo(AppBusDepositBuscenterDto dto) { |
|
|
|
public ResultBean<String> saveDepositInfo(AppBusDepositBuscenterDto dto) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.getUseOrgByUserSid(dto.getUserSid()).getData(); |
|
|
|
Date date = new Date(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData(); |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
//判断订单sid是否有值(无值 新增 有值 修改)
|
|
|
|
if (StringUtils.isBlank(dto.getVirtualOrderSid())) { //新增
|
|
|
|
BusMainDeposit busMainDeposit = new BusMainDeposit(); |
|
|
|
busMainDeposit.setSid(UUID.randomUUID().toString()); |
|
|
|
Map<String, String> map = generateBillNo(dto.getUserSid()); |
|
|
|
busMainDeposit.setBillNo(map.get("billNo_Num")); |
|
|
|
busMainDeposit.setBillNo(getApplyCode1(dto)); |
|
|
|
busMainDeposit.setStaffSid(data.getStaffSid()); |
|
|
|
busMainDeposit.setStaffName(data.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(data.getOrgSid()); |
|
|
|
busMainDeposit.setStaffName(dto.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(useOrgSid); |
|
|
|
busMainDeposit.setOrgName(dto.getDepartmentName()); |
|
|
|
busMainDeposit.setCreateBySid(dto.getUserSid()); |
|
|
|
busMainDeposit.setOrgName(sysOrganizationVo.getName() + "-" + data.getOrgName()); |
|
|
|
busMainDeposit.setDepositBillType("订金收取"); |
|
|
|
busMainDeposit.setDepositBillTypeKey("01"); |
|
|
|
busMainDeposit.setCreateDate(dateFormat.format(date)); |
|
|
|
busMainDeposit.setCreateDate(dateFormat.format(new Date())); |
|
|
|
baseMapper.insert(busMainDeposit); |
|
|
|
BusDeposit busDeposit = new BusDeposit(); |
|
|
|
busDeposit.setBillNo(busMainDeposit.getBillNo()); |
|
|
|
busDeposit.setBillSid(busMainDeposit.getSid()); |
|
|
|
busDeposit.setStaffSid(busMainDeposit.getStaffSid()); |
|
|
|
busDeposit.setStaffName(data.getStaffName()); |
|
|
|
busDeposit.setOrgSid(data.getOrgSid()); |
|
|
|
busDeposit.setOrgName(sysOrganizationVo.getName() + "-" + data.getOrgName()); |
|
|
|
busDeposit.setCreateDate(dateFormat.format(date)); |
|
|
|
busDeposit.setStaffName(busMainDeposit.getStaffName()); |
|
|
|
busDeposit.setOrgSid(busMainDeposit.getOrgSid()); |
|
|
|
busDeposit.setCreateDate(dateFormat.format(new Date())); |
|
|
|
setBusDeposit(busDeposit, dto); |
|
|
|
//付款凭证
|
|
|
|
busDeposit.setPaymentProof(parsePaymentProofList(dto.getPayImages())); |
|
|
|
busDepositService.insert(busDeposit); |
|
|
|
//添加客户信息
|
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("添加成功"); |
|
|
|
return rb.success().setData(busMainDeposit.getSid()); |
|
|
|
} else { //修改
|
|
|
|
BusMainDeposit busMainDeposit = baseMapper.selectBySid(dto.getVirtualOrderSid()); |
|
|
|
String nodeState = busMainDeposit.getNodeState(); |
|
|
|
if (StringUtils.isBlank(nodeState)) { //判断订单状态是否是未提交和拨回到发起人状态
|
|
|
|
BusDeposit busDeposit = busDepositService.selectByBillSid(dto.getVirtualOrderSid()); |
|
|
|
//付款凭证
|
|
|
|
busDeposit.setPaymentProof(parsePaymentProofList(dto.getPayImages())); |
|
|
|
busDeposit.setCreateDate(dateFormat.format(date)); |
|
|
|
busDeposit.setCollectionBankSid(dto.getCollectionBankSid()); |
|
|
|
setBusDeposit(busDeposit, dto); |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
} else if (nodeState.equals("待提交") && nodeState.equals("已驳回")) { |
|
|
|
BusDeposit busDeposit = busDepositService.selectByBillSid(dto.getVirtualOrderSid()); |
|
|
|
//付款凭证
|
|
|
|
busDeposit.setPaymentProof(parsePaymentProofList(dto.getPayImages())); |
|
|
|
busDeposit.setCreateDate(dateFormat.format(date)); |
|
|
|
busDeposit.setCollectionBankSid(dto.getCollectionBankSid()); |
|
|
|
setBusDeposit(busDeposit, dto); |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
if (busMainDeposit == null) { |
|
|
|
return rb.setMsg("该订单不存在"); |
|
|
|
} |
|
|
|
return new ResultBean().fail().setMsg("已提交办理审批中不可修改!"); |
|
|
|
BusDeposit busDeposit = busDepositService.selectByBillSid(dto.getVirtualOrderSid()); |
|
|
|
//付款凭证
|
|
|
|
busDeposit.setPaymentProof(parsePaymentProofList(dto.getPayImages())); |
|
|
|
busDeposit.setCreateDate(dateFormat.format(new Date())); |
|
|
|
busDeposit.setCollectionBankSid(dto.getCollectionBankSid()); |
|
|
|
setBusDeposit(busDeposit, dto); |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return rb.success().setData(busMainDeposit.getSid()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public String getApplyCode1(AppBusDepositBuscenterDto dto) { |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
//获取分公司sid
|
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getPathSidByUserSid(userSid); |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(resultBean.getData()); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.JYDDDJSQ.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
public String getApplyCode2(AppBusDepositVehicleDto dto) { |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
//获取分公司sid
|
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getPathSidByUserSid(userSid); |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(resultBean.getData()); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.JYDDCLYD.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -776,13 +805,12 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public BusDeposit setBusDeposit(BusDeposit busDeposit, AppBusDepositBuscenterDto dto) { |
|
|
|
BeanUtils.copyProperties(dto, busDeposit, "sid"); |
|
|
|
busDeposit.setDraweeName(dto.getPayName()); |
|
|
|
busDeposit.setProBankAccKey(dto.getCollectionNumberKey()); |
|
|
|
busDeposit.setProBankAccValue(dto.getCollectionNumber()); |
|
|
|
busDeposit.setProBankValue(dto.getCollectionBank()); |
|
|
|
busDeposit.setProBankKey(dto.getCollectionBankKey()); |
|
|
|
busDeposit.setPayTypeKey(dto.getPayTypeKey()); |
|
|
|
busDeposit.setPayType(dto.getPayType()); |
|
|
|
if ("03".equals(dto.getPayTypeKey())) { |
|
|
|
busDeposit.setPayBankAcc(dto.getPayNumber()); |
|
|
|
} else { |
|
|
@ -791,9 +819,6 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDeposit.setPaymentDate(dto.getPayDate()); |
|
|
|
busDeposit.setVehicleNum(dto.getCarNumber()); |
|
|
|
busDeposit.setDraweeMobile(dto.getMobile()); |
|
|
|
busDeposit.setDeposit(dto.getDeposit()); |
|
|
|
busDeposit.setRemarks(dto.getRemarks()); |
|
|
|
busDeposit.setCollectionBankSid(dto.getCollectionBankSid()); |
|
|
|
return busDeposit; |
|
|
|
} |
|
|
|
|
|
|
@ -841,41 +866,41 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitMainDespoitApprove(BusDepositDto dto) { |
|
|
|
String orgSid = checkUserOrg(dto.getUserSid()); |
|
|
|
// String businessSid = dto.getSid();
|
|
|
|
ResultBean resultBean1 = saveOrUpdateDeposit(dto); |
|
|
|
String businessSid = resultBean1.getData().toString(); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
variables.put("isLoan", true); |
|
|
|
variables.put("orgSid", orgSid);//部门sid
|
|
|
|
ResultBean resultBean = flowableService.businessStart(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId(), dto.getUserSid(), variables); |
|
|
|
if (resultBean.getSuccess() && resultBean.getData() != null) { |
|
|
|
Map<String, String> map = (Map<String, String>) resultBean.getData(); |
|
|
|
/*saveSysFormLink(map);*/ |
|
|
|
//更新虚拟订单审批(订金)业务表中的流程状态
|
|
|
|
modifiBusMainDepositFlowState(businessSid, |
|
|
|
ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId(),//procDefId
|
|
|
|
map.get("nodeState"),//state
|
|
|
|
map.get("procInsId"),//procInstSid
|
|
|
|
map.get("taskDefKey")//nodeSid
|
|
|
|
); |
|
|
|
} |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
|
|
|
|
private void modifiBusMainDepositFlowState(String businessSid, |
|
|
|
String proDefId,//procDefId
|
|
|
|
String nodeState,//state
|
|
|
|
String procInsId,//procInstSid
|
|
|
|
String taskDefKey//nodeSid
|
|
|
|
) { |
|
|
|
baseMapper.modifiBusDepositFlowState(businessSid, |
|
|
|
proDefId,//procDefId
|
|
|
|
nodeState,//state
|
|
|
|
procInsId,//procInstSid
|
|
|
|
taskDefKey); |
|
|
|
} |
|
|
|
// String orgSid = checkUserOrg(dto.getUserSid());
|
|
|
|
// // String businessSid = dto.getSid();
|
|
|
|
// ResultBean resultBean1 = saveOrUpdateDeposit(dto);
|
|
|
|
// String businessSid = resultBean1.getData().toString();
|
|
|
|
// Map<String, Object> variables = new HashMap<>();
|
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
// variables.put("isLoan", true);
|
|
|
|
// variables.put("orgSid", orgSid);//部门sid
|
|
|
|
// ResultBean resultBean = flowableService.businessStart(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId(), dto.getUserSid(), variables);
|
|
|
|
// if (resultBean.getSuccess() && resultBean.getData() != null) {
|
|
|
|
// Map<String, String> map = (Map<String, String>) resultBean.getData();
|
|
|
|
// /*saveSysFormLink(map);*/
|
|
|
|
// //更新虚拟订单审批(订金)业务表中的流程状态
|
|
|
|
// modifiBusMainDepositFlowState(businessSid,
|
|
|
|
// ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId(),//procDefId
|
|
|
|
// map.get("nodeState"),//state
|
|
|
|
// map.get("procInsId"),//procInstSid
|
|
|
|
// map.get("taskDefKey")//nodeSid
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
return new ResultBean(); |
|
|
|
} |
|
|
|
|
|
|
|
// private void modifiBusMainDepositFlowState(String businessSid,
|
|
|
|
// String proDefId,//procDefId
|
|
|
|
// String nodeState,//state
|
|
|
|
// String procInsId,//procInstSid
|
|
|
|
// String taskDefKey//nodeSid
|
|
|
|
// ) {
|
|
|
|
// baseMapper.modifiBusDepositFlowState(businessSid,
|
|
|
|
// proDefId,//procDefId
|
|
|
|
// nodeState,//state
|
|
|
|
// procInsId,//procInstSid
|
|
|
|
// taskDefKey);
|
|
|
|
// }
|
|
|
|
/*public ResultBean submitMainDespoitApprove(BusDepositDto dto) { |
|
|
|
String orgSid = checkUserOrg(dto.getUserSid()); |
|
|
|
String businessSid = ""; |
|
|
@ -962,37 +987,37 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitMainDespoitVehicleApprove(BusMainDepositVehicleDto dto) { |
|
|
|
String orgSid = checkUserOrg(dto.getUserSid()); |
|
|
|
String businessSid = ""; |
|
|
|
if (StringUtils.isBlank(orgSid)) { |
|
|
|
return new ResultBean().fail().setMsg("用户组织机构不能为空"); |
|
|
|
} |
|
|
|
// 验证
|
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|
// 调用保存接口
|
|
|
|
ResultBean resultBean = saveDepositVehicle(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean.setMsg("提交失败"); |
|
|
|
} |
|
|
|
businessSid = resultBean.getData().toString(); |
|
|
|
} else { |
|
|
|
// 调用更新接口
|
|
|
|
ResultBean resultBean = updateDepositVehicle(dto, dto.getSid()); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean.setMsg("提交失败"); |
|
|
|
} |
|
|
|
businessSid = dto.getSid(); |
|
|
|
} |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
variables.put("isLoan", true); |
|
|
|
variables.put("orgSid", orgSid); |
|
|
|
ResultBean resultBean = flowableService.businessStart(ProcDefEnum.ORDERDEPOSITVEHICLEAPPROVE.getProDefId(), dto.getUserSid(), variables); |
|
|
|
if (resultBean.getSuccess() && resultBean.getData() != null) { |
|
|
|
Map<String, String> map = (Map<String, String>) resultBean.getData(); |
|
|
|
saveSysFormLink(map); |
|
|
|
} |
|
|
|
return resultBean; |
|
|
|
// String orgSid = checkUserOrg(dto.getUserSid());
|
|
|
|
// String businessSid = "";
|
|
|
|
// if (StringUtils.isBlank(orgSid)) {
|
|
|
|
// return new ResultBean().fail().setMsg("用户组织机构不能为空");
|
|
|
|
// }
|
|
|
|
// // 验证
|
|
|
|
// if (StringUtils.isBlank(dto.getSid())) {
|
|
|
|
// // 调用保存接口
|
|
|
|
// ResultBean resultBean = saveDepositVehicle(dto);
|
|
|
|
// if (!resultBean.getSuccess()) {
|
|
|
|
// return resultBean.setMsg("提交失败");
|
|
|
|
// }
|
|
|
|
// businessSid = resultBean.getData().toString();
|
|
|
|
// } else {
|
|
|
|
// // 调用更新接口
|
|
|
|
// ResultBean resultBean = updateDepositVehicle(dto, dto.getSid());
|
|
|
|
// if (!resultBean.getSuccess()) {
|
|
|
|
// return resultBean.setMsg("提交失败");
|
|
|
|
// }
|
|
|
|
// businessSid = dto.getSid();
|
|
|
|
// }
|
|
|
|
// Map<String, Object> variables = new HashMap<>();
|
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
// variables.put("isLoan", true);
|
|
|
|
// variables.put("orgSid", orgSid);
|
|
|
|
// ResultBean resultBean = flowableService.businessStart(ProcDefEnum.ORDERDEPOSITVEHICLEAPPROVE.getProDefId(), dto.getUserSid(), variables);
|
|
|
|
// if (resultBean.getSuccess() && resultBean.getData() != null) {
|
|
|
|
// Map<String, String> map = (Map<String, String>) resultBean.getData();
|
|
|
|
// saveSysFormLink(map);
|
|
|
|
// }
|
|
|
|
return new ResultBean(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1128,49 +1153,53 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean reserveCarInfo(AppBusDepositVehicleDto dto) { |
|
|
|
AppUserOrgInfoVo appUserOrgInfoVo = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.getUseOrgByUserSid(dto.getUserSid()).getData(); |
|
|
|
Date date = new Date(); |
|
|
|
public ResultBean<String> reserveCarInfo(AppBusDepositVehicleDto dto) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData(); |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (StringUtils.isBlank(dto.getVirtualOrderSid())) {//新增
|
|
|
|
BusMainDeposit busMainDeposit = new BusMainDeposit(); |
|
|
|
busMainDeposit.setSid(UUID.randomUUID().toString()); |
|
|
|
Map<String, String> map = generateBillNo(dto.getUserSid()); |
|
|
|
busMainDeposit.setBillNo(map.get("billNo_Num")); |
|
|
|
busMainDeposit.setBillNo(getApplyCode2(dto)); |
|
|
|
busMainDeposit.setCreateBySid(dto.getUserSid()); |
|
|
|
busMainDeposit.setStaffSid(appUserOrgInfoVo.getStaffSid()); |
|
|
|
busMainDeposit.setStaffName(appUserOrgInfoVo.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(appUserOrgInfoVo.getOrgSid()); |
|
|
|
busMainDeposit.setOrgName(sysOrganizationVo.getName() + "-" + appUserOrgInfoVo.getOrgName()); |
|
|
|
busMainDeposit.setStaffSid(data.getStaffSid()); |
|
|
|
busMainDeposit.setStaffName(dto.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(useOrgSid); |
|
|
|
busMainDeposit.setOrgName(dto.getDepartmentName()); |
|
|
|
busMainDeposit.setDepositBillType("车辆预订"); |
|
|
|
busMainDeposit.setDepositBillTypeKey("02"); |
|
|
|
busMainDeposit.setCreateDate(dateFormat.format(date)); |
|
|
|
busMainDeposit.setCreateDate(dateFormat.format(new Date())); |
|
|
|
baseMapper.insert(busMainDeposit); |
|
|
|
// 车辆客户信息
|
|
|
|
BusDepositVehicleCustomer customer = new BusDepositVehicleCustomer(); |
|
|
|
String customerSid = dto.getCustomerSid(); |
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = crmCustomerTempFeign.getAppCustomerTempDetailsBySid(customerSid).getData(); |
|
|
|
customer.setCustomerSid(customerSid); |
|
|
|
customer.setCustomerName(dto.getCustomerName()); |
|
|
|
customer.setCustomerMobile(dto.getMobile()); |
|
|
|
BeanUtils.copyProperties(dto, customer, "sid"); |
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = crmCustomerTempFeign.getAppCustomerTempDetailsBySid(customer.getCustomerSid()).getData(); |
|
|
|
customer.setCustomerClass(appCrmCustomerTempInfoVo.getCustomerType()); |
|
|
|
customer.setCustomerClassKey(appCrmCustomerTempInfoVo.getCustomerTypeKey()); |
|
|
|
customer.setCustomerPhoto(appCrmCustomerTempInfoVo.getCustomerPhoto()); |
|
|
|
customer.setCustomerMobile(dto.getMobile()); |
|
|
|
customer.setBillSid(busMainDeposit.getSid()); |
|
|
|
busDepositVehicleCustomerService.save(customer); |
|
|
|
//添加车辆信息
|
|
|
|
appSetBusDepositVehicle(dto, busMainDeposit); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("添加成功"); |
|
|
|
return rb.success().setData(busMainDeposit.getSid()); |
|
|
|
} else {//修改
|
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(dto.getVirtualOrderSid()); |
|
|
|
BeanUtils.copyProperties(dto, busMainDeposit, "sid"); |
|
|
|
baseMapper.updateById(busMainDeposit); |
|
|
|
busDepositVehicleService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
busDepositVehicleCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
BusDepositVehicleCustomer customer = new BusDepositVehicleCustomer(); |
|
|
|
BeanUtils.copyProperties(dto, customer, "sid"); |
|
|
|
AppCrmCustomerTempInfoVo appCrmCustomerTempInfoVo = crmCustomerTempFeign.getAppCustomerTempDetailsBySid(customer.getCustomerSid()).getData(); |
|
|
|
customer.setCustomerClass(appCrmCustomerTempInfoVo.getCustomerType()); |
|
|
|
customer.setCustomerClassKey(appCrmCustomerTempInfoVo.getCustomerTypeKey()); |
|
|
|
customer.setCustomerMobile(dto.getMobile()); |
|
|
|
customer.setBillSid(busMainDeposit.getSid()); |
|
|
|
busDepositVehicleCustomerService.save(customer); |
|
|
|
appSetBusDepositVehicle(dto, busMainDeposit); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
return rb.success().setData(busMainDeposit.getSid()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增/修改虚拟订单订金收取添加车辆信息方法 |
|
|
|
* |
|
|
@ -1905,11 +1934,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
ResultBean<List<AppGetNodeVo>> rb = new ResultBean<>(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
// Map<String, Object> formVariables = query.getFormVariables();
|
|
|
|
//判断流程分支
|
|
|
|
// Map<String, Object> map = IsTrue(formVariables.get("businessSid"));
|
|
|
|
// bv.setFormVariables(map);
|
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId()); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<AppGetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), AppGetNodeVo.class)).collect(Collectors.toList()); |
|
|
@ -1920,11 +1945,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
ResultBean<List<AppGetNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
// Map<String, Object> formVariables = query.getFormVariables();
|
|
|
|
//判断流程分支
|
|
|
|
// Map<String, Object> map = IsTrue(formVariables.get("businessSid"));
|
|
|
|
// bv.setFormVariables(map);
|
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId()); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<AppGetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), AppGetNodeVo.class)).collect(Collectors.toList()); |
|
|
@ -1971,7 +1992,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg("操作失败!"); |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|