|
|
@ -23,6 +23,8 @@ import com.yxt.anrui.base.api.busvehicleapplydetail.BusVehicleApplyDetailDto; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapplydetail.BusVehicleApplyDetailVo; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapplysz.BusVehicleApplySz; |
|
|
|
import com.yxt.anrui.base.api.busvehicleorder.ActualAndOrgDeptVo; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixDto; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixVo; |
|
|
|
import com.yxt.anrui.base.biz.basemanufactorsubscription.BaseManufactorSubscriptionService; |
|
|
|
import com.yxt.anrui.base.biz.basemanufacturer.BaseManufacturerService; |
|
|
|
import com.yxt.anrui.base.biz.basemanufacturerbank.BaseManufacturerBankService; |
|
|
@ -31,6 +33,8 @@ import com.yxt.anrui.base.biz.basevehiclebrand.BaseVehicleBrandService; |
|
|
|
import com.yxt.anrui.base.biz.basevehiclemodel.BaseVehicleModelService; |
|
|
|
import com.yxt.anrui.base.biz.busvehicleapplydetail.BusVehicleApplyDetailService; |
|
|
|
import com.yxt.anrui.base.biz.busvehicleapplysz.BusVehicleApplySzService; |
|
|
|
import com.yxt.anrui.base.biz.commonappendix.CommonAppendixService; |
|
|
|
import com.yxt.anrui.base.biz.commoncontract.CommonContractService; |
|
|
|
import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
|
import com.yxt.anrui.base.common.enums.DictCommonEnum; |
|
|
|
import com.yxt.anrui.base.common.enums.ManPurOrderType; |
|
|
@ -52,6 +56,7 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -127,7 +132,10 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
private SysProUrlFeign sysProUrlFeign; |
|
|
|
@Autowired |
|
|
|
private BasePurchaseSystemService basePurchaseSystemService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private CommonAppendixService commonAppendixService; |
|
|
|
/** |
|
|
|
* 分页列表 |
|
|
|
* |
|
|
@ -215,6 +223,14 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
busVehicleApplyDetailsVo.setOrgPath(busVehicleApply.getOrgSidPath()); |
|
|
|
List<BusVehicleApplyDetailVo> busVehicleApplyDetailVos = busVehicleApplyDetailService.fetchByApplySid(sid); |
|
|
|
busVehicleApplyDetailsVo.setBusVehicleApplyDetailList(busVehicleApplyDetailVos); |
|
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixService.selByLinkSid(sid); |
|
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
filePath = urlPrefix + filePath; |
|
|
|
commonAppendixVo.setFilePath(filePath); |
|
|
|
} |
|
|
|
busVehicleApplyDetailsVo.setCommonAppendixs(commonAppendixVos); |
|
|
|
return busVehicleApplyDetailsVo; |
|
|
|
} |
|
|
|
|
|
|
@ -237,6 +253,7 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
public ResultBean<String> saveOrUpdateDto(BusVehicleApplyDto dto) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
List<CommonAppendixDto> commonAppendixs = dto.getCommonAppendixs(); |
|
|
|
if (StringUtils.isBlank(sid)) {//新增
|
|
|
|
//=======================================
|
|
|
|
String orgSidPath = ""; |
|
|
@ -295,6 +312,15 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
entity.setSupplierSid(manufacturerSid); |
|
|
|
baseMapper.insert(entity); |
|
|
|
sid = entity.getSid(); |
|
|
|
for (CommonAppendixDto commonAppendix : commonAppendixs) { |
|
|
|
String filePath = commonAppendix.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
commonAppendix.setFilePath(filePath); |
|
|
|
commonAppendix.setLinkSid(sid); |
|
|
|
commonAppendixService.saveOrUpdateDto(commonAppendix); |
|
|
|
} |
|
|
|
} else {//修改
|
|
|
|
BusVehicleApply busVehicleApply = fetchBySid(sid); |
|
|
|
if (busVehicleApply == null) { |
|
|
@ -326,7 +352,16 @@ public class BusVehicleApplyService extends MybatisBaseService<BusVehicleApplyMa |
|
|
|
} |
|
|
|
busVehicleApply.setCurrentAmount(i); |
|
|
|
baseMapper.updateById(busVehicleApply); |
|
|
|
|
|
|
|
commonAppendixService.deleteFiles(sid); |
|
|
|
for (CommonAppendixDto commonAppendix : commonAppendixs) { |
|
|
|
String filePath = commonAppendix.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
commonAppendix.setFilePath(filePath); |
|
|
|
commonAppendix.setLinkSid(sid); |
|
|
|
commonAppendixService.saveOrUpdateDto(commonAppendix); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(sid); |
|
|
|
} |
|
|
|