|
@ -41,6 +41,8 @@ import com.yxt.sms.biz.smssalesbillsettle.SmsSalesBillSettleService; |
|
|
import com.yxt.sms.biz.smssalesreturn.flowable.*; |
|
|
import com.yxt.sms.biz.smssalesreturn.flowable.*; |
|
|
import com.yxt.sms.biz.smssalesreturndetail.SmsSalesReturnDetail; |
|
|
import com.yxt.sms.biz.smssalesreturndetail.SmsSalesReturnDetail; |
|
|
import com.yxt.sms.biz.smssalesreturndetail.SmsSalesReturnDetailService; |
|
|
import com.yxt.sms.biz.smssalesreturndetail.SmsSalesReturnDetailService; |
|
|
|
|
|
import com.yxt.sms.biz.smssalesreturnitem.SmsSalesReturnItem; |
|
|
|
|
|
import com.yxt.sms.biz.smssalesreturnitem.SmsSalesReturnItemService; |
|
|
import com.yxt.sms.biz.smssalesreturnsettle.SmsSalesReturnSettle; |
|
|
import com.yxt.sms.biz.smssalesreturnsettle.SmsSalesReturnSettle; |
|
|
import com.yxt.sms.biz.smssalesreturnsettle.SmsSalesReturnSettleService; |
|
|
import com.yxt.sms.biz.smssalesreturnsettle.SmsSalesReturnSettleService; |
|
|
import com.yxt.sms.feign.as.asbusrepairbill.*; |
|
|
import com.yxt.sms.feign.as.asbusrepairbill.*; |
|
@ -52,6 +54,8 @@ import com.yxt.sms.feign.flowable.flowtask.FlowTaskVo; |
|
|
import com.yxt.sms.feign.flowable.flowtask.LatestTaskVo; |
|
|
import com.yxt.sms.feign.flowable.flowtask.LatestTaskVo; |
|
|
import com.yxt.sms.feign.fms.fmspaysettle.FmsPaysettleDto; |
|
|
import com.yxt.sms.feign.fms.fmspaysettle.FmsPaysettleDto; |
|
|
import com.yxt.sms.feign.fms.fmspaysettle.FmsPaysettleFeign; |
|
|
import com.yxt.sms.feign.fms.fmspaysettle.FmsPaysettleFeign; |
|
|
|
|
|
import com.yxt.sms.feign.fms.fmsreceivesettle.FmsReceivesettle; |
|
|
|
|
|
import com.yxt.sms.feign.fms.fmsreceivesettle.FmsReceivesettleFeign; |
|
|
import com.yxt.sms.feign.message.MessageFeign; |
|
|
import com.yxt.sms.feign.message.MessageFeign; |
|
|
import com.yxt.sms.feign.message.MessageFlowVo; |
|
|
import com.yxt.sms.feign.message.MessageFlowVo; |
|
|
import com.yxt.sms.feign.message.MessageFlowableQuery; |
|
|
import com.yxt.sms.feign.message.MessageFlowableQuery; |
|
@ -126,7 +130,10 @@ public class SmsSalesReturnService extends MybatisBaseService<SmsSalesReturnMapp |
|
|
private FlowFeign flowFeign; |
|
|
private FlowFeign flowFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private MessageFeign messageFeign; |
|
|
private MessageFeign messageFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FmsReceivesettleFeign fmsReceivesettleFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SmsSalesReturnItemService smsSalesReturnItemService; |
|
|
private QueryWrapper<SmsSalesReturn> createQueryWrapper(SmsSalesReturnQuery query) { |
|
|
private QueryWrapper<SmsSalesReturn> createQueryWrapper(SmsSalesReturnQuery 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()));
|
|
@ -458,71 +465,80 @@ public class SmsSalesReturnService extends MybatisBaseService<SmsSalesReturnMapp |
|
|
|
|
|
|
|
|
public SmsSalesReturnNewDetailsVo returnGoodsBillInit(String sid, String type) { |
|
|
public SmsSalesReturnNewDetailsVo returnGoodsBillInit(String sid, String type) { |
|
|
SmsSalesReturnNewDetailsVo vo = new SmsSalesReturnNewDetailsVo(); |
|
|
SmsSalesReturnNewDetailsVo vo = new SmsSalesReturnNewDetailsVo(); |
|
|
List<SmsSitemVo> sitemVos = new ArrayList<>();// 维修项目
|
|
|
vo.setType(type); |
|
|
vo.setRemarks("222"); |
|
|
vo.setSourceBillSid(sid); |
|
|
SmsSitemVo v = new SmsSitemVo(); |
|
|
if (type.equals("0")) { |
|
|
v.setRemarks("saasg"); |
|
|
//维修工单
|
|
|
sitemVos.add(v); |
|
|
AsBusrepairBill data = asBusrepairBillFeign.fetchBySid(sid); |
|
|
List<SmsGoodsDetailsVo> goodsDetailsVos = new ArrayList<>(); //商品信息
|
|
|
if (null != data) { |
|
|
SmsGoodsDetailsVo v2 = new SmsGoodsDetailsVo(); |
|
|
vo.setSourceBillNo(data.getBillNo()); |
|
|
v2.setRemarks("saasg"); |
|
|
vo.setBillType(data.getBillType()); |
|
|
goodsDetailsVos.add(v2); |
|
|
vo.setBillDate(DateUtil.formatDate(data.getCreateTime())); |
|
|
List<SalesGoodsReturnVo> returnGoods = new ArrayList<>(); //退货商品列表
|
|
|
if (StringUtils.isNotBlank(data.getSubject())) { |
|
|
SalesGoodsReturnVo v3 = new SalesGoodsReturnVo(); |
|
|
vo.setSubject(data.getSubject()); |
|
|
v3.setGoodsID("saasg"); |
|
|
} |
|
|
returnGoods.add(v3); |
|
|
if (StringUtils.isNotBlank(data.getWaitorName())) { |
|
|
List<SalesItemsReturnVo> returnSitemVos = new ArrayList<>(); //退货维修项目列表
|
|
|
vo.setWaitorName(data.getWaitorName()); |
|
|
SalesItemsReturnVo v4 = new SalesItemsReturnVo(); |
|
|
} |
|
|
v.setRemarks("saasg"); |
|
|
if (StringUtils.isNotBlank(data.getCustomerName())) { |
|
|
returnSitemVos.add(v4); |
|
|
vo.setCustomerName(data.getCustomerName()); |
|
|
vo.setReturnGoods(returnGoods); |
|
|
} |
|
|
vo.setReturnSitemVos(returnSitemVos); |
|
|
if (StringUtils.isNotBlank(data.getMobile())) { |
|
|
vo.setGoodsDetailsVos(goodsDetailsVos); |
|
|
vo.setMobile(data.getMobile()); |
|
|
vo.setSitemVos(sitemVos); |
|
|
} |
|
|
// vo.setType(type);
|
|
|
if (null != data.getHourAmount()) { |
|
|
// vo.setSourceBillSid(sid);
|
|
|
vo.setHourAmount(data.getHourAmount().toString()); |
|
|
// if (type.equals("0")) {
|
|
|
} |
|
|
// //维修工单
|
|
|
if (null != data.getGoodsAmount()) { |
|
|
// AsBusrepairBillDetailsVo data = asBusrepairBillFeign.fetchDetailsBySid(sid).getData();
|
|
|
vo.setGoodsAmount(data.getGoodsAmount().toString()); |
|
|
// if (null != data) {
|
|
|
} |
|
|
// vo.setSourceBillNo(data.getBillNo());
|
|
|
if (null != data.getAddAmount()) { |
|
|
// vo.setBillType(data.getBillType());
|
|
|
vo.setAddAmount(data.getAddAmount().toString()); |
|
|
// vo.setBillDate(data.getCreateDate());
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getSubject())) {
|
|
|
AsBusrepairBillVech vech = asBusrepairBillFeign.fetchVehInfoByBillSid(sid); |
|
|
// vo.setSubject(data.getSubject());
|
|
|
if (null != vech) { |
|
|
// }
|
|
|
if (StringUtils.isNotBlank(vech.getVehMark())) { |
|
|
// if (StringUtils.isNotBlank(data.getWaitorName())) {
|
|
|
vo.setVehMark(vech.getVehMark()); |
|
|
// vo.setWaitorName(data.getWaitorName());
|
|
|
} |
|
|
// }
|
|
|
if (StringUtils.isNotBlank(vech.getVinNo())) { |
|
|
// if (StringUtils.isNotBlank(data.getCustomerName())) {
|
|
|
vo.setVinNo(vech.getVinNo()); |
|
|
// vo.setCustomerName(data.getCustomerName());
|
|
|
} |
|
|
// }
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getMobile())) {
|
|
|
FmsReceivesettle receivesettle = fmsReceivesettleFeign.fetchBySourceSid(sid).getData(); |
|
|
// vo.setMobile(data.getMobile());
|
|
|
if (null != receivesettle) { |
|
|
// }
|
|
|
vo.setSettleDate(DateUtil.formatDate(receivesettle.getSettleTime())); |
|
|
// if (StringUtils.isNotBlank(data.getCustomerOrg())) {
|
|
|
} |
|
|
// vo.setCustomerOrg(data.getCustomerOrg());
|
|
|
List<SmsSitemVo> sitemVos = new ArrayList<>();// 维修项目
|
|
|
// }
|
|
|
List<AsBusrepairBillSitem> sitems = asBusrepairBillFeign.fetchSitemByBillSid(sid); |
|
|
// if (StringUtils.isNotBlank(data.getVehMark())) {
|
|
|
if (!sitems.isEmpty()) { |
|
|
// vo.setVehMark(data.getVehMark());
|
|
|
for (AsBusrepairBillSitem sitem : sitems) { |
|
|
// }
|
|
|
SmsSalesReturnItem returnItem = smsSalesReturnItemService.selBySouceSidAndLinkSid(sid,sitem.getSid()); |
|
|
// if (StringUtils.isNotBlank(data.getVinNo())) {
|
|
|
if (null == returnItem) { |
|
|
// vo.setVinNo(data.getVinNo());
|
|
|
SmsSitemVo sitemVo = new SmsSitemVo(); |
|
|
// }
|
|
|
BeanUtil.copyProperties(sitem, sitemVo); |
|
|
// SettleVo settleVo = data.getSettleVo();
|
|
|
sitemVo.setItemLinkSid(sitem.getSid()); |
|
|
// if (null != settleVo) {
|
|
|
List<AsBusrepairBillSitemRepairer> repairers = asBusrepairBillFeign.fetchSitemRepairerByBillSid(sid, sitem.getServiceItemSid()); |
|
|
// vo.setSettleDate(settleVo.getSettleTime());
|
|
|
if (!repairers.isEmpty()) { |
|
|
// }
|
|
|
List<String> staffList = new ArrayList<>(); //维修人员信息
|
|
|
// List<SitemVo> sitemVos = data.getSitemVos();
|
|
|
List<String> staffNameList = new ArrayList<>(); //维修人员信息
|
|
|
// List<SmsSitemVo> smsSitemVos = new ArrayList<>();
|
|
|
for (AsBusrepairBillSitemRepairer repairer : repairers) { |
|
|
// if (!sitemVos.isEmpty()) {
|
|
|
if (StringUtils.isNotBlank(repairer.getRepairerSid())) { |
|
|
// for (SitemVo smsSitemVo : sitemVos) {
|
|
|
staffList.add(repairer.getRepairerSid()); |
|
|
// SmsSitemVo sitemVo = new SmsSitemVo();
|
|
|
} |
|
|
// BeanUtil.copyProperties(smsSitemVo, sitemVo);
|
|
|
if (StringUtils.isNotBlank(repairer.getRepairerName())) { |
|
|
// smsSitemVos.add(sitemVo);
|
|
|
staffNameList.add(repairer.getRepairerName()); |
|
|
// }
|
|
|
} |
|
|
// vo.setSitemVos(smsSitemVos);
|
|
|
} |
|
|
// }
|
|
|
sitemVo.setStaffList(staffList); |
|
|
|
|
|
sitemVo.setStaffNameList(staffNameList); |
|
|
|
|
|
sitemVo.setRepairerName(String.join("、", staffNameList)); |
|
|
|
|
|
} |
|
|
|
|
|
sitemVos.add(sitemVo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
vo.setSitemVos(sitemVos); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// List<GoodsDetailsVo> goodsDetailsVos = data.getGoodsDetailsVos();
|
|
|
// List<GoodsDetailsVo> goodsDetailsVos = data.getGoodsDetailsVos();
|
|
|
// List<SmsGoodsDetailsVo> smsGoodsDetailsVos = new ArrayList<>();
|
|
|
// List<SmsGoodsDetailsVo> smsGoodsDetailsVos = new ArrayList<>();
|
|
|
// if (!goodsDetailsVos.isEmpty()) {
|
|
|
// if (!goodsDetailsVos.isEmpty()) {
|
|
@ -537,57 +553,55 @@ public class SmsSalesReturnService extends MybatisBaseService<SmsSalesReturnMapp |
|
|
// }
|
|
|
// }
|
|
|
// vo.setGoodsDetailsVos(smsGoodsDetailsVos);
|
|
|
// vo.setGoodsDetailsVos(smsGoodsDetailsVos);
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
} |
|
|
// } else if (type.equals("1")) {
|
|
|
} else if (type.equals("1")) { |
|
|
// //销售单
|
|
|
//销售单
|
|
|
// SmsSalesBillDetailsVo data = smsSalesBillService.fetchDetailsVoBySid(sid);
|
|
|
SmsSalesBillDetailsVo data = smsSalesBillService.fetchDetailsVoBySid(sid); |
|
|
// if (null != data) {
|
|
|
if (null != data) { |
|
|
// vo.setSourceBillNo(data.getBillNo());
|
|
|
vo.setSourceBillNo(data.getBillNo()); |
|
|
// vo.setBillType("销售单");
|
|
|
vo.setBillType("销售单"); |
|
|
// vo.setBillDate(data.getCreateTime());
|
|
|
vo.setBillDate(data.getCreateTime()); |
|
|
// if (StringUtils.isNotBlank(data.getSubject())) {
|
|
|
if (StringUtils.isNotBlank(data.getSubject())) { |
|
|
// vo.setSubject(data.getSubject());
|
|
|
vo.setSubject(data.getSubject()); |
|
|
// }
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getSalesName())) {
|
|
|
if (StringUtils.isNotBlank(data.getSalesName())) { |
|
|
// vo.setWaitorName(data.getSalesName());
|
|
|
vo.setWaitorName(data.getSalesName()); |
|
|
// }
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getCustomerName())) {
|
|
|
if (StringUtils.isNotBlank(data.getCustomerName())) { |
|
|
// vo.setCustomerName(data.getCustomerName());
|
|
|
vo.setCustomerName(data.getCustomerName()); |
|
|
// }
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getMobile())) {
|
|
|
if (StringUtils.isNotBlank(data.getMobile())) { |
|
|
// vo.setMobile(data.getMobile());
|
|
|
vo.setMobile(data.getMobile()); |
|
|
// }
|
|
|
} |
|
|
// if (StringUtils.isNotBlank(data.getCustomerOrg())) {
|
|
|
|
|
|
// vo.setCustomerOrg(data.getCustomerOrg());
|
|
|
if (StringUtils.isNotBlank(data.getVehMark())) { |
|
|
// }
|
|
|
vo.setVehMark(data.getVehMark()); |
|
|
// if (StringUtils.isNotBlank(data.getVehMark())) {
|
|
|
} |
|
|
// vo.setVehMark(data.getVehMark());
|
|
|
if (StringUtils.isNotBlank(data.getVinNo())) { |
|
|
// }
|
|
|
vo.setVinNo(data.getVinNo()); |
|
|
// if (StringUtils.isNotBlank(data.getVinNo())) {
|
|
|
} |
|
|
// vo.setVinNo(data.getVinNo());
|
|
|
SettlementVo settleVo = data.getSettlementVo(); |
|
|
// }
|
|
|
if (null != settleVo) { |
|
|
// SettlementVo settleVo = data.getSettlementVo();
|
|
|
vo.setSettleDate(settleVo.getSettleTime()); |
|
|
// if (null != settleVo) {
|
|
|
} |
|
|
// vo.setSettleDate(settleVo.getSettleTime());
|
|
|
List<SalesGoodsVo> goodsDetailsVos = data.getGoodsVos(); |
|
|
// }
|
|
|
List<SmsGoodsDetailsVo> smsGoodsDetailsVos = new ArrayList<>(); |
|
|
// List<SalesGoodsVo> goodsDetailsVos = data.getGoodsVos();
|
|
|
if (!goodsDetailsVos.isEmpty()) { |
|
|
// List<SmsGoodsDetailsVo> smsGoodsDetailsVos = new ArrayList<>();
|
|
|
for (SalesGoodsVo goodsDetailsVo : goodsDetailsVos) { |
|
|
// if (!goodsDetailsVos.isEmpty()) {
|
|
|
SmsGoodsDetailsVo smsGoodsDetailsVo = new SmsGoodsDetailsVo(); |
|
|
// for (SalesGoodsVo goodsDetailsVo : goodsDetailsVos) {
|
|
|
BeanUtil.copyProperties(goodsDetailsVo, smsGoodsDetailsVo); |
|
|
// SmsGoodsDetailsVo smsGoodsDetailsVo = new SmsGoodsDetailsVo();
|
|
|
//查询已退数量
|
|
|
// BeanUtil.copyProperties(goodsDetailsVo, smsGoodsDetailsVo);
|
|
|
String goodsID = goodsDetailsVo.getGoodsID(); |
|
|
// //查询已退数量
|
|
|
String sumBackCount = baseMapper.selBackCountByGoodsID(goodsID, sid); |
|
|
// String goodsID = goodsDetailsVo.getGoodsID();
|
|
|
smsGoodsDetailsVo.setReturnedCount(sumBackCount); |
|
|
// String sumBackCount = baseMapper.selBackCountByGoodsID(goodsID, sid);
|
|
|
smsGoodsDetailsVos.add(smsGoodsDetailsVo); |
|
|
// smsGoodsDetailsVo.setReturnedCount(sumBackCount);
|
|
|
smsGoodsDetailsVos.add(smsGoodsDetailsVo); |
|
|
// smsGoodsDetailsVos.add(smsGoodsDetailsVo);
|
|
|
} |
|
|
// smsGoodsDetailsVos.add(smsGoodsDetailsVo);
|
|
|
vo.setGoodsDetailsVos(smsGoodsDetailsVos); |
|
|
// }
|
|
|
} |
|
|
// vo.setGoodsDetailsVos(smsGoodsDetailsVos);
|
|
|
} |
|
|
// }
|
|
|
|
|
|
// }
|
|
|
} |
|
|
//
|
|
|
|
|
|
// }
|
|
|
|
|
|
return vo; |
|
|
return vo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|