|
@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.yxt.anrui.base.api.basediscountpackage.AppDiscountpackageQuery; |
|
|
import com.yxt.anrui.base.api.basediscountpackage.AppDiscountpackageQuery; |
|
|
import com.yxt.anrui.base.api.basediscountpackage.AppDiscountpackageVo; |
|
|
import com.yxt.anrui.base.api.basediscountpackage.AppDiscountpackageVo; |
|
|
|
|
|
import com.yxt.anrui.base.api.basediscountpackage.BaseDiscountpackagePageListVo; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.*; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.*; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.flow.GetNodeQuery; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.flow.GetNodeQuery; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.flow.GetNodeVo; |
|
|
import com.yxt.anrui.base.api.basediscountpackageapply.flow.GetNodeVo; |
|
@ -39,8 +40,15 @@ import com.yxt.anrui.base.api.basediscountpackagelist.AppDiscountpackagelistDeta |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.AppDiscountpackagelistDto; |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.AppDiscountpackagelistDto; |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.BaseDiscountpackagelist; |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.BaseDiscountpackagelist; |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.BaseDiscountpackagelistDto; |
|
|
import com.yxt.anrui.base.api.basediscountpackagelist.BaseDiscountpackagelistDto; |
|
|
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContract; |
|
|
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractFeign; |
|
|
import com.yxt.anrui.base.api.flow.FlowTaskVo; |
|
|
import com.yxt.anrui.base.api.flow.FlowTaskVo; |
|
|
import com.yxt.anrui.base.biz.basediscountpackagelist.BaseDiscountpackagelistService; |
|
|
import com.yxt.anrui.base.biz.basediscountpackagelist.BaseDiscountpackagelistService; |
|
|
|
|
|
import com.yxt.anrui.base.biz.commoncontract.CommonContractService; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandover.BusDiscountpackageHandoverDto; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandover.BusDiscountpackageHandoverFeign; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.busdiscountpackagehandoverlist.BusDiscountpackageHandoverListDto; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
@ -48,6 +56,7 @@ import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUser; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@ -60,10 +69,8 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.List; |
|
|
import java.util.*; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.Optional; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -92,25 +99,63 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
private SysUserFeign sysUserFeign; |
|
|
private SysUserFeign sysUserFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private CommonContractService commonContractService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysUserFeign userFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusDiscountpackageHandoverFeign busDiscountpackageHandoverFeign; |
|
|
|
|
|
|
|
|
private QueryWrapper<BaseDiscountpackageApply> createQueryWrapper(BaseDiscountpackageApplyQuery query) { |
|
|
private QueryWrapper<BaseDiscountpackageApply> createQueryWrapper(BaseDiscountpackageApplyQuery query) { |
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
QueryWrapper<BaseDiscountpackageApply> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<BaseDiscountpackageApply> qw = new QueryWrapper<>(); |
|
|
|
|
|
String orgSid = sysStaffOrgFeign.getPathSidByUserSid(query.getUserSid()).getData(); |
|
|
|
|
|
qw.eq("createOrgSid", orgSid); |
|
|
|
|
|
qw.eq("createBySid",query.getUserSid()); |
|
|
|
|
|
if (StringUtils.isNotBlank(query.getContractId())) { |
|
|
|
|
|
qw.like("contractId", query.getContractId()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
|
|
qw.like("customerName", query.getCustomerName()); |
|
|
|
|
|
} |
|
|
|
|
|
String createStartTime = query.getCreateStartTime(); |
|
|
|
|
|
String createEndTime = query.getCreateEndTime(); |
|
|
|
|
|
qw.apply(StringUtils.isNotEmpty(createStartTime), "date_format (applyDate,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
|
|
|
|
|
apply(StringUtils.isNotEmpty(createEndTime), "date_format (applyDate,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
|
|
|
|
|
); |
|
|
return qw; |
|
|
return qw; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public PagerVo<BaseDiscountpackageApplyVo> listPageVo(PagerQuery<BaseDiscountpackageApplyQuery> pq) { |
|
|
public PagerVo<BaseDiscountpackageApplyVo> listPageVo(PagerQuery<BaseDiscountpackageApplyQuery> pq) { |
|
|
BaseDiscountpackageApplyQuery query = pq.getParams(); |
|
|
BaseDiscountpackageApplyQuery query = pq.getParams(); |
|
|
QueryWrapper<BaseDiscountpackageApply> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<BaseDiscountpackageApply> qw = createQueryWrapper(query); |
|
|
|
|
|
|
|
|
IPage<BaseDiscountpackageApply> page = PagerUtil.queryToPage(pq); |
|
|
IPage<BaseDiscountpackageApply> page = PagerUtil.queryToPage(pq); |
|
|
IPage<BaseDiscountpackageApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
IPage<BaseDiscountpackageApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
|
|
List<BaseDiscountpackageApplyVo> records = pagging.getRecords(); |
|
|
|
|
|
if (null != records) { |
|
|
|
|
|
for (BaseDiscountpackageApplyVo applyVo : records) { |
|
|
|
|
|
applyVo.setShowHandleBtn(true); |
|
|
|
|
|
if (StringUtils.isNotBlank(applyVo.getNodeState())) { |
|
|
|
|
|
if (!("待提交".equals(applyVo.getNodeState()) || "销售专员申请".equals(applyVo.getNodeState()))) { |
|
|
|
|
|
applyVo.setShowHandleBtn(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
CommonContract contract = commonContractService.selectByNo(applyVo.getContractId()).getData(); |
|
|
|
|
|
if (null != contract) { |
|
|
|
|
|
if (StringUtils.isNotBlank(contract.getBusSid())) { |
|
|
|
|
|
applyVo.setSaleOrderSid(contract.getBusSid()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
PagerVo<BaseDiscountpackageApplyVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
PagerVo<BaseDiscountpackageApplyVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void saveOrUpdateDto(BaseDiscountpackageApplyDto dto){ |
|
|
public void saveOrUpdateDto(BaseDiscountpackageApplyDto dto) { |
|
|
String dtoSid = dto.getSid(); |
|
|
String dtoSid = dto.getSid(); |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
this.insertByDto(dto); |
|
|
this.insertByDto(dto); |
|
@ -119,16 +164,18 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
this.updateByDto(dto); |
|
|
this.updateByDto(dto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String insertByDto(BaseDiscountpackageApplyDto dto){ |
|
|
public String insertByDto(BaseDiscountpackageApplyDto dto) { |
|
|
BaseDiscountpackageApply entity = new BaseDiscountpackageApply(); |
|
|
BaseDiscountpackageApply entity = new BaseDiscountpackageApply(); |
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
entity.setNodeState("待提交"); |
|
|
entity.setNodeState("待提交"); |
|
|
entity.setShowHandleBtn(true); |
|
|
entity.setShowHandleBtn(true); |
|
|
baseMapper.insert(entity); |
|
|
entity.setApplyDate(sdf.format(new Date())); |
|
|
|
|
|
int i = baseMapper.insert(entity); |
|
|
return entity.getSid(); |
|
|
return entity.getSid(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void updateByDto(BaseDiscountpackageApplyDto dto){ |
|
|
public void updateByDto(BaseDiscountpackageApplyDto dto) { |
|
|
String dtoSid = dto.getSid(); |
|
|
String dtoSid = dto.getSid(); |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
return; |
|
|
return; |
|
@ -138,10 +185,13 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
baseMapper.updateById(entity); |
|
|
baseMapper.updateById(entity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public BaseDiscountpackageApplyDetailsVo fetchDetailsVoBySid(String sid){ |
|
|
public BaseDiscountpackageApplyDetailsVo fetchDetailsVoBySid(String sid) { |
|
|
BaseDiscountpackageApply entity = fetchBySid(sid); |
|
|
BaseDiscountpackageApply entity = fetchBySid(sid); |
|
|
BaseDiscountpackageApplyDetailsVo vo = new BaseDiscountpackageApplyDetailsVo(); |
|
|
BaseDiscountpackageApplyDetailsVo vo = new BaseDiscountpackageApplyDetailsVo(); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
|
|
//根据优惠包申请sid查询对应优惠包列表
|
|
|
|
|
|
List<BaseDiscountpackagelistDto> dtoList = baseDiscountpackagelistService.fetchDetailsByDiscountSid(sid); |
|
|
|
|
|
vo.setDiscountPackageList(dtoList); |
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -150,14 +200,15 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
QueryWrapper<AppDiscountpackageVo> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<AppDiscountpackageVo> qw = new QueryWrapper<>(); |
|
|
AppDiscountpackageQuery params = pq.getParams(); |
|
|
AppDiscountpackageQuery params = pq.getParams(); |
|
|
String orgSid = sysStaffOrgFeign.getPathSidByUserSid(params.getUserSid()).getData(); |
|
|
String orgSid = sysStaffOrgFeign.getPathSidByUserSid(params.getUserSid()).getData(); |
|
|
|
|
|
qw.eq("createBySid",params.getUserSid()); |
|
|
qw.eq("createOrgSid", orgSid); |
|
|
qw.eq("createOrgSid", orgSid); |
|
|
qw.eq("state",params.getType()); |
|
|
// qw.eq("state", params.getType());
|
|
|
qw.eq("isDelete",0); |
|
|
qw.eq("isDelete", 0); |
|
|
if (StringUtils.isNotBlank(params.getNames())){ |
|
|
if (StringUtils.isNotBlank(params.getNames())) { |
|
|
qw.and(wrapper -> wrapper.like("contractId", params.getNames()).or().like("customerName", params.getNames())); |
|
|
qw.and(wrapper -> wrapper.like("contractId", params.getNames()).or().like("customerName", params.getNames())); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(params.getDate())){ |
|
|
if (StringUtils.isNotBlank(params.getDate())) { |
|
|
qw.like("applyDate",params.getDate()); |
|
|
qw.like("applyDate", params.getDate()); |
|
|
} |
|
|
} |
|
|
IPage<AppDiscountpackageVo> busOrderDiscountPageListVoIPage = baseMapper.getDiscountManageApplyList(page, qw); |
|
|
IPage<AppDiscountpackageVo> busOrderDiscountPageListVoIPage = baseMapper.getDiscountManageApplyList(page, qw); |
|
|
return busOrderDiscountPageListVoIPage; |
|
|
return busOrderDiscountPageListVoIPage; |
|
@ -180,8 +231,9 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
List<AppDiscountpackagelistDto> appDiscountpackagelists = dto.getDiscountPackageList(); |
|
|
List<AppDiscountpackagelistDto> appDiscountpackagelists = dto.getDiscountPackageList(); |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
BaseDiscountpackageApplyDto baseDiscountpackageApplyDto = new BaseDiscountpackageApplyDto(); |
|
|
BaseDiscountpackageApplyDto baseDiscountpackageApplyDto = new BaseDiscountpackageApplyDto(); |
|
|
BeanUtil.copyProperties(dto,baseDiscountpackageApplyDto); |
|
|
BeanUtil.copyProperties(dto, baseDiscountpackageApplyDto); |
|
|
baseDiscountpackageApplyDto.setOrgSidPath(orgSidPath); |
|
|
baseDiscountpackageApplyDto.setOrgSidPath(orgSidPath); |
|
|
|
|
|
baseDiscountpackageApplyDto.setCreateBySid(dto.getUserSid()); |
|
|
String sid = this.insertByDto(baseDiscountpackageApplyDto); |
|
|
String sid = this.insertByDto(baseDiscountpackageApplyDto); |
|
|
for (AppDiscountpackagelistDto appDiscountpackagelist : appDiscountpackagelists) { |
|
|
for (AppDiscountpackagelistDto appDiscountpackagelist : appDiscountpackagelists) { |
|
|
BaseDiscountpackagelistDto baseDiscountpackagelist = new BaseDiscountpackagelistDto(); |
|
|
BaseDiscountpackagelistDto baseDiscountpackagelist = new BaseDiscountpackagelistDto(); |
|
@ -192,12 +244,12 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
return rb.success().setMsg("添加成功").setData(sid); |
|
|
return rb.success().setMsg("添加成功").setData(sid); |
|
|
} |
|
|
} |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(dtoSid); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(dtoSid); |
|
|
if (baseDiscountpackageApply == null){ |
|
|
if (baseDiscountpackageApply == null) { |
|
|
return rb.setMsg("该优惠包申请不存在"); |
|
|
return rb.setMsg("该优惠包申请不存在"); |
|
|
} |
|
|
} |
|
|
baseDiscountpackagelistService.delByDiscountSid(dtoSid); |
|
|
baseDiscountpackagelistService.delByDiscountSid(dtoSid); |
|
|
BaseDiscountpackageApplyDto baseDiscountpackageApplyDto = new BaseDiscountpackageApplyDto(); |
|
|
BaseDiscountpackageApplyDto baseDiscountpackageApplyDto = new BaseDiscountpackageApplyDto(); |
|
|
BeanUtil.copyProperties(dto,baseDiscountpackageApplyDto); |
|
|
BeanUtil.copyProperties(dto, baseDiscountpackageApplyDto); |
|
|
baseDiscountpackageApplyDto.setOrgSidPath(orgSidPath); |
|
|
baseDiscountpackageApplyDto.setOrgSidPath(orgSidPath); |
|
|
this.updateByDto(baseDiscountpackageApplyDto); |
|
|
this.updateByDto(baseDiscountpackageApplyDto); |
|
|
for (AppDiscountpackagelistDto appDiscountpackagelist : appDiscountpackagelists) { |
|
|
for (AppDiscountpackagelistDto appDiscountpackagelist : appDiscountpackagelists) { |
|
@ -213,12 +265,18 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
AppDiscountpackageApplyDetailsVo appDiscountpackageApplyDetailsVo = new AppDiscountpackageApplyDetailsVo(); |
|
|
AppDiscountpackageApplyDetailsVo appDiscountpackageApplyDetailsVo = new AppDiscountpackageApplyDetailsVo(); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(sid); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(sid); |
|
|
BeanUtil.copyProperties(baseDiscountpackageApply,appDiscountpackageApplyDetailsVo); |
|
|
BeanUtil.copyProperties(baseDiscountpackageApply, appDiscountpackageApplyDetailsVo); |
|
|
List<AppDiscountpackagelistDetailsVo> appDiscountpackagelistDetailsVos = baseDiscountpackagelistService.fetchByDiscountSid(sid); |
|
|
List<AppDiscountpackagelistDetailsVo> appDiscountpackagelistDetailsVos = baseDiscountpackagelistService.fetchByDiscountSid(sid); |
|
|
appDiscountpackageApplyDetailsVo.setAppDiscountpackagelists(appDiscountpackagelistDetailsVos); |
|
|
appDiscountpackageApplyDetailsVo.setAppDiscountpackagelists(appDiscountpackagelistDetailsVos); |
|
|
return rb.success().setData(appDiscountpackageApplyDetailsVo); |
|
|
return rb.success().setData(appDiscountpackageApplyDetailsVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 优惠包提交申请 |
|
|
|
|
|
* |
|
|
|
|
|
* @param dto |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
public ResultBean submitRecordApplication(SubmitBaseDiscountpackageApplyDto dto) { |
|
|
public ResultBean submitRecordApplication(SubmitBaseDiscountpackageApplyDto dto) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(dto.getSid()); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply = fetchBySid(dto.getSid()); |
|
@ -239,8 +297,11 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
//流程中的参数赋值
|
|
|
//流程中的参数赋值
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
//若有网关,则赋值网关中判断的字段。
|
|
|
//若有网关,则赋值网关中判断的字段。
|
|
|
variables.put("businessSid", businessSid); |
|
|
variables.put("businessSid", businessSid); |
|
|
|
|
|
appMap.put("businessSid", businessSid); |
|
|
|
|
|
variables.put("appMap", appMap); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply1 = fetchBySid(businessSid); |
|
|
BaseDiscountpackageApply baseDiscountpackageApply1 = fetchBySid(businessSid); |
|
|
//用户的部门全路径sid
|
|
|
//用户的部门全路径sid
|
|
|
bv.setOrgSidPath(baseDiscountpackageApply1.getOrgSidPath()); |
|
|
bv.setOrgSidPath(baseDiscountpackageApply1.getOrgSidPath()); |
|
@ -297,7 +358,6 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
} else { |
|
|
} else { |
|
|
r = 3; |
|
|
r = 3; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
@ -325,6 +385,59 @@ public class BaseDiscountpackageApplyService extends MybatisBaseService<BaseDisc |
|
|
} |
|
|
} |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
//推送优惠包交接
|
|
|
|
|
|
BusDiscountpackageHandoverDto handoverDto = new BusDiscountpackageHandoverDto(); |
|
|
|
|
|
handoverDto.setBusSid(businessSid); |
|
|
|
|
|
//获取合同编号
|
|
|
|
|
|
String contractId = baseDiscountpackageApply.getContractId(); |
|
|
|
|
|
//根据合同编号获取销售订单sid
|
|
|
|
|
|
CommonContract contract = commonContractService.selectByNo(contractId).getData(); |
|
|
|
|
|
if (null != contract) { |
|
|
|
|
|
if (StringUtils.isNotBlank(contract.getBusSid())) { |
|
|
|
|
|
//销售订单sid
|
|
|
|
|
|
String busSid = contract.getBusSid(); |
|
|
|
|
|
//根据销售订单sid查询车架号
|
|
|
|
|
|
List<String> vinNos = busSalesOrderVehicleFeign.selectList(busSid).getData(); |
|
|
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
|
|
if (null != vinNos && vinNos.size() > 0) { |
|
|
|
|
|
for (String vinNo : vinNos) { |
|
|
|
|
|
sb.append(vinNo).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
sb.delete(sb.length() - 1, sb.length()); |
|
|
|
|
|
handoverDto.setVinNo(sb.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
handoverDto.setRecName(baseDiscountpackageApply.getApplyName()); |
|
|
|
|
|
handoverDto.setContractNo(contractId); |
|
|
|
|
|
handoverDto.setCustomerName(baseDiscountpackageApply.getCustomerName()); |
|
|
|
|
|
handoverDto.setCreateBySid(baseDiscountpackageApply.getCreateBySid()); |
|
|
|
|
|
handoverDto.setCreateOrgSid(baseDiscountpackageApply.getCreateOrgSid()); |
|
|
|
|
|
handoverDto.setRecUserSid(baseDiscountpackageApply.getCreateBySid()); |
|
|
|
|
|
handoverDto.setUseOrgSid(baseDiscountpackageApply.getUseOrgSid()); |
|
|
|
|
|
handoverDto.setCreateOrgName(baseDiscountpackageApply.getCreateOrgName()); |
|
|
|
|
|
handoverDto.setUseOrgName(baseDiscountpackageApply.getUseOrgName()); |
|
|
|
|
|
SysUser sysUser = userFeign.selectBySid(baseDiscountpackageApply.getCreateBySid()).getData(); |
|
|
|
|
|
if (null != sysUser) { |
|
|
|
|
|
if (StringUtils.isNotBlank(sysUser.getMobile())) { |
|
|
|
|
|
handoverDto.setRecPhone(sysUser.getMobile()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
handoverDto.setVehCount(baseDiscountpackageApply.getNumber()); |
|
|
|
|
|
handoverDto.setVehModel(baseDiscountpackageApply.getModel()); |
|
|
|
|
|
//根据优惠包申请sid获取优惠包列表
|
|
|
|
|
|
List<BaseDiscountpackagelistDto> dtos = baseDiscountpackagelistService.fetchDetailsByDiscountSid(businessSid); |
|
|
|
|
|
List<BusDiscountpackageHandoverListDto> listDtos = new ArrayList<>(); |
|
|
|
|
|
if (null != dtos) { |
|
|
|
|
|
for (BaseDiscountpackagelistDto dto : dtos) { |
|
|
|
|
|
BusDiscountpackageHandoverListDto listDto = new BusDiscountpackageHandoverListDto(); |
|
|
|
|
|
BeanUtil.copyProperties(dto, listDto, "id", "sid"); |
|
|
|
|
|
listDto.setMainSid(handoverDto.getSid()); |
|
|
|
|
|
listDtos.add(listDto); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
handoverDto.setBusDiscountpackageHandoverLists(listDtos); |
|
|
|
|
|
busDiscountpackageHandoverFeign.save(handoverDto); |
|
|
} |
|
|
} |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
return rb.success().setData(resultBean.getData()); |
|
|
} else { |
|
|
} else { |
|
|