|
|
@ -396,8 +396,12 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
} |
|
|
|
} |
|
|
|
int i = 0; |
|
|
|
//按角色控制权限 1优惠包管理员 2销售专员 3优惠包管理员&&销售专员
|
|
|
|
int role = 0; |
|
|
|
String transferStateValue = busDiscountpackageHandover.getTransferStateValue(); |
|
|
|
//根据当前用户sid查询用户角色
|
|
|
|
List<SysRoleVo> roleVoList = sysRoleFeign.fetchByUserSid(userSid).getData(); |
|
|
|
|
|
|
|
//判断当前登录用户角色是否为销售专员
|
|
|
|
if (null != roleVoList) { |
|
|
|
for (SysRoleVo sysRoleVo : roleVoList) { |
|
|
@ -436,6 +440,79 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
return i; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 优惠包管理员交接准备 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean handoverReady(BusDiscountpackageHandoverDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
String userSid = dto.getCreateBySid(); |
|
|
|
String mobile = ""; |
|
|
|
String userName = ""; |
|
|
|
BusDiscountpackageHandover busDiscountpackageHandover = fetchBySid(sid); |
|
|
|
dto.setCreateBySid(busDiscountpackageHandover.getCreateBySid()); |
|
|
|
if (sysUserFeign.selectBySid(userSid).getSuccess()) { |
|
|
|
SysUser user = sysUserFeign.selectBySid(userSid).getData(); |
|
|
|
if (null != user) { |
|
|
|
if (StringUtils.isNotBlank(user.getMobile())) { |
|
|
|
mobile = user.getMobile(); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(user.getStaffSid())) { |
|
|
|
SysStaffinfoDetailsVo staffinfoDetailsVo = sysStaffinfoFeign.fetchBySid(user.getStaffSid()).getData(); |
|
|
|
if (null != staffinfoDetailsVo) { |
|
|
|
if (StringUtils.isNotBlank(staffinfoDetailsVo.getName())) { |
|
|
|
userName = staffinfoDetailsVo.getName(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
dto.setTransferStateKey("003"); |
|
|
|
dto.setTransferStateValue("移交中"); |
|
|
|
dto.setTransferUserSid(userSid); |
|
|
|
dto.setTransferName(userName); |
|
|
|
dto.setTransferPhone(mobile); |
|
|
|
if (StringUtils.isNotBlank(dto.getTransferStateKey())) { |
|
|
|
this.updateBySid(dto.toMap(), sid); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 销售专员交接确认 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean handoverConfirm(BusDiscountpackageHandoverDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
BusDiscountpackageHandover busDiscountpackageHandover = fetchBySid(sid); |
|
|
|
dto.setCreateBySid(busDiscountpackageHandover.getCreateBySid()); |
|
|
|
int i = 0; |
|
|
|
dto.setTransferStateKey("004"); |
|
|
|
dto.setTransferStateValue("已移交"); |
|
|
|
dto.setRecTime(new Date()); |
|
|
|
if (StringUtils.isNotBlank(dto.getTransferStateKey())) { |
|
|
|
i = this.updateBySid(dto.toMap(), sid); |
|
|
|
} |
|
|
|
List<BuscenterFile> busFiles = dto.getBusFiles(); |
|
|
|
if (null != busFiles && i > 0 && !busFiles.isEmpty()) { |
|
|
|
this.uploadPicture(dto); |
|
|
|
} |
|
|
|
// BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(sid);
|
|
|
|
// String s = commonCreatePdf(detailsVo);
|
|
|
|
// String targetPath = docPdfComponent.getUploadTemplateUrl();
|
|
|
|
// String filePath = s.substring(targetPath.length());
|
|
|
|
// BusDiscountpackageHandover entity = fetchBySid(sid);
|
|
|
|
// entity.setFilePath(filePath);
|
|
|
|
// baseMapper.updateById(entity);
|
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public BusDiscountpackageHandoverDetailsVo handoverDetails(String sid) { |
|
|
|
|
|
|
|
BusDiscountpackageHandoverDetailsVo detailsVo = new BusDiscountpackageHandoverDetailsVo(); |
|
|
@ -916,11 +993,11 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
entity.setRecTime(new Date()); |
|
|
|
entity.setTransferStateValue("已移交"); |
|
|
|
entity.setTransferStateKey("004"); |
|
|
|
BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(dto.getSid()); |
|
|
|
String s = commonCreatePdf(detailsVo); |
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
String filePath = s.substring(targetPath.length()); |
|
|
|
entity.setFilePath(filePath); |
|
|
|
// BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(dto.getSid());
|
|
|
|
// String s = commonCreatePdf(detailsVo);
|
|
|
|
// String targetPath = docPdfComponent.getUploadTemplateUrl();
|
|
|
|
// String filePath = s.substring(targetPath.length());
|
|
|
|
// entity.setFilePath(filePath);
|
|
|
|
baseMapper.updateById(entity); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
@ -941,4 +1018,6 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
} |
|
|
|
return rb.success().setData(handoverImages); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|