|
|
@ -34,12 +34,18 @@ import com.yxt.anrui.as.api.asarrearsoutapply.AsArrearsoutApply; |
|
|
|
import com.yxt.anrui.as.api.asarrearsoutapply.AsArrearsoutApplyVo; |
|
|
|
import com.yxt.anrui.as.api.asarrearsoutapply.flowable.AsArrearsoutApplyNodeVo; |
|
|
|
import com.yxt.anrui.as.api.asarrearsoutapply.flowable.SubmitAsArrearsoutApplyDto; |
|
|
|
import com.yxt.anrui.as.api.asbusclaimbill.AsBusclaimBill; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturn.AsOldpartreturnDetailsVo; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturn.AsOldpartreturnDto; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturn.AsOldpartreturnExcelInfo; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturn.ReturnExcelInfo; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturnapply.flowable.*; |
|
|
|
import com.yxt.anrui.as.api.asoldpartreturndetail.AsOldpartreturnDetailDto; |
|
|
|
import com.yxt.anrui.as.biz.asbusclaimbill.AsBusclaimBillService; |
|
|
|
import com.yxt.anrui.as.biz.asbusrepairinventorybill.AsBusrepairInventorybillService; |
|
|
|
import com.yxt.anrui.as.biz.asbusrepairinventorybilldetail.AsBusrepairInventorybillDetailService; |
|
|
|
import com.yxt.anrui.as.biz.asoldpartreturn.AsOldpartreturnService; |
|
|
|
import com.yxt.anrui.as.biz.asoldpartreturndetail.AsOldpartreturnDetailService; |
|
|
|
import com.yxt.anrui.as.feign.base.billno.Rule; |
|
|
|
import com.yxt.anrui.as.feign.flowable.flow.*; |
|
|
|
import com.yxt.anrui.as.feign.flowable.flow2.FlowDelegateQuery; |
|
|
@ -55,6 +61,8 @@ import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.as.feign.wms.wmsInventory.WmsInventoryFeign; |
|
|
|
import com.yxt.anrui.as.feign.wms.wmsInventory.WmsInventoryReturnFactSelectList; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -78,6 +86,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.File; |
|
|
@ -126,7 +135,15 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
@Autowired |
|
|
|
private AsOldpartreturnService asOldpartreturnService; |
|
|
|
@Autowired |
|
|
|
private AsOldpartreturnDetailService asOldpartreturnDetailService; |
|
|
|
@Autowired |
|
|
|
private HttpServletResponse response; |
|
|
|
@Autowired |
|
|
|
private AsBusclaimBillService asBusclaimBillService; |
|
|
|
@Autowired |
|
|
|
private AsBusrepairInventorybillDetailService asBusrepairInventorybillDetailService; |
|
|
|
@Resource |
|
|
|
private WmsInventoryFeign wmsInventoryFeign; |
|
|
|
|
|
|
|
public PagerVo<AsOldpartreturnApplyVo> listPageVo(PagerQuery<AsOldpartreturnApplyQuery> pq) { |
|
|
|
AsOldpartreturnApplyQuery query = pq.getParams(); |
|
|
@ -238,7 +255,14 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
String sid = this.insertByDto(dto); |
|
|
|
for (AsOldpartreturnDto asOldpartreturnDto : asOldpartreturnList) { |
|
|
|
asOldpartreturnDto.setMainSid(sid); |
|
|
|
asOldpartreturnService.saveOrUpdateDto(asOldpartreturnDto); |
|
|
|
String detailSid = asOldpartreturnService.insertByDto(asOldpartreturnDto); |
|
|
|
List<WmsInventoryReturnFactSelectList> data = wmsInventoryFeign.selBillNoAndCode(asOldpartreturnDto.getSourceBillNo(), asOldpartreturnDto.getGoodsSkuCode(), deptSid).getData(); |
|
|
|
for (WmsInventoryReturnFactSelectList datum : data) { |
|
|
|
AsOldpartreturnDetailDto asOldpartreturnDetailDto = new AsOldpartreturnDetailDto(); |
|
|
|
BeanUtil.copyProperties(datum,asOldpartreturnDetailDto); |
|
|
|
asOldpartreturnDetailDto.setMainSid(detailSid); |
|
|
|
asOldpartreturnDetailService.insertByDto(asOldpartreturnDetailDto); |
|
|
|
} |
|
|
|
} |
|
|
|
return sid; |
|
|
|
} |
|
|
@ -246,7 +270,7 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
asOldpartreturnService.delByMainSid(dtoSid); |
|
|
|
for (AsOldpartreturnDto asOldpartreturnDto : asOldpartreturnList) { |
|
|
|
asOldpartreturnDto.setMainSid(dtoSid); |
|
|
|
asOldpartreturnService.saveOrUpdateDto(asOldpartreturnDto); |
|
|
|
asOldpartreturnService.insertByDto(asOldpartreturnDto); |
|
|
|
} |
|
|
|
return dtoSid; |
|
|
|
} |
|
|
@ -701,12 +725,14 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
ReturnExcelInfo importReturn = getSheetVal(sheet, resultCell); |
|
|
|
resultList = importReturn.getInfos(); |
|
|
|
for (AsOldpartreturnExcelInfo asOldpartreturnExcelInfo : resultList) { |
|
|
|
AsOldpartreturnDetailsVo asOldpartreturnDetailsVo = new AsOldpartreturnDetailsVo(); |
|
|
|
AsBusclaimBill asBusclaimBill = asBusclaimBillService.selectByBillNo(asOldpartreturnExcelInfo.getClaimBillNo()); |
|
|
|
AsOldpartreturnDetailsVo asOldpartreturnDetailsVo = asBusrepairInventorybillDetailService.selByGdSidAndOldCode(asBusclaimBill.getRepairBillSid(),asOldpartreturnExcelInfo.getGoodsSkuCode()); |
|
|
|
asOldpartreturnDetailsVo.setVinNo(asOldpartreturnExcelInfo.getVinNo()); |
|
|
|
asOldpartreturnDetailsVo.setGoodsSkuName(asOldpartreturnExcelInfo.getGoodsSkuName()); |
|
|
|
asOldpartreturnDetailsVo.setGoodsSkuCode(asOldpartreturnExcelInfo.getGoodsSkuCode()); |
|
|
|
asOldpartreturnDetailsVo.setManufacturerName(asOldpartreturnExcelInfo.getManufacturerName()); |
|
|
|
asOldpartreturnDetailsVo.setSourceBillNo(asBusclaimBill.getRepairBillNo()); |
|
|
|
asOldpartreturnDetailsVo.setClaimBillNo(asOldpartreturnExcelInfo.getClaimBillNo()); |
|
|
|
asOldpartreturnDetailsVo.setIsCf("否"); |
|
|
|
asOldpartreturnDetailsVo.setNeedReturnCount(asOldpartreturnExcelInfo.getNeedReturnCount()); |
|
|
|
asOldpartreturnDetailsVo.setActualReturnCount(asOldpartreturnDetailsVo.getNeedReturnCount()); |
|
|
|
resultList2.add(asOldpartreturnDetailsVo); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(importReturn.getCheckInfo())) { |
|
|
@ -742,19 +768,22 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
if (i == resultCell[j]) { |
|
|
|
switch (i) { |
|
|
|
case 0: |
|
|
|
importVo.setVinNo(temp); |
|
|
|
importVo.setGoodsSkuName(temp); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
importVo.setGoodsSkuName(temp); |
|
|
|
importVo.setGoodsSkuCode(temp); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
importVo.setGoodsSkuCode(temp); |
|
|
|
importVo.setManufacturerName(temp); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
importVo.setManufacturerName(temp); |
|
|
|
importVo.setNeedReturnCount(new BigDecimal(temp)); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
importVo.setNeedReturnCount(new BigDecimal(temp)); |
|
|
|
importVo.setVinNo(temp); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
importVo.setClaimBillNo(temp); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
@ -768,19 +797,22 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
String word = new String(); |
|
|
|
switch (i) { |
|
|
|
case 0: |
|
|
|
word = "车架号"; |
|
|
|
word = "商品名称"; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
word = "商品名称"; |
|
|
|
word = "图号"; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
word = "图号"; |
|
|
|
word = "厂家"; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
word = "厂家"; |
|
|
|
word = "需返厂数量"; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
word = "需返厂数量"; |
|
|
|
word = "车架号"; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
word = "索赔单号"; |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
@ -809,6 +841,10 @@ public class AsOldpartreturnApplyService extends MybatisBaseService<AsOldpartret |
|
|
|
checkWord.add("厂家不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getClaimBillNo())) { |
|
|
|
checkWord.add("索赔单号不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getNeedReturnCount().toString())) { |
|
|
|
String count = excelInfo.getNeedReturnCount().toString(); |
|
|
|
Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$"); |
|
|
|